LaTeX enabled for mathematical notation

General discussion about Celestia that doesn't fit into other forums.
Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 10 months
Location: Seattle, Washington, USA

LaTeX enabled for mathematical notation

Post #1by chris » 07.05.2008, 01:30

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

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 11 months
Location: Montreal

Re: LaTeX enabled for mathematical notation

Post #2by Cham » 07.05.2008, 02:47

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].
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

chrisr
Posts: 62
Joined: 21.08.2003
With us: 21 years 3 months
Location: AZ

Re: LaTeX enabled for mathematical notation

Post #3by chrisr » 07.05.2008, 05:31

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]
Just do what makes you happy provided you do not infringe on another's happiness for there is no point in living if you do not have happiness.
[tex]Happiness = \[\int_a^b \int_c^d \int_e^f \int_g^h U(x,y,z,t)\,dx dy dz dt\] = 42[/tex]
If only we knew U!

ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 4 months

Re: LaTeX enabled for mathematical notation

Post #4by ajtribick » 07.05.2008, 11:14

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; ?

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 8 months
Location: Hamburg, Germany

Re: LaTeX enabled for mathematical notation

Post #5by t00fri » 07.05.2008, 11:44

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.
Image

symaski62
Posts: 610
Joined: 01.05.2004
Age: 41
With us: 20 years 7 months
Location: france, divion

Re: LaTeX enabled for mathematical notation

Post #6by symaski62 » 07.05.2008, 15:31

windows 10 directX 12 version
celestia 1.7.0 64 bits
with a general handicap of 80% and it makes much d' efforts for the community and s' expimer, thank you d' to be understanding.

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 10 months
Location: Seattle, Washington, USA

Re: LaTeX enabled for mathematical notation

Post #7by chris » 07.05.2008, 15:37

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

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 10 months
Location: Seattle, Washington, USA

Re: LaTeX enabled for mathematical notation

Post #8by chris » 07.05.2008, 15:43

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

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 8 months
Location: Hamburg, Germany

Re: LaTeX enabled for mathematical notation

Post #9by t00fri » 07.05.2008, 16:02

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.
Last edited by t00fri on 08.05.2008, 19:39, edited 6 times in total.
Image

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 11 months
Location: Montreal

Re: LaTeX enabled for mathematical notation

Post #10by Cham » 07.05.2008, 16:07

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]
Last edited by Cham on 07.05.2008, 16:10, edited 1 time in total.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 8 months
Location: Hamburg, Germany

Re: LaTeX enabled for mathematical notation

Post #11by t00fri » 07.05.2008, 16:33

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.
Image

ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 4 months

Re: LaTeX enabled for mathematical notation

Post #12by ajtribick » 07.05.2008, 18:11

[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)

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 10 months
Location: Seattle, Washington, USA

Re: LaTeX enabled for mathematical notation

Post #13by chris » 07.05.2008, 18:14

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]

ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 4 months

Re: LaTeX enabled for mathematical notation

Post #14by ajtribick » 08.05.2008, 10:50

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]

symaski62
Posts: 610
Joined: 01.05.2004
Age: 41
With us: 20 years 7 months
Location: france, divion

Re: LaTeX enabled for mathematical notation

Post #15by symaski62 » 08.05.2008, 12:35

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]
windows 10 directX 12 version
celestia 1.7.0 64 bits
with a general handicap of 80% and it makes much d' efforts for the community and s' expimer, thank you d' to be understanding.

Epimetheus
Posts: 42
Joined: 30.03.2008
With us: 16 years 8 months

Re: LaTeX enabled for mathematical notation

Post #16by Epimetheus » 27.05.2008, 00:29

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.
Computer Info:

MoBo: GigaByte 6-Quad GA-965P DQ6
CPU: Intel Core 2 6700 @ 2.66GHz
RAM: Ocz 2GB DDR2 800MHz
HDD: Seagate 400GB SATA
VD: Nvidia GeForce 7950 GT OC 512MB
OS: MS XP Pro SP2
Celestia 1.5.1.4342 Qt4 Experimental

vinamaso
Posts: 2
Joined: 03.06.2008
With us: 16 years 6 months

Re: LaTeX enabled for mathematical notation

Post #17by vinamaso » 03.06.2008, 10:14

I would like to know how to add this in phpBB3. Could you tell me how?
Thank you!

Avatar
Hungry4info
Posts: 1133
Joined: 11.09.2005
With us: 19 years 3 months
Location: Indiana, United States

Re: LaTeX enabled for mathematical notation

Post #18by Hungry4info » 03.06.2008, 18:16

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.
Current Setup:
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics

Topic author
chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 10 months
Location: Seattle, Washington, USA

Re: LaTeX enabled for mathematical notation

Post #19by chris » 03.06.2008, 18:20

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

Avatar
Hungry4info
Posts: 1133
Joined: 11.09.2005
With us: 19 years 3 months
Location: Indiana, United States

Re: LaTeX enabled for mathematical notation

Post #20by Hungry4info » 03.06.2008, 19:01

Unsurprisingly, I'm extremely confused on the whole thing. I work with it later and see if I can figure it out though.
Current Setup:
Windows 7 64 bit. Celestia 1.6.0.
AMD Athlon Processor, 1.6 Ghz, 3 Gb RAM
ATI Radeon HD 3200 Graphics


Return to “Celestia Users”