前文分享了不少Tikz制作的页眉设计,总体来说,页眉部分大家还是比较喜欢质朴,清爽的页眉样式,下面这个页眉样例比较清爽也很适合做自己的页眉,如下图所示: tikzhead-draw 代码如下:

\documentclass{book}
\usepackage[a6paper]{geometry}
\usepackage{fancyhdr}
\usepackage{tikzpagenodes}
\usetikzlibrary{shapes.geometric}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhf{}
\renewcommand\headrulewidth{0pt}
\fancyhead[OC]{\begin{tikzpicture}[remember picture,overlay]
\node[diamond,draw,font=\small\itshape] at (current page header area.south west) (dia) {\thepage};
\draw (dia.3) -- (current page header area.south east|-dia.3);
\draw (dia.357) -- ([xshift=-7pt]current page header area.south east|-dia.357);
\end{tikzpicture}}
\fancyhead[EC]{\begin{tikzpicture}[remember picture,overlay]
\node[diamond,draw,font=\small\itshape] at (current page header area.south east) (dia) {\thepage};
\draw (dia.177) -- (current page header area.south west|-dia.177);
\draw (dia.183) -- ([xshift=7pt]current page header area.south west|-dia.183);
\end{tikzpicture}}
\fancyhead[OR]{\small\nouppercase\leftmark}
\fancyhead[EL]{\small\nouppercase\rightmark}

\begin{document}

\chapter{Test chapter}
\lipsum[2]
\section{Test section}
\lipsum[2]\lipsum[2]\lipsum[2]\lipsum[2]\lipsum[2]

\end{document}
其他样例如下: tikz-draw3 tikzhead-draw1   详细代码参看:http://tex.stackexchange.com/questions/122975/page-number-in-a-diamond-box

点赞(0)

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部