tags:

views:

745

answers:

2

When I'm writing my laboratory reports in LaTeX i recently had to make a signature feld 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 come up whith 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 made me able to type;

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

To acheve the wanted result. If any of you have anoter way of doing this, not using the letter document class. I'll be realy glad to hear your responce.

+2  A: 

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.

dmckee
+1  A: 

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}
}
las3rjock