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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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: 10335
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