Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Found a nice piece of code here dynamic signature/date line and modified it to this:

\newcommand*{\DateAndSignature}[1]{%
..\newline
  \par\noindent\makebox[2.25in]{Musterstadt, den}{\hrulefill} \hfill\makebox[2.25in]{\hrulefill}%
  \par\noindent\makebox[2.25in][l]{} \hfill\makebox[2.25in][c]{#1}%
}%

But the result is not exactly as I would like it to be, which would be:

Musterstadt, den ______________      _______________________________
                                                Muster Name

The two parts shall be divided to left and right, as an extra, there might be an indentation to the usual paragraph width, but this is optional.

My problem is the line after den, can't get it there in a proper way - any ideas?

Thanks in advance!

Edit:

combined solution, thanks to the given answers:

\documentclass[a4paper,10pt]{scrreprt}
\usepackage[utf8x]{inputenc}
\newcommand*{\DateAndSignature}[1]{%
  \rule{0pt}{2\baselineskip} %
  \par\noindent\makebox[2.25in]{\indent Musterstadt, den \hrulefill} \hfill\makebox[2.25in]{\hrulefill}%
  \par\noindent\makebox[2.25in][l]{} \hfill\makebox[2.25in][c]{#1}%
}%

\begin{document}
\DateAndSignature{Muster Name}
\end{document}
share|improve this question

2 Answers 2

up vote 2 down vote accepted

enter image description here

Please post complete documents not just fragments that can't be run. I just moved a brace so the rule is in the fixed size box, which is I think what you want.

\documentclass{article}

\newcommand*{\DateAndSignature}[1]{%
..\newline
  \par\noindent\makebox[2.25in]{Musterstadt, den \hrulefill} \hfill\makebox[2.25in]{\hrulefill}%
  \par\noindent\makebox[2.25in][l]{} \hfill\makebox[2.25in][c]{#1}%
}%


\begin{document}


\DateAndSignature{Muster Name}

\end{document}
share|improve this answer

This will use the full line width. Adjust the fractions of \columnwidth and the invisible rule for "vertical spacing" to suit.

\documentclass{article}
\usepackage{lipsum}

\newcommand*{\DateAndSignature}[1]{%
  \par\nobreak\noindent
  \makebox[.55\columnwidth]{%
  \indent % comment out this line if you don't want the normal indentation
    \rule{0pt}{2\baselineskip}% vertical spacing
    Musterstadt, den \hrulefill}%
  \hfill
  \begin{tabular}[t]{@{}c@{}}\makebox[.42\columnwidth]{\hrulefill}\\#1\end{tabular}\par
}

\begin{document}
\lipsum[2]

\DateAndSignature{Muster name}

\end{document}

lipsum is just to show the result.

enter image description here

share|improve this answer
    
thanks for the alternative! Wish I could split the accept, but Davids attempt is the easiest way to adapt the code, however I used some of your parts to improve the formatting. –  Jook Oct 1 '12 at 11:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.