Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infix \vert produces wrong math output #958

dginev opened this issue Mar 13, 2018 · 2 comments

Infix \vert produces wrong math output #958

dginev opened this issue Mar 13, 2018 · 2 comments


Copy link

dginev commented Mar 13, 2018

I have distilled a minimal example from the arxiv-vanity 1603.00788, which (besides some missing package issues, notably glossaries.sty) has some broken equations.

The core problem comes from a redefinition of \mid as:




$p (\mbx\mid\mbtheta)$


The problems are two-fold:

  • First, firefox renders the MathML with the vertical bar as prefix, as opposed to the regular probability syntax in the PDF:

    • Firefox: ffmath

    • PDF: pdftest

    • I haven't checked the mathjax rendering, but there comes part 2 of the issue.

  • Second, the tex attribute is very low-level and out of scope for renderers like MathJax, because of commands such as \leavevmode and \nobreak. This may not be latexml's problem to solve, and could indeed be better addressed by solving Two TeX annotations for Math formulas #432 , which suggests adding a "high-level macro" math annotation attribute. My minimal example produces a slightly different string, but on arxiv-vanity it is:

    p(\mathbf{\boldsymbol{x}}\leavevmode\nobreak\ |\leavevmode\nobreak\ \mathbf{%
Copy link
Collaborator Author

dginev commented Mar 13, 2018

I should also attach the presentation MathML that I made a FF screenshot for:

      <mo stretchy="false">(</mo>
         <mo rspace="5.8pt" stretchy="false">|</mo>
         <mpadded width="+3.3pt">
      <mo stretchy="false">)</mo>

Copy link

Ah, simple problem; when I tweaked the grammar to recognize various forms of VERTBAR as infix, I forgot to update the grammatical role so postprocessing would treat it as infix. Fixed now! Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants