1

I'm using TexLive 2012 from the openSUSE buildservice publishing repository, and a document that would compile with TeXLive 2011 now effects error messages such as:

Package PGF Math Error: The function `add' already exists.

Package PGF Math Error: The function `subtract' already exists.

and so on.

This is caused by todonotes and chemfig, since both load tikz. Is there a way to resolve this conflict?

An example, as requested:

\documentclass[a4paper]{scrbook}
\usepackage{hyperref}
\usepackage{todonotes}
\begin{document}
test
\end{document}

The relevant excerpt of the log from texlive 2011:

(/usr/share/texmf/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty
Package: pgfcomp-version-1-18 2007/07/23 v2.10 (rcs-revision 1.1)
))
(/usr/share/texmf/tex/latex/pgf/utilities/pgffor.sty
(/usr/share/texmf/tex/latex/pgf/utilities/pgfkeys.sty
(/usr/share/texmf/tex/generic/pgf/utilities/pgfkeys.code.tex))
(/usr/share/texmf/tex/generic/pgf/utilities/pgffor.code.tex
Package: pgffor 2010/03/23 v2.10 (rcs-revision 1.18)

and that of the log from texlive 2012:

(/usr/share/texmf/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty
Package: pgfcomp-version-1-18 2007/07/23 v2.10 (rcs-revision 1.1)
))
(/usr/share/texmf/tex/latex/pgf/utilities/pgffor.sty
(/usr/share/texmf/tex/latex/pgf/utilities/pgfkeys.sty
(/usr/share/texmf/tex/generic/pgf/utilities/pgfkeys.code.tex))
(/usr/share/texmf/tex/latex/pgf/math/pgfmath.sty
(/usr/share/texmf/tex/generic/pgf/math/pgfmath.code.tex
(/usr/share/texmf/tex/generic/pgf/math/pgfmathcalc.code.tex
(/usr/share/texmf/tex/generic/pgf/math/pgfmathutil.code.tex)
(/usr/share/texmf/tex/generic/pgf/math/pgfmathparser.code.tex
\pgfmath@dimen=\dimen142
\pgfmath@count=\count113
\pgfmath@box=\box35
\pgfmath@toks=\toks24
\pgfmath@stack@operand=\toks25
\pgfmath@stack@operation=\toks26
)
(/usr/share/texmf/tex/generic/pgf/math/pgfmathfunctions.code.tex
(/usr/share/texmf/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex 
  • 1
    Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. – egreg Sep 16 '12 at 20:23
  • 2
    'Works for me'. Perhaps you could add \listfiles to your example and report what file list you get: I suspect a version conflict with a locally-installed version of one or more files. – Joseph Wright Sep 16 '12 at 20:41
  • Unfortunately the example doesn't produce any error even if I add \usepackage{chemfig}. – egreg Sep 16 '12 at 20:43
  • I just tried the MWE on texlive 2011 on another computer and it compiles fine. The diff of the logs merely indicates that /usr/share/texmf/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex is loaded twice, and in the one case this has no effect, while in the other the functions are defined twice. There are no locally-installed files that interfere with this. – auxsvr Sep 16 '12 at 22:06
  • I didn't edit the previous message in time. pgfmathfunctions.basic.code.tex is included twice when the error message appears, and only once in texlive 2011. – auxsvr Sep 16 '12 at 22:17
1

The cause is that the latest version of pgf has the line

\RequirePackage{pgfmath}

in tex/latex/pgf/utilities/pgffor.sty. If I comment it out, then everything works fine. Here is the bug report for this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.