3

I want to make a LaTeX template that looks exactly like this Word template (it's a template for the law practice exams we write at our university):

enter image description here

So there are supposed to be two columns which have completely independent text, separated by a vertical line. The "Matr.-Nr.", "Benutzername:" and "Abgabe als PDF"-stuff is only supposed to be on the very first page, all further pages should only have the two colums, the vertical line and the page number. At the end of the page, the text is supposed to wrap around and continue in the correlating column on the next page.

I've been trying for hours now and I found a few similar questions, however, all used minipages as a solution which is quite tedious since they have to be created for every single page and do not allow for text wraparound. The twocolumns mode is also unusable, because it creates a single text block and doesn't allow for individual editing. I was able to generate a decent head using fancyhdr, but apart from that, I'm pretty much stuck.

Any suggestions how this can be achieved elegantly in LaTeX?

Edit: My testcode looks like this so far. It however doesn't exactly produce the output I want as everything starts on page two, text in the left column is somehow in the middle of the page and there is no way to automatically create a set of minipages for every new page:

\documentclass[a4paper]{article}
\usepackage[german]{babel}
\usepackage[left=0.5cm, right=1cm, top=1.2cm, bottom=2cm, includehead, includefoot]{geometry}
\usepackage[utf8]{inputenc}
\renewcommand{\thesection}{\Roman{section}.}
\renewcommand{\thesubsection}{\arabic{subsection}.} 
\renewcommand{\thepage}{Seite \arabic{page}} 
\usepackage{fancyhdr} 
\fancypagestyle{firstPage}{
\fancyhf{} 
\renewcommand{\headrulewidth}{0pt} 
\rhead{\thepage} 
\lhead{\framebox{\strut Matr.-Nr.:\hspace{120pt}}\\ \framebox{\strut Benutzername:\hspace{100pt}}}
\rhead{\raisebox{1cm}{\thepage}}
}
\usepackage{blindtext}

\fancypagestyle{otherPages}{
\fancyhf{} 
\renewcommand{\headrulewidth}{0pt} 
\rhead{\thepage}
\rhead{\raisebox{1cm}{\thepage}}
}
\pagestyle{firstPage}

\setlength{\headsep}{7pt}
\begin{document}
%\thispagestyle{firstPage}
\begin{minipage}{0.3\textwidth}
\hspace{-8mm}
%\fbox{\begin{minipage}[t][\height][t]{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
Abgabe als PDF!\\\\\\\\
%\end{minipage}}


\end{minipage}
\hfill\vline\hfill
\begin{minipage}{0.65\textwidth}


\begin{center}
\huge Number\\\vspace{1ex}
\large Name
\end{center} 
\section{Testsection}
\normalsize  
\thispagestyle{otherPages}
\Blindtext[10]

\end{minipage}
\end{document}
3
  • 1
    In addition to the screenshot, can you also post a minimal working example (MWE) of what you have tried so far? It can be a good starting point nevertheless. – Alessandro Cuttin May 8 '20 at 16:01
  • 1
    @AlessandroCuttin Thanks for your input, I've edited it. – DLCom May 8 '20 at 16:19
  • 1
    If you are willing to use the memoir document class, check out \sidebar. If that works we can see about adding the vertical rule, which should be easy. There may be other packages available though. – Donald Arseneau May 8 '20 at 19:37
0

After a bit more of searching, I actually found an elegant and feasible solution using the parallel package. It produces nearly exactly the result I wanted it to.

\documentclass[a4paper]{article}
\usepackage[german]{babel}
\usepackage[left=1cm, right=1cm, top=1cm, bottom=1cm, includehead, includefoot]{geometry}
\usepackage{parallel,enumitem}
\usepackage{fancyhdr}
\usepackage{blindtext}
\usepackage{minibox}
\renewcommand{\thepage}{Seite \arabic{page}} 
\setlength{\headsep}{1pt}
\setlength\parindent{0pt}
\setlength{\headheight}{40pt}
\fancypagestyle{firstPage}{
\fancyhf{}
\renewcommand{\headrulewidth}{0pt} 
\rhead{\thepage}
\lhead{\framebox{\strut Matr.-Nr.:\hspace{110pt}}\\ \vspace{0.3ex}\raisebox{-0.5ex}{\framebox{\strut Benutzername:\hspace{89.5pt}}}}
\rhead{\thepage \vspace{3.0ex}}
}
\def \boxheight {60}

\fancypagestyle{otherPages}{
\fancyhf{} 
\renewcommand{\headrulewidth}{0pt} 
\rhead{\thepage}
\rhead{\thepage \vspace{10.0ex}}
}
\pagestyle{otherPages}
\begin{document}
\thispagestyle{firstPage}

\noindent
%\par
\begin{Parallel}[v]{0.32\textwidth}{0.66\textwidth}


\ParallelLText{
%\vspace{2ex}

\hspace{10pt}\framebox(140,\boxheight)[lt]{\raisebox{-2ex}{\textbf{Abgabe als PDF!}}}
}
\ParallelRText{
\vspace{-\boxheight pt}
\Blindtext[10]
}
\ParallelPar
\end{Parallel}
\end{document}

enter image description here

One tiny problem is left, it would be nice if the line actually extended higher up into the header. I know no solution for that. Maybe one of you?

2
  • 1
    The built in \columnseprule only goes to the top of the parallel text. it might be easier to draw a new line using rikz [overlay,remember picture] or \llap{\smash{...}} than match up two separate lines. – John Kormylo May 8 '20 at 23:34
  • 1
    You might look at flowfram. Besides static and flow frames, \insertvrule can go anywhere. – John Kormylo May 8 '20 at 23:44

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.