Closed reisman234 closed 4 years ago
Thanks a lot from bringing it to my attention!
Fortunately, this does not affect the pseudocode.js library itself, but only the way users should setup MathJax. I would update the documentation right away. You are right that the displayMath
brackets should be preceded by 2 backslashes.
Hello, i use your pseudocode.js lib in my r-bookdown project to generate the nice latex algorithmic output. The include step was stright forward, as it is mentioned in the usage guide in the readme.
However, I got some errors, existing mathematical expressions were apparently influenced by the change in MathJax. In my book i had both, inline expressions (
$somesthing$
) and also multiline expressions ($$ centered mathmatical expression $$) and only the latter expressions are affected and are not correctly displayed.For Example: from following expression:
$$L[k](A) = \prod_{i=1}^N[a_i,k]\cdot h[k]$$
is the folling output generated:I noticed the following lines in the include of MathJax:
The second line looks to me what influences multiline expressions and has just one "\" insteed of two "\\" as it is in the top line. I changed it to the following:
displayMath: [['$$','$$'], ['\\[','\\]']],
and voila, that solve my problem.
I`m not very familiar with javascript and related subjects, so I don't really understand what happens in the include statement and if the backslash is really missing or not. As a simple test I created a simple HTML page. There it seems to be no matter if there are 1 or 2 backslashes in the expression.