TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)
share|improve this question
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. – egreg Sep 16 '12 at 20:23
Thanks, example added. – auxsvr Sep 16 '12 at 20:35
'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 tried the given MWE with several sequences of todonotes, hyperref and chemfig without any error or warning on MiKTeX 2.9. Please update your MWE to reproduce the mentioned errors (more packages loaded? Own definitions used?) – Kurt Sep 16 '12 at 21:11
up vote 1 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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