How to make formula in the center of Web page , but keep left align in its body.

32 views
Skip to first unread message

余江涛

unread,
Nov 26, 2016, 11:50:37 PM11/26/16
to MathJax Users

just like this

i have found two ways to solve this , one is 

\begin{align}
& x+y+z \\
& +w
\end{align}

the other is

\[
\begin{array}{l}
x+y+z \\
+w
\end{array}
\]

but they are not available for large formula like this
\[
{{a}_{0}}=\left(\left(-120\,d\,s\,{k}^{2}\,\sqrt{-120\,d\,s+4\,{p}^{2}+12\,p\,r+9\,{r}^{2}}+8\,p\,{k}^{2}\,\sqrt{-120\,d\,s+4\,{p}^{2}+12\,p\,r+9\,{r}^{2}}\,r+8\,{r}^{2}\,{k}^{2}\,\sqrt{-120\,d\,s+4\,{p}^{2}+12\,p\,r+9\,{r}^{2}}+240\,d\,s\,{k}^{2}\,p+\\
360\,d\,s\,{k}^{2}\,r-16\,{k}^{2}\,{p}^{2}\,r-40\,{r}^{2}\,p\,{k}^{2}-24\,{r}^{3}\,{k}^{2}-\,b\,\sqrt{-120\,d\,s+4\,{p}^{2}+12\,p\,r+9\,{r}^{2}}\,r+3\,d\,q\,\sqrt{-120\,d\,s+4\,{p}^{2}+12\,p\,r+9\,{r}^{2}}-60\,b\,d\,s+2\,b\,p\,r+3\,b\,\\
{r}^{2}+6\,p\,q\,d+3\,d\,q\,r\right)\right)/\left(12\,d\,\left(15\,d\,s-\,p\,r-\,{r}^{2}\right)\right)
\]

Peter Krautzberger

unread,
Nov 28, 2016, 9:59:05 AM11/28/16
to mathja...@googlegroups.com
Hi,

What result do you expect for the large expression?

Regards,
Peter.

--
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-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

余江涛

unread,
Nov 28, 2016, 10:45:07 AM11/28/16
to MathJax Users


just like this, the equation is center of web page , and keep left align in its body.
you can assume the large equaiton is already have line-break marks "\\".

在 2016年11月28日星期一 UTC+8下午10:59:05,Peter Krautzberger写道:
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.

余江涛

unread,
Nov 28, 2016, 10:47:45 AM11/28/16
to MathJax Users
 I have found a quit weird solution by myself. wish you can provide a better solution.

first set the equation left align and set output format is HTML-CSS
```
 MathJax.Hub.Config({]
        jax: ["input/TeX", "output/HTML-CSS"],
        displayAlign:"left"
    });
```
then set the width of span.math to 0, so it's real width would be it's min-width
```
MathJax.Hub.Queue(function() {
    $("div.MathJax_Display span.math").css("width","0");
});
```
and add \\ for every equation, whether you wan't it has a line break or not.
```
\[
x+y+z\\
+w\\
\]
```
for equations you have add the line-breaks by yourself.
```
\[
x+y+z+w\\
\]
```
for equations you in a single line, to make MathJax generate a span with class of MathJax_FullWidth instead of MathJax.

余江涛

unread,
Nov 30, 2016, 8:06:45 PM11/30/16
to MathJax Users
https://github.com/mathjax/MathJax/issues/1669#issuecomment-264029991
thanks dvpc give a perfect solution.
\[{
x+y+z\\
+w
}\]
quote the whole equation in the {}, would make block line-breaks witch is left aligned.

Peter Krautzberger

unread,
Dec 1, 2016, 2:47:54 AM12/1/16
to mathja...@googlegroups.com
Thanks for cross-posting Davide's suggestion for the community here.

Regards,
Peter.

--
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-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages