[Tex/LaTex] Write fraction out of equation

math-mode

I want to write as a math fraction 1/4 " ( a quarter of inch). I want to write this fraction out of an equation because is a characteristic of an element.

Best Answer

Without hassle, use 1/4 as-is, or $\frac{1}{4}$ (similar to amsmath's \tfrac{1}{4}) will typeset one quarter. If you want to add " in order to represent "inches", you could use $\frac{1}{4}''$, which is equivalent to $\frac{1}{4}^{\prime\prime}$. xfrac also produce so-called "vulgar fractions" via \sfrac{<num>}{<denom>}. Here are some examples:

enter image description here

\documentclass{article}
\usepackage{xfrac}% http://ctan.org/pkg/xfrac
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum eu $1/4^{\prime\prime}$ massa lectus. 
Phasellus eget $\frac{1}{4}^{\prime\prime}$ tortor mi, porttitor aliquam lacus. Donec rutrum, purus eu luctus rhoncus, 
nunc enim $\sfrac{1}{4}''$ viverra metus, et iaculis urna enim ut sapien. Aenean malesuada, orci eget 
facilisis pretium, metus dolor dapibus justo, eget laoreet $\frac{1}{4}^{\prime\prime}$ leo eros sit amet massa. 
Duis viverra eleifend elementum. Proin volutpat tristique luctus. In non erat quam. 
Ut porta hendrerit $\sfrac{1}{8}''$ sapien sit amet molestie. Aliquam erat volutpat.
\end{document}

Note that there might be some spacing issues if you use two "text fractions" in successive lines, since the ascenders and descenders of the respective lines push them further apart (lines 1-3 exhibit this stretched look). As such, the "vulgar fractions" are sometimes preferred, since they take up less vertical real estate.