Introducing LaTeX Math Typesetting

In summary, Physicsforums.com has introduced the addition of LaTeX mathematical typesetting to their forum software. This professional-grade typesetting system allows for pleasing mathematical presentation and can be included in any post on the forum. Users can include LaTeX graphics by using the [ tex ]...[ /tex ] or [ itex ]...[ /itex ] tags, with the latter being used for inline graphics. The forum provides a pdf file and symbol reference for the most useful LaTeX commands, symbols, and constructs. The amsmath package is also available for more information. Examples of various techniques are provided, including subscripts, superscripts, and equations. Users can also use the [ tex usepackage= ] tag to include additional packages.
  • #36
Originally posted by Ambitwistor
Yes, we have amsmath; I only recently started using it, so I keep forgetting about it...

However, if you're proposing \text as a replacement for \mbox in this instance ...

yes, it doesn t work... i assume that is because amsmath isn t loaded... or?
 
Physics news on Phys.org
  • #37
chroot-

on the pdf how-to provided on the first post of this thread, it states that [ tex ] is equivalent to $...$ (which makes inline math mode), but i guess what we have discovered here, is that it is actually equivalent to \[ ...\] (which makes display mode math).

perhaps the pdf can be updated?
 
  • #38
Originally posted by lethe
. i assume that is because amsmath isn t loaded... or?

it seems that amsmath is loaded after all.
 
  • #39
Yes, amsmath & amssymb are in fact available.

The code you type into [ tex ] tags goes directly into a \begin{displaymath}...\end{displaymath} environment. This can be changed if necessary. I assumed the majority of users would be putting equations set apart from their text, but this may not be a good assumption. I believe \mbox effectively just steps out it without any downsides.

- Warren
 
  • #40
[tex]
Hrm,~line~breaks \\
don't~seem~to~work.
[/tex]
 
  • #41
All right, here's a new problem. How do I do this, but right?

[tex]
\begin{array}{r l r l}
u &= \ln x \quad & dv &= x\,dx \\
du &= \frac{1}{x}\,dx & v &= \frac{1}{2} x^2
\end{array}
[/tex]
 
  • #42
Originally posted by Hurkyl
All right, here's a new problem. How do I do this, but right?

i don t understand... what are you trying to do?
 
  • #43
There's too much space to the left of the equal signs. [tex]u=\ln x[/tex] "should" be one entity instead of being spread over two separate columns.
 
  • #44
[tex]
\begin{align}
u &= \ln x \quad & dv &= x\,dx \\
du &= \frac{1}{x}\,dx & v &= \frac{1}{2} x^2
\end{align}
[/tex]
 
Last edited:
  • #45
[tex]
\begin{align}
u &= \ln x \quad & dv &= x\,dx \\
du &= \mbox{$\frac{1}{x}\,dx$} & v &= \mbox{$\frac{1}{2} x^2$}
\end{align}
[/tex]
 
  • #46
If I want to denote the real and complex sets, using one of the below fonts which looks better?

[tex]\mathbb{RC}\mathbbmss{RC}\mathds{RC}[/tex]

edited to add: it doesn't look like we have the other two fonts. There must be someway of represintg the real and complex sets in this manner, as the first fonts don't really look right to me.
 
Last edited:
  • #47
Well, like it or not,
[tex]
\mathbb{RC}
[/tex]
is pretty much the standard way of doing it in TeX.

There are other fonts and macros you can install, like bbold, mathbbol, doublestroke, bbm, mathpazo, etc., which all provide variations that are preferred by various people, but it's probably not worth the effort.
 
  • #48
I was just hpoing to get something more inline with what's in my textbooks, but I suppose the font is more than adequate.
 
  • #50
You might be able to hack in a smaller font, but there's no way around the subscript issue. The problem is that HTML doesn't know that the image is supposed to represent text with descenders in it, so it can't align the image's baseline with the normal HTML text surrounding it.
 
  • #51
Actually, you can specify that images should be centered vertically within the line of text they're in -- I'm working on getting that attribute into the image tags. Politics, shmolitics.

- Warren
 
  • #52
I just remembered that for simple annotations as that the sub and sup tags can be used :)
 
  • #53
Update!

The LaTeX code has been improved a bit. I know you guys have been frustrated with the ugliness of inline TeX, so I went ahead and improved that.

I have introduced a new LaTeX command, the \inline command. Whenever you want to include a graphic inline with your text, like [tex]\inline{C H_4}[/tex] or [tex]\inline{G_\textrm{diffeo}}[/tex] or [tex]\inline{y = mx + b}[/tex], you should use the \inline{...} construct. Remember: click the LaTeX images to see how they're implemented.

Of course, you can inline larger pieces of TeX too, like [tex]\inline{\frac{1}{\sqrt{1 - v^2/c^2}}}[/tex] or even [tex]\inline{e^x = \sum_{n=0}^\infty \frac{x^n}{n!} = \lim_{n\rightarrow\infty} (1+x/n)^n
}[/tex]. But if makes more sense to include larger graphics set apart from your text, like this:

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

[tex]e^x = \sum_{n=0}^\infty \frac{x^n}{n!} = \lim_{n\rightarrow\infty} (1+x/n)^n[/tex]

