Problem description
I have a LaTeX project that relies on both, \usepackage{pgfplots}
and \usepackage{forest}
.
Since upgrading to TeX Live 2016, the presence of the pgfplots
package breaks compilation if the document contains a \begin{forest}
environment that has the folder
option enabled.
The error message suggests this is because pgfplots
wants to use the FPU, but the folder
option in the forest
environment relies on a Mod
operation that is not (yet) implemented in the FPU:
! Package PGF Math Error: Sorry, the operation 'Mod' has not yet been implemented in the floating point unit.
Because I require both packages in my project, I would like to find a solution for this problem. I suspect that deactivating the FPU via \pgfkeys{/pgf/fpu=false}
might be an option, but I'm not sure how I would apply this to the MWE below.
Minimal Working Example
Save the following MWE to main.tex
and compile with pdflatex main
. Then, uncomment the line marked TODO
and try to recompile (which will fail).
\documentclass{standalone}
% NOTE: [edges] option required to enable 'folder' option in
% 'forest' environment below.
\usepackage[edges]{forest}%
% TODO: Uncomment the line below to break compilation
%\usepackage{pgfplots}%
\begin{document}
\begin{forest}%
for tree={folder}% NOTE: Problem only occurs with this option enabled
[foo%
[bla]%
[moo]%
]%
\end{forest}%
\end{document}
\pgfkeys{/pgf/fpu=false}
somewhere before forest starts parsing but seems it doesn't accept options.fpu
library does not appear to provide an effective reverse option. (@percusse 's suggestion doesn't work for me.) Hence, the only way to deal with this would be forpgfplots
to enable it locally. I would think this would be best practice anyway, to be honest. If you are changing stuff from the defaults, you have a responsibility to ensure the changes are local unless they are designed to be global (e.g. that's the point of the package), which doesn't apply here.pgfplots
should keep the use offpu
local. Other packages cannot be expected to pre-emptively check for possible disruption to the defaults. However, I think there is a further problem here which is independent ofpgfplots
andforest
: see tex.stackexchange.com/questions/328996/…. In any case, I don't see any reason to think that Forest is at fault in this case.pgfplots
and another in thefpu
library. The former can't intend to enable this globally, given how often it enables it within groups and how frequently it checks whether it is active. And the former can't intend the reversal option to not do what it says on the tin.