Issues

Issue #1554 resolved

LaTeX Error: \PYGZsq undefined.

Takayuki Shimizukawa
created an issue

from: https://groups.google.com/d/msg/sphinx-users/bKBxL4QW3Ys/bkE6ujCKOG0J

On 09/02/14 01:35, Takayuki Shimizukawa wrote:

I'm delighted to announce the release of Sphinx 1.2.3, now available on the Python package index at http://pypi.python.org/pypi/Sphinx.

It includes about 19 bug fixes for the 1.2 release series, among them a regression in 1.2.1.

Great news! After upgrading I ran into a LaTeX error, though:

  LaTeX Error: \PYGZsq undefined.

Any idea what the cause might be? Kind regards,

Roberto


It is this line:

  \renewcommand\PYGZsq{\textquotesingle}

\PYGZsq cannot be redefined because it is not defined. Are there possible workarounds?

Comments (5)

  1. Takayuki Shimizukawa reporter

    I think this is related to the change for #636.

    In my environment there is no error to make latexpdf. \PYGZsq is defined in the generated 'project.tex' in the _build/latex directory as:

    \def\PYGZsq{\char`\'}
    \def\PYGZdq{\char`\"}
    \def\PYGZti{\char`\~}
    % for compatibility with earlier versions
    \def\PYGZat{@}
    \def\PYGZlb{[}
    \def\PYGZrb{]}
    \makeatother
    
    \renewcommand\PYGZsq{\textquotesingle}
    
    \begin{document}
    
    \maketitle
    \tableofcontents
    \phantomsection\label{index::doc}
    
    
    \begin{Verbatim}[commandchars=\\\{\}]
    \PYG{k}{print} \PYG{l+s}{\PYGZsq{}}\PYG{l+s}{bla}\PYG{l+s}{\PYGZsq{}}
    \end{Verbatim}
    
  2. bagnara

    Thanks a lot Takayuki. I believe I was using pygments-1.6 (I am on Ubuntu 14.04). In fact:

    $ dpkg -l | fgrep -i pygments ii python-pygments 1.6+dfsg-1ubuntu1 all syntax highlighting package written in Python

    Anyway, I did this:

    $ sudo apt-get remove python-pygments Reading package lists... Done Building dependency tree
    Reading state information... Done The following packages will be REMOVED: python-pygments 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. After this operation, 2867 kB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 788421 files and directories currently installed.) Removing python-pygments (1.6+dfsg-1ubuntu1) ... Processing triggers for man-db (2.6.7.1-1) ... $ sudo easy_install -U Pygments Searching for Pygments Reading https://pypi.python.org/simple/Pygments/ Best match: Pygments 1.6 Downloading https://pypi.python.org/packages/2.7/P/Pygments/Pygments-1.6-py2.7.egg#md5=1e1e52b1e434502682aab08938163034 Processing Pygments-1.6-py2.7.egg removing '/usr/local/lib/python2.7/dist-packages/Pygments-1.6-py2.7.egg' (and everything under it) creating /usr/local/lib/python2.7/dist-packages/Pygments-1.6-py2.7.egg Extracting Pygments-1.6-py2.7.egg to /usr/local/lib/python2.7/dist-packages Removing Pygments 1.4 from easy-install.pth file Pygments 1.6 is already the active version in easy-install.pth Installing pygmentize script to /usr/local/bin

    Installed /usr/local/lib/python2.7/dist-packages/Pygments-1.6-py2.7.egg Processing dependencies for Pygments Finished processing dependencies for Pygments

    After I did that, the problem went away. Does this make any sense to you? Note that the new version of Sphinx was installed with

    $ sudo easy_install -U sphinx Searching for sphinx Reading https://pypi.python.org/simple/sphinx/ Best match: Sphinx 1.2.3 Downloading https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.2.3.tar.gz#md5=a98c93124035b4cd7183604aec656cb3 Processing Sphinx-1.2.3.tar.gz Writing /tmp/easy_install-NVSwg8/Sphinx-1.2.3/setup.cfg Running Sphinx-1.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-NVSwg8/Sphinx-1.2.3/egg-dist-tmp-4PS1lY no previously-included directories found matching 'doc/_build' Removing Sphinx 1.2.2 from easy-install.pth file Adding Sphinx 1.2.3 to easy-install.pth file Installing sphinx-apidoc script to /usr/local/bin Installing sphinx-build script to /usr/local/bin Installing sphinx-quickstart script to /usr/local/bin Installing sphinx-autogen script to /usr/local/bin

    Installed /usr/local/lib/python2.7/dist-packages/Sphinx-1.2.3-py2.7.egg Processing dependencies for sphinx Finished processing dependencies for sphinx

    Many thanks again,

    Roberto

  3. Takayuki Shimizukawa reporter
    $ sudo easy_install -U Pygments
     ...
    Removing Pygments 1.4 from easy-install.pth file
    

    I think you had installed the 2 versions of pygments. pygments-1.6 Ubuntu package and pygments-1.4 easy_installed package and later one was activated I guess.

    Anyway, I'm relieved to hear the problem has resolved.

  4. Log in to comment