Issue #1554 resolved

LaTeX Error: \PYGZsq undefined.

Takayuki Shimizukawa
created an issue


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

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,


It is this line:


\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:

    % for compatibility with earlier versions
    \PYG{k}{print} \PYG{l+s}{\PYGZsq{}}\PYG{l+s}{bla}\PYG{l+s}{\PYGZsq{}}
  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 ( ... $ sudo easy_install -U Pygments Searching for Pygments Reading Best match: Pygments 1.6 Downloading 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 Best match: Sphinx 1.2.3 Downloading Processing Sphinx-1.2.3.tar.gz Writing /tmp/easy_install-NVSwg8/Sphinx-1.2.3/setup.cfg Running Sphinx-1.2.3/ -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,


  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