I would like to have a signature line for my thesis. I tried to use \hrulefill, but it creates a long line. Is there any way to have a short line?
Asked
Active
Viewed 2,278 times
3
1 Answers
4
The following code could be helpful. It defines the \signature-macro that does the required job.
\documentclass{article}
\newbox\namebox
\newdimen\signboxdim
\def\signature#1{%
\setbox\namebox=\hbox{#1}
\signboxdim=\dimexpr(\wd\namebox+1cm)
\parbox[t]{\signboxdim}{%
\centering
% \mbox{}\leaders\hbox to .4em{\hss.\hss}\hskip\nameboxdim\mbox{}\\ % for dots
\hrulefill\\ % for a line
#1
\par}%
}
\begin{document}
\signature{Abraka Dabra}
\end{document}
Marian G.
- 1,951
- 1
- 9
- 14

\rule{4cm}{0.4pt}. – Andrew Swann Jul 11 '18 at 11:32