# Write fraction out of equation

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.

-
@lostinplace I don't think this is a Mathematics question – user1016253 Dec 30 '11 at 16:37

## migrated from stackoverflow.comDec 30 '11 at 20:21

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:

\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.

-
$$\frac{1}{4}$$


EDIT:

or

\begin{eqnarray}
\frac{1}{4}
\end{eqnarray}


or

$\frac{1}{4}$

-
out of equation. I put this fraction in a cell of a table. – Jorge Vega Sánchez Dec 30 '11 at 16:56
@JorgeVegaSánchez Forgive me I misread, see the edit – user1016253 Dec 30 '11 at 17:12
Please see \eqnarray vs \align on why to avoid using eqnarray. – Werner Dec 30 '11 at 20:26

I don't understand the context of your question. LaTeX provides the much overused $\frac{1}{4}$ but this has several disadvantages, especially if it's used in ordinary math mode (as part of the running text). First, it changes the size of the figures in the numerators and denominators, and second it may screw up the interline spacing. If you just want to write something simple stating that y is a quarter of x then I suggest you write $y=x/4$. Writing this is easier on the eye than $y=\frac{1}{4} x$. For more complex statements, writing $4 y = x$ or (better?) $x = 4 y$ may look better than $y=\frac{1}{4} x$.

In displayed math, similar comments may apply.

-
 Don't forget, you can further condense \frac{1}{4} as \frac14, with an identically good/bad result. ;) – Mark S. Everitt Dec 31 '11 at 11:58 Damn, missed that opportunity! – Mark S. Everitt Dec 31 '11 at 19:26

You can create nice split level fractions with the nicefrac package, or, if you have reasonably recent TeX distribution, with the xfrac package.

\documentclass{article}
\usepackage{nicefrac}

\begin{document}
Blah blah blah \nicefrac{1}{4} blah blah blah.
\end{document}


or

\documentclass{article}
\usepackage{xfrac}

\begin{document}
Blah blah blah \sfrac{1}{4} blah blah blah.
\end{document}


The xfrac package is more flexible, and will work better with much larger variety of fonts.

-