von ikm » Di 21. Jan 2020, 09:24
Danke für die Hinweise, es hat nun sowohl mit Tikz (Lösung: "quick and dirty") als auch zum Teil mit den scrlayern geklappt.
Noch zur Ergänzung: Das optionale Argument von \ohead akzeptiert das tikzpicture bei mir jedoch nicht, d.h. ich habe mir anderweitig beholfen.
Falls es jemand interessiert:
\documentclass[paper=a4,11pt,titlepage,parskip]{scrbook}
\usepackage{ngerman}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}
\usepackage{xcolor}
\usepackage{scrlayer-scrpage}
\usepackage[hidelinks]{hyperref}
\usepackage{blindtext}
%% Colorband / Header
\clearpairofpagestyles
\automark[section]{chapter}
\newpairofpagestyles{simple}{%
\cehead*{\begin{tikzpicture}[overlay, remember picture]%
\fill[lightgray!50] ($(current page.north west)+(0,-0.75cm)$) rectangle ($(current page.north east)+(-1.5cm,-1.5cm)$);
\node[anchor=north east] at ($(current page.north east)+(-19.8cm,-0.9cm)$) {\textbf{\pagemark}};
\end{tikzpicture}}%
\cohead*{\begin{tikzpicture}[overlay, remember picture]%
\fill[lightgray!50] ($(current page.north west)+(1.5cm,-0.75cm)$) rectangle ($(current page.north east)+(0cm,-1.5cm)$);
\node[anchor=north west] at ($(current page.north west)+(19.8cm,-0.9cm)$) {\textbf{\pagemark}};
\end{tikzpicture}}}
\newpairofpagestyles{main}{%
\cehead*{\begin{tikzpicture}[overlay, remember picture]%
\fill[lightgray!50] ($(current page.north west)+(0,-0.75cm)$) rectangle ($(current page.north east)+(-1.5cm,-1.5cm)$);
\node[anchor=north east] at ($(current page.north east)+(-19.8cm,-0.9cm)$) {\textbf{\pagemark}};
\node[anchor=north east] at ($(current page.north east)+(-2.3cm,-0.85cm)$) {\headmark};
\end{tikzpicture}}%
\cohead*{
\begin{tikzpicture}[overlay, remember picture]%
\fill[lightgray!50] ($(current page.north west)+(1.5cm,-0.75cm)$) rectangle ($(current page.north east)+(0cm,-1.5cm)$);
\node[anchor=north west] at ($(current page.north west)+(19.8cm,-0.9cm)$) {\textbf{\pagemark}};
\node[anchor=north west] at ($(current page.north west)+(2.3cm,-0.85cm)$) {\headmark};
\end{tikzpicture}}}
\setkomafont{pageheadfoot}{\sffamily}
\setkomafont{pagination}{}
%% Dokumentenbeginn
\begin{document}
\title{Beispiel}\author{M. Muster}\date{2020} \maketitle
\pagestyle{simple}
\chapter*{Vorwort} \blindtext
\tableofcontents
\pdfbookmark{\contentsname}{toc}
\cleardoublepage
\pagestyle{main}
\blinddocument
\end{document}
Danke für die Hinweise, es hat nun sowohl mit Tikz (Lösung: "quick and dirty") als auch zum Teil mit den scrlayern geklappt.
Noch zur Ergänzung: Das optionale Argument von \ohead akzeptiert das tikzpicture bei mir jedoch nicht, d.h. ich habe mir anderweitig beholfen.
Falls es jemand interessiert:
[code]
\documentclass[paper=a4,11pt,titlepage,parskip]{scrbook}
\usepackage{ngerman}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}
\usepackage{xcolor}
\usepackage{scrlayer-scrpage}
\usepackage[hidelinks]{hyperref}
\usepackage{blindtext}
%% Colorband / Header
\clearpairofpagestyles
\automark[section]{chapter}
\newpairofpagestyles{simple}{%
\cehead*{\begin{tikzpicture}[overlay, remember picture]%
\fill[lightgray!50] ($(current page.north west)+(0,-0.75cm)$) rectangle ($(current page.north east)+(-1.5cm,-1.5cm)$);
\node[anchor=north east] at ($(current page.north east)+(-19.8cm,-0.9cm)$) {\textbf{\pagemark}};
\end{tikzpicture}}%
\cohead*{\begin{tikzpicture}[overlay, remember picture]%
\fill[lightgray!50] ($(current page.north west)+(1.5cm,-0.75cm)$) rectangle ($(current page.north east)+(0cm,-1.5cm)$);
\node[anchor=north west] at ($(current page.north west)+(19.8cm,-0.9cm)$) {\textbf{\pagemark}};
\end{tikzpicture}}}
\newpairofpagestyles{main}{%
\cehead*{\begin{tikzpicture}[overlay, remember picture]%
\fill[lightgray!50] ($(current page.north west)+(0,-0.75cm)$) rectangle ($(current page.north east)+(-1.5cm,-1.5cm)$);
\node[anchor=north east] at ($(current page.north east)+(-19.8cm,-0.9cm)$) {\textbf{\pagemark}};
\node[anchor=north east] at ($(current page.north east)+(-2.3cm,-0.85cm)$) {\headmark};
\end{tikzpicture}}%
\cohead*{
\begin{tikzpicture}[overlay, remember picture]%
\fill[lightgray!50] ($(current page.north west)+(1.5cm,-0.75cm)$) rectangle ($(current page.north east)+(0cm,-1.5cm)$);
\node[anchor=north west] at ($(current page.north west)+(19.8cm,-0.9cm)$) {\textbf{\pagemark}};
\node[anchor=north west] at ($(current page.north west)+(2.3cm,-0.85cm)$) {\headmark};
\end{tikzpicture}}}
\setkomafont{pageheadfoot}{\sffamily}
\setkomafont{pagination}{}
%% Dokumentenbeginn
\begin{document}
\title{Beispiel}\author{M. Muster}\date{2020} \maketitle
\pagestyle{simple}
\chapter*{Vorwort} \blindtext
\tableofcontents
\pdfbookmark{\contentsname}{toc}
\cleardoublepage
\pagestyle{main}
\blinddocument
\end{document}
[/code]