2

I have trouble getting my footer right. I want it to look as follows: In ifoot, with the vertikal line on the left side being a continuous one:

| Name
| PLZ Ort
| Straße

in cfoot, horicontally centered:
empty line
confidential
\copyright Name 2020

in ofoot:
empty line
empty line
Seite x von y

I tried to code it like this:

\documentclass[a4paper,ngerman]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[left=2cm, right=2cm, top=2cm, bottom=3cm]{geometry}
\usepackage{color}
\usepackage{lastpage}
\usepackage{scrlayer-scrpage}
\begin{document}
\clearpage
\clearpairofpagestyles
\setkomafont{pageheadfoot}{\sffamily\footnotesize}
\setkomafont{pagination}{}
\setlength{\footheight}{25mm}
\definecolor{hellblau}{RGB}{0, 176, 240}
\pagestyle{scrheadings}
\ihead{
    Titel \newline
    \textcolor{hellblau}{Untertitel}
}
\ohead{
    Grafik
}
\ifoot{
    \flushleft{\smash{\vfootline}
    \hspace{5mm} Name \newline
    \hspace{5mm} PLZ Ort \newline
    \hspace{5mm} Straße}
}    
\def\vfootline{%
   \begingroup\color{hellblau}\rule[-35pt]{1pt}{35pt}\endgroup}
\cfoot{
    Confidential \newline
    \copyright Name \the\year
}
\ofoot{
    \flushright{Seite \thepage von \pageref{LastPage}}
}
\renewcommand{\contentsname}{Inhaltsverzeichnis}
\tableofcontents
\section{Überschrift1}
\subsection{Überschrift1.1}
\subsubsection{Überschrift1.1.1}
\end{document}

well, that's what happened: footline

I tried to insert the empty lines as well via \space \newline, but it didn't work out. Shouldn't the three parts of the footer all be horizontally aligned? And if not, is there an option I forgot to add or do I need to use a different concept, like tables or something? and what happened to the two spaces I inserted in line 2 and 3 of the inner foot?

thanks for your help in advance,

Bene

Bene
  • 21

1 Answers1

1

The inner, center and outer footer elements are vertically centered to each other. You could use \strut\\ to get empty lines in the center and outer footer elements or a table with empty lines.

Do not use \newline. Therefore replace \newline by \\. See What is the difference between \newline and \\ ? and the first comment below of the answer.

Remove \flushleft and \flushright from \ifoot and \ofoot.

Remove spurious spaces from your code and enlarge headheight.

Move the format settings to the preamble.

Suggestion for a onesided document:

\documentclass[a4paper,ngerman,
  footheight=33pt,% <- added
  headheight=22pt% <- added
]{scrartcl}
%\usepackage[utf8]{inputenc}% needed with older TeX distributions
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[left=2cm, right=2cm, top=2cm, bottom=3cm]{geometry}
\usepackage{color}
\usepackage{lastpage}
\usepackage{scrlayer-scrpage}% sets page style scrheadings automatically
\clearpairofpagestyles
\setkomafont{pageheadfoot}{\sffamily\footnotesize}
\setkomafont{pagination}{}
\definecolor{hellblau}{RGB}{0, 176, 240}

\ihead{% Titel\ \textcolor{hellblau}{Untertitel}% } \ohead{Grafik}

\newlength\vfootlinewidth \setlength\vfootlinewidth{1pt} \ifoot{% \begin{tabular}{@{{\color{hellblau}\vline width \vfootlinewidth}\hspace{5mm}}l} Name \ PLZ Ort \ Straße \end{tabular}% } \cfoot{% \begin{tabular}{c} \ Confidential\strut\ \copyright Name \the\year \end{tabular}% } \ofoot{% \begin{tabular}{r@{}} \ \ \pagemark \end{tabular}} \renewcommand\pagemark{{\usekomafont{pagination}Seite \thepage\ von \pageref{LastPage}}}

\begin{document} \tableofcontents \section{Überschrift1} \subsection{Überschrift1.1} \subsubsection{Überschrift1.1.1} \end{document}

enter image description here

esdd
  • 85,675
  • Thank you, that solved many of my Problems. Now just a short question. In case the address is too long, I need to shift cfoot to the right. Is there any Offset-Command I can use? – Bene Aug 04 '20 at 10:41
  • You can define a new length \newlength{\cfootoffset} and set this length to either to 0pt or the needed offset, eg. \setlength{\cfootoffset}{1cm}. This offset can be used in the table declaration of \cfoot: \begin{tabular}{@{\hspace{2\cfootoffset}}c@{}}. – esdd Aug 05 '20 at 22:44