LineBreak Mathjax 3.2

371 views
Skip to first unread message

MarcS

unread,
Mar 14, 2022, 6:10:12 AM3/14/22
to MathJax Users
Hello everyone.

I updated Mathjax 2.7 to version 3.2.
I've read that command line break "\\"  is not implemented yet.
https://docs.mathjax.org/en/latest/output/linebreaks.html

I have so many formulas with command \\ and was wondering if is there any work around to solve it.
Which command should I use for line breaking in 3.2 ?

Thank you so much !

Davide Cervone

unread,
Mar 14, 2022, 9:40:01 AM3/14/22
to mathja...@googlegroups.com
Just to be clear, the usage of `\\` that is not implemented is `\\` as a forced line break in what would otherwise be a single displayed equation.  The usage of `\\` as a break in arrays, alignment environments, and so on is implemented.  If you are using \\ to force line breaks, you can use

\displaylines{
   ... \\
   ... \\
}

to produce the separate lines.  It would be possible to make a TeX input pre-filter to insert the `\displaylines{` and `}` automatically, I would think.

Davide


https://www.tekmaneducation.com/programa/emat/
Aviso de confidencialidad:  Este correo contiene información confidencial y privilegiada solo para ti. Si no eres el destinatario, cualquier distribución o uso está estrictamente prohibido. ¿Has recibido esta comunicación por error? Por favor notifícanoslo y elimina el mensaje. Tekman Education S.L. no asume ninguna responsabilidad al respecto.
Recuerda que en aplicación de la Ley Orgánica de Protección de Datos de Carácter Personal y Garantía de los Derechos Digitales, no estás obligado y por lo tanto es opcional responder los correos recibidos fuera de tu horario laboral. ¡Feliz jornada! 

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/d27cbe8d-c8fa-4fcc-902c-3b456c57a7c6n%40googlegroups.com.

MarcS

unread,
Mar 14, 2022, 10:29:55 AM3/14/22
to MathJax Users
Thank you so much for response. 
I really appreciate it.

This is an example of a formula we using \\ to force line break.
In that case how it would be the usage of \displaylines ?
Thanks again !

  $tekbegininline$\dfrac{5+3\sqrt{2}}{5-3\sqrt{2}}=\dfrac{5+3\sqrt{2}}{5-3\sqrt{2}}\cdot\dfrac{5+3\sqrt{2}}{5+3\sqrt{2}}=\dfrac{(5+3\sqrt{2})^{\scriptstyle{2}}}{5^{\scriptstyle{2}}-(3\sqrt{2})^{\scriptstyle{2}}}=\dfrac{25+2\cdot5\cdot3\sqrt{2}+(3\sqrt{2})^{\scriptstyle{2}}}{5^{\scriptstyle{2}}-(3\sqrt{2})^{\scriptstyle{2}}}=\dfrac{25+30\sqrt{2}+9\cdot2}{25-9\cdot2}=\\=\dfrac{25+30\sqrt{2}+18}{25-18}=\dfrac{43+30\sqrt{2}}{7}$tekendinline$  

Davide Cervone

unread,
Mar 14, 2022, 10:43:01 AM3/14/22
to mathja...@googlegroups.com
Use

\displaylines{
\dfrac{5+3\sqrt{2}}{5-3\sqrt{2}}=\dfrac{5+3\sqrt{2}}{5-3\sqrt{2}}\cdot\dfrac{5+3\sqrt{2}}{5+3\sqrt{2}}=\dfrac{(5+3\sqrt{2})^{\scriptstyle{2}}}{5^{\scriptstyle{2}}-(3\sqrt{2})^{\scriptstyle{2}}}=\dfrac{25+2\cdot5\cdot3\sqrt{2}+(3\sqrt{2})^{\scriptstyle{2}}}{5^{\scriptstyle{2}}-(3\sqrt{2})^{\scriptstyle{2}}}=\dfrac{25+30\sqrt{2}+9\cdot2}{25-9\cdot2}=\\=\dfrac{25+30\sqrt{2}+18}{25-18}=\dfrac{43+30\sqrt{2}}{7}
}

to do it.

Davide

MarcS

unread,
Mar 14, 2022, 11:55:53 AM3/14/22
to MathJax Users
it worked !

I used a prefilter to add displayline

MathJax.startup.document.inputJax[0].preFilters.add((data) => {
if (!data.math.display) {
data.math.math = '\\displaylines{' + data.math.math + '}';
}
});


Thank you so much !

Reply all
Reply to author
Forward
0 new messages