Page MenuHomePhabricator

Port texvc to PHP, reducing external dependencies and development impedence for Math extension
Closed, DeclinedPublic


Author: rene.kijewski

The work on texvc seems to be stuck.[1] I guess the major cause is the language it is written in. Most files were not updated for years, even though there are bugs and feature requests pending.[2]
Maybe even more important is the fact, that it is difficult to compile the extension without root access, because mostly none web hoster has an Ocaml compiler installed. If there would be any chance to use a script language, you chould do it.
*Any* language would fit better. (C, perl, …)
IMHO you should drop texvc at all in favor of mimetex/mathtex.


Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:27 PM
bzimport added a project: Math.
bzimport set Reference to bz17465.

Poked summary; recommend just doing this in PHP...

A few issues that I noted while playing around some at (ATM ~ 90/1000 deviations in DVIs):

  • Despite being one of its purposes, there are no testcases that "rogue" TeX commands (I/O, "\catcode", etc.) are actually rejected.
  • texvc not only validates the input and generates HTML, but also /transforms/ the TeX source:
    • Some functions are aliased ("\uarr" => "\uparrow").
    • White space is added and deleted.
    • "M^{II}_3N_2" gets rearranged to "M_{3}^{{II}}N_{2}".

IMHO the transformations are bad (TM):

  • A reader cannot simply copy and paste apparent TeX from a wiki source to other applications.
  • An editor cannot simply copy and paste apparent TeX from a TeX source to MediaWiki.
  • It lays an unnecessary burden on the usage of other renderers and editors. For example, MathJax doesn't recognize "\uarr", but only "\uparrow".

So I think we should settle for a purely validating parser.

Omitting the transformations will of course also change the output and thus the outputhash column.  So a migration plan would probably have to include expiring PNGs generated before the deployment.

Interestingly, sometimes MathJax seems to emulate texvc's behaviour: If you TeX "m_\mbox{t} = m \cdot \frac {1}{1 - \sum k}", the result is "m" with the rest of the line as subscript. texvc transforms that to: "m_{{\mbox{t}}}=m\cdot {\frac {1}{1-\sum k}}" which only puts "t" as subscript, and at least the MathJax demo at uses the same rendering.

I fear if we do not clearly define the grammar and its meaning, we will face a situation similar to MediaWiki's parser.
Physikerwelt changed the task status from Resolved to Declined.Jul 17 2017, 9:55 AM