Skip to content

Early macro substitution in \ifstrequal clauses #9676

Closed
@sgolovan

Description

@sgolovan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions