如何在两页之间设置一个干净的分页符,以便一页上的命令不会干扰另一页上的命令

如何在两页之间设置一个干净的分页符,以便一页上的命令不会干扰另一页上的命令
\documentclass[10pt,a4paper]{letter}                 %inter office note /cover page vertical line template
\usepackage{fancyhdr}
%\usepackage{amsmath}
%\usepackage{amsfonts}
%\usepackage{amssymb}
\usepackage{graphicx}

\usepackage[table]{xcolor}                      %for color of table
\usepackage{booktabs}                        %for toprule midrule bottomrule in tables
\usepackage{multirow}           % Required for multirows
\usepackage{rotating}
\usepackage{lscape}
\usepackage[utf8]{inputenc}             
\usepackage[none]{hyphenat}             %no hyphenation
\usepackage{graphicx}
\usepackage{float}
\usepackage{lastpage}                                     %toget last page number
\usepackage{indentfirst}
\usepackage[bottom]{footmisc}
% \usepackage{datetime2}
\usepackage[en-US]{datetime2}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}            %footnotes will have symbols instead of                                                                                                                 numbers

\newcommand*{\plogo}{\fbox{$\mathcal{PL}$}}             % Generic dummy publisher logo 
\renewcommand*\familydefault{\sfdefault}             %best
\usepackage[
height=8in,      % height of the text block
width=5.1in,       % width of the text block
top=78pt,        % distance of the text block from the top of the page
headheight=60pt, % height for the header block
headsep=12pt,    % distance from the header block to the text block
heightrounded,   % ensure an integer number of lines
%  showframe,       % show the main blocks
verbose,         % show the values of the parameters in the log file
]{geometry}


%header and footer
\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}

\renewcommand{\headrulewidth}{0.1pt}
\renewcommand{\footrulewidth}{0.1pt}

%\newcommand{\footer}{                               %change the header or footer on a particular page
%   \renewcommand{\footrulewidth}{.4pt}%
%   \fancyhead{}
%   \fancyhead[c]{CONTENT}
%   \fancyfoot[L]{%
%       \footnotesize 
%       Typeset in \LaTeX}}
    \fancyhead[R]{%
        \footnotesize 
        Special Assignment Wing\\Controllerate of Quality Assurance \\ Armoured Vehicle                                 Electronics\\Avadi, Chennai – 600 054}

    \fancyhead[C]{\includegraphics[scale=.05]{C:/Users/"J S Bibra"/"Google Drive"/LATEX/images/ashoka.png} } 

\fancyhead[L]{%
    \footnotesize 
    File No: 48332/2019/ISO/1 \\dt 28 Jun 2019}
\fancyfoot[L]{%
            \footnotesize 
                 Typeset in \LaTeX} 
\newsavebox{\mybox}
\newlength{\restofline}          


\begin{document}

\vspace{1cm}
\raggedleft{(JS Bibra)\\
    Colonel\\Jt Controller(SA)}

\raggedright \underline{Admin Officer}\\ \vspace{1pt}


\vspace{1cm}

\savebox\mybox{\hbox{\underline {Shri Peter J,  } --\hskip 1pt}}
\noindent\usebox{\mybox}
\setlength{\restofline}{\dimexpr\textwidth-\wd\mybox-10pt\relax}
\begin{minipage} [t]{\restofline}
    Please intimate the progress of the Board.
\end{minipage}  
\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\fancyhead[L]{%cover page for key result areas
            \footnotesize 
                 File No: 20211/JC/SA \\dt 06 Sep 2019}
\raggedleft % Right align the title page

    \rule{1pt}{\textheight} % Vertical line
    \hspace{0.05\textwidth} % Whitespace between the vertical line and title page text
    \parbox[b]{0.6\textwidth}{ % Paragraph box for holding the title page text, adjust the width to move the title page left or right on the page

        {\Huge\bfseries  Areas \\[0.5\baselineskip] August 2019}\\[2\baselineskip] % Title
        \begin{itemize}
        \item {\large\textit{ Canteen\\ 
        \item ISO \\
        \item  Orders}}\\[4\baselineskip] % Subtitle or further description
        \end{itemize}

        {\Large\textsc{ js bibra}} % Author name, lower case for consistent small caps

        \vspace{0.5\textheight} % Whitespace between the title block and the publisher

        {\noindent The Publisher~~\plogo}\\
        [\baselineskip] % Publisher and logo
    }
