Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Update Oct 30th 2011

This has now been fixed in the CVS repository of PGF due to my bug report. With this version \usepackage{pgfmath} should work.

I would like to use pgfmath in one of my packages to do math, but don't like to load the whole pgf package just for that. I like to keep the used resources to a minimum. However a simple \usepackage{pgfmath} returns an error message that it doesn't know \pgfkeys. Loading also pgfkeys gives leaves me with the error message:

! Undefined control sequence.
<recently read> \pgfutil@in@ 

l.1451 \pgfkeys{/pgf/number format/std}

Is it possible to load pgfmath without loading the whole pgf package? Also, any idea why the pgfmath package doesn't load all its dependencies itself? Is that by intention?

MWE:

\documentclass{article}

\usepackage{pgfkeys}
%\usepackage{???}% what extra `pgfxxx` package(s) is/are missing?
\usepackage{pgfmath}

\begin{document}
\pgfmathparse{1+1}
\pgfmathresult
\end{document}

I also reported this on the PGF/TikZ bug tracker. IMHO \usepackage{pgfmath} should load all required dependencies. The v2.10 PGF manual states in section 61.1 Loading the Mathematical Engine, that this is supposed to be the case, so this is indeed a bug!

share|improve this question
add comment

1 Answer

up vote 10 down vote accepted
\listfiles
\documentclass{article}

\usepackage{pgfkeys}
\input{pgfutil-common}
\input{pgfmath.code}

\begin{document}
\pgfmathparse{1+1}
\pgfmathresult
\end{document}
share|improve this answer
1  
Thanks, that works! I now figured I could also load any package which loads pgfutil-common, e.g.: \usepackage{pgfrcs,pgfkeys,pgfmath}, but I like your solution better. –  Martin Scharrer Jul 11 '11 at 16:24
1  
Ok, if then the pgf package is loaded afterwards all the math functions like add are installed again and cause an error :-( It's a pity that PGF doesn't check if the .code.tex files were already loaded. –  Martin Scharrer Jul 30 '11 at 22:59
add comment

Your Answer

 
discard

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.