标题在第二部分后消失

标题在第二部分后消失

我正在尝试设置论文的页眉,以便奇数页有章节名称,偶数页有节名称。

在第一章中,这似乎没问题,但是对于其余章节,章节标题只出现在第一节中。在其余部分中,只出现节标题,而不出现章节标题。

有人可以帮忙吗?

抱歉,前言太长,但我不知道这是什么原因造成的。

\documentclass[twoside,12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[top=3cm,bottom=2cm,left=3cm,right=3cm,asymmetric]{geometry}

%dummy text
\usepackage{lipsum} 

%table of contents
\usepackage[nottoc,numbib]{tocbibind}

%header
\usepackage{fancyhdr}
\pagestyle{fancy} % Sets fancy header and footer
\fancyfoot{} % Delete current footer settings
\fancyhf{}
\fancyhead[LE,RO]{\thepage} % Page number in left on even pages and right on odd pages
\setlength{\headheight}{15pt}

\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{\thechapter.\ #1}}{}}
\fancyhead[RE]{\itshape\nouppercase{\leftmark}} % Chapter in the right on even pages
\fancyhead[LO]{\itshape\nouppercase{\rightmark}\chaptermark}     % Section in the left on odd pages

%% Math packages
\usepackage{bm}
\usepackage[normalem]{ulem}
\usepackage{mathtools}
\usepackage{amsmath,amsfonts,amssymb,amsthm} 
\newcount\colveccount
\newcommand*\colvec[1]{
        \global\colveccount#1
        \begin{pmatrix}
        \colvecnext
}
\def\colvecnext#1{
        #1
        \global\advance\colveccount-1
        \ifnum\colveccount>0
                \\
                \expandafter\colvecnext
        \else
                \end{pmatrix}
        \fi
}

\newtheoremstyle{mystyle}
  {0.7em} % Space above
  {0.7em} % Space below
  {} % Body font
  {} % Indent amount
  {\itshape} % Theorem head font
  { ---} % Punctuation after theorem head
  {.5em} % Space after theorem head
  {} % Theorem head spec (can be left empty, meaning `normal')

\theoremstyle{mystyle} 
\newtheorem*{definition}{Definition}
\newtheorem*{remark}{Remark}
\newtheorem*{theorem}{Theorem}

%nomenclature %doesn't work yet
%\usepackage{nomencl}
%\makenomenclature
%\renewcommand{\nomname}{List of Symbols} 
%\renewcommand{\nompreamble}{The next list describes several symbols that will be later used within the body of the thesis}

%% Figures and graphics
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{multirow}

%% Draw flow diagrams
\usepackage{tikz}
\usetikzlibrary{fit,calc,trees,arrows.meta,positioning,arrows,chains,shapes.geometric,decorations.pathreplacing,decorations.pathmorphing,shapes,matrix,shapes.symbols}
\tikzstyle{box} = [rectangle,draw,very thick,rounded corners, text centered,text width = 10em, minimum height = 3em]
\tikzstyle{line} = [draw, -latex']

%algorithm environment
\usepackage[titlenumbered,ruled]{algorithm2e}
\makeatletter
\renewcommand{\@algocf@capt@plain}{above}% formerly {bottom}
\makeatother

%hyperlinks and back referencing in format "(page #)"
\usepackage[hyperindex,colorlinks,hyperfootnotes = false,citecolor = blue,backref=page]{hyperref}
\renewcommand\backreftwosep{, }
 \renewcommand\backrefsep{, }
 \renewcommand*{\backrefalt}[4]{%
    \ifcase #1%
     \or (page:~#2)%
     \else (pages:~#2)%
    \fi%
    }

%epigraph
\usepackage{epigraph}

%subappendix
\usepackage{appendix}
\usepackage{chngcntr}
\usepackage{etoolbox}
\AtBeginEnvironment{subappendices}{
\chapter*{Appendix}
\addcontentsline{toc}{section}{Appendices}
\counterwithin{figure}{section}
\counterwithin{table}{section}
}

% double spacing.
\usepackage{setspace} % Now set to spacing = 1, only used in the tixz flow diagram
\linespread{1.1}

%Table format
\usepackage{tabularx}
\newcolumntype{Y}{>{\centering\arraybackslash}X}
\renewcommand\tabularxcolumn[1]{m{#1}}


%% Custom commands
\newcommand{\red}[1]{\textcolor{red}{#1}}
\newcommand{\green}[1]{\textcolor{green}{#1}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Wass}{\mathcal{W}}
\newcommand{\etal}{\textit{et al.}}
\newcommand{\varA}[1]{{\operatorname{#1}}}
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}

%\usepackage{xcolor}
%\definecolor{light-gray}{gray}{0.9}



%%%% STARTS HERE


\begin{document}

\newpage
{
  \hypersetup{linkcolor=black}
  \tableofcontents
}

\newpage

%\mbox{}

%\nomenclature{$c$}{Speed of light in a vacuum inertial frame}
%\nomenclature{$h$}{Planck constant}
% 
%\printnomenclature


\chapter{Temporal dynamics at the cell level}\label{sect:tempdyncell}




\lipsum[1-4]


\paragraph{Experimental conditions ---}

The experiments were designed to test the dynamic response of intracellular states in response to variations in the external ammonium abundance, including the run-out, starvation and a subsequent ammonium shock. 
The experimental data include 
%
\lipsum[1-4]
%





\paragraph{Regulation of nitrogen uptake ---}

We now give an outline of the interactions and the dynamic behaviour of the nitrogen system. Further biochemical details will be provided in the next section during the presentation of the mathematical model.

\lipsum[3-8]




\section{Results}


\subsection{Mechanistic model of nitrogen assimilation}

\lipsum[2-8]

\paragraph{Definition of system boundaries ---}


\lipsum[4-8]


\end{document}

答案1

\chaptermark您通过调用每个第二个标题将章节标记设置为空- 将其删除。

\documentclass[twoside,12pt]{report}

\usepackage{lipsum} 

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot{} 
\fancyhf{}
\fancyhead[LE,RO]{\thepage} 
\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
\fancyhead[RE]{\itshape \nouppercase{\leftmark}} 
\fancyhead[LO]{\itshape \nouppercase{\rightmark}}  

\begin{document}

\tableofcontents
\newpage

\chapter{Temporal dynamics at the cell level}
\label{sect:tempdyncell}

\lipsum[1-4]

\paragraph{Experimental conditions ---}

The experiments were designed to test the dynamic response of intracellular states in response to variations in the external ammonium abundance, including the run-out, starvation and a subsequent ammonium shock. 
The experimental data include 
%
\lipsum[1-4]
%

\paragraph{Regulation of nitrogen uptake ---}

We now give an outline of the interactions and the dynamic behaviour of the nitrogen system. Further biochemical details will be provided in the next section during the presentation of the mathematical model.

\lipsum[3-8]

\section{Results}

\subsection{Mechanistic model of nitrogen assimilation}

\lipsum[2-8]

\paragraph{Definition of system boundaries ---}

\lipsum[4-8]


\end{document}

相关内容