效果图如下:headdesign20140123010456代码如下:

\documentclass[12pt,twoside]{scrbook}

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

\usepackage[table,dvipsnames,svgnames]{xcolor}
\usepackage{calc}
%Schrift
\usepackage{mathptmx,charter,courier}
\usepackage[scaled]{helvet}
\usepackage{microtype}

\usepackage{blindtext}

% TikZ-Pakete
\usepackage{tikz}
\usetikzlibrary{positioning,backgrounds,shapes}

% Kopf- und Fußzeile
\usepackage[automark]{scrpage2}
\clearscrheadings
\clearscrplain

\tikzset{pagenumber/.style={rectangle,rounded corners=5pt,inner sep=6pt, fill=gray!20,draw=gray!30,line width=0.1em}}

\lohead{\begin{tikzpicture}[remember picture,overlay]
\begin{pgfonlayer}{background}
\draw[fill=gray!10, fill opacity=1.0, draw=none] (-.65\paperwidth,0cm) rectangle (\paperwidth+2cm,2cm);
\end{pgfonlayer}
\path (current page.north west) node[anchor=west,xshift=1.58cm, yshift=-0.9cm,pagenumber] {\parbox{\widthof{\Large 1111}}{\centering \color{black} \bfseries\Large \thepage}};
\end{tikzpicture}}
\rohead{\begin{tikzpicture}[remember picture,overlay]
\path (current page.north east) node[anchor=east,xshift=-3.4cm, yshift=-0.9cm] {\color{black}\upshape Beispieldokument};
\end{tikzpicture}}

\lehead{\begin{tikzpicture}[remember picture,overlay]
\begin{pgfonlayer}{background}
\draw[fill=gray!10, fill opacity=1.0, draw=none] (-.65\paperwidth,0cm) rectangle (\paperwidth+2cm,2cm);
\end{pgfonlayer}
\path (current page.north west) node[anchor=west,xshift=3.4cm, yshift=-1.0cm] {\color{black}\upshape \Large \headmark};
\end{tikzpicture}}
\rehead{\begin{tikzpicture}[remember picture,overlay]
\path (current page.north east) node[anchor=east,xshift=-1.58cm, yshift=-0.9cm,pagenumber] {\parbox{\widthof{\Large 1111}}{\centering \color{black}\bfseries\Large \thepage}};
\end{tikzpicture}}
\setlength{\headsep}{1.1cm}

\begin{document}
\pagestyle{scrheadings}
\chapter{Einleitung}
\Blindtext

\Blindtext

\chapter{Hauptteil}
\blindtext

\end{document}

选自:http://web.slzm.de/blog/latex/latex-schone-kopfzeilen/#more-345

点赞(0)

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部