Text FormattingDiagonal fractions

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
john.will.wright
Posts: 2
Joined: Wed Oct 06, 2010 3:28 pm

Diagonal fractions

Post by john.will.wright »

Hello,

I'm trying to write a fraction commonly used for distance and weight, e.g. 3/8". However I can't find a way on LaTeX to write it with the 3 in the top left and 8 on the bottom right, so it'd look a bit like:

3/
/8

as you'd see on say a measure of weight for your weighing scale as opposed to the traditional fraction of one vertically above the other (\frac{}{}) or the solidus with letter horizontally next to each other (3 / 8)

Does anyone know how to do this?

John

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Diagonal fractions

Post by gmedina »

Hi,

perhaps \nicefrac is what you are looking for:

Code: Select all

\documentclass{article}
\usepackage{units}

\begin{document}

\nicefrac{3}{8}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
john.will.wright
Posts: 2
Joined: Wed Oct 06, 2010 3:28 pm

Re: Diagonal fractions

Post by john.will.wright »

Exactly what I was looking for, thank you very much
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Diagonal fractions

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic accordingly as clearly written in the Board Rules (to be read before posting). Please keep that in mind for the future so that further reminders will not be necessary.


Best regards and welcome to the board
Thorsten
Post Reply