包含章节名称的页面页脚不正确

包含章节名称的页面页脚不正确

我想在页面左侧底部的框中​​插入代码中所示的页码,但是在包含章节声明的页面中,编号发生了变化!

这是一个代码:

\documentclass[svgnames,french,english,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage{anysize}
\marginsize{22mm}{14mm}{12mm}{25mm}
\usepackage{colortbl} 
\usepackage{fancybox}
\usepackage[explicit]{titlesec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\headheight}{71.12737pt}
\setlength{\footskip}{28.44942pt}
\fancyhf{}
\lfoot{\shadowbox{\textbf{Page \thepage}}}
\titleformat{\section}[block]{\sffamily\Large\bfseries\color{white}}%
{}{0em}{\colorbox{RoyalBlue!90}{\parbox{\dimexpr\linewidth-2\fboxsep}{\thesection\enspace #1}}}
\titleformat{name=\section, numberless}[block]{\sffamily\Large\bfseries\color{white}}%
{}{0em}{\colorbox{RoyalBlue!90}{\parbox{\dimexpr\linewidth-2\fboxsep}{#1}}}
\titleformat{\subsection}[block]{\sffamily\Large\bfseries\color{white}}%
{}{0em}{\colorbox{RoyalBlue!30}{\parbox{\dimexpr\linewidth-2\fboxsep}{\thesubsection\enspace #1}}}

\titleformat{\subsubsection}{\sffamily\large\bfseries\color{RoyalBlue}}{\thesubsubsection\enspace #1}{1em}{}[{\color{black}\titlerule[1.5pt]}]
\usepackage{tikz}
\usepackage{kpfonts}
\newcommand*\chapterlabel{}
\titleformat{\chapter}
  {\gdef\chapterlabel{}
   \normalfont\sffamily\Huge\bfseries\scshape}
  {\gdef\chapterlabel{\thechapter\ }}{0pt}
  {\begin{tikzpicture}[remember picture,overlay]
    \node[yshift=-3cm] at (current page.north west)
      {\begin{tikzpicture}[remember picture, overlay]
        \draw[fill=black] (0,0) rectangle
          (\paperwidth,3cm);
        \node[anchor=east,xshift=.9\paperwidth,rectangle,
              rounded corners=20pt,inner sep=11pt,
              fill=MidnightBlue]
              {\color{white}\chapterlabel#1};
       \end{tikzpicture}
      };
   \end{tikzpicture}
  }
\titlespacing*{\chapter}{0pt}{50pt}{-60pt}
\usepackage{fancyhdr}
\begin{document}
\chapter{Chapitre 1}
\section*{section without numerotation }
\section{section 1}
This page is not correct ,because this number of page is in the center footer ,  but in the code there is declared as a shadowbox in the left footer
\clearpage
\section{section 2}
This page is correct about footer
\section{section without numerotation''}
\end{document}

结果如下:

在此处输入图片描述

在此处输入图片描述

答案1

plain样式应用于章节的第一页,您必须重新定义它。将其添加到您的序言中:

\fancypagestyle{plain}{%
\fancyhf{}
\lfoot{\shadowbox{\textbf{Page \thepage}}}}%

在此处输入图片描述

相关内容