![如何使当前页面的右页最后一个一级标题成为页眉?](https://linux22.com/image/465816/%E5%A6%82%E4%BD%95%E4%BD%BF%E5%BD%93%E5%89%8D%E9%A1%B5%E9%9D%A2%E7%9A%84%E5%8F%B3%E9%A1%B5%E6%9C%80%E5%90%8E%E4%B8%80%E4%B8%AA%E4%B8%80%E7%BA%A7%E6%A0%87%E9%A2%98%E6%88%90%E4%B8%BA%E9%A1%B5%E7%9C%89%EF%BC%9F.png)
我在右页页眉中遇到了一个问题。每当同一右页上有多个 1 级标题时,最后一个 1 级标题就不会更新\@oddhead
。每次,我都使用命令手动更改页眉\markright
。
我没有使用fancyheadings
和fancyhdr
包。我正在手动重新定义命令\ps@headings
。请参阅下面的 TeX 代码
\documentclass[letterpaper,12pt]{book}
\usepackage[utf8]{inputenc}
\UseRawInputEncoding
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[authoryear,comma,longnamesfirst,sectionbib]{natbib}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{rsfso}
\usepackage{multirow}
\usepackage{lipsum}
\makeatletter
\newcommand{\nut}{\hspace{.5em}}
\def \@setfolio #1{%
{\sffamily\bfseries\small #1}}
\def \ps@headings {%
\def \@evenhead {\hskip-88\p@\@setfolio{\thepage}\hspace*{11.3pt}\fontsize{9.5pt}{9.5pt}\selectfont\leftmark\hfill}%
\let \@evenfoot = \@empty
\def \@oddhead {\hfill\fontsize{9.5pt}{9.5pt}\selectfont\rightmark\hspace*{10.5pt}\@setfolio{\thepage}}%
\let \@oddfoot = \@empty
\let \@mkboth = \markboth
\def \chaptermark ##1{%
\markboth{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\@chapapp\ \thechapter\kern7pt %\quad
\fi
\fi
\emph{##1}}{}}%
\def \sectionmark ##1{%
\markright{%
\ifnum \c@secnumdepth >\z@
%\raisebox{15pt}{
\thesection%}
\nut
\fi
##1}}}
\ps@headings
\makeatother
\begin{document}
\chapter{This was the Sample Title}
\section{01 - Sample Heading 1} \label{sec:1.1}
\lipsum[1-7]
\section{02 - Sample Heading 1}\label{sec:1.2}
\lipsum[1]
\section{03 - Sample Heading 1}\label{sec:1.3}
\lipsum[1-2]
\end{document}
请参考标题上黄色突出显示的图像。我需要从1.2 02 - 示例标题 1 3到1.3 03 - 示例标题 1。
如何进行这种更新而无需\markright
每次都使用?