jkuczm / mmacells

Mathematica cells in TeX
63 stars 18 forks source link

Handle `^^M`s inside formatted "lines" #46

Closed jkuczm closed 3 years ago

jkuczm commented 3 years ago

When listings-fancyverb interface is switched on \FancyVerbFormatLine command set by listings can't handle carriage return (^^M) characters passed to it. Although it's intended to format individual lines, when commandchars are set, commands with arguments containing newlines are passed to \FancyVerbFormatLine as single "lines". This leads to infinite compilation.

As a workaround all ^^Ms are replaced by \emptys before tokens are passed to formatting command.

Fixes newline issue from #20#issuecomment-212977239.