MathJax in Matlab Help Browser

조회 수: 2 (최근 30일)
Carl Banks
Carl Banks 2024년 8월 6일
댓글: Shubham 2024년 8월 22일
Anyone know if it's possible to do this?
Matlab's web viewer (using web command on local file) shows HTML files that use MathJax just fine. However, when I index the HTML file in a helptoc.xml, so that the file can be viewed in the Help Browser, the MathJax rendered equations are not shown. I assume the javascript that loads MathJax isn't even being run when viewing the file in the Help Browser, but perhaps there is a way.
MathML would be acceptible (and probably superior) but the Help Browser does not seem to support MathML at all.
I no interest in using Live Script or any other publishing solution built into Matlab. The HTML is coming from a source external to Matlab.
  댓글 수: 1
Carl Banks
Carl Banks 2024년 8월 7일
Experimentation reveals that Matlab Help Browser does run inline scripts, but fails to run externally defined scripts. Also does not seem ot call window.load event which is when MathJax starts running.

댓글을 달려면 로그인하십시오.

답변 (1개)

Shubham
Shubham 2024년 8월 20일
Hi Carl,
As per my understanding, the issue is caused by the HTML renderer used by MATLAB to view the Help Browser. Since R2021a, CEF(Chromium) is the only supported renderer for MATLAB and Help Browser.
It is possible that JavaScript that loads MathJax may not be running while viewing the file in Help Browser. I tried reproducing the issue and MathJax was not rendering the equations.
A possible workaround can be achieved using the following steps:
  1. Download MathJax locally from the official site: https://github.com/mathjax/MathJax/archive/refs/tags/3.2.0.zip
  2. Unzip it and place it in a directory accessible to your HTML file.
  3. Update the script tag to load MathJax locally in your HTML file.
<script type="text/javascript" async
src="path/to/your/local/mathjax/es5/tex-mml-chtml.js">
</script>
This enables you to render mathematical equations present in your HTML file in the MATLAB Help Browser.
Hope this helps.
  댓글 수: 2
Carl Banks
Carl Banks 2024년 8월 20일
Thanks for the answer but this flat out doesn't work; it behaves no differently than linking to the Internet MathJax. I was already using a local copy of MathJax.
Shubham
Shubham 2024년 8월 22일
I did not quite understand your comment. The approach described above functions correctly on my end and successfully renders the mathematical equations in the Help Browser. Could you please provide further clarification?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Assembly에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by