Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaTeX force slash fraction notation

Tags:

latex

Is it possible to force latex to use the slash notation for a fraction (i.e., separating the numerator and denominator with a slash instead of stacking them on top of one another)? Just using a slash (/) instead of \frac looks bad because the slash does not size itself properly.

like image 508
Dan Avatar asked Sep 17 '09 03:09

Dan


People also ask

How do you write a fraction inline in LaTeX?

To write a fraction, you use the code \frac{expression in the numerator}{expression in the denominator} . Formulas that appear in text are called inline. Inline formulas are sometimes squashed to avoid altering the height of the lines.

How do you do a long slash in LaTeX?

It is also possible to put the equation into the brackets and then use the \middle/ instead of the regular slash. Or if you do not need any visible brackets, you may use the "fake" brackets instead: \left. \int \limits_{a}^{b} \frac{x}{y} \middle/ \int \limits_c^d \frac{x}{y} \right.


1 Answers

Here is a command that might work for you:

\newcommand{\slfrac}[2]{\left.#1\middle/#2\right.}

It sizes the slash based on the size of the numerator and denominator.

like image 85
Rob Hyndman Avatar answered Sep 29 '22 07:09

Rob Hyndman