Page 1 of 2

LaTeX enabled for mathematical notation

Posted: 07.05.2008, 01:30
by chris
It is now possible to post mathematical equations on the forum using the LaTeX markup language. Simply insert whatever LaTeX commands you like inside a tex bbcode block. For example:

[tex]m = \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}[/tex]

can be produced with the following code:

Code: Select all

[tex]m = \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}[/tex]


If you're interested in learning more about how to use LaTeX, you may want to have a look at the American Mathematical Society's quick guide:
ftp://ftp.ams.org/pub/tex/doc/amsmath/s ... -guide.pdf

--Chris

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 02:47
by Cham
Yikes ! Thanks Chris ! 8)

[tex]%]|Expr|[#>`b___})9# b'4$^" *~: ;bP8&c552R(!"!Symbol^:!mn}_: |
%|/0 <2^1^2}!!$^g(!:!mn}_: !!R ,K:! &c55*L: &c552 $^g(!:!mn}_: |
%|,] /0:! k: $^T(!:!mn}_}& b!( b"0 b#8 b$@ b%H b&P!WW}]|[
\[{\mit R}_{\mit \mu \nu }\mit \ -\ {\frac{1}{2}}\,\,{g}_{\mu \nu }\,\,R\ +\ \rm \Lambda \rm \mit \ {g}_{\mu \nu }\ =\ -\ \kappa \rm \ {T}_{\mu \nu }\][/tex],

[tex]%]|Expr|[#>`b___})5# b'4$^" Symbol^: ;bP8&c552/1^m_"!*~:!!!$^F|
%|_(!: mn}:! ,K ig!-;!$^B^: m_:!,L $^F_(!: mn}:!!-= ,] $^J_^: n}& b!( b"0 b#8 b$@ b%H b&P!WW}]|[
\[{\mit \nabla }_{\mit \mu }\mit \,\,{F}^{\mu \nu }\ +\ ig\,[\,{B}_{\mu },\ {F}^{\mu \nu }\,]\ =\ {J}^{\nu }\][/tex],

[tex]%]|Expr|[#>`b___})0# b'4$^" Symbol^: ;bP8&c55*G_(""!*~:!&c552!|
%|: m}:!!$^D^: m_:!!!: &c55*Y:!&c552 ,K im : &c55*Y:!&c552 ,] 0}& b!( b"0 b#8 b$@ b%H b&P!WW}]|[
\[{\Gamma }^{\mit \,\mu }\mit \,{D}_{\mu }\,\,\rm \Psi \rm \mit \ +\ im\ \rm \Psi \rm \mit \ =\ 0\][/tex].

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 05:31
by chrisr
This is great. I don't make many posts, but I'm familiar with Latex. It's the way to go for writing anything that has too look professional (that's short).

[tex]\textbf{Celestia is \textit{AWESOME}}[/tex]

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 11:14
by ajtribick
Thanks...

test...

Code: Select all

\omega^2 = \frac{G(M_1+M_2)}{r^3}

[tex]\omega^2 = \frac{G(M_1+M_2)}{r^3}[/tex]

Hmmm... that's not right. Why are brackets getting replaced by 40; and 41; ?

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 11:44
by t00fri
At last...good.

but slightly less trivial latex tends to end in:

[unparsable or dangerous latex]

e.g. array or tabular environments are NOT supported.

F.

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 15:31
by symaski62

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 15:37
by chris
ajtribick wrote:Thanks...

Hmmm... that's not right. Why are brackets getting replaced by 40; and 41; ?

Looks like some adjustments are necessary to make latexrender work with phpbb3. Parentheses should work now:

[tex]\omega^2 = \frac{G(M_1+M_2)}{r^3}[/tex]

--Chris

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 15:43
by chris
t00fri wrote:At last...good.

but slightly less trivial latex tends to end in:

[unparsable or dangerous latex]

e.g. array or tabular environments are NOT supported.

F.

Can you post an example of some non-working LaTeX code? I'll see if there's some adjustment I can make to the LatexRender package. HTML encoding was messing up parentheses and may also be responsible for the problems with your complex examples.

--Chris

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 16:02
by t00fri
No changes for me!
This is the resulting error message

