

% ==========================================================================================================
% Vertical Centering of Text
% ----------------------------------------------------------------------------------------------------------
\ProvidesPackage{cxltx-style-pushraise}
\usepackage{cxltx-style-convert-to}

\makeatletter
\newcommand{\prFontSizePt}{\f@size}
% \newcommand{\prFontSizeSp}{\ctConvertTo{sp}{\f@size pt}}
\newcommand{\prFsizeMm}{\ctConvertTo{mm}{\f@size pt}mm}

% \def\prCenter{\@ifstar\@@cvCenter\@cvCenter}
\newdimen\pr@TextWidth
\newdimen\pr@Height
\newdimen\pr@WidthA
\newdimen\pr@WidthB

% \newcommand{\@cvCenter}[1]{%
%   % {\setlength{\fboxsep}{0mm}\fbox{\parbox[c][\@fsize][c]{\@fsize}{#1}}}%
%   {\parbox[c][\f@size pt][c]{\f@size pt}{#1}}%
%   }
% \newcommand{\@@cvCenter}[1]{%

% ----------------------------------------------------------------------------------------------------------
\newcommand{\prCenter}[1]{%
  {\settowidth{\pr@TextWidth}{#1}\parbox[c]{\pr@TextWidth}{#1}}%
  }

% ----------------------------------------------------------------------------------------------------------
\newcommand{\prRaise}[2]{%
  \setlength{\pr@Height}{\f@size pt}%
  \raisebox{#1\pr@Height}{#2}%
  }

% ----------------------------------------------------------------------------------------------------------
% This (makeshift?) version reverses the order of arguments, so you'd say `\prRaiseBy{X}{0.2}` instead of
% `\prRaise{0.2}{X}`. The sole reason for this command is interoperability with `CXLTX`; specifically, you
% you can now call an external command in the first argument and use the result in the second:
%
%     A \prRaiseBy{\node{gimme-five}{-0.5}CONTEXT}{\cxltxR} C
%                  '---------------------'        '-------'
%                    factor computation            factor
%                                                   usage
\newcommand{\prRaiseBy}[2]{%
  \setlength{\pr@Height}{\f@size pt}%
  \raisebox{#2\pr@Height}{#1}%
  }

% ----------------------------------------------------------------------------------------------------------
\newcommand*{\prPush}[2]{%
  \settowidth{\pr@WidthA}{#2}%
  \setlength{\pr@WidthB}{\f@size pt}%
  \makebox[\pr@WidthA]{\hspace*{#1\pr@WidthB}#2}%
}

% ----------------------------------------------------------------------------------------------------------
\newcommand{\prPushRaise}[3]{%
  \prPush{#1}{\prRaise{#2}{#3}}%
  }


\makeatother
