NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.74k stars 13.86k forks source link

texLive cannot compile TikZ examples any more #2292

Closed peti closed 9 years ago

peti commented 10 years ago

I have some simple TikZ/PGF code in my latex files that used to compile just fine, but now the document doesn't translate anymore; pdflatex fails with an error. My guess is that one of the recent texLive updates broke TikZ/PGF support in some way. To reproduce the error, just compile the sample file from http://www.texample.net/tikz/examples/doa-diagram/:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{shapes.arrows}
\usepackage{array}

\begin{document}
\begin{tikzpicture} [
    auto,
    decision/.style = { diamond, draw=blue, thick, fill=blue!20,
                        text width=5em, text badly centered,
                        inner sep=1pt, rounded corners },
    block/.style    = { rectangle, draw=blue, thick,
                        fill=blue!20, text width=10em, text centered,
                        rounded corners, minimum height=2em },
    line/.style     = { draw, thick, ->, shorten >=2pt },
  ]
  % Define nodes in a matrix
  \matrix [column sep=5mm, row sep=10mm] {
                    & \node [text centered] (x) {$\mathbf{X}$};            & \\
                    & \node (null1) {};                                    & \\
                    & \node [block] (doa) {\textsf{DoAE}($\mathbf{X}$)};   & \\
    \node(null3){}; & \node [decision] (uiddes)
                        {\textsf{UID}($\hat{\mathbf{X}}$)};
                                  & \node[text centered](tra){$\mathbf{i}$}; \\
                    & \node [block] (track) {\textsf{DoAT}($\mathbf{x}$)}; & \\
                    & \node [block] (pesos)
                        {\textsf{BF}(DoA$_{\mathrm{T}}$,DoAs)};            & \\
                    & \node [block] (filtrado)
                        {\textsf{SF}($\mathbf{w}$,$\mathbf{x}$)};          & \\
                    & \node [text centered] (xf) {$\hat{x}(t)$ };          & \\
  };
  % connect all nodes defined above
  \begin{scope} [every path/.style=line]
    \path (x)        --    (doa);
    \path (doa)      --    node [near start] {DoAs} (uiddes);
    \path (tra)      --    (uiddes);
    \path (uiddes)   --++  (-3,0) node [near start] {no} |- (null1);
    \path (uiddes)   --    node [near start] {DoA} (track);
    \path (track)    --    node [near start] {DoA$_{\mathrm{T}}$} (pesos);
    \path (pesos)    --    node [near start] {\textbf{w}} (filtrado);
    \path (filtrado) --    (xf);
  \end{scope}
  %
  % legend for subprocedures
  \node (leyend) at (7.5, 5){
    \begin{tabular}{>{\sffamily}l@{: }l}
      \multicolumn{2}{c}{\textbf{subprocedures}} \\
      DoAE & direction of arrival estimation     \\
      UID  & user identification                 \\
      DoAT & DoA tracking                        \\
      BF   & beam forming                        \\
      SF   & spatial filtering
    \end{tabular}
  };
  %
  % legend for input and output variables
  \node (leyend) at (7, 0){
    \begin{tabular}{l@{: }l}
      \multicolumn{2}{c}{\textbf{variables}}              \\
      DoA                       & direction of arrival    \\
      $\mathbf{i}$              & identification sequence \\
      $\mathbf{X},\,\mathbf{x}$ & signal model            \\
      DoA$_{\mathrm{T}}$        & DoAs up to date         \\
      $\hat{x}(t)$              & fitered signal
      \end{tabular}
  };
\end{tikzpicture}

\end{document}

This is what my texLiveFull installation says:

$ pdflatex doa-diagram.tex 
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013)
 restricted \write18 enabled.
[...]
! Undefined control sequence.
\tikz@text@action ...rightskip \pgfutil@flushglue 
                                                  \leftskip \pgfutil@flushgl...
l.24                         {
                              \textsf{UID}($\hat{\mathbf{X}}$)};

Many other examples from the TikZ site fail in this way (although not all of them).

Does anyone know how to explain and/or fix this issue?

jgeerds commented 10 years ago

@peti Is this still an issue? see #4507

peti commented 10 years ago

Well, just try to compile the sample file! :-)

jgeerds commented 9 years ago

The issue is still present (although the generated file looks very good).

gebner commented 9 years ago

I think this is because texLivePGF (used by texLive) is still at 2.10, if I replace it by pgf3, I can compile the tex file without errors. Is there a reason we have separate texLivePGF and pgf packages?

7c6f434c commented 9 years ago

No, thanks for the hint, made the older TeXLive pgf attribute name an alias for pgf3.

bennofs commented 9 years ago

This is still an issue on current nixos-unstable.

$ pdflatex --version
pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2015/dev)
kpathsea version 6.2.1dev
Copyright 2014 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.6.13; using libpng 1.6.13
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.32.0

Is there any workaround?

7c6f434c commented 9 years ago

@bennofs currently works for me with trunk…

The problem is not with pdflatex per se, but with available pgf versions.

nix-store -qR "$(which pdflatex)" | grep -i pgf with current NixPkgs trunk (texLiveFull installed) mentions pgf-3.00. What is the revision of nixos-unstable channel that you use?

bennofs commented 9 years ago

@7c6f434c /nix/store/w54rgqf9w8kjn8wlyhzlq5s7ppvxy6i3-pgf-3.00 is the pgf that I use. Channel version is f93a8ee

bennofs commented 9 years ago

Oh sorry, I just noticed that latex was installed globally, and my system is still on an older channel. Installing with nix-env fixes the issue. I think this can be closed in that case?

7c6f434c commented 9 years ago

I guess this still affects NixOS stable channel until 15.06 lands

peti commented 9 years ago

I don't have the problem anymore in master.