-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling FPU breaks drawing with arrows #678
Comments
Bisected to 65b8261 |
What we have here is a much deeper problem, namely that drawing with FPU enabled will not work. Try this example with any version of PGF: \documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fpu}
\begin{document}
\begin{tikzpicture}[/pgf/fpu=true]
\draw (0,0) -- (1,1);
\end{tikzpicture}
\end{document} I'm tending to mark this as wont-fix because even if we fix this tiny regression, the rest will still remain unusable. |
Imho it indicates a real problem of the fpu library with output format fixed: \documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fpu}
\begin{document}
\pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}
\pgfmathcos{1}
xxx
\end{document} |
It seems to work if one use \documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fpu}
\makeatletter
\def\pgfpointnormalised#1{%
\pgf@process{#1}%
\pgfmathparse{atan2(\the\pgf@y,\the\pgf@x)}%
\let\pgf@tmp=\pgfmathresult%
\pgfmathparse{cos(\pgf@tmp)}%
\pgf@x=\pgfmathresult pt\relax%
\pgfmathparse{sin(\pgf@tmp)}%
\pgf@y=\pgfmathresult pt\relax%
}
\begin{document}
\begin{tikzpicture}[/pgf/fpu=true,/pgf/fpu/output format=fixed]
\draw (0,0) -- (1,1); % works
\draw [->] (0,0) -- (1,1); % doesn't
\end{tikzpicture}
\end{document} |
I have a patch, but that will break other things. diff --git a/tex/generic/pgf/math/pgfmathfunctions.code.tex b/tex/generic/pgf/math/pgfmathfunctions.code.tex
index d1c3c434..3f6e5784 100644
--- a/tex/generic/pgf/math/pgfmathfunctions.code.tex
+++ b/tex/generic/pgf/math/pgfmathfunctions.code.tex
@@ -71,7 +71,11 @@
\def#1{#2}%
\def\pgfmath@@head{\def#2}%
\or
- \def#1##1{\pgfmathparse{##1}\expandafter#2\expandafter{\pgfmathresult}}%
+ \def#1##1{%
+ \pgfmathparse{##1}%
+ \pgfmathfloatparsenumber{\pgfmathresult}%
+ \expandafter#2\expandafter{\pgfmathresult}%
+ }%
\def\pgfmath@@head{\def#2####1}%
\else%
\pgfmath@toks={}%
@@ -91,7 +95,8 @@
\pgfmath@addto@toks{\pgfmathparse}%
\expandafter\expandafter\expandafter\pgfmath@addto@toks%
\expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter%
- {\expandafter\pgfmath@char@hash\pgfmathcounter}}%
+ {\expandafter\pgfmath@char@hash\pgfmathcounter}%
+ \pgfmathfloatparsenumber{\pgfmathresult}}%
\pgfmath@addto@toks{\let}%
\expandafter\pgfmath@addto@toks\expandafter{%
\csname pgfmath@argument@\pgfmathcounter\endcsname=\pgfmathresult}% |
I enjoy the manual's warning about this instead of changing the behavior
I think a better warning about |
The following code:
breaks with:
with the current (3.1.3) version of PGF--TikZ.
The command works fine without the
[->]
. PGF--TikZ version 3.1.1 works fine.The text was updated successfully, but these errors were encountered: