Nested subscript working in Browsers but throwing error from inside chm file

253 views
Skip to first unread message

DWeights

unread,
Sep 17, 2013, 1:31:54 PM9/17/13
to mathja...@googlegroups.com
Hi,
 
I am creating some documentation that is to be distributed in a chm file. I have been using MathJax to render a series of equations.

I have no problem rendering any of my equations when using IE / Chrome / Firefox. However, when I compile my chm file equations containing nested subscripts that require braces produce a 'Math Processing Error'. If I right click and view source the html appears as expected and is identical to that used by the browsers. To clarify the issue I have stripped out all complex equations and can recreate the issue with a dummy example. I have found no difference and that all nested superscripts that require braces also fail in the chm and not in the browsers.
 
I have checked the documentation and I think my notation is correct.
 
Here is an example of a line of HTML code that succeeds in both browsers and a chm file...
 
<p>This is a dummy equation that correctly displays a nested subscript         \(1_{X_a} \)   </p>
 
Here is an example of a line of HTML code that succeeds in browsers and fails in a chm file...
 
<p>This is a dummy equation that fails to display a nested subscript         \(1_{X_{avg}} \)   </p>
 
 
The same error occurs if replace the subscripts with superscripts.
 
Please can someone clarify if the nested subscript should work correctly in a chm file or if my syntax must be modified? I should reiterate and say that other equations are displaying correctly in the chm using MathJax on the same page.
 
 
Thank you for your time,
 
Doug

Peter Krautzberger

unread,
Sep 17, 2013, 3:00:07 PM9/17/13
to mathja...@googlegroups.com
Hi Doug,
 
Can you share a sample file? We've heard about issues with CHM viewing and javascript, so this might be a bad interaction. A sample and/or details on your compilation process could allow others to test things.

Peter.


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Dayal Purohit

unread,
Sep 17, 2013, 5:21:46 PM9/17/13
to mathja...@googlegroups.com
chm file are compressed html file. maybe thats why not working

d^3p

DWeights

unread,
Sep 17, 2013, 5:49:55 PM9/17/13
to mathja...@googlegroups.com
Hi,

Thanks for the quick reply, I'm home from work now. I'll post some files tomorrow morning with some more details of the compilation process.

In short I am using the latest version of doxygen with latest version of MathJax and the latest version of HTML Help Workshop.

I created a single doxygen file which contains a simple heading and a simple equation (with nested subscripts).
I then compile with doxygen which generates the appropriate html files and uses hcc.exe to generate a chm file. The html inside the chm is identical to the html in the single file which renders correctly inside a browser (If I use HTML Help workshop without doxygen I get the same error).

Tomorrow, I will send over the simple doxyfile file (for project set-up) and the single doxygen file which contains the content. I'll also send the html file that is generated so this can be tested easily (obviously the path to the MathJax folder will need to be edited. If necessary I can send the hhp and other files required by html workshop. However, it may be simpler to quickly regenerate with doxygen as it takes 2 minutes to do.

Please don't hesitate to ask me for anything else you would like to see.

Thank you for your time

Doug. 

Peter Krautzberger

unread,
Sep 17, 2013, 5:24:11 PM9/17/13
to mathja...@googlegroups.com
IIRC, the CHM viewer has a stricter security policy for javascript execution, in particular affecting the loading of our webfonts.

Peter.

DWeights

unread,
Sep 18, 2013, 6:56:45 AM9/18/13
to mathja...@googlegroups.com
Hi,
 
Thanks for the reply.
 
[Before starting I would like to correct an error I sent yesterday. I am using version 1.8.3.1 of doxygen. There is a later version out now. However, I am unable to use this at this time. I have checked for a fix to my problem in the release notes and didn't see anything.]
 
Please find attached a zip file containing the doxyfile (for doxygen set-up) and the single source file processed by doxygen to generate the file. The doxyfile will need to be edited to point to the location of your hhc compiler and also to the location of MathJax (MATHJAX_RELPATH = "C:\..."). In my example I put the MathJax directory in the html folder. Putting the distribution higher in the directory hierarchy will cause the chm to no avoid running the java scripts (I assume this is a security feature).

Once this is done you should be able to run Doxygen and generate the html files together with the chm file in the html folder. For clarity I have commented out test equations that are causing an issue so the first attempt should create a chm that worked perfectly well. You can then go back to the dox file and comment out the working equation and uncomment the problematic eqn below. If you have the same issue as me you will notice that in a browser there is no issue. However, in the chm there is a rendering error.
 
RANDOM ERROR:
I have also included a 3rd eqn. (commented by default) this randomly renders/fails regardless of whether other errors exist on the page. If it does render correctly I find that hitting F5 to refresh the chm page or selecting the tree view on the left causes a stack overflow. You may wish to see this as well.
 
Please don't hesitate to contact me if you require further information.
 
 
Thank you for your time,
 
Doug 
example.zip

DWeights

unread,
Sep 18, 2013, 11:52:02 AM9/18/13
to mathja...@googlegroups.com

Further testing seems to indicate the problem occurs when there are nested braces after a subscript or superscript. The following will also fail in a chm file whilst correctly rendering in a browser...

\( \sum_{ \{t_i\} } X(t_i) - K \)
 
The following works correctly
 
\( \sum_{ t_i } X(t_i) - K \)

DWeights

unread,
Sep 19, 2013, 1:02:32 PM9/19/13
to mathja...@googlegroups.com
Hi Peter,

I have come up with a solution to the simple math processing errors. It is by no means elegant but it does solve my problem.

I noticed that I could make the equations render in the chm if I navigated through the MathJax menu and re-selected the default HTML-CSS rendering option. This led me to assume that something (perhaps another event) was causing the rendering process to terminate early. To overcome the issue I implemented a simple javascript function in the header of the html file that forces MathJax to re-process and update the equations. I then used an onload event in the html body tag to call the function after a 100 ms delay. This fixes the issue. For you interest I have provided an attachment which is a screen shot of the actual error that is displayed when I right click on the math processing error message and ask an actual error to be displayed. Below I have provided a simplified example of the html solution to the issue.

<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Nested_Subscript_Test: MATHJAX TEST PAGE</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
function myFunc() {
MathJax.Hub.Typeset();
MathJax.Hub.Process();
MathJax.Hub.Update();
}
</script>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSsymbols.js", "TeX/AMSmath.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script src="myPathToMathJax/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body onload="setTimeout('myFunc();',100)">
My Body.....
</body>


I now have to solve the more complex issue of pages that contain typically  >6 equations causing a stack overflow of memory error. I'm guessing this could be down to a limitation with the help viewer for the chm file. I have included two screenshots of these errors in case you would like to see what is happening.

Thanks for your help,

Doug



On Tuesday, 17 September 2013 22:24:11 UTC+1, Peter Krautzberger wrote:
error.png
StackOverflow.PNG
OutOfMemory.PNG
Message has been deleted

Peter Krautzberger

unread,
Sep 25, 2013, 12:29:52 AM9/25/13
to mathja...@googlegroups.com
Hi Doug,

Thanks for the update! I'm sorry to hear that this turned into something more complicated than fixing MathJax. If you want, you could add a post to our public docs-wiki at https://github.com/mathjax/mathjax-docs/wiki

Thanks again for reporting back,
Peter.


On Thu, Sep 19, 2013 at 10:04 AM, DWeights <dwei...@googlemail.com> wrote:
--
Reply all
Reply to author
Forward
0 new messages