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.
- 603,163
- 1,303
-
2@lostinplace I don't think this is a Mathematics question – Dec 30 '11 at 16:37
4 Answers
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.
- 603,163
-
Isn't it different text fonts when using the $-environment? Can you get \frac-like fractions but with the text font? – Lars Abrahamsson Oct 14 '18 at 09:39
-
@LarsAbrahamsson: Sure, try with
\frac{\text{<num>}}{\text{<denom>}}if you're loadingamsmath. – Werner Oct 14 '18 at 16:08
\begin{equation}
\frac{1}{4}
\end{equation}
EDIT:
or
\begin{eqnarray}
\frac{1}{4}
\end{eqnarray}
or
$ \frac{1}{4} $
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.
- 19,242
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.
-
1Don't forget, you can further condense
\frac{1}{4}as\frac14, with an identically good/bad result. ;) – qubyte Dec 31 '11 at 11:58 -