I know that automatic line breaks are not available in 3.2 so I temporarily moved my website from 3.2 to 2.7 until automatic line breaks get updated to Mathjax 3. Automatic line breaks are a must-have for me because I want my website to work on both computers and phones which have very different screen sizes.
However, I have an issue with the line breaks. The line breaks don't seem to work on things like this:
$\text{The formula used to calculate the dependent variable using the value of the input variable}$. This is an issue for me because I have math tips that have long sentences inside of the tip that appears (this issue is not related to mathtips though, line breaks work in mathtips for stuff like x+x+... and they don't work for \text{} even when not in mathtips).
$\text{The formula}\ \text{used to calculate the dependent variable using the value of the input variable}$ doesn't work but
$\text{The formula}\, \text{used to calculate the dependent variable using the value of the input variable}$ does but only breaks between "fomula" and "used". The automatic line breaks work by doing
$\text{The}\,\, \text{formula}\,\,\text{used}\,\,\text{to}\,\,\text{calculate}\,\,\text{the}\,\, \text{variable}\,\,\text{using}\,\,\text{the}\,\,\text{value}\,\,\text{of}\,\,\text{the}\,\,\text{input}\,\,\text{variable}$
The method works but takes a very long time to type and the code is hard to read due to taking up more space. Is there to make the line break at spaces between words inside of text in Mathjax 2.7? If not that's ok I will write Java code that converts strings like "\text{The formula used to calculate the dependent variable using the value of the input variable}" into strings like "\text{The}\,\,\text{formula}\,\,\text{used}\,\,\text{to}\,\,\text{calculate}\,\,\text{the}\,\,\text{variable}\,\,\text{using}\,\,\text{the}\,\,\text{value}\,\,\text{of}\,\,\text{the}\,\,\text{input}\,\,\text{variable}".
Also, some of the CSS and configuration broke when downgrading to 2.7.
The below, code, which I used to make bolder plus, minus, and equal signs doesn't work because MacroMap doesn't exist in Mathjax 2.7 but I ok without this while I wait for automatic line breaking to come to Mathjax 3
const { MacroMap } = MathJax._.input.tex.SymbolMap;
const { Configuration } = MathJax._.input.tex.Configuration;
const BaseMethods = MathJax._.input.tex.base.BaseMethods.default;
new MacroMap('bold-chars', {
'=': ['Macro', String.raw`\mathrel{\vcenter{\rlap{\Rule{2ex}{3px}{0px}}\raise9px{\Rule{2ex}{3px}{0px}}}}`],
'-': ['Macro', String.raw`\mathrel{\vcenter{\Rule{20px}{2px}{0px}}}`],
'+': ['Macro', String.raw`\mathrel{\vcenter{\rlap{\kern7px\Rule{2px}{9px}{7px}}\Rule{16px}{2px}{0px}}}`]
}, BaseMethods);
Configuration.create('bold-chars', { handler: { character: ['bold-chars'] } });
More importantly, the CSS code used to change the position of the tooltips doesn't work either. I have hired someone to fix the CSS code (which apparently has to be done by editing one of the Mathjax .js files since the mathtip positioning in 2.7 is set there and .css cannot override .js. I thought it could be done with
https://docs.mathjax.org/en/v2.3-latest/CSS-styles.html#css-style-objects and
#MathJax_Tooltip but the person I hired said you use that to change the color but not the positioning) but if it's not possible then I might have to choose between automatic line breaking and tooltip positioning.
mjx-maction>mjx-tool>mjx-tip {
box-shadow: none;
border: none;
padding: 0;
display: flex;
align-items: center;
}
mjx-maction>mjx-tool>mjx-tip>* {
border: 4px solid #555;
padding: 15px 15px 15px 15px;
border-radius: 18px;
background-color: beige;
/* color: white; */
}
mjx-maction.tip-top>mjx-tool {
bottom: auto ! important;
right: auto ! important;
left: 50%;
top: calc(-100% - 9px);
height: auto;
z-index: 1;
}
mjx-maction.tip-top>mjx-tool>mjx-tip {
flex-direction: column;
width: 0;
}
mjx-maction.tip-top>mjx-tool>mjx-tip::after {
content: "";
position: absolute;
top: 100%;
border-width: 9px 4px 0 4px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
mjx-maction.tip-bot>mjx-tool {
/* bottom: auto; */
right: auto ! important;
left: 50%;
top: calc(100% + 10px) ! important;
height: auto;
z-index: 1;
}
mjx-maction.tip-bot>mjx-tool>mjx-tip {
flex-direction: column;
width: 0;
}
mjx-maction.tip-bot>mjx-tool>mjx-tip::after {
content: "";
position: absolute;
bottom: 100%;
border-width: 9px 4px 0 4px;
transform: rotate(180deg);
border-style: solid;
border-color: #555 transparent transparent transparent;
}
mjx-maction.tip-right>mjx-tool {
bottom: auto ! important;
left: calc(100% + 7px) ! important;
top: 50%;
width: auto;
height: auto;
z-index: 1;
}
mjx-maction.tip-right>mjx-tool>mjx-tip {
flex-direction: row;
height: 0;
width: 1200px;
}
mjx-maction.tip-right>mjx-tool::after {
content: "";
position: absolute;
left: -9px;
top: -4px;
border-width: 4px 9px 4px 0;
border-style: solid;
border-color: transparent #555 transparent transparent;
}
mjx-maction.tip-left>mjx-tool {
bottom: auto ! important;
right: calc(100% + 15px) ! important;
top: 50%;
width: auto;
height: auto;
z-index: 1;
}
mjx-maction.tip-left>mjx-tool>mjx-tip {
flex-direction: row;
height: 0;
}
mjx-maction.tip-left>mjx-tool::after {
content: "";
position: absolute;
right: -9px;
top: -4px;
border-width: 4px 9px 4px 0;
border-style: solid;
border-color: transparent #555 transparent transparent;
transform: rotate(180deg);
}
mjx-maction.tip-left>mjx-tool {
bottom: auto ! important;
right: auto ! important;
left: calc(0% - 45px);
top: calc(50% - 13px);
width: auto;
height: auto;
z-index: 1;
}
mjx-maction.tip-left>mjx-tool::after {
content: "";
position: absolute;
right: -9px;
top: 8px;
border-width: 4px 9px 4px 0px;
transform: rotate(180deg);
border-style: solid;
border-color: transparent #555 transparent transparent;
}
As a last note, I really appreciate you replying to all my messages and fixing my Mathjax problems for free.