Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Skip LaTeX errors

Help
2008-05-16
2013-04-29
  • 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.
    <http://cdsweb.cern.ch/record/567710>, that contains broken LaTeX appear definitively worse than without the error.

    Thanks a lot for your help and this great tool!

     
    • 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;
      _ }

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

      Davide

       
    • Samuele Kaplun
      Samuele Kaplun
      2008-05-17

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