Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [fractions]

This tag is for questions regarding the display of fractions and related problems.

Filter by
Sorted by
Tagged with
117 votes
7 answers
114k views

How do I typeset arbitrary fractions like the standard symbol for .5 = ½?

I know I've seen somewhere how to typeset 1/2 as ½, but with arbitrary fractions (that is, a macro that takes two arguments and makes the first denominator and the second numerator...). Now I can't ...
Tomas Aschan's user avatar
  • 15.6k
110 votes
4 answers
100k views

What is the difference between \over and \frac?

What is the difference between {some-expression}\over{another-expression} and \frac{some-expression}{another-expression} ? Which is preferable?
lily's user avatar
  • 1,226
87 votes
1 answer
101k views

How to get a little frac

I am wondering how to make a fraction in LaTeX small enough to fit on a line, or at least just a little larger. I could have sworn I had seen this before but I just cannot find it. In particular, I ...
BBischof's user avatar
  • 4,209
53 votes
2 answers
3k views

Improved kerning in fractions?

Question How can I apply selective kerning within the numerator and denominator of an inline fraction? Specifically, I'd like to: Tighten kerning after the numerator if it ends in 7 Loosen kerning ...
Todd Lehman's user avatar
48 votes
2 answers
147k views

Elegant fractions in one line

What solution do you think is more elegant for a simple fraction that should be displayed in just one line? My examples are $x_F \equiv \frac{p_z}{p^{\rm MAX}_{z}} = \frac{p_z}{\sqrt{s}/2}$ $x_F \...
leoredi's user avatar
  • 811
43 votes
5 answers
88k views

How to print \frac{1}{2} by a single Unicode character?

I am looking for a command which would print simple fractions like 1/2, 1/3 etc using glyphs available in modern TTF/OTF fonts. Ideally, I want this command to output ordinary \frac{1}{2}, \frac{1}{3} ...
Igor Kotelnikov's user avatar
43 votes
3 answers
30k views

Guidelines for typesetting fractions

I realize that this question is to some extent subjective. However, I suspect that there are some common standards regarding how fractions ought to be typeset in mathematics. The guide Mathematical ...
void-pointer's user avatar
  • 3,166
37 votes
3 answers
40k views

Smaller fractions in displayed formulae?

How do you make script-sized fractions in display mode? In certain cases, I find that \frac-based fractions are too large for my tastes in displayed formulae. For example, I feel that the fractions ...
Todd Lehman's user avatar
37 votes
1 answer
411k views

Vertical spacing between numerator and division symbol in \dfrac

How can I fix the vertical spacing between the numerator and the division symbol when entering fractions. Eg. in the following code, the spacing between a and the division symbol is greater than one ...
mythealias's user avatar
  • 3,621
36 votes
3 answers
61k views

How to make fractions in powers look good

Quick question. When I type $e^{\frac{1}{2x}}$ it makes the fraction very small and hard to read. However when I type $e^{\displaystyle\frac{1}{2x}}$ it makes the fraction way to big. I guess in ...
user62563's user avatar
  • 373
33 votes
7 answers
84k views

A symbol for the quotient of two objects

One often needs a symbol to denote the quotient of two (algebraic) objects (e.g. quotient by a subgroup, subring, submodule etc.). In simple cases people use A/B. But when both A and B are complicated ...
qui_vadis's user avatar
  • 523
32 votes
7 answers
19k views

How to increase row height while using booktabs?

I'm making a table using booktabs. One of the columns contains a series of fractions. \documentclass[12pt, letterpaper]{article} \usepackage{nag} \usepackage[margin=1.0in]{geometry} \...
Michael0x2a's user avatar
27 votes
3 answers
2k views

Superscripts appear in various weird places in fractions

This is a weird phenomenon. Consider the following code: \documentclass{article} \begin{document} $$Z^* \frac{Z^*}{Z^*}$$ \end{document} It produces the following picture: The asterisks appear ...
Bach's user avatar
  • 1,275
21 votes
6 answers
9k views

Align denominator of fraction to left

The highlighted part has the equation centred, which looks rather imbalance with the top equation, is it possible to align the highlighted part to the left? Below is the code I am using. \begin{...
william007's user avatar
  • 4,841
19 votes
3 answers
71k views

Text-mode in fractions?

I want to have written words in a fraction but to have them in correct fraction form and not crude-looking. So, I have; $\displaystyle\frac{Actual Value of Production}{Demand}$ x $100$ But it makes ...
Charlotte's user avatar
  • 191
19 votes
3 answers
20k views

Legendre symbol in theory of numbers

How can I get a Legendre symbol , which just used the dashed line instead of the fractional rule?
fas's user avatar
  • 205
18 votes
2 answers
19k views

Continued fractions

How do I make this in LaTeX? I keep losing track of the brackets.
user121994's user avatar
17 votes
5 answers
4k views

Cross Multiplying Two Fractions with Ovals Around the Appropriate Terms

I would like to implement something akin to the following in LaTeX, perhaps in tikz. I would be very grateful for any help.
J G's user avatar
  • 2,643
17 votes
2 answers
637 views

Interesting recursive behaviour with \frac error

I have this code below. Obviously it's not actually valid code because there's no second argument to \frac, but nonetheless I'm curious why it produces what it does. \[ \text{abc$\frac{123}$} \] ...
Ethan Lawler's user avatar
17 votes
3 answers
983 views

How would you name these fraction macros?

I've got four macros now for typesetting fractions in text mode. The first writes them horizontally (shilling style, with a hyphen), the second writes them diagonally, the third writes them vertically,...
Todd Lehman's user avatar
16 votes
5 answers
42k views

Proper display of fractions

Have a look at the following code: \documentclass[letterpaper]{article} \usepackage{amsmath,amssymb} \begin{document} $2-\frac{2}{1-\left(\frac{2}{2-\frac{2}{x^2}}\right)}$\quad $2-\dfrac{2}{1-\...
azetina's user avatar
  • 29.1k
16 votes
3 answers
6k views

How can you change the width of a fraction bar?

I have an equation using fractions of fractions - much like \frac{\frac{a}{b}}{\frac{c}{d}} However, all of the fraction bars are the same width. I'd like to make the central bar wider than the ...
jebyrnes's user avatar
  • 265
16 votes
1 answer
15k views

Annotating individual math terms with braces

I am trying to annotate individual terms of a mathematical expression, as depicted below. The problem I get is that the comment seems to be taken as part of the fraction, which unnecessarily extends ...
brian-ammon's user avatar
  • 2,425
16 votes
1 answer
5k views

Reformat \frac depending on numerator/denominator size difference

Is it possible to detect cases where the second argument of \frac is much smaller than the first argument, and split it? Namely (I'm using a new macro name \wfrac to simplify things), \wfrac{x}{2} % ...
Bruno Le Floch's user avatar
15 votes
6 answers
10k views

How to typeset a continued fraction in the following format?

How does one typeset the following continued fraction as shown below? Source: Notes on continued fractions and recurrence sequences by Alfred van der Poorten. Note: Alf van der Poorten's style is ...
Américo Tavares's user avatar
15 votes
4 answers
6k views

TikZ Fill for Fraction Diagram

I'm trying to shade in one third of this circle. Obviously, it's not working. What did I do wrong? I got no error messages for either of my attempts in the code below, but neither filled anything in....
WeCanLearnAnything's user avatar
15 votes
3 answers
3k views

Frac or inference rule with dotted line

I would like to have a \frac or mathpartir-style inference rule with a dotted rather than solid line, so that I can put fractions into inference rules without overloading horizontal bar. The ...
Roly's user avatar
  • 4,231
15 votes
2 answers
1k views

Automatically add fractions and reduce the result (if neccessary)

I'm trying to figure out how to reduce fractions. Adding fractions is no problem, see this example: \documentclass[parskip]{scrartcl} \usepackage[margin=15mm]{geometry} \usepackage{tikz} \newcommand{...
Tom Bombadil's user avatar
  • 40.3k
14 votes
6 answers
11k views

too little space between the bar on the denominator and the horizontal line

Please see below: There is too little space between the horizontal line from \frac and the bar from \bar{h_1}. So, it is a little hard to read. Any alternative way to represent the upper bar? And, ...
Chang's user avatar
  • 9,588
14 votes
5 answers
9k views

Fraction with longer line

I'm trying to display some axioms and operational rules with LaTeX. Those are basically . They work quite well when used with frac, but it's not really nice, I'd like the fraction line to be a bit ...
Tim van Dalen's user avatar
14 votes
1 answer
18k views

displaystyle, dfrac, dcases

Am I correct in saying that the dcases environment replaces \frac with \dfrac? The replacement only occurs at the outer-most level of \frac, so if I have \documentclass{article} \usepackage{...
jrand's user avatar
  • 757
14 votes
2 answers
538 views

Aesthetic issue in fractions

While I was typing a document related to special relativity, I came across this slight misalignment in \frac{V}{c}(shown with huge text size so that the effect is easily seen) The 'problem' is that ...
typesanitizer's user avatar
14 votes
1 answer
598 views

Fractions' stretch and shrink [duplicate]

When TeX shrinks an equation, it only uses the shrink component of glue "at the outer level". For instance, numerator/denominator of fractions are not shrunk, as shown by the example below: first I ...
Bruno Le Floch's user avatar
13 votes
4 answers
2k views

In math mode, how do I make the fraction bar "invisible"?

I am trying to typeset a "fraction" without the fraction bar. I have tried to do this using the genfrac, but as in the example below, the numerator and denominator in genfrac are farther ...
Andrew's user avatar
  • 1,269
13 votes
1 answer
1k views

How and whether to fine-tune the vertical placement of a fraction line

This is a question about the aesthetics of mathematical typesetting, as well as a technical question about LaTeX. I'm writing a lot of expressions like this: (\log\frac{p_{i\to j}}{p_{j\to i}} in a ...
N. Virgo's user avatar
  • 4,289
12 votes
2 answers
1k views

How do I typeset continued fractions in Pringsheim's concise notation?

I would like to obtain the following formatting so as to write continued fractions in my equations without wasting vertical space. What I need is one command named \cFrac which writes one fraction ...
projetmbc's user avatar
  • 13.4k
12 votes
4 answers
838 views

How to align 2 equations in fraction at `=`?

I was trying to answer this question on another stackexchange forum, to say that they could use Latex instead, only to find I can't figure how to do this in Latex myself. Is it possible to have 2 ...
Nasser's user avatar
  • 20.3k
12 votes
2 answers
12k views

Practical consequences of using \over vs. \frac?

This question explains the difference between \over and \frac and it seems as though the most experienced members unanimously agree that \over is inferior (if not something to be outright regretted); ...
Rax Adaam's user avatar
  • 1,767
12 votes
3 answers
3k views

\frac command: height of the numerator vs height of denominator

I have the following code: \begin{equation} \underline{W}^1_{\,q,\rho} = \left\lceil \frac{\sum\limits_{v \in Q, v \neq q}\underline{C}_{\,v} + \sum\limits_{i=\rho+1}^{|\Omega^{(U)}_q|}p_i+ \sum\...
Roby's user avatar
  • 123
12 votes
2 answers
9k views

Increase size of fractions on multiple lines

Inside a matrix, I have some very loaded (subscripts, greek letters, \breve) fractions: \begin{equation} Q_r = \begin{bmatrix} \frac{\partial \breve{y}_r}{\partial \theta_1}\bigg|_{t_1} & \...
laureapresa's user avatar
11 votes
3 answers
2k views

Minus sign not aligning with fraction

When I use subscripts and superscript with \frac the numerator and denominator looks very tight, \documentclass[a4paper,12pt]{article} \usepackage{mathtools,amssymb} \begin{document} \[e^{-\frac{(x-\...
zmkm's user avatar
  • 379
11 votes
2 answers
14k views

How to make a nice fraction in subscript?

I wrote \begin{equation} M_{\frac{1}{2}}= ... \end{equation} but it doesn't look very nice. fraction is too small and and "tight", and when I add \dfrac that is too big. Any solution for this ?
Bonnie's user avatar
  • 389
11 votes
3 answers
490 views

uncommon form of continued-fraction expression

I have a copy of the text from the book to do. But I have been working in latex for a month and I have a problem with remaking these continued fractions. My code is looking like this: \[ \frac{n_{0}}{...
Cloudy's user avatar
  • 111
11 votes
1 answer
838 views

Why do \left( \frac{a}{b} \right) and \left( \frac{b}{a} \right) have different sizes?

Interestingly enough, I found that \left( \frac{a}{b} \right) and \left( \frac{b}{a} \right) have different sizes in Display Mode. What caused them to have a different size?
Benjamin's user avatar
  • 233
11 votes
2 answers
2k views

Color fraction bar

What would be the easiest way to create a fraction whose bar can be coloured as desired? I know one can use the \genfrac{left-delim}{right-delim}{thickness}{mathstyle}{numerator}{denominator} command ...
azetina's user avatar
  • 29.1k
10 votes
3 answers
433 views

Nicer alignment of x^*/2

I'm trying to typeset $\frac{x^*}{2}$, but I can't find a (simple) way to make the alignment look nice. So far, I've tried the following: \documentclass{article} \begin{document} \begin{equation} \...
Tomas Aschan's user avatar
  • 15.6k
10 votes
2 answers
2k views

Combinatorial notation (\choose) not working with \frac

I want to display the following $p_N= \frac{{200 \choose 11}{ 200 \choose {N-189}}}{200 \choose N}$ However, texmaker gives me this error: Does anybody know why is that? I have tried replacing the ...
Maths Wizzard's user avatar
10 votes
2 answers
1k views

Interpret a/(b+c) as \frac{a}{b+c}

Is it possible to make LaTeX, or a similar software, interpret a/b as \frac{a}{b}? Writing out (x+1)/((x)(x+2)) seems much easier than writing \frac{x+1}{(x)(x+2)}.
simplegamer's user avatar
10 votes
1 answer
26k views

Substitute \frac for a slash (/) only on inline math mode

I was wondering if there is a way to have LaTeX interpret $\frac{a}{b}$ as $a/b$, but \[\frac{a}{b}\] as \[\frac{a}{b}\]. It is a little tedious to change a inline equation $a/b$ to a display ...
josinalvo's user avatar
  • 1,177
10 votes
2 answers
3k views

Fraction with doubled line

Is there a way to make the fraction line look like the equality (=) sign, i.e., to have two parallel horizontal lines with a little gap in between? Many thanks!
Alex's user avatar
  • 437

1
2 3 4 5
12