• Print view

## LaTeX enabled for mathematical notation

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

### LaTeX enabled for mathematical notation

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:

$$m = \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}$$

can be produced with the following code:

Code: Select all

$$m = \frac{m_0}{\sqrt{1-\frac{v^2}{c^2}}}$$

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

Cham
Posts: 4323
Joined: 14.01.2004
Age: 54
With us: 15 years 3 months
Location: Montreal

### Re: LaTeX enabled for mathematical notation

Yikes ! Thanks Chris !

$$%]|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 }$$$,

$$%]|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 }$$$,

$$%]|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$$$.
"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: 15 years 8 months
Location: AZ

### Re: LaTeX enabled for mathematical notation

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

$$\textbf{Celestia is \textit{AWESOME}}$$
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.
$$Happiness = $\int_a^b \int_c^d \int_e^f \int_g^h U(x,y,z,t)\,dx dy dz dt$ = 42$$
If only we knew U!

ajtribick
Posts: 1780
Joined: 11.08.2003
With us: 15 years 8 months
Location: Switzerland

### Re: LaTeX enabled for mathematical notation

Thanks...

test...

Code: Select all

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

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

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

t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 17
With us: 17 years
Location: Hamburg, Germany

### Re: LaTeX enabled for mathematical notation

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.

Posts: 602
Joined: 01.05.2004
Age: 36
With us: 14 years 11 months
Location: france, divion

### Re: LaTeX enabled for mathematical notation

vista home basic
intel(R) Pentium(R) Dual CPU E2160 @ 1,80GHz 1,79GHz
1Go RAM
NVIDIA GeForce 8400 GS
directX 11
celestia 1.6
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
Posts: 4211
Joined: 28.01.2002
With us: 17 years 2 months
Location: Seattle, Washington, USA

### Re: LaTeX enabled for mathematical notation

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:

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

--Chris

Topic author
chris
Posts: 4211
Joined: 28.01.2002
With us: 17 years 2 months
Location: Seattle, Washington, USA

### Re: LaTeX enabled for mathematical notation

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

t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 17
With us: 17 years
Location: Hamburg, Germany

### Re: LaTeX enabled for mathematical notation

No changes for me!
This is the resulting error message

$$\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.$$

This is the actual (tested) latex code:

Code: Select all

$$\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.$$

Here is how the code should look like:

F.
Last edited by t00fri on 08.05.2008, 19:39, edited 6 times in total.

Cham
Posts: 4323
Joined: 14.01.2004
Age: 54
With us: 15 years 3 months
Location: Montreal

### Re: LaTeX enabled for mathematical notation

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 :

$$%]|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)$$$
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!"

t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 17
With us: 17 years
Location: Hamburg, Germany

### Re: LaTeX enabled for mathematical notation

Simple formulae seem to work OK, even slightly more complicated ones, like this one, for example,

$$-\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)$$
For people with physics knowhow, the metric $$\delta^{\mu\,\sigma}$$ is NO typo. It refers to Euclidean space, NOT to Minkowski space ($$g^{\mu\,\sigma}$$)

Here is the corresponding Latex code:

Code: Select all

$$-\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)$$

F.

ajtribick
Posts: 1780
Joined: 11.08.2003
With us: 15 years 8 months
Location: Switzerland

### Re: LaTeX enabled for mathematical notation

$$\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)$$

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
Posts: 4211
Joined: 28.01.2002
With us: 17 years 2 months
Location: Seattle, Washington, USA

### Re: LaTeX enabled for mathematical notation

Matrix test:

$$I = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$$

$$R_z (\theta)= \begin{pmatrix} 1 & 0 & 0 \\ 0 & \cos \theta & - \sin \theta \\ 0 & \sin \theta & \cos \theta \end{pmatrix}$$

ajtribick
Posts: 1780
Joined: 11.08.2003
With us: 15 years 8 months
Location: Switzerland

### Re: LaTeX enabled for mathematical notation

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

$$\left. \begin{array}{l}\mbox{\rm 1-lo{}op}\\\mbox{\rm 2-lo{}op} \end{array}\right\}\mbox{\rm \ for\ }$$$$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.$$

$$\left. \begin{array}{l} \mbox{\rm 1-lo{}op}\\ \mbox{\rm 2-lo{}op} \end{array}\right\}\mbox{\rm \ for\ }$$$$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.$$

Posts: 602
Joined: 01.05.2004
Age: 36
With us: 14 years 11 months
Location: france, divion

### Re: LaTeX enabled for mathematical notation

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

$$\left. \begin{array}{l}\mbox{\rm 1-lo{}op}\\\mbox{\rm 2-lo{}op} \end{array}\right\}\mbox{\rm \ for\ }$$$$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.$$

$$\left. \begin{array}{l} \mbox{\rm 1-lo{}op}\\ \mbox{\rm 2-lo{}op} \end{array}\right\}\mbox{\rm \ for\ }$$$$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.$$

fichier.pdf 6 page

Code: Select all

$$\lbrace \rbrace$$

$$\lbrace \rbrace$$
vista home basic
intel(R) Pentium(R) Dual CPU E2160 @ 1,80GHz 1,79GHz
1Go RAM
NVIDIA GeForce 8400 GS
directX 11
celestia 1.6
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: 11 years

### Re: LaTeX enabled for mathematical notation

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:

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: 10 years 10 months

### Re: LaTeX enabled for mathematical notation

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

Hungry4info
Posts: 1133
Joined: 11.09.2005
With us: 13 years 7 months
Location: Indiana, United States

### Re: LaTeX enabled for mathematical notation

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

Topic author
chris
Posts: 4211
Joined: 28.01.2002
With us: 17 years 2 months
Location: Seattle, Washington, USA

### Re: LaTeX enabled for mathematical notation

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

Hungry4info
Posts: 1133
Joined: 11.09.2005
With us: 13 years 7 months
Location: Indiana, United States

### Re: LaTeX enabled for mathematical notation

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