I need to create lines for signatures. I need 3 of them with different texts below them, but i want all lines to have the same length and the texts centered below them.
Tables with \hline
s made the horizontal placement easy, but then the vertical placement of the lines was not as good as with \overline
.
The following code achieves centering the text under the (over-)line with length of xDatum/Unterschrift Ausbildungsleiterx
, but the question is: is there a better way to do it, because this feels like a very 'odd' solution.
\documentclass{article}
\usepackage{calc}
\newcommand{\strich}[1]{%
\makebox[\width][c]{%
\makebox[0pt][l]{%
\makebox[\widthof{xDatum/Unterschrift\ Ausbildungsleiterx}]{%
#1%
}%
}%
\makebox{%
\ensuremath{%
\overline{%
\phantom{%
\mathrm{xDatum/Unterschrift\ Ausbildungsleiterx}%
}%
}%
}%
}%
}%
}
\begin{document}
\begin{center}
\footnotesize{\strich{Datum/Unterschrift\ Auszubildender}}
\vspace{2.5cm}\\
\footnotesize{\strich{Datum/Unterschrift\ Betreuer}\hfill\strich{Datum/Unterschrift\ Ausbildungsleiter}}
\end{center}
\end{document}
Notice, that Datum/Unterschrift Ausbildungsleiter
is the longest of the 3 texts i need to place under the signature-lines.
Best Answer
You can create a
\parbox
and insert a\rule
: