I am trying to use the fp
package, and the results are deeply confusing to me:
\documentclass[a4paper]{article}
\usepackage{fp}
\begin{document}
\begin{tabular}{r|l}
\FPeval\testing{2 + 2}
a & \testing
\end{tabular}
\end{document}
This will not compile:
This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018/Arch Linux) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./mvce.tex
LaTeX2e <2018-04-01> patch level 5
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texmf-dist/tex/latex/fp/fp.sty
`Fixed Point Package', Version 0.8, April 2, 1995 (C) Michael Mehlich
(/usr/share/texmf-dist/tex/latex/fp/defpattern.sty)
(/usr/share/texmf-dist/tex/latex/fp/fp-basic.sty)
(/usr/share/texmf-dist/tex/latex/fp/fp-addons.sty)
(/usr/share/texmf-dist/tex/latex/fp/fp-snap.sty)
(/usr/share/texmf-dist/tex/latex/fp/fp-exp.sty)
(/usr/share/texmf-dist/tex/latex/fp/fp-trigo.sty)
(/usr/share/texmf-dist/tex/latex/fp/fp-pas.sty)
(/usr/share/texmf-dist/tex/latex/fp/fp-random.sty)
(/usr/share/texmf-dist/tex/latex/fp/fp-eqn.sty)
(/usr/share/texmf-dist/tex/latex/fp/fp-upn.sty)
(/usr/share/texmf-dist/tex/latex/fp/fp-eval.sty))
No file mvce.aux.
( FP-EVAL ( FP-UPN ( FP-ADD ) ) )
! Undefined control sequence.
l.6 a & \testing
However, removing the &
will give the intended result. Why does that happen, and what can I do about it? Should I use a different package for arithmetic?
This is just a simplified example. I actually want to use the result multiple times across a &
and \\
boundary, which is why I can't just move the FPeval
where the result is used.