Skip to content
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

\pgfmathfloatifflags adds whitespace to "true"-code #182

Closed
pgf-tikz-bot opened this issue Oct 6, 2011 · 2 comments
Closed

\pgfmathfloatifflags adds whitespace to "true"-code #182

pgf-tikz-bot opened this issue Oct 6, 2011 · 2 comments

Comments

@pgf-tikz-bot
Copy link

Migrated from SourceForge
Author: tentotwo
Timestamp: 2011-10-06 23:50:13

The code executed by \pgfmathfloatifflags in the True case starts with a whitespace, caused by a missing % after the line

\if\pgfmathfloat@loc@TMPa#2

Here's a minimal example that demonstrates the error and the fix:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fpu}
\begin{document}

\pgfkeys{/pgf/fpu}

\pgfmathparse{-1}
\fbox{\pgfmathfloatifflags{\pgfmathresult}{1}{T}{F}}

\pgfmathparse{1}
\fbox{\pgfmathfloatifflags{\pgfmathresult}{1}{T}{F}}

\makeatletter
\def\pgfmathfloatifflags#1#2#3#4{%
\if#2-%
\pgfmathfloatifflags{#1}{2}{#3}{#4}%
\else
\if#2+%
\pgfmathfloatifflags{#1}{1}{#3}{#4}%
\else
\pgfmathfloatgetflagstomacro#1\pgfmathfloat@loc@TMPa
\if#2u%
\ifnum\pgfmathfloat@loc@TMPa>2
#3\relax
\else
#4\relax
\fi
\else
\if\pgfmathfloat@loc@TMPa#2%
#3\relax
\else
#4\relax
\fi
\fi
\fi
\fi
}%
\makeatother

\pgfmathparse{-1}
\fbox{\pgfmathfloatifflags{\pgfmathresult}{1}{T}{F}}

\pgfmathparse{1}
\fbox{\pgfmathfloatifflags{\pgfmathresult}{1}{T}{F}}

\end{document}

@pgf-tikz-bot
Copy link
Author

Migrated from SourceForge
Author: cjorssen
Timestamp: 2011-10-21 12:53:39

Fixed in the cvs repo. Thanks for the report and the fix.

@pgf-tikz-bot
Copy link
Author

Migrated from SourceForge
Author: cjorssen
Timestamp: 2011-10-30 13:35:30

  • status: open --> closed-fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant