PreTeXtBook / pretext

PreTeXt: an authoring and publishing system for scholarly documents
https://pretextbook.org
Other
266 stars 208 forks source link

Warning when using aligment character in <m> or <me>. #1308

Closed JeanSebastienTurcotte closed 4 years ago

JeanSebastienTurcotte commented 4 years ago

When you write something like x+y&=3 inside a \<m> or \<me> tag, it does not get displayed by Mathjax (which is normal). I feel like there should be a warning when you compile that tells you you may have misplaced an aligment character. LaTeX does that if I remember correctly.

sean-fitzpatrick commented 4 years ago

That should be tricky, since PreTeXt doesn't have a LaTeX processor. So you can't say, for example, that \amp is not allowed inside <m> because there are many LaTeX environments (like matrices) that use it

JeanSebastienTurcotte commented 4 years ago

I thought this might be the case.

On Wed, Jun 10, 2020 at 10:08 AM Sean Fitzpatrick notifications@github.com wrote:

That should be tricky, since PreTeXt doesn't have a LaTeX processor. So you can't say, for example, that \amp is not allowed inside because there are many LaTeX environments (like matrices) that use it

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rbeezer/mathbook/issues/1308#issuecomment-642034628, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6COPOB3AOEK4ISWCB4R4DRV6HVTANCNFSM4N2ML6RQ .

-- Jean-Sébastien Turcotte

sean-fitzpatrick commented 4 years ago

Maybe Rob's mythical preprocessor can help?

rbeezer commented 4 years ago

The ampersand lives two lives: separating items in 2-D layout (matrices, array, align), plus being an "alignment point". As Sean points out, a simple search won't suffice.

We help authors by writing quality LaTeX, but they are on their own for the math bits (a conscious design decision). For example, if there is a \left( we don't check for a \right) like LaTeX will. So we just get whatever (divergent?) behavior MathJax and LaTeX give us.

What exactly does LaTeX do with your example? m and/or me?

JeanSebastienTurcotte commented 4 years ago

I haven't gone around to compiling the PDF yet and have since then (found and) fixed my problem. Feel free to close this issue, I was just feeling like maybe there should be a warning there. But I understand the distinction between the author's responsability via producing correct math code bits.

rbeezer commented 4 years ago

OK, got it.