Hi!
I'm trying to use PGF's calculation facility to generate labels and want them to be integers. Unfortunately the code from the first post doesn't work for me.
torbjorn t. wrote:
Code: Select all
\documentclass{article}
\usepackage{pgf}
\begin{document}
87 divided by 17 is approximately \pgfmathparse{int(round(87/17))}\pgfmathresult.
\end{document}
Copied it to a new file 'a.tex' and on compilation pdflatex shows this error which seems to imply that the function "int()" is not available:
Code: Select all
[...]
(/usr/share/texmf/tex/latex/pgf/compatibility/pgfcomp-version-0-65.sty)
(/usr/share/texmf/tex/latex/pgf/compatibility/pgfcomp-version-1-18.sty))
No file a.aux.
(/usr/share/texmf-texlive/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
)
! Package PGF Math Error: Unknown function `int'.
See the PGF Math package documentation for explanation.
Type H <return> for immediate help.
...
l.4 ...roximately \pgfmathparse{int(round(87/17))}
\pgfmathresult.
The PFG documentation also does not mention "int()" but noone here seems to have any problems. Is my version of PGF outdated? I use Ubuntu 11.4 and Synaptic says PGF version is 2.00-1 with no updates available.
Any help is appreciated.