# Introducing LaTeX Math Typesetting

Staff Emeritus
Gold Member
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

Monique
Staff Emeritus
Gold Member
I just remembered that for simple annotations as that the sub and sup tags can be used :)

Staff Emeritus
Gold Member
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 $$\inline{C H_4}$$ or $$\inline{G_\textrm{diffeo}}$$ or $$\inline{y = mx + b}$$, 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 $$\inline{\frac{1}{\sqrt{1 - v^2/c^2}}}$$ or even $$\inline{e^x = \sum_{n=0}^\infty \frac{x^n}{n!} = \lim_{n\rightarrow\infty} (1+x/n)^n }$$. But if makes more sense to include larger graphics set apart from your text, like this:

$$\frac{1}{\sqrt{1 - v^2/c^2}}$$

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

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 $$\inline{\vec{F} = m \vec{a}}$$ to denote vector quantities.

Enjoy!

- Warren

Hurkyl
Staff Emeritus
Gold Member
How do I get the arrows, then, if I want them?

Staff Emeritus
Gold Member
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:

- Warren

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

Staff Emeritus
Gold Member
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 $$\inline{\vec \lambda}$$.

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

- Warren

Staff Emeritus
Gold Member
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

Staff Emeritus
Gold Member
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

Staff Emeritus
Gold Member
Also, Ambi, you LaTeX guru you,

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

$$\inline{ \int_{a}^{b}} e^x dx }$$

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

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

- Warren

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

Hurkyl
Staff Emeritus
Gold Member
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!!!

jcsd
Gold Member
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.

Staff Emeritus
Gold Member
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 lets me on the site, I'll do that.

- Warren

Staff Emeritus
Gold Member
Okay guys, now [ itex ] ... [ /itex ] is equivalent to [ tex ]\inline{...}[ /tex ].

Have fun.

- Warren

Hurkyl
Staff Emeritus
Gold Member
W$oo$t!

Staff Emeritus
Gold Member
Also, \vec now does $\lambda_j = \vec{\lambda} \cdot \vec{e}_j$ while \mathbf does $\lambda_j = \mathbf{\lambda} \cdot \mathbf{e}_j$.

- Warren

Staff Emeritus
Gold Member
And ams math environments should work now too:

$$a + b + c + d + e + f +g+h+i+j+k+l+m+n$$

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

$$\begin{gather*} a_1 = b_1 + c_1\\ a_2 = b_2 + c_2 - d_2 + e_2 \end{gather*}$$

- Warren

Staff Emeritus
Gold Member
Guide to using the amsmath package:

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

- Warren

Last edited by a moderator:
Hurkyl
Staff Emeritus
Gold Member
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 probably should go in the .pdf too)

Hurkyl
Staff Emeritus
Gold Member
Is there a smaller triangle that goes well here? What's the command for the floor and ceiling functions? Am I spelling the command for omicron wrong, or is omicron identical to 'o' so there isn't a command?

$$\Delta x \triangle x$$
$\Delta x \triangle x$

Last edited:
$$ab$$
$$a b$$
$$a\! b$$
$$a\, b$$
$$a\: b$$
$$a\; b$$

Originally posted by Hurkyl
Is there a smaller triangle that goes well here?
What do you want a triangle for?

What's the command for the floor and ceiling functions?
$$\lfloor x \rfloor, \lceil y \rceil$$

Am I spelling the command for omicron wrong, or is omicron identical to 'o' so there isn't a command?
The latter.

'~' isn't really intended to add space in LaTeX; it's just like a regular space, except it's non-breaking (LaTeX won't try to insert a line break there).

Hurkyl
Staff Emeritus
$$f(x + \Delta x) = f(x) + f'(x) \Delta x + \varepsilon(\Delta x) \Delta x$$