为什么回忆录会在目录页中添加不需要的页眉,并且标题位置错误?

为什么回忆录会在目录页中添加不需要的页眉,并且标题位置错误?

到目前为止,回忆录类对我来说效果很好,但它仍然有一些让我困惑的怪癖。如附图所示,标题被放置在目录 (TOC) 的两列之一中,而不是位于两列上方的中央。此外,尽管页面样式明确设置为“bookstart”样式,非常简单地定义为仅在底部(在页脚中)显示页码,但它仍然坚持将目录标题添加到页眉(右侧和左侧),并在顶部添加页码。

确实,我对文档的其余部分做了一些复杂的事情(包括下面的代码),但我认为这些不会影响目录。

目录的标题和页眉位置不当

以下是产生该问题的大部分代码:

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass[smallroyalvopaper,11pt]{memoir}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%     SET UP PAGE DIMENSIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\stockheight = 9.5in %795pt
\stockwidth = 6.25in %614pt
\headsep = 8pt
\headheight = 18pt
\footskip = 28pt

    \addtolength{\oddsidemargin}{-.875in}
    \addtolength{\evensidemargin}{-.875in}
    \addtolength{\textwidth}{1.75in}
    \addtolength{\topmargin}{-.875in}
    \addtolength{\textheight}{1.75in}

\setlrmarginsandblock{2.0cm}{2.0cm}{*}
\setulmarginsandblock{1.0cm}{1.5cm}{*}
\checkandfixthelayout[fixed]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength{\parskip}{0pt} %MEMOIR CLASS ALREADY DEFINES PARSKIP

\usepackage{xparse}     
\usepackage{microtype}  
\usepackage{lettrine}   
\usepackage{eso-pic}    
\usepackage{multicol}   
\usepackage{fontspec}   
\usepackage[margin=0.8in]{geometry}
\usepackage{marginnote}
\usepackage{newunicodechar}
\newunicodechar{^^^^200b}{^^^^200b\allowbreak}

\setromanfont[Mapping=tex-text]{Saysettha OT}   
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Saysettha OT}
\setmonofont[Scale=MatchLowercase]{Saysettha OT}
\setmainfont{Saysettha OT}[WordSpace={0.6,0.8,0.6}] %Nominal, stretch, shrink

\makeatletter

% plan b make multicol add two rules
\setlength\columnseprule{0.5pt}
\def\LR@column@boxes{%
     \process@cols\mult@gfirstbox{%
       \ifdim\dp\count@>\dimen\tw@
         \global\dimen\tw@\dp\count@ \fi
       \mc@col@status@write
       \box\count@
       \kern3pt %
       {\columnseprulecolor\vrule\@width\columnseprule}%
       \hss
       {\columnseprulecolor\vrule \@width\columnseprule}%
       \kern3pt}%
     \ifdim\dp\mult@rightbox>\dimen\tw@
       \global\dimen\tw@\dp\mult@rightbox \fi
     \mc@lastcol@status@write
     \box\mult@rightbox
}
\LRmulticolcolumns

\makeatother

%\thispagestyle{bookstart}
\makepagestyle{bookstart}% Create bookstart page style
\makeevenfoot{bookstart}% Adjust even footer for bookstart page style
  {}% Left even footer
  {\thepage}% Center even footer
  {}% Right even footer
\makeoddfoot{bookstart}% Adjust odd footer for bookstart page style
  {}% Left odd footer
  {\thepage}% Center odd footer
  {}% Right odd footer
\makefootrule{bookstart}{\textwidth}{.4pt}{\footruleskip}% Footer rule width/thickness/skip for bookstart page style


\copypagestyle{chapter}{plain}% Copy plain page syle to chapter page style
\makeoddhead{chapter}% Adjust odd header for chapter page style
  {\leftmark}% Left odd header
  {\thepage}% Center odd header
  {\rightmark}% Right odd header
