Generalitalic roman inside an equation

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
edallica
Posts: 2
Joined: Wed Jul 16, 2008 12:41 pm

italic roman inside an equation

Post by edallica »

hi eveyone!

im trying to put a nice looking lande g-factor into an equation. what i need is a roman g that is italicised when in the equation environment. i just can't figure out how to do this!

so far ive tried...

\rm{g}, this gives a roman g but it is not in italics
\emph{\rm{g}}, this gives a roman g but it is not in italics
\rm{\emph{g}}, this gives an italic g, but not the roman font!

any help would be very appreciated.
cheers.

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

italic roman inside an equation

Post by Stefan Kottwitz »

Hi edallica,

welcome to the board!
Don't use the old macros like \rm, \it, \bf. Instead of \rm use \rmfamily or \textrm{text} or in math mode \mathrx{text}.
If there's no italic shape of the font typeface you like, you could try slanted: \textsl{text} or \slshape. Try this small example:

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ \text{g} , \text{\textit{g}} , \textsl{\textrm{g}} \]
\end{document}
Stefan
LaTeX.org admin
edallica
Posts: 2
Joined: Wed Jul 16, 2008 12:41 pm

Re: italic roman inside an equation

Post by edallica »

Thanks Stefan,

\textsl{\textrm{g}} worked a treat.
Post Reply