精美“侧章节缩略标题”第 2 部分

精美“侧章节缩略标题”第 2 部分

这个问题是基于精心设计的解决方案的罗尼可以找到这里

我想从章节第一页中删除页眉和页脚,但保持章节第一页上的章节缩略图不变:在此处输入图片描述

这是Ronny's代码:

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{lipsum}
\usepackage{xcolor,etoolbox,fancyhdr}
\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}
\usepackage{fourier}
\usepackage{titlesec}
\definecolor{lightblue}{RGB}{199,232,250}
\definecolor{darkblue}{RGB}{59,134,215}
\usetikzlibrary{calc}
% Define just chapter start pages
\pagestyle{fancy}
\fancyhf[LE]{Author's Name}\fancyhead[LE,RO]{}
\fancyhead[LO]{%\textcolor{mybluei} \rightmark%
\begin{tikzpicture}[overlay,remember picture]
    % Box
    \draw[fill=lightblue,draw=none] ($(current page.north east) - (1cm,0)$) -- (current page.north east) -- (current page.south east) -- ++ (-1cm,0) -- cycle;
    % Chapter Number
    \node[scale=3,darkblue] at ($(current page.north east) + (-1cm,-4cm)$)  {\thechapter};
    % Chapter
    \node[rotate=90, anchor=east] at ($(current page.north east) + (-.5cm,-4cm)$) {\leftmark{}};
    % Circle for page number
    \draw[fill=darkblue,draw=none] ($(current page.south east) + (-1cm,3cm)$) circle (3mm);
    % Page number
    \node at ($(current page.south east) + (-1cm,3cm)$)  {\textcolor{white}\thepage};
  \end{tikzpicture}}
\fancyhead[RE]{
\begin{tikzpicture}[overlay,remember picture]
    \draw[fill=lightblue,draw=none] ($(current page.north west) + (1cm,0)$) -- (current page.north west) -- (current page.south west) -- ++ (1cm,0) -- cycle;
    \node[rotate=90,anchor=east] at ($(current page.north west) + (.5cm,-4cm)$) {\rightmark};
    \node[scale=3,darkblue] at ($(current page.north west) + (1cm,-4cm)$) {\thechapter};
    \draw[fill=darkblue,draw=none] ($(current page.south west) + (1cm,3cm)$) circle (3mm);
    \node at ($(current page.south west) + (1cm,3cm)$)  {\textcolor{white}\thepage};
  \end{tikzpicture}}

\renewcommand{\chaptermark}[1]{%
\markboth{#1}{}}
\begin{document}
\chapter{My first Chapter: Problems}
\section{Problem 1}
\subsection{Problem 1}
\lipsum[1]
\subsection{Solution 1}
\lipsum[1-7]
\newpage
\section{Problem 2}
\subsection{Problem 2}
\lipsum[1]
\subsection{Solution 2}
\lipsum[1-4]

\chapter{A second Chapter Title}
\section{Problem 1}
\subsection{Problem 1}
\lipsum[1]
\newpage
\subsection{Solution 1}
\lipsum[1]
\newpage
\section{Problem 2}
\subsection{Problem 2}
\lipsum[1]
\subsection{Solution 2}
\lipsum[1]

\end{document}

答案1

您可以定义自定义页面样式并将其用于章节的第一页:

\fancypagestyle{myfancy}{%
    \renewcommand*\headrulewidth{0pt}
    \fancyfoot[c]{}
    }
\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{myfancy}}{}{}

结果:

在此处输入图片描述

相关内容