章节以标题和页码显示在左侧

章节以标题和页码显示在左侧

我正在使用类编写论文memoir。我有两个问题要获得漂亮的标题/页脚。首先,我希望页码位于页脚中,在右侧或左侧,但对于章节的第一页,它保持居中。然后,对于偶数页,我希望将当前章节的名称插入标题中。我找不到如何做这些事情。这是我的代码:

\documentclass[12pt]{memoir}

\usepackage{blindtext}
\usepackage[english]{babel}
\nouppercaseheads
\makepagestyle{these}
\makeevenhead{these}{\rightmark}{}{}
\makeoddhead{these}{}{}{\leftmark}
\makeheadrule{these}{\textwidth}{\normalrulethickness}
\makeevenfoot{these}{\thepage}{}{}
\makeoddfoot{these}{}{}{\thepage}
\makepsmarks{these}{%
\createmark{section}{left}{shownumber}{}{\ } 
\createmark{chapter}{right}{shownumber}{}{\ }
\createplainmark{toc}{both}{\contentsname}}
\pagestyle{these}

\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\frontmatter

\title{My title} 

\maketitle

\chapter{Thanks}
\tableofcontents

\chapter{Introduction}\label{intro}
\Blindtext

\mainmatter
\part{1st Part}

\chapter{My Chapter}
\section{My Section}

\Blindtext
\end{document}

答案1

这个网站上肯定有一个问题,已经给出了答案,但你可以这样做:

\documentclass[
a4paper, % Stock and paper size.
11pt, % Type size.
% article,
% oneside, 
onecolumn, % Only one column of text on a page.
% openright, % Each chapter will start on a recto page.
% openleft, % Each chapter will start on a verso page.
openany, % A chapter may start on either a recto or verso page.
]{memoir}

\usepackage{lipsum} % Will come in handy below...

%%% HEADER AND FOOTER 
%%%--------------------------------------------------------------

\makepagestyle{standard} % Make standard pagestyle

\makeatletter                 % Define standard pagestyle
\makeevenfoot{standard}{}{}{\thepage} % Even footer
\makeoddfoot{standard}{\thepage}{}{}  % Odd Footer
\makeevenhead{standard}{}{\leftmark}{} % ...
\makeoddhead{standard}{}{\leftmark}{}  %
% \makeheadrule{standard}{\textwidth}{\normalrulethickness}
\makeatother                  %

\makeatletter % Make marks (to put chapter title etc. in the header)
\makepsmarks{standard}{
\createmark{chapter}{both}{shownumber}{\@chapapp\ }{ \quad }
\createmark{section}{right}{shownumber}{}{ \quad }
\createplainmark{toc}{both}{\contentsname}
\createplainmark{lof}{both}{\listfigurename}
\createplainmark{lot}{both}{\listtablename}
\createplainmark{bib}{both}{\bibname}
\createplainmark{index}{both}{\indexname}
\createplainmark{glossary}{both}{\glossaryname}
}
\makeatother   

\makepagestyle{chap} % Make new chapter pagestyle

\makeatletter
\makeevenfoot{chap}{}{\thepage}{} % Define new chapter pagestyle
\makeoddfoot{chap}{}{\thepage}{}  %
\makeevenhead{chap}{}{}{}   %
\makeoddhead{chap}{}{}{}    %
% \makeheadrule{chap}{\textwidth}{\normalrulethickness}
\makeatother

\nouppercaseheads
\pagestyle{standard}               % Choosing pagestyle and chapter pagestyle
\aliaspagestyle{chapter}{chap} %

%%% DOCUMENT
%%%----------------------------------------------------------------------

\begin{document}

\chapter{Introduction}
\lipsum[1-10]

\chapter{Conclusions and Outlook}
\lipsum[1-10]

\end{document}

我不确定这是否正是您想要的。如果不是,我希望代码足够清晰,您可以自己进行更改。

相关内容