\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\fancyhead[L]{%
    \footnotesize 
    File No: 48332/2019/ISO/2 \\dt 04 Jul 2019} 
\begin{center}
    \underline{\textbf{INTER OFFICE NOTE}}\\
    \underline{BOO: ISO 9001:2015}
\end{center}

    \begin{enumerate}
        \item Ref
        \begin{enumerate}
            \item  AVL/20203/Est dt 19 Jun 2019.
            \item  Serial No 5 dt 29 Jan 2019.
            \item  48332/2019/ISO/1 dt 28 Jun 2109.
        \end{enumerate}
        \item   Progress on the Board Proceedings.
    \end{enumerate} 


\vspace{1cm}
\raggedleft{(JS Bibra)\\
(SA)}

\vspace{1cm}

\savebox\mybox{\hbox{\underline {Shri Peter J, PScO/ SA Wing } --\hskip 1pt}}
\noindent\usebox{\mybox}
\setlength{\restofline}{\dimexpr\textwidth-\wd\mybox-10pt\relax}
\begin{minipage} [t]{\restofline}
    Please intimate the progress of the Board.
\end{minipage}
\pagebreak
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\fancyhead[L]{%
    \footnotesize 
    File No: 48332/2019/ISO/2 \\dt 07 Sep 2019} 
\begin{center}
    \underline{\textbf{INTER OFFICE NOTE}}\\
    \underline{ URC}
\end{center}


\begin{enumerate}
    \item   Ref remarks.
    \item   Please progress . 
\end{enumerate}


\vspace{1cm}
\raggedleft{(JS Bibra)\\
(SA)}

\vspace{1cm}

\savebox\mybox{\hbox{\underline {Shri Peter J, PScO/ SA Wing } --\hskip 1pt}}
\noindent\usebox{\mybox}
\setlength{\restofline}{\dimexpr\textwidth-\wd\mybox-10pt\relax}
\begin{minipage} [t]{\restofline}
    Please intimate the progress.
\end{minipage}
\pagebreak


\end{document}

答案1

无关

尝试编译您的代码,我只有一页包含章节和列表。我添加了\lipsum[1]部分内容以制作额外的页面。如果可以,请编辑您的帖子以使用相应的按钮显示代码的演示文稿: 在此处输入图片描述


我猜有两个问题:

  1. 一是您在有更改的每一页上都没有写任何内容,\fancyhead{}因此不会打印这些页面。
  2. 您已创建\pagestyle{fancy}但对于章节而言它仍然是plain样式章节。

为了解决这个问题,我添加了一些虚拟文本,并在章节命令中重新定义了纯页面样式。(来自 Mico回答)。

以下是代码:

\documentclass[letterpaper,10pt]{report}
\usepackage{fancyhdr}
\usepackage{lipsum}
\newenvironment{packed_enum}
    {
    \begin{enumerate}
        \setlength{\itemsep}{1pt} 
        \setlength{\parskip}{0pt} 
        \setlength{\parsep}{0pt}
    }
    {\end{enumerate}}

\fancypagestyle{MyStyle}
    \fancyhf{}  %Same as \fancyheader{} \fancyfooter{}

    \renewcommand{\headrulewidth}{0.1pt}
    \renewcommand{\footrulewidth}{0.1pt}


\usepackage{etoolbox}
\patchcmd{\chapter}{\thispagestyle{plain}}{\thispagestyle{fancy}}{}{}

\begin{document}
    \pagestyle{MyStyle}

\fancyhead[L]{%
     \footnotesize File No: 48332/2019/ISO/1 28 Jun 2019}

\lipsum[1-2]

\newpage
\fancyhead[L]{%
    \footnotesize File No: 48332/2019/ISO/2 04 Jul 2019}
\chapter{Movies I need to watch}


Here is a short list of movies \marginpar{Flag A -- This note will appear in the margin.} I need to watch some day:

\begin{packed_enum}
    \item The Longest Day
    \item Kill Bill 1
    \item Kill Bill 2
    \item Pretty much every other movie created in the last 30 years. :)
\end{packed_enum}

\newpage
    \lipsum[1]
\fancyhead[L]{%
     \footnotesize File No: 48332/2019/ISO/2 07 Sep 2019
    }
\newpage
    \lipsum[2]
\end{document}

相关内容