4

enter image description hereIn my header of a page in documentclass scrbook there should be two horizontal lines with text in between.

This was my idea:

\begin{minipage}{12cm}
{\color{black}\rule{12cm}{0.7mm}}
\begin{center}
{\Large\textbf{Musterklausur Nr. 1}\\[3mm]
\textbf{Lösungsvorschlag}}
\end{center}
{\color{black}\rule{12cm}{0.7mm}}
\end{minipage}

Before i have made a pagebreak. My problem ist that the folowing text has no distance to the lower line. When I put a \vspace*{4mm} in the text goes down till the half of the page.

Can somebody help?

2
  • 2
    Please edit your question so that it includes a complete example code that reproduces the problem. Without this it may be difficult for anyone to help you. Aug 25, 2014 at 13:52
  • You should configure things so that e.g. \maketitle does the formatting rather than marking it up manually. But, as already pointed out, it is difficult to advise how best to do that without a Minimum Working Example.
    – cfr
    Aug 25, 2014 at 15:15

2 Answers 2

3

This solution provides two ways -- first with a tabular environment and second with an adjustable tcolorbox environment.

\documentclass{scrbook}%
\usepackage{tcolorbox}%
\usepackage{colortbl}%
\usepackage{xcolor}%
\usepackage[utf8]{inputenc}
\usepackage{blindtext}%

\newcounter{musterklausur}

\newlength{\kopfbreite}
\setlength{\kopfbreite}{0.9\textwidth}%
\newlength{\liniendicke}
\setlength{\liniendicke}{0.7mm}%

\newcommand{\musterklausurkopf}{%
\stepcounter{musterklausur}%
\begin{center}
\arrayrulecolor{black}%
\setlength{\arrayrulewidth}{\liniendicke}%
\begin{tabular}{p{\kopfbreite}}
\hline 
\tabularnewline
\multicolumn{1}{c}{\Large \textbf{Musterklausur Nr. \themusterklausur}}\tabularnewline %\[3mm]
\tabularnewline
\multicolumn{1}{c}{\Large \textbf{Lösungsvorschlag}}\tabularnewline
\tabularnewline
\hline
\end{tabular}%
\end{center}%
}%


\newcommand{\musterklausurkopfalternativ}{%
\stepcounter{musterklausur}%
\begin{center}
\begin{tcolorbox}[width=\kopfbreite,arc=0mm,auto outer arc,boxsep=0.3cm,toprule=0.7mm,leftrule=0pt,bottomrule=0.7mm,rightrule=0pt,colframe=blue]
\begin{center}
\Large \textbf{Musterklausur Nr. \themusterklausur}\par
\vspace{\baselineskip}%
\Large \textbf{Lösungsvorschlag}
\end{center}
\end{tcolorbox}%
\end{center}
}%



\setlength{\parindent}{0pt}% No indentation

\begin{document}
\musterklausurkopf%


Aufgabe 1 % Use a problem/answer package for this!)

\blindtext

\newpage

\musterklausurkopfalternativ%


Aufgabe 2 % Use a problem/answer package for this!)

\blindtext



\end{document}

enter image description here

2

this work for me:

\documentclass{article}
    \begin{document}     
\noindent\begin{minipage}{12cm}
\rule{12cm}{0.7mm}
    \begin{center}
\textbf{Musterklausur Nr. 1}\\[3mm]
\textbf{Lösungsvorschlag}
    \end{center}
\rule{12cm}{0.7mm}\par
\vspace*{1ex}% or desired distance
        \end{minipage}
Aufgabe 1% this line also can be put after \vspace* command
    \end{document} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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