LaTeX and other markup!
Moderators: gmalivuk, Moderators General, Prelates
 gmalivuk
 GNU Terry Pratchett
 Posts: 26767
 Joined: Wed Feb 28, 2007 6:02 pm UTC
 Location: Here and There
 Contact:
LaTeX and other markup!
As many of you already know, the fora now have LaTeX support. This, combined with the [sup] and [sub] tags which have been around for awhile, should make it far easier to type math formulae. jsMath, which is what the new math and imath tags use, only works properly in the prosilver or prosilver_left styles. Sorry, subsilver adherents, but your favorite skin is no longer supported.
Much of the syntax is pretty selfexplanatory, and if nothing else you can quote an entry with math in it to see exactly what that person entered to typeset it that way. For a simple guide, you can check out Wikipedia's Help:Displaying a formula page.
What you would enter there between <math> and </math>, you would put here with square brackets. math places formulae in the center of a new line [math]something\ like\ this\ x^2_0[/math] while imath places it inline, which is only recommended for simpler (nonmultiline) things, as it can get cramped otherwise. But for an example [imath]this\ is\ inline\ math\ x^2_0[/imath].
Please take advantage of this new feature, as it greatly expands the range of math that can be readably displayed on the forum.
Much of the syntax is pretty selfexplanatory, and if nothing else you can quote an entry with math in it to see exactly what that person entered to typeset it that way. For a simple guide, you can check out Wikipedia's Help:Displaying a formula page.
What you would enter there between <math> and </math>, you would put here with square brackets. math places formulae in the center of a new line [math]something\ like\ this\ x^2_0[/math] while imath places it inline, which is only recommended for simpler (nonmultiline) things, as it can get cramped otherwise. But for an example [imath]this\ is\ inline\ math\ x^2_0[/imath].
Please take advantage of this new feature, as it greatly expands the range of math that can be readably displayed on the forum.
Re: LaTeX and other markup!
How complex can it be? Lesse:
[math]v(r)= \left\{
\begin{array}{rl}
2618.86r11486.7r^2+27263.8r^336117.9r^4+24768r^56819r^6\mbox{ km/s } & \mbox{ if } r<0.09 \mbox{ kpc }
\\
319.8354194.3591r+155.30181r^263.00332r^3+12.142556r^40.869573r^5 \mbox{ km/s } & \mbox{ if } r=0.090.45 \mbox{ kpc }
\\
1931.3363+1768.47176r606.461977r^2+112.102138r^311.9698505r^4 \mbox{ }& \\
+0.7367828r^50.02423453r^6+0.00032952r^7\mbox{ km/s} & \mbox{ if } r=0.451.6 \mbox{ kpc }
\\
264.76 \mbox{ km/s } & \mbox{ if } r>1.60 \mbox{ kpc }\\
\end{array}\right.[/math]
ooooooh... fancy.
[math]v(r)= \left\{
\begin{array}{rl}
2618.86r11486.7r^2+27263.8r^336117.9r^4+24768r^56819r^6\mbox{ km/s } & \mbox{ if } r<0.09 \mbox{ kpc }
\\
319.8354194.3591r+155.30181r^263.00332r^3+12.142556r^40.869573r^5 \mbox{ km/s } & \mbox{ if } r=0.090.45 \mbox{ kpc }
\\
1931.3363+1768.47176r606.461977r^2+112.102138r^311.9698505r^4 \mbox{ }& \\
+0.7367828r^50.02423453r^6+0.00032952r^7\mbox{ km/s} & \mbox{ if } r=0.451.6 \mbox{ kpc }
\\
264.76 \mbox{ km/s } & \mbox{ if } r>1.60 \mbox{ kpc }\\
\end{array}\right.[/math]
ooooooh... fancy.
Re: LaTeX and other markup!
Before someone asks, to change the board skin from subsilver to prosilver:
User Control Panel (in the top right)
Board preferences (in the left options menu)
And then where it says 'My board style' change it to either prosilver or prosilver_left, the difference being prosilver has the avatars on the right side of the screen, and prosilver_left has them on the left (like subsilver).
Also, it's a good idea to change the size of the math to 150% so that it's easier to read and not distorted. You can do this by clicking on the little jsMath box in the bottom right corner, going options and then setting 'scale all mathematics to' to 150%. Make sure to set 'Save settings for' to '5 years' so that it actually stays like that.
User Control Panel (in the top right)
Board preferences (in the left options menu)
And then where it says 'My board style' change it to either prosilver or prosilver_left, the difference being prosilver has the avatars on the right side of the screen, and prosilver_left has them on the left (like subsilver).
Also, it's a good idea to change the size of the math to 150% so that it's easier to read and not distorted. You can do this by clicking on the little jsMath box in the bottom right corner, going options and then setting 'scale all mathematics to' to 150%. Make sure to set 'Save settings for' to '5 years' so that it actually stays like that.
Code: Select all
_=0,w=1,(*t)(int,int);a()??<char*p="[gd\
~/d~/\\b\x7F\177l*~/~djal{x}h!\005h";(++w
<033)?(putchar((*t)(w??(p:>,w?_:0XD)),a()
):0;%>O(x,l)??<_='['/7;{return!(x%(_11))
?x??'l:x^(1+ ++l);}??>main(){t=&O;w=a();}
 Amnesiasoft
 Posts: 2573
 Joined: Tue May 15, 2007 4:28 am UTC
 Location: Colorado
 Contact:
Re: LaTeX and other markup!
gmalivuk wrote:Much of the syntax is pretty selfexplanatory, and if nothing else you can quote an entry with math in it to see exactly what that person entered to typeset it that way.
You can also double click the formula to see as well.
Re: LaTeX and other markup!
I've heard people say this before, but the math looks much, much better on a Mac than on a PC.
Either, it's very nice!
Either, it's very nice!
Re: LaTeX and other markup!
ICDB wrote:I've heard people say this before, but the math looks much, much better on a Mac than on a PC.
Either, it's very nice!
Proper TeX fonts at the correct weighting for both Mac OS and Windows (i.e. properly adjusted for the respective different gammas) are available here; installing the right set for your machine will make the maths look just as good on any machine.
(BTW, Linux (i.e. freetype) users should use the 'Mac' weighting; the PC ones show up too heavy.)
I don't like numbers which can't be written as fractions. It's an irrational fear.
 spaceinvader
 Posts: 12
 Joined: Sat May 03, 2008 10:08 pm UTC
 Location: Cornwall, UK
Re: LaTeX and other markup!
Hmm, does it support amsmath?
[math]\begin{align*}
\begin{bmatrix}
x\\
y
\end{bmatrix}
&= \frac{1}{27} \begin{bmatrix}
4 & 5\\
7 & 2
\end{bmatrix}
\begin{bmatrix}
17.1685\\
17.7848
\end{bmatrix}\\
\begin{bmatrix}
x\\
y
\end{bmatrix}
&=  \frac{1}{27} \begin{bmatrix}
20.25\\
84.6099
\end{bmatrix}\\
\begin{bmatrix}
x\\
y
\end{bmatrix}
&= \begin{bmatrix}
0.75\\
3.1337
\end{bmatrix}
\end{align*}[/math]
Wow, seems like it does! Neat.
[math]\begin{align*}
\begin{bmatrix}
x\\
y
\end{bmatrix}
&= \frac{1}{27} \begin{bmatrix}
4 & 5\\
7 & 2
\end{bmatrix}
\begin{bmatrix}
17.1685\\
17.7848
\end{bmatrix}\\
\begin{bmatrix}
x\\
y
\end{bmatrix}
&=  \frac{1}{27} \begin{bmatrix}
20.25\\
84.6099
\end{bmatrix}\\
\begin{bmatrix}
x\\
y
\end{bmatrix}
&= \begin{bmatrix}
0.75\\
3.1337
\end{bmatrix}
\end{align*}[/math]
Wow, seems like it does! Neat.
Re: LaTeX and other markup!
Hmm  is it just me, or has something interesting just been done to the LaTeX engine behind the scenes? Things seem to be rendered as text rather than images now, and for a brief period a few constructions (like [imath]\frac{\partial y}{\partial x}[/imath]) were borked...
This post brought to you by the language C and the number F.
Re: LaTeX and other markup!
Simon wrote:Proper TeX fonts at the correct weighting for both Mac OS and Windows (i.e. properly adjusted for the respective different gammas) are available here; installing the right set for your machine will make the maths look just as good on any machine.
Ah I was using an old library computer vs. a newer mac, that probably made the difference.
Re: LaTeX and other markup!
Any chance to add a few definitions?
In particular, an "\abs" control sequence (for vertical bars that automatically size themselves) would be nice:
\def\abs#1{{\left  #1 \right \vert}}
From my Plain TeX custom macros file on my machine, for the record.
In particular, an "\abs" control sequence (for vertical bars that automatically size themselves) would be nice:
\def\abs#1{{\left  #1 \right \vert}}
From my Plain TeX custom macros file on my machine, for the record.
Re: LaTeX and other markup!
gmalivuk wrote:As many of you already know, the fora now have LaTeX support. This, combined with the [sup] and [sub] tags which have been around for awhile, should make it far easier to type math formulae. jsMath, which is what the new math and imath tags use, only works properly in the prosilver or prosilver_left styles. Sorry, subsilver adherents, but your favorite skin is no longer supported.
That said, does this excuse such things as "[im
Basically, can we have a policy of encouraging universal legibility? I don't suggest not using jsMath, as that would be mad. But I do suggest if something can be written using the typical characters on a keyboard without LaTeX, [ma
LOWA
 gmalivuk
 GNU Terry Pratchett
 Posts: 26767
 Joined: Wed Feb 28, 2007 6:02 pm UTC
 Location: Here and There
 Contact:
Re: LaTeX and other markup!
Yeah, I was actually going to say that things which could already be typed inline without any special tags, should still be posted that way. No need to increase rendering time and decrease the number of people who can read it correctly, when doing so accomplishes nothing of real benefit over typing it as normal.
Re: LaTeX and other markup!
Blackboard bold (i.e. ℤ for the integers) isn't supported (\mathbb just gives ordinary bold) is there any way to add support for that?
EDIT: it looks like this is what needs to be done.
Also  I've noticed that in some cases, what to do isn't obvious, and people don't seem to want to sift through that huge instruction page  I've started working on a "quick start guide" to doing math markup  would that be helpful to post here as a thread?
EDIT: it looks like this is what needs to be done.
Also  I've noticed that in some cases, what to do isn't obvious, and people don't seem to want to sift through that huge instruction page  I've started working on a "quick start guide" to doing math markup  would that be helpful to post here as a thread?
Re: LaTeX and other markup!
Random832 wrote:Blackboard bold (i.e. ℤ for the integers) isn't supported (\mathbb just gives ordinary bold) is there any way to add support for that?
Use \unicode{x????} for such fonts. For example \unicode{x2124} is [imath]\unicode{x2124}[/imath].
A page with useful codes is here: http://en.wikipedia.org/wiki/Letterlike_Symbols .
Re: LaTeX and other markup!
[math]y=x/2[/math]
It seems that all it does on simple equations is make it italic. Oooh, italic. I must not know how to write up LaTex.
It seems that all it does on simple equations is make it italic. Oooh, italic. I must not know how to write up LaTex.
 Mathmagic
 It's not as cool as that Criss Angel stuff.
 Posts: 2926
 Joined: Thu Nov 30, 2006 12:48 am UTC
 Location: In ur fora posting in teh threads
Re: LaTeX and other markup!
sh3l1 wrote:[math]y=x/2[/math]
It seems that all it does on simple equations is make it italic. Oooh, italic. I must not know how to write up LaTex.
You need to use actual TeX code, such as typing "y=\frac{x}{2}" (without the quotes, and in math tags) to get [imath]y=\frac{x}{2}[/imath]. I find myself referring to this site on a regular basis for TeX characters and the coding for them.
Axman: That, and have you played DX 10 games? It's like having your corneas swabbed with clits made out of morphine.
Pathway: cocks cocks cocks
Pathway: cocks cocks cocks
Re: LaTeX and other markup!
Is there a LilyPond parser available?
[math]\begin{lilypond}
\relative c'' {
a4 b c d
}
\end{lilypond}[/math]
Clearly, there needs to be.
[math]\begin{lilypond}
\relative c'' {
a4 b c d
}
\end{lilypond}[/math]
Clearly, there needs to be.
 gmalivuk
 GNU Terry Pratchett
 Posts: 26767
 Joined: Wed Feb 28, 2007 6:02 pm UTC
 Location: Here and There
 Contact:
Re: LaTeX and other markup!
To gauge actual demand for that, you could post about it in the Music forum.

 Posts: 12
 Joined: Thu Oct 30, 2008 8:45 pm UTC
Re: LaTeX and other markup!
On an only tangentially related note, I need LaTeX for a class and it appears that quite literally every official mirror of it is down. Does forum code offer full LaTeX text setting support, or only the mathematics portion?
Re: LaTeX and other markup!
Konstantin wrote:On an only tangentially related note, I need LaTeX for a class and it appears that quite literally every official mirror of it is down. Does forum code offer full LaTeX text setting support, or only the mathematics portion?
Only math.
If you install almost any linux distribution you can probably load it from their package repositories.
Re: LaTeX and other markup!
[math]x_{1,2}=\frac{b\pm\sqrt{\color{Red}b^24ac}}{2a}[/math]
Whys my colour only apply to the b?
Not the whole row? (b^2+4ac)
Whys my colour only apply to the b?
Not the whole row? (b^2+4ac)
Slowpoke says: 'GENERATION BB/9000*(A(g_64,g_64)): World first ever social experiment! Add one meme to this sig and post it in yours!'
 jestingrabbit
 Factoids are just Datas that haven't grown up yet
 Posts: 5967
 Joined: Tue Nov 28, 2006 9:50 pm UTC
 Location: Sydney
Re: LaTeX and other markup!
Xv8M4g3r wrote:[math]x_{1,2}=\frac{b\pm\sqrt{\color{Red}b^24ac}}{2a}[/math]
Whys my colour only apply to the b?
Not the whole row? (b^2+4ac)
[math]x_{1,2}=\frac{b\pm\sqrt{ \color{Red}{b^24ac}}}{2a}[/math]
Who the hell knows?
ameretrifle wrote:Magic space feudalism is therefore a viable idea.
Re: LaTeX and other markup!
[math]x_{1,2}=\frac{b\pm\sqrt{ \color{Red}{b^24ac}}}{2a}[/math]
Missed a space maybe? hmm cheers!
Missed a space maybe? hmm cheers!
Slowpoke says: 'GENERATION BB/9000*(A(g_64,g_64)): World first ever social experiment! Add one meme to this sig and post it in yours!'
 jestingrabbit
 Factoids are just Datas that haven't grown up yet
 Posts: 5967
 Joined: Tue Nov 28, 2006 9:50 pm UTC
 Location: Sydney
Re: LaTeX and other markup!
Xv8M4g3r wrote:Missed a space maybe? hmm cheers!
[math]x_{1,2}=\frac{b\pm\sqrt{\color{Red}{b^24ac}}}{2a}[/math]
Nope, that isn't the significant change that I made to your code.
[math]\color{Red}monkeys,\ \color{Red}{monkeys}[/math]
ameretrifle wrote:Magic space feudalism is therefore a viable idea.
Re: LaTeX and other markup!
It appears that the forum software doesn't support the \binom tag. What's the preferred form for binomial coefficients here?
[imath]n \choose k[/imath] , [imath]{}^n \! \mathbf{C}_k[/imath] or [imath]{}_n \! \mathbf{C}_k[/imath] ?
I originally learned the 2nd form, though I'm quite familiar with the first form, and it's obviously the easiest to type.
I only noticed the last form quite recently, and FWIW I think it's ugly.
[imath]n \choose k[/imath] , [imath]{}^n \! \mathbf{C}_k[/imath] or [imath]{}_n \! \mathbf{C}_k[/imath] ?
I originally learned the 2nd form, though I'm quite familiar with the first form, and it's obviously the easiest to type.
I only noticed the last form quite recently, and FWIW I think it's ugly.
 gmalivuk
 GNU Terry Pratchett
 Posts: 26767
 Joined: Wed Feb 28, 2007 6:02 pm UTC
 Location: Here and There
 Contact:
Re: LaTeX and other markup!
Pretty sure the first one is what basically everyone's been using since [math] tags were implemented in the first place.
Re: LaTeX and other markup!
[imath]\pi(xy) = N\left(\mu_x + \frac{\sigma_{xy}}{\sigma_y^2}(y\mu_y),\sigma_x^2(1\rho_{xy}^2)\right)[/imath]
Re: LaTeX and other markup!
I'm having some trouble with the \frac command when using LaTeXiT on my mac. I'm inputting:
and getting the D/t_2d/t_1 in the denominator next to t_1+t_2 and nothing in the numerator.
Code: Select all
$g=\frac{2}{t_1+t_2} (\frac{D}{t_2}  \frac{d}{t_1})$
and getting the D/t_2d/t_1 in the denominator next to t_1+t_2 and nothing in the numerator.
 Talith
 Proved the Goldbach Conjecture
 Posts: 848
 Joined: Sat Nov 29, 2008 1:28 am UTC
 Location: Manchester  UK
Re: LaTeX and other markup!
dinoian wrote:I'm having some trouble with the \frac command when using LaTeXiT on my mac. I'm inputting:Code: Select all
$g=\frac{2}{t_1+t_2} (\frac{D}{t_2}  \frac{d}{t_1})$
and getting the D/t_2d/t_1 in the denominator next to t_1+t_2 and nothing in the numerator.
Your code gives:
[math]g=\frac{2}{t_1+t_2} (\frac{D}{t_2}  \frac{d}{t_1})[/math]
is that not what you wanted?
if it looks something like
[math]g=\frac{2}{{t_1+t_2} (\frac{D}{t_2}  \frac{d}{t_1}})[/math]
then you've made a mistake with your bracing and need to correct that (it can get confusing with lots of nested braces).
double click on the typeset stuff above to see the LaTeX code.
Re: LaTeX and other markup!
That is exactly what I wanted, but it is coming out like:
[math]g = 2 \frac{}{t_1+t_2 (\frac{D}{t_2}\frac{d}{t_1})}[/math]
[math]g = 2 \frac{}{t_1+t_2 (\frac{D}{t_2}\frac{d}{t_1})}[/math]
 jestingrabbit
 Factoids are just Datas that haven't grown up yet
 Posts: 5967
 Joined: Tue Nov 28, 2006 9:50 pm UTC
 Location: Sydney
Re: LaTeX and other markup!
There'll be some white space in the "\frac{2}{" bit somewhere. Could be a tab, could be anything. Also, put a \left in front of your left bracket, and a \right in front of your right, like so
[math]\left(\frac{1}{2}\right)[/math]
[math]\left(\frac{1}{2}\right)[/math]
ameretrifle wrote:Magic space feudalism is therefore a viable idea.
Re: LaTeX and other markup!
[math]\int_{\Omega} \Delta u dx = \int_{\partial \Omega} \frac{\partial u}{\partial \vec{n}} dS[/math]
some test
some test
I am a Math/Physics/Astrodynamics/Programming geek
I am currently working on NavierStokes and Maxwell equations
My Gamertag for XBOX LIVE and PSN same as my username
I am currently working on NavierStokes and Maxwell equations
My Gamertag for XBOX LIVE and PSN same as my username
Re: LaTeX and other markup!
[math]t=\sqrt[3]{v+\dfrac{4}{3} \pi (6371+d)^3 \over {\dfrac{4}{3}\pi}}6371d[/math]
[math]v=(\dfrac{4}{3} \pi (6371+t+d)^3)(\dfrac{4}{3} \pi (6371+d)^3[/math]
It seems to work well. I'm too lazy to figure out the third formula if you know t and v.. Also, first post. Hello.
[math]v=(\dfrac{4}{3} \pi (6371+t+d)^3)(\dfrac{4}{3} \pi (6371+d)^3[/math]
It seems to work well. I'm too lazy to figure out the third formula if you know t and v.. Also, first post. Hello.
Re: LaTeX and other markup!
This is genuinely broken now. At the time of this writing, "\mathbb{Z}", [imath]\mathbb{Z}[/imath], gives the error "Unknown control sequence '\msbm'".Random832 wrote:Blackboard bold (i.e. ℤ for the integers) isn't supported (\mathbb just gives ordinary bold) is there any way to add support for that?
I can probably install fonts locally to make this go away (can I?), but that would hardly fix the problem of people being unable to read what I write.
Jerry Bona wrote:The Axiom of Choice is obviously true; the Well Ordering Principle is obviously false; and who can tell about Zorn's Lemma?
 gmalivuk
 GNU Terry Pratchett
 Posts: 26767
 Joined: Wed Feb 28, 2007 6:02 pm UTC
 Location: Here and There
 Contact:
Re: LaTeX and other markup!
In the meantime, putting ℤ in math tags gives the right character.
Re: LaTeX and other markup!
Simon wrote:Proper TeX fonts at the correct weighting for both Mac OS and Windows (i.e. properly adjusted for the respective different gammas) are available here; installing the right set for your machine will make the maths look just as good on any machine.
It looked pretty bad before I installed the fonts. After I installed the 25 font (I'm using a PC), it looked worse. 20 and 30 looked even worse. So I got rid of them altogether, and that seems to look the best... ?
"I think nature's imagination is so much greater than man's, she's never gonna let us relax."

 Posts: 1
 Joined: Tue Apr 13, 2010 12:35 am UTC
Re: LaTeX and other markup!
Testing support for xypic
[math]\xymatrix{T\times V\ar[r]^p\ar[dr]_i&T\otimes V\ar[d]^h\\&W[/math]
[math]\xymatrix{T\times V\ar[r]^p\ar[dr]_i&T\otimes V\ar[d]^h\\&W[/math]

 Posts: 5
 Joined: Mon Feb 22, 2010 3:39 am UTC
Re: LaTeX and other markup!
It's not showing up right in preview, so I'll check if that's just the preview or if it's really not working.
<imath>\Delta^1_2</imath>
<imath>\Delta^1_2</imath>
Who is online
Users browsing this forum: No registered users and 5 guests