Skip LaTeX errors

  • Samuele Kaplun

    Samuele Kaplun - 2008-05-16

    Dear jsMath developers,
    which would be the best way to instruct jsMath to skip errors and displays plain original text instead of the yellow box with the error message?
    jsMath would definitively bring a great added value to our online scientific digital repository, but unfortunately some records, e.g.
    <>, that contains broken LaTeX appear definitively worse than without the error.

    Thanks a lot for your help and this great tool!

    • Davide P. Cervone

      Add the following lines to your easy/load.js file just before the comment about not changing anything after that.  (Underscores are used at the beginning of the lines to show indenting, since I haven't been able to figure out any way to get spaces at the beginning of the line.  You should change the underscores to spaces.)

      _ jsMath.styles = {
      ___ '.typeset .error': 'font-style: italic; color: grey'
      _ };

      _ jsMath.Parse = function (s,font,size,style) {
      ___ var parse = new jsMath.Parser(s,font,size,style);
      ___ parse.Parse();
      ___ if (parse.error) {parse.error = s};
      ___ return parse;
      _ }

    • Davide P. Cervone

      PS, you can set the '.typeset .error' style to however you want to error LaTeX to appear.  grey italics is just a sample.


    • Samuele Kaplun

      Samuele Kaplun - 2008-05-17

      Dear Davide,
      thanks a lot of your quick and complete answer. That solved perfectly my issue!


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks