I am using the code from egreg (a new command, xabove) from my previous question to typeset a "fraction" without the fraction bar.
In the following MWE, would there be a straightforward way to horizontally align the colons (:) in "A: 3.14" and "B: 6.28"? Or would I need to use a different definition of xabove?
\documentclass[oneside,11pt]{book}
\usepackage[semibold,tt=false]{libertine}
\usepackage{libertinust1math}
\usepackage[T1]{fontenc}
\usepackage[
expansion = false ,
tracking = smallcaps ,
letterspace = 40 ,
final
]{microtype}
\usepackage{booktabs}
% egreg's answer (https://tex.stackexchange.com/a/590218/15622)
\makeatletter
\DeclareRobustCommand{\xabove}[2]{{%
\mathpalette\fix@genfrac{{#1}{#2}}%
}}
\newcommand{\fix@genfrac}[2]{\fix@@genfrac#1#2}
\newcommand{\fix@@genfrac}[3]{%
\genfrac{}{}{\fix@@@genfrac{#1}}{}{#2}{#3}%
}
\newcommand{\fix@@@genfrac}[1]{%
\ifx#1\displaystyle 0pt\else
\ifx#1\textstyle -\fontdimen8\textfont2 \else
\ifx#1\scriptstyle -\fontdimen8\scriptfont2 \else
0pt % but doesn't really work :-(
\fi\fi\fi
}
\makeatother
\begin{document}
$\xabove{\textit{A}:;3.14}{\textit{B}:;6.28}$
\end{document}




array. – egreg Mar 29 '21 at 16:56$\xabove{\textit{\makebox[3mm]{A:}}\;3.14}{\textit{\makebox[3mm]{B:}}\;6.28}$– Ivan Mar 29 '21 at 17:00