https://bugzilla.wikimedia.org/show_bug.cgi?id=31442

--- Comment #14 from Nicholas Longo <nmich...@gmail.com> 2011-10-13 16:39:34 
UTC ---
Explanation of Parser behavior.

The parser previously added many braces (aka { } ) around expressions
generously.  This was causing issues with commands that produced space and was
breaking some commands.  For example It would translate
<math>\operatername{sen} x</math> to $${\operatorname {sen}}x$$ does not
produce the correct result.  

As a result the extra braces were removed.  This causes strange behavior
relating to math accents in the following ways:

1. Code that would used to compile under LaTeX is no longer sanitized to work
under texvc.  Examples include 1 from comment #10.

2. The amsmath package changes the way accents are handled (as discussed in
their user documentation).  Texvc only loads amsmath as needed.  Which means if
a command such as \text appears then the behavior suddenly seems to change.  

This is why Which is why <math>\dot\vec B</math> will not render but
<math>\text{rot}\dot\vec B</math> will render, but incorrectly.

Technically speaking amsmath insists all math accents use braces on all math
accents.  Thus despite the example the example of
<math>\text{rot}\dot{\vec{B}}</math> actually compiling other examples do not
compile exactly because of amsmath  such as <math>\tilde \mathcal{M}</math>
which is what was happening at the Mellin Transform page.  This code $$\tilde
\mathcal{M}$$ is fine as vanilla LaTeX but not accepted by amsmath.

I am testing a patch now which does the following:
1. Restores the original placement of braces of braces.
2. Introduces a new function specifically to handle commands which are brace
sensitive such as \operatorname.
3. Removes some unneeded white space for the sanitized LaTeX.

I could use the following information/examples if anyone comes across them:
Potentially many other examples of incorrect LaTeX were sanitized into working
by way of adding braces.  Do we know of any examples of things that broke that
do not involve a math accent such as \dot, \vec, \tilde, \hat, etc.? 

I am interested because I think it would be wise to document the ways in which 
in which texvc extends/differs from LaTeX.  There is, and has been for a long
time interest in moving away from texvc to blahtex, mathjax, etc.   And if we
cannot give guidelines as to the non-standard LaTeX occuring within the
wikimedia sites, it could be a rough transition.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to