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:


The relevant excerpt of the log from texlive 2011:

Package: pgfcomp-version-1-18 2007/07/23 v2.10 (rcs-revision 1.1)
Package: pgffor 2010/03/23 v2.10 (rcs-revision 1.18)

and that of the log from texlive 2012:

Package: pgfcomp-version-1-18 2007/07/23 v2.10 (rcs-revision 1.1)
  • 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

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


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.