When a macro with an optional argument is replaced, if it is followed by a \n the whitespace is discarded.
\n
To see the issue feed
\newcommand{\macro}[1]{bla #1 bla} \newcommand{\macroopt}[1][]{bla #1 bla} A \macro{B} C A \macroopt[B] C A \macroopt[B] C
to
pandoc -f latex -t plain
to obtain
A bla B bla C A bla B blaC A bla B bla C
A bla B bla C
A bla B blaC
Note that, following the macro expansion rules of LaTeX, there should be a space between bla and C in the second line as well.
bla
C
Tested with
pandoc 1.12.3.3 Compiled with texmath 0.6.6, highlighting-kate 0.5.6.1.
LaTeX reader: don't eat whitespace after macro with only opt arg.
Closes #2446.
1af8bc6
LaTeX reader: don't eat excess whitespace after macros.
Really close #2446.
114103d
Great thanks a lot!
When a macro with an optional argument is replaced, if it is followed by a
\n
the whitespace is discarded.To see the issue feed
to
to obtain
Note that, following the macro expansion rules of LaTeX,
there should be a space between
bla
andC
in the second line as well.Tested with