Skip to main content
added 134 characters in body
Source Link
user1362373
  • 3.1k
  • 3
  • 26
  • 44

After unsuccessfully playing around trying to find a fix, I searched tex.stackexchange.com once more and found too little space between the bar on the denominator and the horizontal line, where Werner proposed building on amsmath's \genfrac command thus:

\newcommand{\myfrac}[3][0pt]{\genfrac{}{}{}{}{\raisebox{#1}{$#2$}}{\raisebox{-#1}{$#3$}}} 

This does nearly all of what I want. (Separating the amounts by which the boxes are raised and lowered is a trivial extension.) The updated MWE is:

\documentclass{article} \usepackage{amsmath} \newcommand{\myfrac}[3][0pt]{\genfrac{}{}{}{}{\raisebox{#1}{$#2$}}{\raisebox{-#1}{$#3$}}} \begin{document} \begin{equation*} t = \frac{\dfrac{T_1}{T_2}}{1+\dfrac{Q_1}{Q_2}} \end{equation*} \begin{equation*} t = \myfrac[7pt]{\dfrac{T_1}{T_2}}{1+\dfrac{Q_1}{Q_2}} \end{equation*} \end{document} 

and gives

enter image description here

Separating the amounts by which the boxes are raised and lowered is a trivial extension:

\usepackage{twoopt} \newcommandtwoopt{\myfrac}[4][0pt][0pt]{\genfrac{}{}{}{}{\raisebox{#1}{$#3$}}{\raisebox{-#2}{$#4$}}} 

After unsuccessfully playing around trying to find a fix, I searched tex.stackexchange.com once more and found too little space between the bar on the denominator and the horizontal line, where Werner proposed building on amsmath's \genfrac command thus:

\newcommand{\myfrac}[3][0pt]{\genfrac{}{}{}{}{\raisebox{#1}{$#2$}}{\raisebox{-#1}{$#3$}}} 

This does nearly all of what I want. (Separating the amounts by which the boxes are raised and lowered is a trivial extension.) The updated MWE is:

\documentclass{article} \usepackage{amsmath} \newcommand{\myfrac}[3][0pt]{\genfrac{}{}{}{}{\raisebox{#1}{$#2$}}{\raisebox{-#1}{$#3$}}} \begin{document} \begin{equation*} t = \frac{\dfrac{T_1}{T_2}}{1+\dfrac{Q_1}{Q_2}} \end{equation*} \begin{equation*} t = \myfrac[7pt]{\dfrac{T_1}{T_2}}{1+\dfrac{Q_1}{Q_2}} \end{equation*} \end{document} 

and gives

enter image description here

After unsuccessfully playing around trying to find a fix, I searched tex.stackexchange.com once more and found too little space between the bar on the denominator and the horizontal line, where Werner proposed building on amsmath's \genfrac command thus:

\newcommand{\myfrac}[3][0pt]{\genfrac{}{}{}{}{\raisebox{#1}{$#2$}}{\raisebox{-#1}{$#3$}}} 

This does nearly all of what I want. The updated MWE is:

\documentclass{article} \usepackage{amsmath} \newcommand{\myfrac}[3][0pt]{\genfrac{}{}{}{}{\raisebox{#1}{$#2$}}{\raisebox{-#1}{$#3$}}} \begin{document} \begin{equation*} t = \frac{\dfrac{T_1}{T_2}}{1+\dfrac{Q_1}{Q_2}} \end{equation*} \begin{equation*} t = \myfrac[7pt]{\dfrac{T_1}{T_2}}{1+\dfrac{Q_1}{Q_2}} \end{equation*} \end{document} 

and gives

enter image description here

Separating the amounts by which the boxes are raised and lowered is a trivial extension:

\usepackage{twoopt} \newcommandtwoopt{\myfrac}[4][0pt][0pt]{\genfrac{}{}{}{}{\raisebox{#1}{$#3$}}{\raisebox{-#2}{$#4$}}} 
Source Link
user1362373
  • 3.1k
  • 3
  • 26
  • 44

After unsuccessfully playing around trying to find a fix, I searched tex.stackexchange.com once more and found too little space between the bar on the denominator and the horizontal line, where Werner proposed building on amsmath's \genfrac command thus:

\newcommand{\myfrac}[3][0pt]{\genfrac{}{}{}{}{\raisebox{#1}{$#2$}}{\raisebox{-#1}{$#3$}}} 

This does nearly all of what I want. (Separating the amounts by which the boxes are raised and lowered is a trivial extension.) The updated MWE is:

\documentclass{article} \usepackage{amsmath} \newcommand{\myfrac}[3][0pt]{\genfrac{}{}{}{}{\raisebox{#1}{$#2$}}{\raisebox{-#1}{$#3$}}} \begin{document} \begin{equation*} t = \frac{\dfrac{T_1}{T_2}}{1+\dfrac{Q_1}{Q_2}} \end{equation*} \begin{equation*} t = \myfrac[7pt]{\dfrac{T_1}{T_2}}{1+\dfrac{Q_1}{Q_2}} \end{equation*} \end{document} 

and gives

enter image description here