\makeevenhead{chapter}% Adjust odd header for chapter page style
  {\leftmark}% Left odd header
  {\thepage}% Center odd header
  {\rightmark}% Right odd header
\makepagestyle{ptkpage}% Create ptkpage page style
\makeevenhead{ptkpage}% Adjust even header for ptkpage page style
  {\rightmark}% Left even header
  {\thepage}% Center even header
  {\leftmark}% Right even header
\makeoddhead{ptkpage}% Adjust odd header for ptkpage page style
  {\rightmark}% Left odd header
  {\thepage}% Center odd header
  {\leftmark}% Right odd header
\makeheadrule{ptkpage}{\textwidth}{.4pt}% Header rule width/thickness for ptkpage page style
%\makefootrule{ptkpage}{\textwidth}{.4pt}{\footruleskip}% Footer rule width/thickness/skip for ptkpage page style

\pagestyle{ptkpage}% Set page style to ptkpage

\usepackage{wrapfig,graphicx,lipsum}    
\setlength{\parindent}{0em}
\renewcommand{\contentsname}{ເນື້ອໃນ}
\raggedbottom


% code to create chapters, verses, and cross references
\ExplSyntaxOn

\int_new:N \crossref_int
\int_new:N \vs_int
\int_new:N \ch_int 
\tl_new:N \crossref_tl
\seq_new:N \l_ptk_my_seq

% insert a cross reference
\NewDocumentCommand {\crossref} {m}
  {
% BEGIN BOOK TITLE MODIFICATION
    \int_compare:nNnT { \ch_int } = { 1 }
        {
        \int_compare:nNnT { \vs_int } = { 1 }
            {
                \sidebar  { \rule[30pt]{0pt}{-0.3\baselineskip} }
            }
        }  
% END BOOK TITLE MODIFICATION

%   \int_compare:nNnT { \crossref_int } > { 25 }    %25 for letters of alphabet
%      {
%        \int_set:Nn \crossref_int { 0 }
%      }
%    \int_incr:N \crossref_int

% ADD Chapter Number to sidebar
    \int_compare:nNnT { \vs_int } = { 1 }
        {
            \sidebar  { \hrule }
            \sidebar  { {\centering ບົດທີ \,\, \int_use:N \ch_int \par} } 
            \sidebar  { \hrule }
            \tl_if_empty:NF \crossref_tl
              {
                \sidebar
                  {
                    (\textbf { 1 }) \, \tl_use:N \crossref_tl
                  }
              }
            \tl_gclear:N \crossref_tl
        }   
    
% PROVIDES SUPERSCRIPTS FOR REFERENCES
%    \textsuperscript{ \emph { \int_to_alph:n { \crossref_int } } }

    \tl_if_empty:NF \crossref_tl
      {
        \tl_gput_right:Nn \emph { \crossref_tl { ~ } }
      }
    \tl_gput_right:Nx \crossref_tl
      {
% PROVIDES SUPERSCRIPTS FOR REFERENCES
%        \exp_not:N \textsuperscript
%          {
%            \exp_not:N \emph { \int_to_alph:n { \crossref_int } }
%          }
        \, #1
      }
    
    \tl_if_empty:NF \crossref_tl
              {
                \sidebar
                  {
                    (\textbf { \int_use:N \vs_int }) \, \tl_use:N \crossref_tl
                  }
              }
            \tl_gclear:N \crossref_tl  
  }

