页眉与文本框架不对齐

页眉与文本框架不对齐

我注意到我的页眉与文本边框不对齐,这是我想要的。只有当我调整方程式上下间距时才会出现此问题。有人能告诉我该怎么做才能避免对齐问题吗?

我也遇到了一些问题Underfull \vboxOverfull \hbox警告——也许与问题有关。无论如何,我也想摆脱它们。

错位图示

梅威瑟:

\documentclass[a4paper, twoside]{memoir}

% Packages

\usepackage{layout}         % Layout frames
\usepackage{showframe}      % Layout frames

% Spacing around equations

\expandafter\def\expandafter\normalsize\expandafter{%
  \normalsize
  \setlength\abovedisplayskip{-1\parskip}
  \setlength\belowdisplayskip{0.5\parskip}
  \setlength\abovedisplayshortskip{-1\parskip}
  \setlength\belowdisplayshortskip{0.5\parskip}
}

% Header

\aliaspagestyle{chapter}{empty}

% Defining general header
\setlength{\headwidth}{\textwidth}
  \addtolength{\headwidth}{\marginparsep}
  \addtolength{\headwidth}{\marginparwidth}

\copypagestyle{thesis}{myheadings}            % Create pagestyle 'thesis'
\makerunningwidth{thesis}{\headwidth}
\makeheadrule{thesis}{\headwidth}{0.2pt}      % Horizontal line in header
\makeheadposition{thesis}{flushright}{flushleft}{}{}

\makepsmarks{thesis}{
  \nouppercaseheads
  \createmark{chapter}{left}{nonumber}{\@chapapp\ }{. \ }
  \createmark{section}{right}{nonumber}{}{} 
  \createplainmark{toc}{both}{\contentsname}
  \createplainmark{lof}{both}{\listfigurename}
  \createplainmark{lot}{both}{\listtablename}
  \createplainmark{bib}{both}{\bibname}
  \createplainmark{index}{both}{\indexname}
  \createplainmark{glossary}{both}{\glossaryname}
}

\makeevenhead{thesis}
  {\sffamily\bfseries\small\thepage}{}{\sffamily\bfseries\small\leftmark}

\makeoddhead{thesis}
  {\sffamily\bfseries\small\rightmark}{}{\sffamily\bfseries\small\thepage}

\pagestyle{thesis} % Activating pagestyle


\begin{document}

\chapter{Test chapter}

\pagebreak

Some other text

\end{document}

答案1

\documentclass[a4paper, twoside]{memoir}

% Packages

\usepackage{layout}         % Layout frames
\usepackage{showframe}      % Layout frames

% Header

\aliaspagestyle{chapter}{empty}

% Defining general header
\setlength{\headwidth}{\textwidth}
\addtolength{\headwidth}{\marginparsep}
\addtolength{\headwidth}{\marginparwidth}

\copypagestyle{thesis}{myheadings}            % Create pagestyle 'thesis'
\makerunningwidth{thesis}{\headwidth}
\makeheadrule{thesis}{\headwidth}{0.2pt}      % Horizontal line in header
\makeheadposition{thesis}{flushright}{flushleft}{}{}

\makepsmarks{thesis}{
  \nouppercaseheads
  \createmark{chapter}{left}{nonumber}{\@chapapp\ }{. \ }
  \createmark{section}{right}{nonumber}{}{}
  \createplainmark{toc}{both}{\contentsname}
  \createplainmark{lof}{both}{\listfigurename}
  \createplainmark{lot}{both}{\listtablename}
  \createplainmark{bib}{both}{\bibname}
  \createplainmark{index}{both}{\indexname}
  \createplainmark{glossary}{both}{\glossaryname}
}

\makeevenhead{thesis}
{\sffamily\bfseries\small\thepage}{}{\sffamily\bfseries\small\leftmark}

\makeoddhead{thesis}
{\sffamily\bfseries\small\rightmark}{}{\sffamily\bfseries\small\thepage}

\pagestyle{thesis} % Activating pagestyle


\begin{document}

  \setlength\abovedisplayskip{-1\parskip}
  \setlength\belowdisplayskip{0.5\parskip}
  \setlength\abovedisplayshortskip{-1\parskip}
  \setlength\belowdisplayshortskip{0.5\parskip}


  \chapter{Test chapter}

  \pagebreak

  Some other text.
  \begin{equation}
    a + b = c
  \end{equation}
  Some more text.

\end{document}

相关内容