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.


Macros in non-mathematical text

  • Arnaud Bodin
    Arnaud Bodin

    Dear all,

    I would like to know how to create macro in *text* mode.
    Example : \emph{Definition}. Let $x\in \Rr$ be real number,...
    In this example, I can define a macro for \Rr : jsMath.Macro('Rr','{\\bf R}');
    But for for \emph I can't do it.

    I understand that this is not the first aim of jsMath to deal with text mode.
    But I have 2000 exercises in Latex that I want to display with jsMath
    without modifying the Latex code.

    Example of macro that I would like to control :
    \emph, \textbf, ...
    \'e (for the French accent é), \`a,...
    ~ (non-secable space, for example in A.~Einstein).
    \begin{enumerate}, \begin{itemize},...

    If this is not possible then I will pre-process my files as in the following link:

    Thanks for your answers,
    Arnaud Bodin

    • JsMath does not handle any TeX commands in text mode, only math mode.  While it would potentially be possible to make a plugin similar to the tex2math plugin that would handle such constructs, jsMath has no current mechanism for doing what you ask, and it is not likely to in the near future.  There are hooks for handling LaTeX environments outside of math mode, but so far none are available.

      JsMath was never intended as a means of taking raw LaTeX and displaying it as a web page.  The assumption is that jsmath will handle the mathematical display and that the rest of the page will be formatted in HTML.  Sorry!


    • Arnaud Bodin
      Arnaud Bodin

      Thanks for your answer,

      I've made a script in perl that tanslates (most of) the Latex non-mathematical macros
      in html code.

      Thanks again for jsMath !!