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

Warnings about vertical bars in $q_{A|A}$ #899

Closed
evoludolab opened this issue Dec 6, 2017 · 4 comments

Comments

@evoludolab
Copy link

@evoludolab evoludolab commented Dec 6, 2017

lateXML issues some spurious (?) warnings about vertical bars when processing mathematical expressions. For example, processing an expression for conditional probabilities, $q_{A|A}$, results in

	at <path to file>/PA.tex; line 24 col 132
	In "$q_{A|A}$"
	A[[UNKNOWN]]
	        > |[[VERTBAR]] A[[UNKNOWN]]

but the final output is fine. Thus, this problem seems merely a cosmetic issue.

Looking into the code it seemed to me that lateXML was expecting a second vertical bar as in an expression for an absolute value or norm but did not like the isolated, but perfectly reasonable, occurrence of a single vertical bar.

@dginev dginev added this to the LaTeXML-0.8.4 milestone Dec 6, 2017
@dginev

This comment has been minimized.

Copy link
Collaborator

@dginev dginev commented Dec 6, 2017

Thanks for the report @evoludolab . This should be a mostly harmless math parsing failure - the final presentation of the formula should still be quite accurate given the example. But good to know, could be an easy upgrade when we revisit the grammar for some upgrades.

@brucemiller

This comment has been minimized.

Copy link
Owner

@brucemiller brucemiller commented Dec 8, 2017

Ah, vertbar! The "|" is such great fun from a parsing perspective! Grammatically, it can appear as an open or close delimiter, and as infix. Moreover, it can be doubled, in which case still be infix, but only a doubled close should match a doubled open. And of course the semantics (for each case) are all over the map.

LaTeXML's grammar (I think) should be able to recognize this case, but I expect that it gets hung up not being able to backtrack correctly. Hopefully we'll be able to move to a more powerful parsing infrastructure that will deal with this (someday... ).

In any case, the conversion to MathML should fallback fairly cleanly, so it's pretty much an ignorable problem, unless you're trying to get the purest semantics out.

@evoludolab

This comment has been minimized.

Copy link
Author

@evoludolab evoludolab commented Dec 8, 2017

I completely agree - it does seem to be an entirely harmless and ignorable issue. The XHTML output is exactly as expected:
qaa
In my case, I just get lots of those warnings, which makes it harder to find and keep track of those that do matter. At the same, it seems clear that the costs for fixing these warnings might easily get out of proportion as compared to the benefits. More importantly, many thanks for an already wonderful product!

@brucemiller

This comment has been minimized.

Copy link
Owner

@brucemiller brucemiller commented Feb 13, 2018

This one annoyed me since the syntax looks so simple --- although the syntax of conditional probability is a bit more than just infix. So, I spent some time working on the grammar, hopefully without messing up the various other uses of "|". So this should parse without gratuitous warnings. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.