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

MakeUppercase creates infinite loop #155

Closed
pgf-tikz-bot opened this issue Jan 2, 2011 · 3 comments
Closed

MakeUppercase creates infinite loop #155

pgf-tikz-bot opened this issue Jan 2, 2011 · 3 comments

Comments

@pgf-tikz-bot
Copy link

Migrated from SourceForge
Author: funkycoder2
Timestamp: 2011-01-02 05:57:00

In the attached example, this line:
\node[align=center]{\MakeUppercase{a\\ b}};
creates an infinite loop when compiling the document using pdflatex/lualatex/xelatex. By pressing ^C after a minute you get the following error message:
! Interruption.
\pgfkeys@parse ...uturelet \pgfkeys@possiblerelax
\pgfkeys@parse@main
l.5 \node[align=center]{\MakeUppercase{a\\ b}
};

There seems to be an issue with the redefined \\-command, because leaving align=center away gets rid of the problem, as does not enclosing the command in a picture and node at all, so it's definitely PGF's fault.

The equivalent TeX-command works though:
\node[align=center]{\uppercase{a\\ b}};

@pgf-tikz-bot
Copy link
Author

Migrated from SourceForge
Author: funkycoder2
Timestamp: 2011-01-02 05:57:00

https://sourceforge.net/p/pgf/bugs/_discuss/thread/536eed61/9891/attachment/uppercase.tex

@pgf-tikz-bot
Copy link
Author

Migrated from SourceForge
Author: tantau
Timestamp: 2013-07-12 21:36:54.149000

  • status: open --> closed-wont-fix
  • Group: --> v1.0 (example)

@pgf-tikz-bot
Copy link
Author

Migrated from SourceForge
Author: tantau
Timestamp: 2013-07-12 21:36:54.561000

I patched the CVS so that at least no infinite loop results any longer.

However, the underlying problem cannot be fixed directly. The problem is that \MakeUppercase surrounds its result by braces. So, this has the same effect as if you had written \node [align=center] {{A//B}};. This is illegal, however, since \ may only be given with the align option on the outermost TeX group of the node box when text width is not set (this is mentioned indirectly somewhere in the fine print of the align option.

Interestingly, the problem is really caused by a "buggy" implementation of \MakeUppercase in the latex core: The additional brace is to blame. Here is a version of \MakeUppercase that works:

\DeclareRobustCommand{\PatchedMakeUppercase}[1]{{%
\def\i{I}\def\j{J}%
\def\reserved@a##1##2{\let##1##2\reserved@a}%
\expandafter\reserved@a@uclclist\reserved@b{\reserved@b@gobble}%
\protected@edef\reserved@a{\uppercase{#1}}%
\expandafter}\reserved@a
}

The only difference in the second-to-last line of the definition.

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