Skip to content

Commit fd820ed

Browse files
committed
issue #9217 Can't load MathJax 3 extensions
Specified loader for the extension as well. (looks like for e.g. `ams` it is not necessary but no negative influence seen when explicitly loading).
1 parent 1231a9e commit fd820ed

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

src/htmlgen.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,8 +461,22 @@ static QCString substituteHtmlKeywords(const QCString &str,
461461
const StringVector &mathJaxExtensions = Config_getList(MATHJAX_EXTENSIONS);
462462
if (!mathJaxExtensions.empty() || !g_latex_macro.isEmpty())
463463
{
464-
mathJaxJs+= ",\n"
465-
" tex: {\n"
464+
mathJaxJs+= ",\n";
465+
if (!mathJaxExtensions.empty())
466+
{
467+
bool first = true;
468+
mathJaxJs+= " loader: {\n"
469+
" load: [";
470+
for (const auto &s : mathJaxExtensions)
471+
{
472+
if (!first) mathJaxJs+= ",";
473+
mathJaxJs+= "'[tex]/"+QCString(s.c_str())+"'";
474+
first = false;
475+
}
476+
mathJaxJs+= "]\n"
477+
" },\n";
478+
}
479+
mathJaxJs+= " tex: {\n"
466480
" macros: {";
467481
if (!g_latex_macro.isEmpty())
468482
{

templates/html/htmlbase.tpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ window.MathJax = {
5151
ignoreHtmlClass: 'tex2jax_ignore',
5252
processHtmlClass: 'tex2jax_process'
5353
},
54+
{% if config.MATHJAX_EXTENSIONS %}
55+
loader: {
56+
load: [{% for ext in config.MATHJAX_EXTENSIONS %},'{{ ext }}'{% endfor %}]
57+
},
58+
{% endif %}{# MATHJAX_EXTENSIONS #}
5459
tex: {
5560
{% if doxygen.mathJaxMacros %}
5661
macros: { {{ doxygen.mathJaxMacros|raw }} },

0 commit comments

Comments
 (0)