Note the difference in font sizing and layout between the normal and inlined graphics.

In addition, I have changed the TeX \vec command to boldface vectors. So feel free to use expressions like [tex]\inline{\vec{F} = m \vec{a}}[/tex] to denote vector quantities.

Enjoy!

- Warren
 
  • #54
How do I get the arrows, then, if I want them?
 
  • #55
Originally posted by Hurkyl
How do I get the arrows, then, if I want them?
Hmmm well, I thought I knew how, but now I'm not so sure. I'll have to look around. Maybe Ambitwistor knows a trick to put a command that has been \renew'd back to its default behavior.

Also, I found this pdf of useful mathematical constructs, that goes a bit beyond what we already have:

http://amath.colorado.edu/documentation/LaTeX/Symbols.pdf

- Warren
 
  • #56
I don't know how to get a command back to its original behavior. You could try defining a new command to act like the original \vec before you redefine it. (Or else you could leave the original alone and define a new command to act like the bold version.)
 
  • #57
Originally posted by Ambitwistor
I don't know how to get a command back to its original behavior. You could try defining a new command to act like the original \vec before you redefine it. (Or else you could leave the original alone and define a new command to act like the bold version.)
Both are good ideas. Generally, boldfacing is the "proper" way to represent vectors. Unfortunately, TeX treats lowercase greek letters and uppercase greek letters differently, making it fairly complicated to just boldface any old character. I put the macro into the system so people wouldn't have to jump through hoops if they just wanted to make a boldface [tex]\inline{\vec \lambda}[/tex].

Maybe redefining \boldmath to work everywhere is the best approach here, leaving \vec alone.

- Warren
 
  • #58
I also just noticed that in IE6, the inline LaTeX images are a few pixels below the baseline of the text. In my preferred browser, Mozilla, they are exactly correct. Perhaps I need to tweak the site's style sheet to get the line spacing just right in all browsers. I'll have to think about it. In the meantime, everyone should switch to Mozilla Firebird!

- Warren
 
  • #59
Actually, scratch that -- when the font size is set to "Medium" in the view menu, it's just right in IE6 too. (whew) Are any of you experiencing inline LaTeX graphics that are NOT aligned properly with your text?

- Warren
 
  • #60
Also, Ambi, you LaTeX guru you,

Can you tell me why the font size is different between these two images?

[tex]\inline{
\int_{a}^{b}} e^x dx
}[/tex]

[tex]\inline{
e^x = \sum_{n=0}^\infty \frac{x^n}{n!} = \lim_{n\rightarrow\infty} (1+x/n)^n
}[/tex]

Look at the e^x... does the integral sign somehow cause the font size to change, or what?

- Warren
 
  • #61
Originally posted by Hurkyl
How do I get the arrows, then, if I want them?

wouldn t it just be better to follow ams guidlines, and have \vec make an overline, and \mathbf make boldface? i much prefer boldface to arrows in print, but i don t see any reason to override ams defaults to get rid of arrows... they are not that bad...
 
  • #62
What about making a new tag, say, [ itex ] for inline tex? It gets annoying having to type [ tex ]\inline{x}[ /tex ] 10 times in a post!
 
  • #63
Your right it can be annoying, when I posted a load of inline text though, I just copied the commands onto the clipboard and pasted, changing the code between the inline brackets.
 
  • #64
Originally posted by Hurkyl
What about making a new tag, say, [ itex ] for inline tex? It gets annoying having to type [ tex ]\inline{x}[ /tex ] 10 times in a post!
Yeah, I was strongly considering this from the beginning. Next time Greg let's me on the site, I'll do that.

- Warren
 
  • #65
Okay guys, now [ itex ] ... [ /itex ] is equivalent to [ tex ]\inline{...}[ /tex ].

Have fun. :smile:

- Warren
 
  • #66
W[itex]oo[/itex]t!
 
  • #67
Also, \vec now does [itex]\lambda_j = \vec{\lambda} \cdot \vec{e}_j[/itex] while \mathbf does [itex]\lambda_j = \mathbf{\lambda} \cdot \mathbf{e}_j[/itex].

- Warren
 
  • #68
And ams math environments should work now too:

[tex]a + b + c + d + e + f
+g+h+i+j+k+l+m+n[/tex]

[tex]
\begin{multline*}
a + b + c + d + e + f\\
+g+h+i+j+k+l+m+n
\end{multline*}
[/tex]

[tex]
\begin{gather*}
a_1 = b_1 + c_1\\
a_2 = b_2 + c_2 - d_2 + e_2
\end{gather*}
[/tex]

- Warren
 
  • #69
Guide to using the amsmath package:

http://www.cds.caltech.edu/~dunbar/docs/amsldoc.pdf

- Warren
 
Last edited by a moderator:
  • #70
What are all the spacers available to us? (like '~' and '\,')

(and remember, I'm a LaTeX newbie, so mentioning what they're supposed to do is nice :smile: probably should go in the .pdf too)
 

Similar threads

Replies
5
Views
1K
Replies
3
Views
1K
Replies
4
Views
2K
Replies
8
Views
2K
Replies
3
Views
878
Replies
2
Views
1K
Back
Top