%Sample output
% insert chapter marker
\NewDocumentCommand {\ch} {m}
  {
    \int_gset:Nn \ch_int { #1 }
    \int_gset:Nn \vs_int {1}
    \par\textbf{\huge \int_use:N \ch_int \, }
  }

% output cross references from previous verse and insert verse marker
\NewDocumentCommand {\vs} {m}
  {
    \tl_if_empty:NF \crossref_tl
      {
        \sidebar
          {
            (\textbf { \int_use:N \vs_int }) \, \tl_use:N \crossref_tl
          }
      }
    \int_gset:Nn \vs_int { #1 }
    \tl_gclear:N \crossref_tl
    \par\textbf{#1 \, }
  }

% output any remaining cross references
\AtEndDocument
  {
    \tl_if_empty:NF \crossref_tl
      {
        \sidebar
          {
            \textbf { \int_use:N \vs_int } \, \tl_use:N \crossref_tl
          }
      }
  }

\ExplSyntaxOff


% set up centre column location and size
\setlength\columnsep{2.2cm}     %ORIGINAL: {2.5cm}
\setlength{\sidebarhsep}{\dimexpr -0.5\textwidth - 0.5\columnsep + 2mm}
\setlength{\sidebarwidth}{\dimexpr \columnsep - 4mm}
\sidebarmargin{left}        % ADDED THIS LINE
\renewcommand{\sidebarfont}{\footnotesize\normalfont}
\renewcommand*{\sidebarform}{\raggedright\hangindent 1mm}
\setlength{\sidebarvsep}{0.5ex}
\setsidebarheight{\dimexpr \textheight - 1ex}

\newcommand{\chapterhead}[1]{ % THIS IS A SIMPLIFIED VERSION
   \clearforchapter        % move to correct page
   \thispagestyle{chapter} % set the page style
   \insertchapterspace     % Inserts space into LoF and LoT
   \chapterheadstart       % \beforechapskip space before heading
   \printchaptername\chapternamenum\printchapternum
   \afterchapternum        % \midchapskip space between number and title
   \printchaptertitle{#1}  % title
   \afterchaptertitle}     % \afterchapskip space after title

%\RequirePackage{multicol}
%\renewcommand\cfttocprehook{\begin{multicols}{2}}
%\renewcommand\cfttocposthook{\end{multicols}}


\begin{document}

\frontmatter


%----------------------------------------------------------------------------------------
%   TITLE PAGE
%----------------------------------------------------------------------------------------

\pagestyle{empty}

% TITLE PAGE CONTENTS SNIPPED

\pagestyle{bookstart}
\cleardoublepage

\renewcommand*{\contentsname}{ເນື້ອໃນ}
\twocoltocetc 
\tocheadstart
% \printtoctitle{\contentsname}
% \tocmark
% \thispagestyle{bookstart}
%\aftertoctitle

\thispagestyle{bookstart}
\tableofcontents*   %ASTERISK PREVENTS TOC ENTERING TOC ITSELF

\cleardoublepage

\mainmatter
\pagestyle{ptkpage}


\clearforchapter

{\centering{\Large {\fontsize{26}{26}\selectfont \textbf{ປະຖົມມະການ}}} \par}
\markboth{ປະຖົມມະການ 1}{ປະຖົມມະການ 1}
\addcontentsline{toc}{chapter}{ປະຖົມມະການ}
\begin{multicols}{2}

\thispagestyle{bookstart}
\lettrine[findent=0pt,nindent=0.5em]{\selectfont \textbf{\ch{1}} }{ }\markboth{ປະຖົມມະການ 1}{ປະຖົມມະການ 1}
\crossref{ຢຮ 1:1-2; ຮຣ 1:10; ພສສ 8:3; ອຊຢ 44:24; ກຈກ 17:24; ພນມ 4:11}
\rule[10pt]{0pt}{-0.3\baselineskip}ໃນ \rule[10pt]{0pt}{-0.3\baselineskip}ເລີ່ມຕົ້ນ \rule[10pt]{0pt}{-0.3\baselineskip}ນັ້ນ \rule[10pt]{0pt}{-0.3\baselineskip}ພຣະເຈົ້າ \rule[10pt]{0pt}{-0.3\baselineskip}ຊົງ \rule[10pt]{0pt}{-0.3\baselineskip}ນິລະມິດ \rule[10pt]{0pt}{-0.3\baselineskip}ສ້າງ \rule[10pt]{0pt}{-0.3\baselineskip}ຟ້າສະຫວັນ \rule[10pt]{0pt}{-0.3\baselineskip}ແລະ \rule[10pt]{0pt}{-0.3\baselineskip}ແຜ່ນດິນໂລກ.
\vs{2}
\crossref{ຢມຢ 4:23; ພສສ 33:6; ອຊຢ 40:13-14}
\rule[10pt]{0pt}{-0.3\baselineskip}ແລະ \rule[10pt]{0pt}{-0.3\baselineskip}ແຜ່ນດິນໂລກ \rule[10pt]{0pt}{-0.3\baselineskip}ນັ້ນ \rule[10pt]{0pt}{-0.3\baselineskip}ກໍ \rule[10pt]{0pt}{-0.3\baselineskip}ປາສະຈາກ \rule[10pt]{0pt}{-0.3\baselineskip}ຮູບຮ່າງ \rule[10pt]{0pt}{-0.3\baselineskip}ແລະ \rule[10pt]{0pt}{-0.3\baselineskip}ຫວ່າງເປົ່າ; \rule[10pt]{0pt}{-0.3\baselineskip}ຄວາມມືດ \rule[10pt]{0pt}{-0.3\baselineskip}ຢູ່ \rule[10pt]{0pt}{-0.3\baselineskip}ເທິງ \rule[10pt]{0pt}{-0.3\baselineskip}ໜ້າ \rule[10pt]{0pt}{-0.3\baselineskip}ຄວາມເລິກ \rule[10pt]{0pt}{-0.3\baselineskip}ແລະ \rule[10pt]{0pt}{-0.3\baselineskip}ພຣະວິນຍານ \rule[10pt]{0pt}{-0.3\baselineskip}ຂອງ \rule[10pt]{0pt}{-0.3\baselineskip}ພຣະເຈົ້າ \rule[10pt]{0pt}{-0.3\baselineskip}ເຄື່ອນໄຫວ \rule[10pt]{0pt}{-0.3\baselineskip}ເທິງ \rule[10pt]{0pt}{-0.3\baselineskip}ໜ້ານໍ້າ \rule[10pt]{0pt}{-0.3\baselineskip}ທັງຫຼາຍ.

% TRUNCATED

答案1

不是一个答案,但是,是的,你确实似乎在做一些复杂的事情。你的 MWE 被截断,因此无法处理。不知道你为什么使用multicols而不是twocolumn(你可以在两列之间的间距中设置垂直线,但有时看起来很奇怪)。目录标题是根据文档的章节样式设置的。

以下是一种最小的 MWE,显示默认的memoir两列目录。

% memtocprob.tex  SE 600491
\documentclass[smallroyalvopaper,11pt,twocolumn,openany]{memoir}
\usepackage{lipsum}
\setcolsepandrule{1em}{0.4pt}

\setlength{\textheight}{0.5\textheight}
\begin{document}
\frontmatter
\twocoltocetc
\tableofcontents
\mainmatter
\chapter{One}
\lipsum[1-3]
\section{I}
\section{II}
\section{III}
\section{IV}
\section{V}
\chapter{Two}
\section{I}
\section{II}
\section{III}
\section{IV}
\section{V}
\chapter{Three}
\section{I}
\section{II}
\section{III}
\section{IV}
\section{V}
\chapter{Four}
\section{I}
\section{II}
\section{III}
\section{IV}
\section{V}
\chapter{Five}
\section{I}
\section{II}
\section{III}
\section{IV}
\section{V}
\chapter{Six}
\section{I}
\section{II}
\section{III}
\section{IV}
\section{V}
\chapter{Seven}
\section{I}
\section{II}
\section{III}
\section{IV}
\section{V}
\end{document}

在此处输入图片描述

我怀疑您可能必须重新检查您的 chapterstyle 代码或重新定义 ToC 等代码。

相关内容