6

1) How can we control the vertical alignment of this fraction line?

2) I'm also looking for a way to make the ends of the fraction line round.

I know doing these will cause problems. I'm just wondering how to do something like this.

enter image description here

2
  • 3
    By design, TeX places the fraction line on the math axis. Where is the math axis, you may ask? The - symbol is placed on the math axis, and the = symbol straddles the math axis. That way, in the expression \frac{1}{2}-\frac{1}{3}, the fraction lines and the - symbol are all on the same level. Any other positioning choice would look both weird and wrong. Are you thus asking how to shift the entire math axis?
    – Mico
    Oct 15, 2021 at 6:55
  • I'm asking for a way to adjust the height of the expressions in the numerator and denominator of this fraction line. Or a new fraction line definition where we can control everything... @Mico
    – Pitaya88
    Oct 15, 2021 at 7:41

1 Answer 1

5

The font parameters 8,9,10,11,12 determine the position of numerator and denominator see

What do different \fontdimen<num> mean

You can not draw the rule using different style unless you abandon the TeX fraction primitives alltogether and draw the rule by hand using tikz or similar. (the rule thickness is however settable).

enter image description here

\documentclass{article}

\begin{document}


$\frac{1}{2}$
\quad
\fontdimen9\textfont2=10pt
$\frac{1}{2}$
\end{document}
6
  • Is it possible to do this for "only" one fraction line? @David Carlisle
    – Pitaya88
    Oct 15, 2021 at 8:14
  • 1
    @Pitaya88 you can do it in a group so it only affects one math list but not much point doing it for a single fraction would be easier to do \frac{\rule[10pt]{0pt}20pt}1}{2} or whatever rule you want to force some padding Oct 15, 2021 at 8:19
  • \frac{\rule[10pt]{0pt}20pt}1}{2} this code not worked @David Carlisle
    – Pitaya88
    Oct 15, 2021 at 8:41
  • 1
    @Pitaya88 typo, $\frac{\rule[-10pt]{0pt}{20pt}1}{2}$ Oct 15, 2021 at 9:16
  • 1
    don't ask new questions in comments (but I have no idea what you mean by that sorry) the rule is aligned on the math axis so all you can do (if using tex fraction primitives) is move the text relative to that rule. Oct 15, 2021 at 9:48

You must log in to answer this question.

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