49

I'm trying to create a signature and date line in a document. I need the date line to always be in the same spot on the page no matter what name is under the signature line, such as:

----------------------   ----------------------
Representative           Date

----------------------   ----------------------
Program Manager          Date

Here is the code I currently have:

\makebox[2.5in]{\hrulefill} \hspace {1.0in}\makebox[2.5in]{\hrulefill} \\
User Representative \makebox[2.5in][r]{Date} \\

\vspace{.2in}
\makebox[2.5in]{\hrulefill} \hspace {1.0in}\makebox[2.5in]{\hrulefill} \\
Program Manager \makebox[2.5in][r]{Date} \

I want to be able to change the names, such as change Program Manager to Joe Foo and have the word 'Date' stay in the exact place.

Any help would be greatly appreciated. I'm still a newbie at TeX so please forgive my ignorance.

5 Answers 5

34

You can use \makebox to set the text in a fixed amount of space. Below I have defined a SignatureAndDate macro to make this easier to use:

enter image description here

I used the showframe package to show the margins so you can see the placement relative to that.

\documentclass{article}
\usepackage{showframe}
\newcommand*{\SignatureAndDate}[1]{%
    \par\noindent\makebox[2.5in]{\hrulefill} \hfill\makebox[2.0in]{\hrulefill}%
    \par\noindent\makebox[2.5in][l]{#1}      \hfill\makebox[2.0in][l]{Date}%
}%
\begin{document}
\SignatureAndDate{User Representative}
\vspace{.2in}
\SignatureAndDate{Program Manager}
\end{document}
2
  • Adding \usepackage{showframe} caused all text fields to be outlined in black for me? However, this command doesn't seem to be necessary and it can be removed.
    – MRule
    Commented Feb 28, 2022 at 9:02
  • @MRule: That to me indicates something else went wrong. To debug it, first check that the MWE given here works. If it does then, some other package or setting that you are using is the cause. I suggest poosting a question with a MWE including \documentclass and the appropriate packages that reproduces the problem. Including the output of \listfiles will help to figure out which package is the cause. Commented Feb 28, 2022 at 16:50
29

I'd use a tabular:

\documentclass{article}

\begin{document}

\noindent\begin{tabular}{ll}
\makebox[2.5in]{\hrulefill} & \makebox[2.5in]{\hrulefill}\\
User Representative & Date\\[8ex]% adds space between the two sets of signatures
\makebox[2.5in]{\hrulefill} & \makebox[2.5in]{\hrulefill}\\
Program Manager & Date\\
\end{tabular}

\end{document}

the output

For details on tabulars, I recommend section 2.11.6 of The Not So Short Introduction to LaTeX2e.

2
  • 1
    Can I use dotted line instead?
    – hola
    Commented Sep 8, 2020 at 5:03
  • 2
    @xxx--- Using \dotfill instead of \hrulefill seems to work.
    – doncherry
    Commented Sep 8, 2020 at 8:22
11

You can use the following command \titledate[<width>]{<title>} to draw your "title and date" configurations. Each are set it a tabular of width <width> (default is 2.5in).

enter image description here

\documentclass{article}
\newcommand{\titledate}[2][2.5in]{%
  \noindent%
  \begin{tabular}{@{}p{#1}@{}}
    \\ \hline \\[-.75\normalbaselineskip]
    #2
  \end{tabular} \hspace{1in}
  \begin{tabular}{@{}p{#1}@{}}
    \\ \hline \\[-.75\normalbaselineskip]
    Date
  \end{tabular}
}
\begin{document}

\titledate{User Representative}

\titledate{Program Manager}

\titledate[2in]{My title}

\end{document}

Modifying the width parameter adjusts both sides to the new <width>.

3

I use the following macros \signatureline and signaturedash for this. These allow me to set the line parameters quite flexibly.

\documentclass{article}

\usepackage{xparse}

\makeatletter
  \newcommand*\signaturelinewidth{5cm}
  \newcommand*\signaturelineheight{.4pt}
  \newcommand*\signaturedashleaderatom{\kern .1pt.\kern .1pt}
  \newcommand*\signaturelineraise{.4ex}
  \newcommand*\signaturelabelindent{.5cm}
  \newcommand*\signaturetextindent{}
  \NewDocumentCommand\signatureline{
    O{\signaturelinewidth}      % line width
    O{\signaturelabelindent}    % label margin
    O{%                           text indentation
      \ifx\@empty\signaturetextindent
        .5\dimexpr #2\relax
      \else
        \signaturetextindent
      \fi
    }
    m                           % label
    O{\signaturelineheight}     % line height
    O{\signaturelineraise}      % line raise
    D||{}                       % text
  }{%
    \parbox[t]{#1}{%
      \leftskip #3%
      \mbox{\strut #7}%
      \vskip -#6%
      \hrule height #5%
      \vskip #6%
      \scriptsize
      \leftskip #2%
      \rightskip #2%
      \strut #4%
    }%
  }
  \NewDocumentCommand\signaturedash{
    O{\signaturelinewidth}      % line width
    O{\signaturelabelindent}    % label margin
    O{%                           text indentation
      \ifx\@empty\signaturetextindent
        .5\dimexpr #2\relax
      \else
        \signaturetextindent
      \fi
    }
    m                           % label
    O{\signaturedashleaderatom} % leader atom
    O{\signaturelineraise}      % line raise
    D||{}                       % text
  }{%
    \parbox[t]{#1}{%
      \leftskip #3%
      \mbox{\strut #7}%
      \vskip -#6%
      \leftskip 0pt%
      \hrule height 0pt%
      \leavevmode\cleaders\hbox{#5}\hfill\kern 0pt%
      \hrule height 0pt%
      \vskip #6%
      \scriptsize
      \leftskip #2%
      \rightskip #2%
      \strut #4%
    }%
  }
\makeatother

\begin{document}\makeatletter

Sign here:
\signatureline[3cm]{Date}|\today|
\signatureline[6cm]{Pat McDaniel\\Program Manager}

Sign here:
\signaturedash[3cm]{Date}|\today|
\signaturedash[6cm]{Pat McDaniel\\Program Manager}

Sign here:
\signaturedash[3cm]{\centering Date}[\kern 1pt\rule{.5em}{1ex}\kern 1pt]|\today|
\signaturedash[6cm]{\centering Pat McDaniel\\Program Manager}[\kern 1pt\rule{1em}{1ex}\kern 1pt]

\end{document}

MWE output

2
  • 1
    Looks a little complicated!
    – hola
    Commented Sep 8, 2020 at 5:03
  • @xxx--- Well, more functionality requires more complex macros. If you don't need this functionality, a different solution may be enough for you. (You could of course reduce this one, but I don't see the point of that.)
    – schtandard
    Commented Sep 8, 2020 at 9:37
0

Slightly improving David Carlisle's Answer so that you only need to specify the width in the tabular header

\documentclass{article}

\begin{document}
\noindent
\begin{tabular}{p{2.5in}p{2.5in}}
    \hrulefill          & \hrulefill \\
    User Representative & Date       \\[8ex]% adds space between the two sets of signatures
    \hrulefill          & \hrulefill \\
    Program Manager     & Date       \\
\end{tabular}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .