1

I have been asked to make a simple LaTeX template for a friend of mine. Here is my attempt:

\documentclass[
  danish,
  a4paper,
  12pt
]{article}


\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[
  hmargin=2.4cm,
  vmargin=3cm
]{geometry}
\usepackage{fancyhdr}
\usepackage{graphicx}
%\usepackage{enumitem} Maybe include.
\usepackage{microtype}


\DisableLigatures[f]{encoding=T1}

\setlength\parindent{1em}

\pagestyle{fancy}
\renewcommand*\headrulewidth{0pt}
\setlength\headheight{42.5pt}
\addtolength{\textheight}{-29pt}
\lhead{}
\rhead{\rule{100pt}{38.1424pt}} % Insert logo here via \includegraphics.
\cfoot{\scriptsize Læreruddannelsen i Århus, Trøjborgvej~$82$, $8200$~Aarhus~N, telefon~$87\,55\,30\,00$}


\begin{document}

\vspace*{\baselineskip}
\begin{center}
  \textbf{%
    {\LARGE\MakeUppercase{bacheloropgave}}\\[\baselineskip]
    Emenvalg og -begrundelse\\
    (2007-uddannelsen)\\
  }
  {\scriptsize Jf. Bekendtgørelse om uddannelsen til professionsbachelor som lærer i folkeskolen, $\S~10$}
\end{center}
\vspace{4ex}

\noindent\textbf{Fag}\\
Something\\[1.2\baselineskip]
\textbf{Emne}\\
Something\\[1.2\baselineskip]
\textbf{Emnebegrundelse}\\
Something
\vspace{4ex}

\noindent\textbf{Navn}\\
Something\\[1.2\baselineskip]
\textbf{Studienummer} \hspace{5em}    \textbf{Stamhold}\\
$123\,456$            \hspace{9.01em} $12.34$\\[1.2\baselineskip]
\textbf{Underskrift}

\end{document}

My main problem is that when I use \hspace{5em} at the bottom of the document, I don't know how to automatically vertically align "Stamhold" and "12.34"; the 9.01em is found by eye-balling.

If there are any other comments to the template, please let me know.

P.S. The width of the \rule in the header is set precisely to give the same headheight as the logo does.

11
  • 2
    I would use memoir as the base instead. Get lots of freebies in the mix. Wouldn't it be better to use a table for those data instead of messing with \hspace? – daleif Nov 6 '13 at 14:56
  • @daleif I've never learned memoir, unfortunately, so I would like to stick to article. Regarding the table use of a table: Your suggestion makes sense. (If I can make you create an answer, that would be great.) – Svend Tveskæg Nov 6 '13 at 15:00
  • Learn it, there are so many twists and turns you have to go through with article, report and book. – daleif Nov 6 '13 at 15:01
  • This this just for the front page? Or for the entire project? – daleif Nov 6 '13 at 15:02
  • I do not understand the adding negative space to the \textheight – daleif Nov 6 '13 at 15:04
1

For the allignment.

\begin{tabular}{@{}l @{\hspace{5em}}   l}
\textbf{Studienummer}  &   \textbf{Stamhold}\\
$123\,456$            & $12.34$
\end{tabular}

By very fast take on it, not including the logo. I'd also like to make the headline better, but out of time for today.

\documentclass[
  danish,
  a4paper,
  12pt
]{memoir}


\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\setlrmarginsandblock{2.4cm}*1
\setulmarginsandblock{3.5cm}{4cm}* 

\checkandfixthelayout

\usepackage{graphicx}
\usepackage{eso-pic,picture,calc}
\usepackage{microtype}

\AddToShipoutPicture{
  \put(\paperwidth-\foremargin,\paperheight-2.5cm){\llap{\rule{100pt}{38.1424pt}}}
}

\usepackage{environ,etoolbox}

\newcommand\Generator[1]{
  \NewEnviron{#1}{\subsubsection*{#1}\BODY}}

\Generator{Fag}
\Generator{Emne}
\Generator{Emnebegrundelse}
\Generator{Navn}
\Generator{Underskrift}

\setlength\aftersubsubsecskip{1sp}

\newenvironment{Studieinfo}{
  \par\vskip-\beforesubsubsecskip % negative length
  \noindent
  \begin{tabular}{@{}l @{\hspace{5em}}   l}
    \textbf{Studienummer}  &   \textbf{Stamhold}\\
  }{
  \end{tabular}
}

\DisableLigatures[f]{encoding=T1}

\makepagestyle{st} 
\makeoddfoot{st}{}{\scriptsize Læreruddannelsen i Århus,
  Trøjborgvej~82, 8200~Aarhus~N, telefon~87\,55\,30\,00}{}

\pagestyle{st}

\raggedbottom

\begin{document}

\begin{center}
  \bfseries
  {\LARGE\MakeUppercase{bacheloropgave}} % don't want \LARGE to mess
                                % with line spacing

  \vspace{1em}

  \normalsize
  Emenvalg og -begrundelse

  (2007-uddannelsen)

  \medskip

  \normalfont \scriptsize 
  Jf. Bekendtgørelse om uddannelsen til professionsbachelor som lærer
  i folkeskolen, \S~10
\end{center}

\vspace{3em}


\begin{Fag}
  Skrev noget her
\end{Fag}

\begin{Emne}
  Skrev noget her
\end{Emne}

\begin{Emnebegrundelse}
  Skriv noget her
\end{Emnebegrundelse}

\begin{Navn}
  Skriv dit navn her
\end{Navn}

\begin{Studieinfo}
  % Studienummer & Stamhold
  123\,456    & 12.34
\end{Studieinfo}

\begin{Underskrift}
  % just used to add a headline
\end{Underskrift}
\end{document}

Addition: Add picute and calc. I'd like no to care about the width of the gfx, so we wrap it in \llap and thus only have to figure out where the lower right corner of the gfx should be placed, whic is up to the OP.

\paperwidth-\foremargin is the right edge of the text block

\paperheight-3cm is some arbitrary length from the top of the paper.

\usepackage{eso-pic,picture,calc}

\AddToShipoutPicture{
  \put(\paperwidth-\foremargin,\paperheight-3cm){\llap{\rule{100pt}{38.1424pt}}}
}
11
  • This looks really good! I'm looking forward to a 'better' headline. (Not that I think what you have now is bad.) – Svend Tveskæg Nov 6 '13 at 16:06
  • Regarding the picture, I got \AddToShipoutPicture{\put(416,750){\includegraphics{VIA-UC-logo}}} by eye-balling but isn't there a better way to place the picture at the right side of the header? (The picture can be downloaded from gupl.dk/703750/.) – Svend Tveskæg Nov 6 '13 at 16:48
  • That depends. Where do they want it. Do you have some template you're trying to replicate? Plus if you know your way around the memoir layout you can have latex calculate the position for you – daleif Nov 6 '13 at 19:55
  • The picture should be right-flushed in the header. – Svend Tveskæg Nov 6 '13 at 22:33
  • 1
    Ex is AFAIK the height if the x in the current font. Em is the current font size. So Em kan be used for both. As Em matches the font size it is just very useful as a general unit. The template can alway be made better, but for a one of... – daleif Nov 7 '13 at 23:11

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.