-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MathJax v4.0.0-beta.3 does not seem to support spreadlines environments #3072
Comments
It works for me (once I change When you say the second doesn't get rendered, do you mean there is an error message, or that the |
The You don't provide your MathJax configuration that we requested in the template for bug reports, which you ignored. It is for situations like this that we request that information. IN future, it would help if you actually followed the bug report template that we provided. |
I am really sorry about that (I have a bad habit of automatically highlighting text and deleting it). Just saw it now. Will definitely make sure to follow it in future reports! Here is a more informative report: Issue SummaryAs mentioned above, I cannot seem to get $$
\begin{spreadlines}{0.5em}
\begin{align}
x = 1
\end{align}
\end{spreadlines}
$$ does not render. I get this with Safari Version 16.4 and Chrome Version 114.0.5735.198 (Official Build, x86_64). I am using the following MathJax configuration: window.MathJax = {
section: {
n: -1,
useLetters: false,
letters: "AABCDEFGHIJKLMNOPQRSTUVWXYZ"
},
loader: {load: ['[tex]/tagformat', '[tex]/mathtools', 'output/chtml']},
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']], //allow inline math
displaymath: [['$$','$$'], ['\\[','\\]']],
tagSide: 'right', //location of equation numbers
processEscapes: true,
processEnvironments: true,
tags: 'all',
packages: {'[+]': ['tagformat', 'sections', 'autoload-all', 'mathtools']},
tagformat: {
number: (n) => {
const section = MathJax.config.section;
return (section.useLetters ? section.letters[section.n] : section.n) + '.' + n;
}
}},
chtml: {
mtextInheritFont: true, // font to use for mtext, if not inheriting (empty means use MathJax fonts)
displayOverflow: 'linebreak'
},
linebreaks: { // options for when overflow is linebreak
inline: true, // true for browser-based breaking of inline equations
width: '90%', // a fixed size or a percentage of the container width
lineleading: 2, // the default lineleading in em units
LinebreakVisitor: null, // The LinebreakVisitor to use
},
startup: {
ready() {
const {CommonWrapper} = MathJax._.output.common.Wrapper;
const {LineBBox} = MathJax._.output.common.LineBBox;
const {ChtmlMtable} = MathJax._.output.chtml.Wrappers.mtable;
const Configuration = MathJax._.input.tex.Configuration.Configuration;
const CommandMap = MathJax._.input.tex.SymbolMap.CommandMap;
new CommandMap('sections', {
nextSection: 'NextSection',
setSection: 'SetSection',
}, {
NextSection(parser, name) {
MathJax.config.section.n++;
parser.tags.counter = parser.tags.allCounter = 0;
},
SetSection(parser, name) {
const section = MathJax.config.section;
const c = parser.GetArgument(name);
const n = section.letters.indexOf(c);
if (n >= 0) {
section.n = n;
section.useLetters = true;
} else {
section.n = parseInt(c);
section.useLetters = false;
}
},
});
Object.assign(ChtmlMtable.prototype, {
adjustWideTable() {
const attributes = this.node.attributes;
if (attributes.get('width') !== 'auto') return;
const [pad, align] = this.getPadAlignShift(attributes.get('side'));
const W = Math.max(this.containerWidth / 10, this.containerWidth - pad - (align === 'center' ? pad : 0));
this.naturalWidth() > W && this.adjustColumnWidths(W);
}
});
Configuration.create(
'sections', {handler: {macro: ['sections']}}
);
MathJax.startup.defaultReady();
}
}
}; and loading MathJax via <script src="https://cdn.jsdelivr.net/npm/[email protected]/tex-chtml.js"></script> Note that the <script src="https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-mml-chtml.js"></script> Supporting information:I cannot provide a link to a live working example, but I have provided relevant screenshots of the console errors (see attached image below). ![]() It seems With respect to the point below |
OK, thanks for the full report. That helps a lot. It does look like |
Change Symbol to Token to avoid conflict with native Symbol in webpacked files. (mathjax/MathJax#3072)
I noticed that MathJax v4.0.0-beta.3 does not seem to support spreadlines environments. For example,
gets rendered when using
but not with
The text was updated successfully, but these errors were encountered: