Register to reply

Introducing LaTeX Math Typesetting

by chroot
Tags: introducing, latex, math, typesetting
Share this thread:
Adrian Baker
#19
Nov19-03, 02:33 PM
Adrian Baker's Avatar
P: 419
Lets have a go....

[tex]2\pi\sqrt{l/g}[/tex]


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


edit: After three attempts I got it to work!!
chroot
#20
Nov20-03, 11:47 AM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Displaying vectors can be tricky.

The default \vec LaTeX command produces a little arrow over the top of vectors, e.g.

[tex]\lambda_j = \vec{\lambda} \cdot \vec{e}_j[/tex]

If you'd prefer to make your vectors boldface, just redefine the \vec command. See the source for this image to see how the command is redefined.

[tex]
\renewcommand{\vec}[1]{\mbox{\boldmath $ #1 $}}

\lambda_j = \vec{\lambda} \cdot \vec{e}_j[/tex]

- Warren
lethe
#21
Nov20-03, 10:29 PM
lethe's Avatar
P: 657
does this always generate display mode, or can we make it do inline mode as well?
chroot
#22
Nov20-03, 10:30 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Originally posted by lethe
does this always generate display mode, or can we make it do inline mode as well?
You mean, can you typeset your entire post in TeX and use $ $ to set off the math?

- Warren
lethe
#23
Nov20-03, 10:47 PM
lethe's Avatar
P: 657
Originally posted by chroot
You mean, can you typeset your entire post in TeX and use $ $ to set off the math?

- Warren
no, LaTeX has two modes, one for displaying equations inline (with $...$), where stuff is smaller, and another for display mode equations (\[ .... \]). the same equation will display differently depending on which you use. can we have access to both methods?
chroot
#24
Nov20-03, 10:52 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Originally posted by lethe
no, LaTeX has two modes, one for displaying equations inline (with $...$), where stuff is smaller, and another for display mode equations (\[ .... \]). the same equation will display differently depending on which you use. can we have access to both methods?
In what way are equations displayed differently in these two modes? AFAIK, math is displayed the same way in between $$ as in the displaymath environment.

- Warren
Ambitwistor
#25
Nov20-03, 10:56 PM
P: 837
Display math:

[tex]\sum_i x^i[/tex]

(inline) math, [tex]\mbox{$\sum_i x^i$}[/tex], hacked
Ambitwistor
#26
Nov20-03, 10:57 PM
P: 837
Originally posted by chroot
In what way are equations displayed differently in these two modes? AFAIK, math is displayed the same way in between $$ as in the displaymath environment.
The 'displaymath' environment is the same as $$...$$, to show equations on a line by themselves, but $...$ is the 'math' environment, which is intended for equations inlined with other text.
chroot
#27
Nov20-03, 10:58 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Ambi,

Cool, I tried a few things and couldn't find anything that displayed differently!

Using \mbox is a fine way to do it.

- Warren
chroot
#28
Nov20-03, 10:59 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
If it becomes a serious wishlist item for a lot of people, I can consider adding some attributes like mode=displaymath or mode=inline to the [ tex ] tag. Otherwise, \mbox is the easiest way to accomplish it.

- Warren
lethe
#29
Nov20-03, 11:01 PM
lethe's Avatar
P: 657
Originally posted by chroot
Ambi,

Cool, I tried a few things and couldn't find anything that displayed differently!
yeah, neither could i, because apparently the software doesn t recognize the inline mode commands...

Using \mbox is a fine way to do it.
OK, good enough
chroot
#30
Nov20-03, 11:02 PM
Emeritus
Sci Advisor
PF Gold
chroot's Avatar
P: 10,429
Originally posted by lethe
yeah, neither could i, because apparently the software doesn t recognize the inline mode commands...
No, I tried \mbox too -- but I tried y = mx + b, which looks the same in both environments, lol:

[tex]y = m x + b[/tex]

[tex]\mbox{ $ y = m x + b $ }[/tex]

- Warren
lethe
#31
Nov20-03, 11:04 PM
lethe's Avatar
P: 657
Originally posted by chroot
Otherwise, \mbox is the easiest way to accomplish it.

- Warren
do we have the amsmath package? mbox is a little limited, (like it doesn t go into subscripts very well), and \text is better.
lethe
#32
Nov20-03, 11:05 PM
lethe's Avatar
P: 657
Originally posted by chroot
No, I tried \mbox too -- but I tried y = mx + b, which looks the same in both environments, lol:
yeah, i think the only place where this makes a difference is for larger things like fractions, summations and integrations.
Ambitwistor
#33
Nov20-03, 11:06 PM
P: 837
Originally posted by chroot
If it becomes a serious wishlist item for a lot of people, I can consider adding some attributes like mode=displaymath or mode=inline to the [ tex ] tag. Otherwise, \mbox is the easiest way to accomplish it.
It seems to me that typing "\mbox{}" is still easier than typing "mode=inline" ...
Ambitwistor
#34
Nov20-03, 11:12 PM
P: 837
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 ...

[tex]\mbox{$\sum_i x^i$}[/tex]
[tex]\text{$\sum_i x^i$}[/tex]
lethe
#35
Nov20-03, 11:14 PM
lethe's Avatar
P: 657
Originally posted by lethe
do we have the amsmath package? mbox is a little limited, (like it doesn t go into subscripts very well), and \text is better.
apparently not.
lethe
#36
Nov20-03, 11:15 PM
lethe's Avatar
P: 657
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?


Register to reply

Related Discussions
How can I make math (by latex) available in my post? Forum Feedback & Announcements 5
Typesetting Problems General Math 2
Math Typesetting General Math 10
A math book on introducing proofs(?) General Math 29
Notation for recursion - better typesetting General Math 0