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

Broken math mode scoping with \textnormal and others #599

Closed
Quoor8ee opened this issue May 14, 2020 · 3 comments
Closed

Broken math mode scoping with \textnormal and others #599

Quoor8ee opened this issue May 14, 2020 · 3 comments
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@Quoor8ee
Copy link

Commit 87f1646 extended \textnormal and a few other \text* macros for beamer-aware semantics. This broke the single-token expansion syntax in math mode.
MWE:

\documentclass{beamer}
\begin{document}
\begin{frame}
$X_\textnormal{Y}$
\end{frame}
\end{document}

Works fine up to TeXLive 2018, but with beamer code younger than one year (TL19 with updates, TL20, trunk) it complains:

! Missing { inserted.
<to be read again> 
                   \def 
l.5 \end{frame}
                
? x
No pages of output.

As a workaround, one can add braces around the subscript argument, like $X_{\textnormal{Y}}$. But math mode syntax (and the principle of least astonishment) are broken for writing/remembering/copy-pasting/importing code from any other documents into beamer presentations (plus editor autocomplete).
Is there a clever way to wrap those macros into a scope so that beamer's descendants of these macros behave more like their counterparts in plain LaTeX?

@josephwright josephwright self-assigned this May 14, 2020
@josephwright josephwright added the bug Something isn't working label May 14, 2020
@u-fischer
Copy link

u-fischer commented May 14, 2020

Using a subscript without braces is not a supported syntax. It may work but it can also break.

With braces your example work fine and this not a workaround but the proper input. So always use it.

\documentclass{beamer}
\begin{document}
\begin{frame}
$X_{\textnormal{Y}}$
\end{frame}
\end{document}

See also https://tex.stackexchange.com/a/342272/2388

@Quoor8ee
Copy link
Author

It has worked before, and if someone wonders why their documents no longer build correctly, they at least might come here, and know that this is indeed a regression.
But you're right that nobody should rely on gambling if such accidental syntactic sugar works or not.

In the meantime, I am more sensitised about the topic, and I have found a viable way to deal with it in my actual code. So I don't mind if someone still does something around the issue, or decides to close/wontfix it.

@josephwright josephwright added the wontfix This will not be worked on label Jul 22, 2020
@josephwright
Copy link
Owner

I'm closing here: it's not official LaTeX syntax and moreover we have to make a choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants