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.

This question already has an answer here:

I would like to create a line with text below it as it can be seen often in contracts:

enter image description here

Ideally, that line would have a fillable element over it.

Minimal Working Example

The best I could come up (which is much better than I've expected as I started writing this question!) is:

\documentclass[a4paper]{scrartcl}
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf
\usepackage[margin=2.5cm]{geometry} %layout
\usepackage{csquotes}       % nice quotes
\usepackage{parskip}        % I don't want indentation

\begin{document}
\section{Untermietvertrag}
Im Folgenden wird ein Untermietvertrag zwischen (nachfolgend \enquote{Hauptmieter} genannt)\\

\line(1,0){250}\\
\vspace{-0.3cm}
{\scriptsize Name, Anschrift}\\

und (nachfolgend \enquote{Untermieter} genannt)\\

\line(1,0){250}\\
\vspace{-0.3cm}
{\scriptsize Name, Anschrift}\\

geschlossen.
\end{document}

which renders to

enter image description here

This solution does not have fillable form elements at the over the lines.

Is there probably a package that helps when you want to write a contract? Or a document class?

share|improve this question

marked as duplicate by Werner, yo', Masroor, Heiko Oberdiek, cslstr May 27 at 23:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

Not the prettiest, but:

\documentclass[a4paper]{scrartcl}
\usepackage[utf8]{inputenc} % this is needed for umlauts
\usepackage[ngerman]{babel} % this is needed for umlauts
\usepackage[T1]{fontenc}    % this is needed for correct output of umlauts in pdf
\usepackage[margin=2.5cm]{geometry} %layout
\usepackage{csquotes}       % nice quotes
\usepackage{parskip}        % I don't want indentation

\begin{document}
\section{Untermietvertrag}
Im Folgenden wird ein Untermietvertrag zwischen (nachfolgend\enquote{Hauptmieter} genannt)\\

\def\platzhalter{Max Mustermann}

\begin{tabular}{@{}p{\linewidth}}
   \platzhalter \\\hline
   \scriptsize Name, Anschrift \\
\end{tabular}

und (nachfolgend \enquote{Untermieter} genannt)\\

\def\platzhalter{}

\begin{tabular}{@{}p{\linewidth}}
   \platzhalter \\\hline
   \scriptsize Name, Anschrift \\
\end{tabular}

geschlossen.
\end{document}

I put the @{} at before the column definition, because I like my fields better when their description is not indented. Instead of \linewidth you can put any width you like, thus creating "small input fileds".

share|improve this answer

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