[tex]\left. \begin{array}{l}
\mbox{\rm 1-loop}\\
\mbox{\rm 2-loop} \end{array}\right\} \mbox{\rm \ for\ }
b=\left\{\begin{array}{lllcl}
\beta_0;&\alpha_s(\mu_r)&=&\alpha_s^{1-loop}(\mu_r)\\
\beta_0+(\beta_1-4 N_c \,\beta_0)\,\frac{\alpha_s(\mu_r)}{4\pi};&\alpha_s(\mu_r)&=&\alpha_s^{2-loop}(\mu_r).
\end{array}\right.[/tex]

This is the actual (tested) latex code:

Code: Select all

[tex]\left. \begin{array}{l}
\mbox{\rm 1-loop}\\
\mbox{\rm 2-loop} \end{array}\right\} \mbox{\rm \ for\ }
b=\left\{\begin{array}{lllcl}
\beta_0;&\alpha_s(\mu_r)&=&\alpha_s^{1-loop}(\mu_r)\\
\beta_0+(\beta_1-4 N_c \,\beta_0)\,\frac{\alpha_s(\mu_r)}{4\pi};&\alpha_s(\mu_r)&=&\alpha_s^{2-loop}(\mu_r).
\end{array}\right.[/tex]


Here is how the code should look like:

Image

F.

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 16:07
by Cham
I also have some problems with matrices and arrows of equations. The following matrix isn't properly displayed. It should be a 4 by 4 matrix :

[tex]%]|Expr|[#>`b___})%# b'4$^" Symbol^: ;bP8&c552h(!"!*~:!ab}_ ,]|
%| <c!$1^[$$ ^1^0^0^0^0(#/0 1}^0^0^0^0(#/0 1}^0^0^0^0(#/0 1}}}}& b!( b"0 b#8 b$@ b%H b&P!WW}]|[
\[{\mit \eta }_{\mit ab}\mit \ =\ \left({\begin{array}{4c}1&0&0&0\\
0&-\ 1&0&0\\
0&0&-\ 1&0\\
0&0&0&-\ 1\end{array}}\right)\][/tex]

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 16:33
by t00fri
Simple formulae seem to work OK, even slightly more complicated ones, like this one, for example,

[tex]-\frac{4}{\sqrt{\pi\alpha_s}}\frac{\rho^2}{\left(\rho^2+x^2\right)^2}
\left[ \frac{x^\mu x^{\sigma}}{x^2}-\frac{1}{4}\delta^{\mu\,\sigma}\right]\bar{\eta}_{a\nu\sigma}\frac{\lambda_a}{2}
-\left(\mu \leftrightarrow \nu\right)[/tex]
For people with physics knowhow, the metric [tex]\delta^{\mu\,\sigma}[/tex] is NO typo. It refers to Euclidean space, NOT to Minkowski space ([tex]g^{\mu\,\sigma}[/tex])

Here is the corresponding Latex code:

Code: Select all

[tex]-\frac{4}{\sqrt{\pi\alpha_s}}\frac{\rho^2}
{\left(\rho^2+x^2\right)^2}
\left[ \frac{x^\mu x^{\sigma}}{x^2}-\frac{1}{4}\delta^{\mu\,\sigma}\right]\bar{\eta}_{a\nu\sigma}
\frac{\lambda_a}{2}-\left(\mu \leftrightarrow \nu\right)[/tex]


F.

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 18:11
by ajtribick
[tex]\eta_{ab} = \left( \begin{array}{cccc}1 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1 \\ \end{array} \right)[/tex]

Code: Select all

\eta_{ab} = \left( \begin{array}{cccc}1 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 \\
0 & 0 & -1 & 0 \\
0 & 0 & 0 & -1 \\ \end{array} \right)

Re: LaTeX enabled for mathematical notation

Posted: 07.05.2008, 18:14
by chris
Matrix test:

[tex]I = \begin{pmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{pmatrix}[/tex]

[tex]R_z (\theta)= \begin{pmatrix}
1 & 0 & 0 \\
0 & \cos \theta & - \sin \theta \\
0 & \sin \theta & \cos \theta
\end{pmatrix}[/tex]

Re: LaTeX enabled for mathematical notation

Posted: 08.05.2008, 10:50
by ajtribick
Experimenting with Fridger's formula suggests the code does not like the word "loop" (even as part of a text box) - you can cheat by using "lo{}op". Furthermore there is apparently a width restriction, so to get the result I have split the equation into two pieces:

Code: Select all

[tex]\left. \begin{array}{l}
\mbox{\rm 1-lo{}op}\\
\mbox{\rm 2-lo{}op} \end{array}\right\}\mbox{\rm \ for\ }[/tex][tex]b=\left\{\begin{array}{lllcl}
\beta_0;&\alpha_s(\mu_r)&=&\alpha_s^{1-\mathrm{lo{}op}}(\mu_r)\\
\beta_0+(\beta_1-4 N_c \,\beta_0)\,\frac{\alpha_s(\mu_r)}{4\pi};&\alpha_s(\mu_r)&=&\alpha_s^{2-\mathrm{lo{}op}}(\mu_r).
\end{array}\right.[/tex]


[tex]\left. \begin{array}{l}
\mbox{\rm 1-lo{}op}\\
\mbox{\rm 2-lo{}op} \end{array}\right\}\mbox{\rm \ for\ }[/tex][tex]b=\left\{\begin{array}{lllcl}
\beta_0;&\alpha_s(\mu_r)&=&\alpha_s^{1-\mathrm{lo{}op}}(\mu_r)\\
\beta_0+(\beta_1-4 N_c \,\beta_0)\,\frac{\alpha_s(\mu_r)}{4\pi};&\alpha_s(\mu_r)&=&\alpha_s^{2-\mathrm{lo{}op}}(\mu_r).
\end{array}\right.[/tex]

Re: LaTeX enabled for mathematical notation

Posted: 08.05.2008, 12:35
by symaski62
ajtribick wrote:Experimenting with Fridger's formula suggests the code does not like the word "loop" (even as part of a text box) - you can cheat by using "lo{}op". Furthermore there is apparently a width restriction, so to get the result I have split the equation into two pieces:

Code: Select all

[tex]\left. \begin{array}{l}
\mbox{\rm 1-lo{}op}\\
\mbox{\rm 2-lo{}op} \end{array}\right\}\mbox{\rm \ for\ }[/tex][tex]b=\left\{\begin{array}{lllcl}
\beta_0;&\alpha_s(\mu_r)&=&\alpha_s^{1-\mathrm{lo{}op}}(\mu_r)\\
\beta_0+(\beta_1-4 N_c \,\beta_0)\,\frac{\alpha_s(\mu_r)}{4\pi};&\alpha_s(\mu_r)&=&\alpha_s^{2-\mathrm{lo{}op}}(\mu_r).
\end{array}\right.[/tex]


[tex]\left. \begin{array}{l}
\mbox{\rm 1-lo{}op}\\
\mbox{\rm 2-lo{}op} \end{array}\right\}\mbox{\rm \ for\ }[/tex][tex]b=\left\{\begin{array}{lllcl}
\beta_0;&\alpha_s(\mu_r)&=&\alpha_s^{1-\mathrm{lo{}op}}(\mu_r)\\
\beta_0+(\beta_1-4 N_c \,\beta_0)\,\frac{\alpha_s(\mu_r)}{4\pi};&\alpha_s(\mu_r)&=&\alpha_s^{2-\mathrm{lo{}op}}(\mu_r).
\end{array}\right.[/tex]

fichier.pdf 6 page :wink:

Code: Select all

[tex]\lbrace \rbrace[/tex]


[tex]\lbrace \rbrace[/tex]

Re: LaTeX enabled for mathematical notation

Posted: 27.05.2008, 00:29
by Epimetheus
Wow, this is very impressive. Is this the full MathML extension or a subset of unicode characters supported by the UTF-8 encoding of the web pages on the server? UTF-8 encoded documents, such as the web page we are viewing right now, supports a subset of unicode characters that can render a subset of mathematical symbols and notation. Although, this subset would not support the entire LaTex extension. Am I correct?

- Brent P.

Re: LaTeX enabled for mathematical notation

Posted: 03.06.2008, 10:14
by vinamaso
I would like to know how to add this in phpBB3. Could you tell me how?
Thank you!

Re: LaTeX enabled for mathematical notation

Posted: 03.06.2008, 18:16
by Hungry4info
Chris, very nice!

I must ask, how did you enable this for your forum? I'm trying to manage a new forum, and would very much like to have this implemented for it.

Re: LaTeX enabled for mathematical notation

Posted: 03.06.2008, 18:20
by chris
Hungry4info wrote:Chris, very nice!

I must ask, how did you enable this for your forum? I'm trying to manage a new forum, and would very much like to have this implemented for it.

Andrew pointed me to this phpbb forum thread, and I just followed the instructions:

http://www.phpbb.com/community/viewtopi ... 2&t=653165

Once I got that working, I had to make one further modification to make parentheses look right; I'll post my change if that hasn't already been fixed in the phpbb-LaTeX package.

--Chris

Re: LaTeX enabled for mathematical notation

Posted: 03.06.2008, 19:01
by Hungry4info
Unsurprisingly, I'm extremely confused on the whole thing. I work with it later and see if I can figure it out though.