After a while I decided I want to make the equation numbers on the far right now, but somehow I had previously changed it to make it only a little to the right. Unfortunately I can't figure out how to restore the normal behavior. This is my mathjax config file:
import {customColors} from "./helper.js";
window.MathJax = Object.assign({
loader: { load: ['[tex]/color','[tex]/cancel','[tex]/unicode','[tex]/mathtools','[tex]/textcomp'] },
tex: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
packages: { '[+]': ['bold-chars', 'my-active', 'color', 'cancel', 'unicode','mathtools','textcomp'] },
maxBuffer: 10 * 1024,
tags: 'ams',
macros: Object.assign({
//fractions
frac: ['\\p{\\genfrac{} {} {2} {0} {#1}{#2}}', 2],
powfrac: ['\\p{\\genfrac{} {} {2} {1} {#1}{#2}}', 2],
//environments
a: ['\\begin{aligned}#1\\end{aligned}', 1],
fla: ['\\begin{flalign*}#1\\end{flalign*}', 1],
ga:['\\begin{gathered}#1\\end{gathered}',1],
cases:['\\begin{cases}#1\\end{cases}',1],
eq: ['\\begin{equation}\\label{#1}#2\\end{equation}',2],
//other
pa:['\\p{\\left(#1\\right)}',1],
so:['\\cancel{#1}',1],
quotes:['\\unicode{x201C}#1\\unicode{x201D}',1],
ds: '\\displaystyle',
//colors non-text
b: ['\\textcolor{bluee}{#1}', 1],
bk: ['\\textcolor{blackk}{#1}', 1],
cdb:['\\textcolor{cadet}{#1}',1],
g: ['\\textcolor{greenn}{#1}', 1],
go: ['\\textcolor{goldd}{#1}', 1],
greyOut:['\\textcolor{lightGray}{#1}',1],
lb: ['\\textcolor{lightbluee}{#1}', 1],
mg:['\\textcolor{mediumGray}{#1}',1],//for tooltips
o: ['\\textcolor{orangee}{#1}', 1],
pk: ['\\textcolor{pinkk}{#1}', 1],
pu: ['\\textcolor{purplee}{#1}', 1],
r: ['\\textcolor{redd}{#1}', 1],
w: ['\\class{white}{#1}', 1],
//dollar
dol:'\\$',
//pause
p: ['\\class{invisible}{#1}',1],
pt: ['\\class{word}{\\p{#1}}',1],//change to ['\\class{word}{\\p{\\t{#1}}}',1] after parser is fixed
ptextbf: ['\\class{word}{\\p{\\textbf{#1}}}',1],
pgt: ['\\class{word}{\\p{\\gt{#1}}}',1],
pbt: ['\\class{word}{\\p{\\bt{#1}}}',1],
pbkt: ['\\class{word}{\\p{\\bkt{#1}}}',1],
prt: ['\\class{word}{\\p{\\rt{#1}}}',1],
pgot: ['\\class{word}{\\p{\\got{#1}}}',1],
ppkt: ['\\class{word}{\\p{\\pkt{#1}}}',1],
pot: ['\\class{word}{\\p{\\ot{#1}}}',1],
pcbdt: ['\\class{word}{\\p{\\cdbt{#1}}}',1],
lbrac:'\\p{\\{}',
rbrac:'\\p{\\}}',
//parsing issues
pn:['{#1}',1],
//avoid -- becoming + and +- becoming -
m:'-',
pms:'+-',
//tooltips
btip: ['\\p{\\class{tip-bot}{\\mathtip{\\mg{\\underbrace{\\bk{#2}}}}{\\ga{#1}}}}', 2,''],
btipg: ['\\p{\\class{tip-bot}{\\mathtip{{\\mg{\\underbrace{\\bk{\\ga{#1}}}}}}{\\ga{#2}}}}', 2],
//text and colored text
tm:'\\t{-}',
sot:['\\so{\\t{#1}}',1],
bt: ['\\b{\\t{#1}}', 1],
bkt: ['\\bk{\\t{#1}}', 1],
cdbt:['\\cdb{\\t{#1}}',1],
gt: ['\\g{\\t{#1}}', 1],
got: ['\\go{\\t{#1}}', 1],
greyOutT:['\\greyOut{\\t{#1}}',1],
lbt: ['\\lb{\\t{#1}}', 1],
ot: ['\\o{\\t{#1}}', 1],
pkt: ['\\pk{\\t{#1}}', 1],
put: ['\\pu{\\t{#1}}', 1],
rt: ['\\r{\\t{#1}}', 1],
wt: ['\\w{\\t{#1}}', 1],
op:['\\operatorname{\\t{#1}}',1],
arccot:'\\op{arccot}',
arcsec:'\\op{arcsec}',
arccsc:'\\op{arccsc}',
//color boxes
gb: ['\\,\\bbox[10px, border: 6px solid LimeGreen]{#1}',1],
ob: ['\\,\\bbox[10px, border: 6px solid DarkOrange]{#1}',1],
// bb: ['\\,\\bbox[10px, border: 6px solid CornflowerBlue]{#1}',1],
bb: ['\\,\\bbox[4px, border: 4px solid CornflowerBlue]{#1}',1],
//limits
limfu:['\\lim\\limits_{#1\\to#2}',2],
limlc:['\\limfu{#1}{#2^{\\bf\\Large\\p{\\r{-}}}}',2],
limrc:['\\limfu{#1}{#2^{\\bf\\Large\\g{+}}}',2],
linf:'\\limfu{x}{\\infty}',
//lines+slope
sf:'\\slope{x_1}{y_1}{x_2}{y_2}',
sfinfo:'\\slopeNoColor{\\btipg{\\r{x_1}}{\\r{\\t{the first }x\\t{ value}}}}{\\btipg{\\go{y_1}}{\\go{\\t{the' +
' first' +
' }y\\t{ value}}}}{\\btipg{\\b{x_2}}{\\b{\\t{the second }x\\t{ value}}}}{\\btipg{\\pu{y_2}}{\\pu{\\t{the' +
' second }y\\t{ value}}}}',
slope:['\\slopeNoColor{\\r{#1}}{\\go{#2}}{\\b{#3}}{\\pu{#4}}',4],
slopeNoColor:['\\frac{#4\\p{-}#2}{#3\\p{-}#1}',4],
psf:['y-\\b{#3}=\\r{#1}(x-\\go{#2})',3],
psfTip:['y\\m\\btipg{\\b{#3}}{\\b{y_1}}=\\btipg{\\r{#1}}{\\r{m}}(x\\m\\btipg{\\go{#2}}{\\go{x_1}})',3],
psfdef:'\\psf{m}{x_1}{y_1}',
//integrals
i: ['\\ds\\int#1\\,\\t{d}x',1],
ie:['\\ds{\\int_{#1}^{#2}#3}\\,\\t{d}x',3],
iu: ['\\ds\\int#1\\,\\t{d}#2',2],
ieu:['\\ds{\\int_{#1}^{#2}#3}\\,\\t{d}#4',4],
iep:['\\ds\\p{\\int_{\\p{#1}}^{\\p{#2}}\\p{#3}\\,\\t{d}x}',3],
ev:['\\hspace{6px}\\bk{\\Rule{1.25pt}{15pt}{10pt}}\\w{\\Rule{1.5pt}{15pt}{10pt}}_{#1}^{#2}',2],
evp:['\\p{\\hspace{6px}\\bk{\\Rule{1.25pt}{15pt}{10pt}}\\w{\\Rule{1.5pt}{15pt}{10pt}}_{\\p{#1}}^{\\p{#2}}}',2],
ipi: [String.raw`\b{\left\{\t{variable part of $\i{f'(x)}$ with $#1$ plugged in for $x$}\right\}}`,1],
ipit: [String.raw`\b{\left\{\t{variable part of $\i{f(x)}$ with $#1$ plugged in for $x$}\right\}}`,1],
C: '\\p{\\g{+C}}',
//textboxes
tbs:['\\,\\bbox[10px, border: 1.5px solid Cyan]{#1}\\,',1],//String.raw`\colorbox{textbox}{$#1$}`
tb:['\\quad\\tbs{#1}',1],
//group selections
hb:['\\,\\bbox[5px, border: 1.5px dashed Cyan]{\\b{#1}}',1],
hbr:['\\,\\bbox[5px, border: 1.5px dashed Red]{\\r{#1}}\\,',1],
hbg:['\\,\\bbox[5px, border: 1.5px dashed Green]{\\g{#1}}\\,',1],
hbo:['\\,\\bbox[5px, border: 1.5px dashed Orange]{\\o{#1}}\\,',1],
hbgo:['\\,\\bbox[5px, border: 1.5px dashed Gold]{\\go{#1}}\\,',1],
hbpu:['\\,\\bbox[5px, border: 1.5px dashed Magenta]{\\pu{#1}}\\,',1],
//text size
bigtext:['\\class{bigtext}{#1}',1],
smalltext:['\\class{smalltext}{#1}',1],
do:'\\$',
//current amount equation
ca: String.raw`\put{current amount}\p{=}\p{\lbt{starting amount}}\p{\cdot }\p{e}^{\p{(\ot{growth rate})}\p{(\gt{time passed})}}`,
cda: String.raw`\put{current amount}=\p{\lbt{starting amount}}\p{\cdot} \p{e}^{\p{\r{-}}\p{(\ot{decay rate})}\p{(\gt{time passed})}}`,
//MA 141 only
eps: '\\p{\\varepsilon}',
R: '\\p{\\mathbb{R}}',
iff: '\\p{\\Longleftrightarrow}',
// and:String.raw`~~\text{and}~~`,
// recip: ['\\frac{1}{#1}', 1],
// h: ['\\frac{#1}{2}', 1],
// yu: ['\\pu{#1}', 1],
// yk: ['\\pk{#1}', 1],
// yut: ['\\put{#1}', 1],
// ykt: ['\\pkt{#1}', 1],
// d:['\\ds\\frac{d}{dx}\\left(#1\\right)',1],
// ttip: ['\\class{tip-top}{\\mathtip{#1}{\\begin{gathered}#2\\end{gathered}}}', 2],
// rtip: ['\\class{tip-right}{\\mathtip{\\left.#1\\right\\}}{\\begin{gathered}#2\\end{gathered}}}', 2],
// ltip: ['\\class{tip-left}{\\mathtip{#1}{\\begin{gathered}#2\\end{gathered}}}', 2],
// btipn: ['#1', 2],
// hi: ['\\class{him}{#1}',1],
},window.ExtraMacros ||{}),
},
// chtml: {
// scale: 1,//1.25 // global scaling factor for all expressions
// minScale: 0.5, // smallest scaling factor to use
// mtextInheritFont: false, // true to make mtext elements use surrounding font
// merrorInheritFont: false, // true to make merror text use surrounding font
// mtextFont: '', // font to use for mtext, if not inheriting (empty means use MathJax fonts)
// merrorFont: 'serif', // font to use for merror, if not inheriting (empty means use MathJax fonts)
// unknownFamily: 'serif', // font to use for character that aren't in MathJax's fonts
// mathmlSpacing: false, // true for MathML spacing rules, false for TeX rules
// skipAttributes: {}, // RFDa and other attributes NOT to copy to the output
// exFactor: 0.5, // default size of ex in em units
// displayAlign: 'center', // default for indentalign when set to 'auto'
// displayIndent: '0', // default for indentshift when set to 'auto'
// // displayOverflow: 'linebreak',
// //
// // linebreaks: { // options for when overflow is linebreak
// // inline: true, // true for browser-based breaking of inline equations
// // width: '100%', // a fixed size or a percentage of the container width
// // lineleading: 1, // the default lineleading in em units
// // LinebreakVisitor: null, // The LinebreakVisitor to use
// // },
// },
startup: {
ready() {
const { MacroMap } = MathJax._.input.tex.SymbolMap;
const { Configuration } = MathJax._.input.tex.Configuration;
const BaseMethods = MathJax._.input.tex.base.BaseMethods.default;
let map= {};
addPauseStr(map,33,true);
for(let i=40;i<43;i++){
addPauseStr(map,i,true);
}
addPauseStr(map,43,true,true);
addPauseStr(map,44,true);
// addPauseStr(map,45,true,true);
// for(let i=43;i<46;i++){
// addPauseStr(map,i,true,true);
// }
// map["-"]=["Macro","\\mathrel{{}\\p{\\textminus}{}}"]
for(let i=46;i<58;i++){
addPauseStr(map,i,true);
}
addPauseStr(map,91,true);
addPauseStr(map,93,true);
addPauseStr(map,58,true,true);
addPauseStr(map,59,true);
for(let i=60;i<63;i++){
addPauseStr(map,i,true,true);
}
addPauseStr(map,63,true);
for(let i=65;i<91;i++){
addPauseStr(map,i);
}
for(let i=97;i<123;i++){
addPauseStr(map,i);
}
new MacroMap('bold-chars', map, BaseMethods);
// new MacroMap('bold-chars', {":":["Macro","\\r{\\mmlToken{mi}{\\mathrel{\\vcenter{{}:{}}}}}"]}, BaseMethods);
// new MacroMap('my-active', {
// 'a': ['Macro', '\\pu{\\mmlToken{mi}{a}}'],
// 'b': ['Macro', '\\b{\\mmlToken{mi}{b}}']
// }, BaseMethods);
// new MacroMap('bold-chars', {
// '=': ['Macro', String.raw`\bk{\mathrel{\vcenter{\rlap{\Rule{2ex}{2px}{0px}}\raise9px{\Rule{2ex}{2px}{0px}}}}}`],
// '-': ['Macro', String.raw`\bk{\mathrel{\vcenter{\Rule{20px}{2px}{0px}}}}`],
// '+': ['Macro', String.raw`\bk{\mathrel{\vcenter{\rlap{\kern7px\Rule{2px}{9px}{7px}}\Rule{16px}{2px}{0px}}}}`]
// }, BaseMethods);
//Configuration.create('my-active', { handler: { character: ['my-active'] } });//'bold-chars' (had to remove
Configuration.create('bold-chars', { handler: { character: ['bold-chars'] } });//'bold-chars' (had to remove
// this because it wasn't working with both my-active and bold-chars
const { TooltipData } = MathJax._.output.common.Wrappers.maction;
TooltipData.postDelay = 10; // delay in milliseconds
const CommandMap = MathJax._.input.tex.SymbolMap.CommandMap;
const TexError = MathJax._.input.tex.TexError.default;
const CheckDimen = function (dimen) {
if (dimen === '') return '';
if (dimen.match(/^\s*([-+]?(\.\d+|\d+(\.\d*)?))\s*(pt|em|ex|mu|px|mm|cm|in|pc)\s*$/)) {
return dimen.replace(/ /g, '');
}
throw new TexError('BadImageDimen', 'Bad dimension for image: %1', dimen);
};
new CommandMap('img', {img: 'Img'}, {
Img(parser, name) {
const arg = parser.GetBrackets(name, '');
const def = {
valign: '',
width: '',
height: ''
};
if (arg.match(/[,=]/)) {
for (const pair of arg.split(/\s*,\s*/)) {
const [key, ...value] = pair.split(/\s*=\s*/);
if (!def.hasOwnProperty(key)) throw new TexError('UnknownKey', 'Unknown parameter "%1" in %2', key, name);
def[key] = CheckDimen(value.join('='));
}
} else {
def.valign = CheckDimen(arg);
def.width = CheckDimen(parser.GetBrackets(name, ''));
def.height = CheckDimen(parser.GetBrackets(name, ''));
}
def.src = parser.GetArgument(name);
if (!def.valign) delete def.valign;
if (!def.width) delete def.width;
if (!def.height) delete def.height;
parser.Push(parser.create('token', 'mglyph', def));
}
});
Configuration.create('img', {handler: {macro: ['img']}});
MathJax.startup.defaultReady();
MathJax.tex2mml(customColors+addPauseToCommand('sqrt',1,[''])+addPauseToCommand('cancel',1)+
addPauseToCommandNoArg('infty','to','lim','cdot','pm','pi','sin','cos','tan','cot','sec','csc','theta','arcsin','arccos','arctan',
'arccot','arcsec','arccsc','m','tm','do','eps','iff','R','int')
);
}
}//definecolor{lightbluee}{RGB}{0, 176, 240}
});
delete window.ExtraMacros;
function addPauseStr(map,i,number,operator){
let char=String.fromCharCode(i);
map[char]=['Macro', (operator?'\\mathrel{{}':'')+
(number?'\\p{\\unicode{'+char.charCodeAt(0)+'}}':'\\p{\\mmlToken{mi}{'+char+'}}')+(operator?'{}}':'')]
}
//defs has length 1
function addPauseToCommand(command,n,defs){
defs=defs==null?[]:defs;
let str='';
let str1='';
for(let i=0;i<defs.length;i++){
str+='[#'+(i+1)+']'
str1+='['+defs[i]+']'
}
for(let i=0;i<n;i++){
str+='{#'+(i+1+defs.length)+'}'
}
return '\\let\\old'+command+'\\'+command+' \\renewcommand{\\'+command+'}'+(n>0?'['+(n+defs.length)+']':'')+str1+'{\\p{\\old'+command+str+'}}'
}
function addPauseToCommandNoArg(...strs){
let str1='';
for(let str of strs){
str1+=addPauseToCommand(str,0)
}
return str1;
}