asciidoctor/asciidoctor-latex

Multiple math mode glitches

xsrvmy opened this issue · 3 comments

It looks like \[\] equation environment is very glitch if it is placed in the middle of a line, and sometimes weird + signs will appear. Looks like an incorrectly inserted new line to me.

Another glitch is that a closing square bracket can end up outside the math if $...$ is used for mathmode, but this is not a problem with \(\).

I will have to review this. The problem is the following. What is inside \[ ... \] has to be protected from alteration by other parts of Asciidoctor. In the regex that handles this, I assume that \[ and \]
at the beginning of the line. Hence the problem. I'll see if there is a better solution that doesn't mess something else up. Using regexes to do all this work is inherently problematic, and will be solved once there is a proper parser for asciidoc.

Example of the second bug:
$[a],b$ incorrectly results in the output [a,b]
\([a],b\) correctly results in the output [a],b