[Tex/LaTex] Creating a right aligned signature block

horizontal alignmentsignaturesspacing

I would like to create a signature block for the title page of my dissertation.

A requirement is that the block must be aligned with the right side of the page. Within the block itself, everything must be aligned left as it appears here. Also, the vertical space between a professor’s name and the line above it should not be as wide as shown in my below example.

Currently my efforts looks something like this:

_________________________

Chairperson, Professor A

_________________________

Professor B

_________________________

Professor C

Thank you very much for your help!

Best Answer

At first I came up with this:

\documentclass{article}

%-------Definition of \myrule--
 \def\myrule#1#2#3{{\hskip#1in{\hbox to #2in%
{\leaders\hbox to .00625in{\hfil.\hfil}\hfill}}%
 \par\hskip#1in#3\vskip1cm}}
%------------------------------

\begin{document}

\hfill margin

\myrule{2.56}{2}{Chairperson, Professor A}
\myrule{2.56}{2}{Professor B}
\myrule{2.56}{2}{Professor C}

\end{document}

This makes signature lines the same thickness as a period. See TeX Primitive Control Sequences-leaders.

\hfill margin is there to show you where the right margin is, take it out when you have the signature blocks placed correctly.

The first variable of \myrule takes the horizontal placement of the left edge of the signature line in inches; the second variable is the length of the signature line; and the third takes the name of the signatory.

Producing:

enter image description here

Which is pretty good at placing the signature block where one wants it.

But the OP really didn't ask that, he wants it to be automatic.

Enclosing variables #2-#5 (the variables place under the signature line) in a \vtop box, preceded by \hfill, placed the \vtop box containing the information under the signature against the right margin. Variable #1 is used as both to size the \vtop box hsize=#1in, and the definition of \mynewrule, \hbox to #1in.

So both the signature line, contained in the \hbox, and the material under the signature line, contained in the \vtop box will be the same length. This allows the \hfill in both the signature line definition, and the definition of what is under the signature line, to push them as far to the right as the length given in variable #1 permits, but correctly aligned per the OP's request:

\documentclass{article}

%Definition of right aligned signature block
%%%Defined the signature line using \leaders%%%
\def\mynewrule#1{\hbox to #1in{\leaders\hbox to 0.00625in{\hfil.\hfil}\hfill}}
%%%%Defined the signature line with \hfill%%%   
\def\rnewrule#1{\hfill\mynewrule{#1}}
%%%%Defined block to include rule and information%%%
\def\rsignblock#1#2#3#4#5{\rnewrule{#1}\par        
\hfill\vtop{\hsize=#1in\noindent{#2}\par\noindent{#3}%
     \par\noindent{#4}\par\noindent{#5}}%
 \vskip1cm}
%-------------------------------------------X

\begin{document}

%-to demonstrate where the margin is---X
\hfill margin\par
%--------------------------------------X

\rsignblock{2}{Chairperson, Professor A}{}{}{}
\rsignblock{2}{Professor B}{}{}{}
\rsignblock{2}{Professor C}{}{}{}
\rsignblock{2}{Professor D}{Head of the Institute of Pearls}{50 Rainbow Street}{Succhitash, OH}

\end{document}

Which produces:

enter image description here

Same result, but works differently, now there is no variable to place the block with relation to the left margin, only the single length variable, the length of the signature line/block in inches, and the signature block is automatically placed flush with the right margin.

The rest of the fields, #2,#3,#4,#5 are for information that is under the signature line, as shown by "Professor D".

Related: How to write macro with variable amount of text variables

Related Question