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

Early macro substitution in \ifstrequal clauses #9676

Closed
sgolovan opened this issue Apr 21, 2024 · 0 comments
Closed

Early macro substitution in \ifstrequal clauses #9676

sgolovan opened this issue Apr 21, 2024 · 0 comments
Labels

Comments

@sgolovan
Copy link

sgolovan commented Apr 21, 2024

The following LaTeX document fails to convert using pandoc 3.1.13:

\documentclass{article}
\usepackage{etoolbox}
\begin{document}
\def\foo{BAR}
\foo
\ifstrequal{BAR}{BAR}{\def\foo{BAZ}}{}
\foo
\end{document}

The error message is the following:

% ~/.cabal/bin/pandoc test.tex -o test.html
Error at "test.tex" (line 9, column 27):
unexpected BAR
\ifstrequal{BAR}{BAR}{\def\foo{BAZ}}{}
                          ^

It looks like pandoc substitutes the \foo macro too early, so it tries to interpret something like \def BAR{BAR}. LaTeX compiler issues PDF the expected BAR BAZ.

@sgolovan sgolovan added the bug label Apr 21, 2024
@jgm jgm closed this as completed in f366e5f Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant