asciidoctor / asciidoctor-latex

:triangular_ruler: Add LaTeX features to AsciiDoc & convert AsciiDoc to LaTeX
http://asciidoctor.org
Other
114 stars 26 forks source link

Multiple math mode glitches #72

Open xsrvmy opened 7 years ago

xsrvmy commented 7 years ago

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 \(\).

jxxcarlson commented 7 years ago

Hi, Could you provide me with examples? That would help a great deal.

Thanks so much!

On Sep 12, 2017, at 9:51 PM, xsrvmy notifications@github.com wrote:

It looks like [] equation environment is very glitch if it is placed in the middle of a line, and sometimes weird + signs will appear.

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 ()

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/asciidoctor/asciidoctor-latex/issues/72, or mute the thread https://github.com/notifications/unsubscribe-auth/AApgN0QNlwM77Spw-KwQZLB_Eywll3PFks5shzULgaJpZM4PVeUS.

jxxcarlson commented 7 years ago

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.

xsrvmy commented 7 years ago

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