GeneralPlain Text in Math Mode

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
mach7
Posts: 1
Joined: Mon May 05, 2008 12:56 am

Plain Text in Math Mode

Post by mach7 »

Hey there. I'm trying to write out a stoichiometry formula, something like 1 level * 20V/65536 levels * 1000mV / V. I think I have to be in math mode to get the fractions, but I want the text to be plain (no italics and the same font as the rest of the paper) and to have spaces. I saw one solution using \textrm{}, but that seems like a hack. Is there just a way to "escape out" of math mode temporarily to write plain text?

Thanks,
-mach7

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Re: Plain Text in Math Mode

Post by curiouslearn »

It seems command \text{your text here} should be sufficient. You may not need \textrm. I am not sure what you mean by a hack, but that is the method suggested in the "The Latex Companion" by Mittelbach et. al.
Danielc
Posts: 11
Joined: Sat May 03, 2008 10:12 pm

Plain Text in Math Mode

Post by Danielc »

Code: Select all

\text{}
is what you want...

spaces...in math mode spaces are automatic, so the text will be pushed right up against your equations...so you need to include spaces

Code: Select all

 $2 \times \text{dumb\,example\,}=4$  
there are a handful of math mode space options, you can look them up online..
good luck

dpc
User avatar
Stefan Kottwitz
Site Admin
Posts: 10397
Joined: Mon Mar 10, 2008 9:44 pm

Re: Plain Text in Math Mode

Post by Stefan Kottwitz »

Hi mach7,

welcome to the LaTeX Community board!
\text{} is the right way like both members above said. I just want to add that \text needs the amsmath package (or at least amstext).
Without amsmath text inside math would be possible using \mbox{...}, but \text is the better choice, it respects current font size.

Stefan
LaTeX.org admin
Post Reply