Fix issue with \textit, etc., not working with textmacros extension. (mathjax/MathJax#2514) #546
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
textmacros
extension resets the font to normal when\text{}
is used (as it does in actual LaTeX), since you can change fonts internally within\text{}
withtextmacros
. (This differs from\text{}
withouttextmacros
, since the only way to set the font within\text{}
previously was to set the font outside it, a conscious decision to differ from LaTeX to allow that functionality.) But because\textit{}
and the other similar macros were defined as macros that used{\it\text{#1}}
, the change in behavior for\text{}
caused these macros to fail with thetextmacros
extension.This PR changes the implementations of
\textit{}
and the other similar macros to use javascript functions (rather than replacement macros) that get passed the neededmathvariant
for initializing the font. The\text{}
macro retains its original behavior withouttextmacros
, but has its new behavior with the extension, and now all the related ones now work with the extension as well.Resolves issue mathjax/MathJax#2514