Hallo,
danke für die Lösung, das war genau das, was ich gesucht habe!
Bei der Einarbeitung in mein Dokument ist mir aber noch eine Sache aufgefallen, bei der Ihr mir hoffentlich nochmal helfen könnt. Haben die Buchstaben im Section Title eine Unterlänge (wie bei q,y,p...), wandert der Titel nach oben. Alle anderen Section und Document Title bleiben aber unten. Das Problem ist im angehängten Layout ersichtlich. Kann man einfach die Linie nach unten verschieben? Hat irgendjemand noch eine Idee, wie man das am Besten angeht?
Wie kann man die Seitenzahl zur anderen Seite verschieben (dort wo auch das Logo ist)?
Hier nochmal der Code mit meinen kleinen Anpassungen:
Code:
\documentclass[
12pt,
headinclude,
BCOR12mm,
DIV12,
openright,
bibliography=totoc,
listof=totoc,
numbers=noenddot,
fleqn,
]{scrbook}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman, english]{babel}
\usepackage{lipsum}
\usepackage{mwe}
\usepackage{xcolor}
\definecolor{grey} {RGB} {132,130,132}
\usepackage[automark]{scrpage2}
\usepackage{tikz}
\usetikzlibrary{positioning}
\setkomafont{pageheadfoot}{\color{grey}{\normalfont\sffamily}}
\setkomafont{pagenumber}{\color{grey}{\normalfont\sffamily}}
\addtolength{\headheight}{1\baselineskip}
\clearscrheadfoot
\def\logo{\includegraphics[width=2cm]{example-image-A.jpg}}
%Dokumententitel definieren
\def\doctitle{Dokumententitel}
\defpagestyle{meiner}{%Kopf
{%Gerade Seite
\begin{tikzpicture}[inner sep=0]
%Ein Punkt in allen 4 Ecken des Headers
\node[] (lowerL) at (0,0) {};
\node (upperL) at (0,\headheight) {};
\node (upperR) at (\textwidth,\headheight) {};
\node (lowerR) at (\textwidth,0) {};
%Zum testen, ein Rahmen um den Header
%\draw (lowerL) -- (upperL) -- (upperR) -- (lowerR) -- (lowerL);
%Einfuegen des Logos
\node[anchor=south east] (logo) at (lowerR) {\logo};
%Position der Trennlinie bestimmen
%yshift anpassen fuer andere linienhoehe
\node[yshift=15pt,xshift=-4pt] (lineL) at (logo.south west) {};
\node[yshift=15pt] (lineR) at (lowerL) {};
\draw[line width=0.5pt,grey] (lineL) -- (lineR);
%Dokumententitel und heading positionieren
\node[,anchor=south west,yshift=2pt] (title) at (lineR)
{\rightmark};
\node[anchor=south east,yshift=2pt] (title) at (lineL)
{\doctitle};
\end{tikzpicture}
}
{%Ungerade seite
\begin{tikzpicture}[inner sep=0]
%Ein Punkt in allen 4 Ecken des Headers
\node (lowerL) at (0,0) {};
\node (upperL) at (0,\headheight) {};
\node (upperR) at (\textwidth,\headheight) {};
\node (lowerR) at (\textwidth,0) {};
%Zum testen, ein Rahmen um den Header
%\draw (lowerL) -- (upperL) -- (upperR) -- (lowerR) -- (lowerL);
%Einfuegen des Logos
\node[anchor=south west] (logo) at (lowerL) {\logo};
%Position der Trennlinie bestimmen
%yshift anpassen fuer andere linienhoehe
\node[yshift=15pt,xshift=4pt] (lineL) at (logo.south east) {};
\node[yshift=15pt] (lineR) at (lowerR) {};
\draw[line width=1pt,grey] (lineL) -- (lineR);
%Dokumententitel und heading positionieren
\node[anchor=south west,yshift=2pt] (title) at (lineL)
{\doctitle};
\node[anchor=south east,yshift=2pt] (title) at (lineR)
{\rightmark};
\end{tikzpicture}
}
{}%Einseitig
}{%Fuss
{\pagemark\hfill}
{\hfill\pagemark}
{}
}
\pagestyle{meiner}
\begin{document}
\chapter{Test}
\lipsum[1-9]
\lipsum[1]
\section{section title}
\lipsum[1]
\lipsum[1-5]
\section{example}
\lipsum[1]
\end{document}
Lesezeichen