3
$\begingroup$

What I'm looking for is that all numbers that are not exponentials have the same font size (the same as the paragraph they are in). Currently when testing this, I try using two fractions within a third, like so:

\frac{\frac{1}{2}}{\frac{3}{4}}

$$ \frac{\frac{1}{2}}{\frac{3}{4}}+2 $$

All four numbers above are smaller than this surrounding text (70.7%). I have tried setting scale and minScaleAdjust to 100 which made a slight difference, but all the text is still smaller for each fraction level. Messing around with inline, block, \displaystyle and \dfrac didn't help either.

For the above example using \large modifies everything up to 95.5% of font size, but that's something I'd have to add manually to each fraction (plus \normalsize for the rest of the expression) and it's still not 100%.. very hacky.

\large\frac{\frac{1}{2}}{\frac{3}{4}}\normalsize+2

$$ \large\frac{\frac{1}{2}}{\frac{3}{4}}\normalsize+2 $$

Is there a setting/solution to force all numbers having the same size? Thanks.

$\endgroup$
4
  • 3
    $\begingroup$ try \dfrac instead of \frac... $\endgroup$
    – Grigory M
    Jan 6, 2015 at 0:11
  • $\begingroup$ Aww, I only tried \dfrac on the main one and not the two within. Thanks a lot! The sizes are nice now, but commas are no longer treated as decimal signs. :( $\endgroup$
    – LGT
    Jan 6, 2015 at 1:11
  • 1
    $\begingroup$ Just don't write a horror like that... $\endgroup$ Jan 6, 2015 at 8:39
  • $\begingroup$ As for "that's something I'd have to add manually to each fraction". Macros are useful (among other things) for situations like this. When you are not sure how to typeset something in TeX, just make a macro. Then you only need to make a change in one place, after you find out better way. $\endgroup$ Jan 6, 2015 at 11:15

2 Answers 2

8
$\begingroup$

Just use \dfrac instead of \frac.

P.S. I hope that this is only a minimal example; if you actually plan to use $\dfrac{\dfrac ab}{\dfrac cd}$ — please don't, it takes a lot of vertical space and looks ugly (even something like $\dfrac{a/b}{c/d}$ is better).

$\endgroup$
2
  • $\begingroup$ Ah, but I need this for a math site, asked specifically about this kind of expressions and there will be a few. $\endgroup$
    – LGT
    Jan 6, 2015 at 23:49
  • $\begingroup$ I disapprove of \dfrac as you are forcing $\TeX$ to do something it wasn't meant to do. A better solution would be to put your fractions on a line of their own $$\frac{\frac{a}{b}}{\frac{c}{d}}$$. This is rendered like \dfrac. For a lengthier discussion, see here. $\endgroup$
    – user1729
    Jan 7, 2015 at 9:59
5
$\begingroup$

Actually, \cfrac is better suited for this: $$\cfrac{\cfrac12}{\cfrac34}$$

$\endgroup$
3
  • $\begingroup$ I appreciate this as well. I tried it and it works!.. except for the commas, but perhaps we won't be using any in fractions. $\endgroup$
    – LGT
    Jan 6, 2015 at 5:27
  • 3
    $\begingroup$ @LGT, use braces around the commas: \frac{1{,}23}{45{,}6} produces $\frac{1{,}23}{45{,}6}$. You should need this in math mode whether the number is in a fraction or not, as otherwise $\rm\TeX$ thinks the comma is a separator between numbers, which gets a little extra space. $\endgroup$ Jan 6, 2015 at 12:35
  • $\begingroup$ Thank you. I ended up redefining digits and numbers (works) but I'll remember this as well. $\endgroup$
    – LGT
    Jan 6, 2015 at 23:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .