Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a signature field in LaTeX

Tags:

latex

When I'm writing my laboratory reports in LaTeX, I recently had to make a signature field on the form.

                   Trondheim 4.september 2009


______________________         ___________________________
  Ivar Nesje                      Team mate's name

The problem was that I could not find a easy way to do it so after a lot of searching on the net I came up with this simple solution

\newcommand{\doubleSignature}[3]{
\begin{minipage}[c]{\textwidth}
\vspace{2cm}

\makebox[12cm][c]{
 #1, \today 
}
\vspace{3cm}

\makebox[12cm][c]{
\hfill \makebox[5cm][c] {\hrulefill} \hfill \makebox[5cm][c] {\hrulefill} \hfill
}
\makebox[12cm][c]{
\hfill #2 \hfill #3 \hfill
}
\vspace{1cm}
\end{minipage}
}

This allowed me to type;

\doubleSignature{Trondheim}{Ivar Nesje}{Team mate's name}

To achieve the wanted result. If any of you have another way of doing this, not using the letter document class, I'd be really glad to hear your suggestions.

like image 235
ivarne Avatar asked Sep 16 '09 23:09

ivarne


People also ask

How do I create a signature field?

On the Prepare Form ribbon over the top of the document, click the icon for Add a digital signature field. Your mouse will turn into a light blue box for you to Left mouse click > Drag a box > Release. (This is where you want the digital signature in your file).

What is a signature field?

Signature fields are specialized fields that allow users to sign a form with a stylus, finger, or by entering their name. If desired, you can configure signatures on form to be unmodifiable after the form is submitted.


2 Answers

I think I would work from \rule[<raise>]{<width>}{<thickness>}. Because the reference point is the lower left corner, you probably don't even need the optional raising argument. Something like:

\newcommand{\doublesignature}[3][Ivar Nesje]{%
  \parbox{\textwidth}{
    \centering #3 \today\\
    \vspace{2cm}

    \parbox{7cm}{
      \centering
      \rule{6cm}{1pt}\\
       #1 
    }
    \hfill
    \parbox{7cm}{
      \centering
      \rule{6cm}{1pt}\\
      #2
    }
  }
}

I've re-ordered your arguments to make your name optional.

like image 119
dmckee --- ex-moderator kitten Avatar answered Sep 20 '22 05:09

dmckee --- ex-moderator kitten


Assuming there aren't additional formatting restrictions, I probably would have used a tabular environment instead of boxes, and I would have used \rule{length}{width} instead of \hrulefill:

\newcommand{\doubleSignature}[3]{
\vspace{2cm}

\begin{center}
    #1, \today
\end{center}
\vspace{3cm}

\noindent
\begin{tabular}{lcl}
    \rule{5cm}{1pt} & \hspace{2cm} & \rule{5cm}{1pt} \\
    #2 & & #3
\end{tabular}
\vspace{1cm}
}
like image 23
las3rjock Avatar answered Sep 18 '22 05:09

las3rjock