As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [fractions]

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

Filter by
Sorted by
Tagged with
111 votes
7 answers
104k 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.2k
109 votes
4 answers
93k 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 Chung's user avatar
  • 1,217
83 votes
1 answer
90k 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,049
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
  • 13.6k
43 votes
3 answers
27k 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,116
42 votes
5 answers
80k 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
41 votes
2 answers
129k 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
  • 731
37 votes
1 answer
379k 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,571
35 votes
3 answers
56k 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
  • 363
35 votes
3 answers
38k 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
  • 13.6k
32 votes
7 answers
18k 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
32 votes
7 answers
74k 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
  • 513
27 votes
3 answers
1k 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,243
21 votes
6 answers
8k 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,681
19 votes
3 answers
18k 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
3 answers
64k 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
  • 181
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,533
17 votes
2 answers
611 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
966 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
  • 13.6k
16 votes
5 answers
41k 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
  • 28.3k
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
14k 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,365
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
2 answers
16k views

Continued fractions

How do I make this in LaTeX? I keep losing track of the brackets.
user121994's user avatar
15 votes
3 answers
2k 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,060
14 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
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,308
14 votes
5 answers
8k 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
17k 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
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
  • 39.7k
14 votes
2 answers
530 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
535 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
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
  • 3,835
12 votes
4 answers
767 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
  • 19.6k
12 votes
3 answers
2k 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
4 answers
1k 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,207
11 votes
3 answers
1k 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
  • 369
11 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
  • 12.9k
11 votes
3 answers
439 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
655 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
8k 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
1 answer
682 views

Correct typesetting of a formula with a long fraction

I have a two-column document and as you can see a long mathematical formula, consisting of a fraction, can't fit in the column width. What I don't know is what is the right way to typeset such kind ...
Adam's user avatar
  • 4,634
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
  • 28.3k
10 votes
3 answers
430 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.2k
10 votes
2 answers
12k 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
  • 369
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
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
11k 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,657
10 votes
1 answer
23k 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,117

1
2 3 4 5
11