Skip to content
This repository was archived by the owner on Sep 7, 2020. It is now read-only.

mathjax-node-page parsing latex 'def'-like commands #52

Closed
ronligt opened this issue Oct 6, 2017 · 3 comments
Closed

mathjax-node-page parsing latex 'def'-like commands #52

ronligt opened this issue Oct 6, 2017 · 3 comments
Labels

Comments

@ronligt
Copy link

ronligt commented Oct 6, 2017

Inside our document we style some of the latex-equations using for example \definecolor, \def, \newcommand and \colorbox. This worked perfectly in a (much) older version of mathjax-node v.0.5.1 page2svg, but we can’t seem to get this to work in the latest version of mjpage (mathjax-node-page v.1.4.0).

Can you help us solve this as we would like to know if we can switch to this newer version?

Code snip from Chap_6.html (see below):

<span class="math inline" style="display:none;">\[
\definecolor{mainresultcolor}{rgb}{1,0.6,1}
\newcommand{\mainresult}[1]{
	\colorbox{mainresultcolor}{$#1$}
}
\]</span>
<span class="math display">\[
\mainresult{\begin{array}{*{20}{l}}
{{m_y}}&amp;{ = {m_x}\sum\limits_{k =  - \infty }^{ + \infty } {h[n - k]}  = {m_x}\sum\limits_{n =  - \infty }^{ + \infty } {h[n]} }\\
{\,\,\,}&amp;{ = {m_x}H(\Omega  = 0)}
\end{array}} % end class mainresult
\]</span>

This is the error:

$ ../node_modules/mathjax-node-page/bin/mjpage < Chap_6.html > test.html
TeX parse error: Undefined control sequence \definecolor
TeX parse error: Undefined control sequence \mainresult
@pkra
Copy link
Owner

pkra commented Oct 9, 2017

This problem is due to mathjax/MathJax-node#175.

Running mjpage --extensions 'TeX/color.js' ... should give the desired result.

@pkra pkra added the question label Oct 9, 2017
@ronligt ronligt closed this as completed Oct 9, 2017
@ronligt
Copy link
Author

ronligt commented Oct 9, 2017

Solved the problem!

@ronligt ronligt reopened this Oct 9, 2017
@ronligt ronligt closed this as completed Oct 9, 2017
@pkra
Copy link
Owner

pkra commented Oct 9, 2017

Good to hear. Thanks for the follow up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants