## Macros in non-mathematical text document.SUBSCRIPTION_OPTIONS = { "thing": "thread", "subscribed": false, "url": "subscribe", "icon": { "css": "fa fa-envelope-o" } };

2008-03-01
2013-04-29
• Arnaud Bodin - 2008-03-01

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, ...
\bigskip
\'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:
http://www.pmwiki.org/wiki/Cookbook/LatexMarkup

Arnaud Bodin

• Davide P. Cervone - 2008-03-03

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!

Davide

• Arnaud Bodin - 2008-03-03