pandoc/test/command/newif.md
John MacFarlane 81eadfd99a LaTeX reader: improve \def and implement \newif.
- Improve parsing of `\def` macros.  We previously set "verbatim mode"
  even for parsing the initial `\def`; this caused problems for things
  like
  ```
  \def\foo{\def\bar{BAR}}
  \foo
  \bar
  ```
- Implement `\newif`.
- Add tests.
2021-05-27 09:15:04 -07:00

454 B

% pandoc -f latex -t plain
\iftrue
should print
\iftrue
should print
\else
should not print
\fi
\else
should not print
\fi

\iffalse
should not print
\else
\iftrue
should print
\else
should not print
\fi
\fi

\newif\ifepub

\ifepub
should not print
\fi

\epubtrue

\ifepub
should print
\else
should not print
\fi

\epubfalse

\ifepub
should not print
\else
should print
\fi
^D
should print

should print

should print

should print

should print