更改标题大小写,保留第一个大写字母,八度音程类

更改标题大小写,保留第一个大写字母,八度音程类

八度字体非常适合我刚看完的一本只有文字的书,没有数学公式,只有几个化学方程式。我对布局非常满意,除了一些我无法更改的细节,需要帮助:某些页面的页眉。正文的页眉很优雅:第一个大写字母后面跟着小写字母,全部是小写字母。然而,在某些部分,页眉全是大写字母。问题是,如何解决这个问题?

下面是一个最小的例子。它会产生相当长的输出(40 页),但这是必须的。

漂亮的页眉(要保留并用作模型)是第 4 页(序言)第 6、8、10、14 页(所有正常章节)

丑陋的标题(在我看来)是:第 2 页(内容)第 36 页(参考书目)第 40 页(名称索引)

第 38 页没有页眉。我将其用作词汇表,这样条目就会按引用顺序显示,而不是按字母顺序显示。为此,我使用了 \endnote。

感谢您的帮助。

编译示例需要文件 biblatex-examples.bib,可从以下位置下载: https://mirror.hmc.edu/ctan/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib

所有的包裹都包含在序言中,因为它们可能会发生干扰。

\documentclass[foolscap,10pt,openright]{octavo}
%Preample
\makeatletter
\def\input@path{{./}{./octavo}}
\makeatother

\usepackage{bibref,autind} % For newindex
\usepackage[utf8]{inputenc} %Trans­lates var­i­ous stan­dard and other in­put en­cod­ings into a LaTeX in­ter­nal lan­guage
\usepackage[T1]{fontenc} %Al­lows to se­lect font en­cod­ings. Its most pow­er­ful ef­fect is to en­able hy­phen­ation. 
\usepackage[portuguese]{babel}

%Bibliografia
\usepackage[fixlanguage]{babelbib} %fixlanguage
\selectbiblanguage{brazil} 
\setbtxfallbacklanguage{portuguese}
\usepackage[version=4]{mhchem} %For chemical equations
\usepackage{lettrine}

% Optical margins, kerning etc.
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,babel=true]{microtype} 
\usepackage{xspace}
\usepackage{emptypage} % Needed sometimes
\usepackage{cfr-lm} %Old style numerals
\usepackage{endnotes} % Simultaneously endnote and footnote

%Insert () for endnotes 
\renewcommand*\makeenmark{\hbox{\textsuperscript{\@({\theenmark})}}}
% Personaliza o cabeçalho das notas finais (ver manual)
\renewcommand{\notesname}{\null}
% For beautifull quotes
\usepackage[autostyle=false,csdisplay=true,threshold=1,thresholdtype=words,csdisplay=true]{csquotes}

% Decrease font size when quoting 
\usepackage{relsize,etoolbox}
\AtBeginEnvironment{quote}{\smaller\protect}
\AtBeginEnvironment{quotation}{\smaller\protect}
\usepackage{ebgaramond}%Nice font for text books (no Math needed)
\newcommand{\nomedepgm}[1]{\textsf{\smaller #1}}% Used with program names

% Nice for pages like \putoncenter{The end}
\newcommand{\putoncenter}[1]{
\cleardoublepage
\thispagestyle{empty}
\null
\vfill
\begin{center}
{\sc #1}
\end{center}
\null
\vfill
}

\usepackage{lipsum}

% New index
\newindex{idenomes}{ndx}{nnx}{\protect{\'{I}ndice de nomes}}\index[idenomes]{John7 Doe1}

\begin{document}
\tableofcontents

\chapter{Prefácio} \lipsum[1]John\cite{baez/article} read\index[idenomes]{John Doe1}.\lipsum[2]

%Chapters 1, 2...  repeated just for getting more pages
\chapter{Here begins a story}
\lipsum[1-2]
He\index[idenomes]{Somebody Smith} said\footnote{This book contains footnotes.} something useful\cite{gillies}.
\lipsum[3-4]
A word\endnote{\emph{Word} is a set of letters with a meaning.}
\lipsum[5]
She\index[idenomes]{Mary Doe} said\footnote{This book contains footnotes.} something useful\cite{glashow}.
\lipsum[6]

\chapter{The story goes on}
\lipsum[7]\cite{stdmodel}
John\index[idenomes]{John Doe1}\endnote{\emph{Latin} is an old language.},
John\index[idenomes]{John Doe2}\endnote{\emph{Water}, \ce{H2O}, is a liquid.},
John\index[idenomes]{John Doe3}\endnote{\emph{\sc PC} stands for \emph{personal computer}.},
John\index[idenomes]{John Doe4}\endnote{\emph{John Doe} is a random name.},
John\index[idenomes]{John Doe5}\endnote{\emph{Minimal} should be less than two pages.},
John\index[idenomes]{John1 Doe1}\endnote{\emph{Lipsum} makes this: \lipsum[13]},
John\index[idenomes]{John2 Doe2}\endnote{\emph{Lipsum} makes also this: \lipsum[14]},
John\index[idenomes]{John3 Doe3},
John\index[idenomes]{John4 Doe4} and
John\index[idenomes]{John5 Doe5}\cite{murray}\nocite{reese}
said \lipsum[8]
\lipsum[6]\cite{aksin}
John\index[idenomes]{John6 Doe1},
John\index[idenomes]{John6 Doe2}\cite{bertram}
John\index[idenomes]{John6 Doe3}
John\index[idenomes]{John6 Doe4}
John\index[idenomes]{John6 Doe5}\cite{doody}
John\index[idenomes]{John7 Doe1}
John\index[idenomes]{John7 Doe2}
John\index[idenomes]{John8 Doe3}
John\index[idenomes]{John8 Doe4}
John\index[idenomes]{John90 Doe57}
John\index[idenomes]{John8 Doe5}
\lipsum[9]\cite{angenendt}

\chapter{And keep going}
\lipsum[10]\cite{stdmodel}
John\index[idenomes]{John Doe1}
John\index[idenomes]{John Doe2}
John\index[idenomes]{John Doe3}
John\index[idenomes]{John Doe4}
John\index[idenomes]{John Doe5}
John\index[idenomes]{John1 Doe1}
John\index[idenomes]{John2 Doe2}
John\index[idenomes]{John3 Doe3}
John\index[idenomes]{John4 Doe4}
John\index[idenomes]{John5 Doe5}
John\index[idenomes]{John90 Doe57}
said \lipsum[11]
\lipsum[6]\cite{aksin}
John\index[idenomes]{John6 Doe1},
John\index[idenomes]{John6 Doe2}\cite{bertram}
John\index[idenomes]{John6 Doe3}
John\index[idenomes]{John6 Doe4}
John\index[idenomes]{John6 Doe5}\cite{doody}
John\index[idenomes]{John7 Doe1}
John\index[idenomes]{John7 Doe2}
John\index[idenomes]{John8 Doe3}
John\index[idenomes]{John8 Doe4}
John\index[idenomes]{John8 Doe5}
John\index[idenomes]{John90 Doe57}
\lipsum[12]\cite{angenendt}

\chapter{Fill toc and index}
There was a time\ldots
John\index[idenomes]{John61 Doe1},
John\index[idenomes]{John62 Doe2}\cite{bertram}
John\index[idenomes]{John63 Doe3}
John\index[idenomes]{John64 Doe4}
John\index[idenomes]{John65 Doe5}\cite{doody}
John\index[idenomes]{John76 Doe1}
John\index[idenomes]{John77 Doe2}
John\index[idenomes]{John88 Doe3}
John\index[idenomes]{John89 Doe4}
John\index[idenomes]{John90 Doe5}
John\index[idenomes]{John90 Doe57}

\chapter{Fill toc and index: part 2}
There was a time\ldots
John\index[idenomes]{John61 Doe11},
John\index[idenomes]{John62 Doe22}\cite{sarfraz}
John\index[idenomes]{John63 Doe33}
John\index[idenomes]{John64 Doe44}
John\index[idenomes]{John65 Doe55}\cite{shore}
John\index[idenomes]{John76 Doe15}
John\index[idenomes]{John77 Doe26}
John\index[idenomes]{John88 Doe36}
John\index[idenomes]{John89 Doe46}
John\index[idenomes]{John90 Doe57}

\chapter{Fill just toc}
There was a time\ldots 
\chapter{Fill toc: part 2}
There was a time\ldots
\chapter{Fill toc: part 3}
There was a time\ldots
\chapter{Fill toc: part 4}
There was a time\ldots
\chapter{Fill toc: part 5}
There was a time\ldots
\chapter{Fill toc: part 6}
There was a time\ldots
\chapter{Fill toc: part 7}
There was a time\ldots
\chapter{Fill toc: part 8}
There was a time\ldots

%Bibliography
\newpage
\backmatter
\bibliography{biblatex-examples.bib}
\bibliographystyle{unsrt}

%I used a kind of glossary, but like a chapter
%Chapter used as glossary
\chapter*{Glossário}
% I forgot where the following lines of code came from!
% Without them, it does not work.
\begingroup
\parindent 0pt
\parskip 2ex

\def\enotesize{\normalsize}
\theendnotes
\endgroup

% Here comes a name index
\printindex[idenomes]
\end{document}

答案1

\MakeUppercase您可以通过从适当的位置移除可怕的标题来修复坏标题。

我还做了一些其他的修复。

  1. 不要使用(在下面的代码中\null寻找)\vspace*
  2. 你的\protect命令根本没有起到任何作用(甚至可能起到了坏作用)
  3. 加载cfr-lmebgaramond无用的,因为后者覆盖了前者,稍后被调用
  4. 第 38 页上缺少的标题是由于与的神秘交互造成的endnotes;我建议使用enotez更加灵活的方法。

这是代码。

\documentclass[foolscap,10pt,openright]{octavo}
%Preamble
\makeatletter
%\def\input@path{{./}{./octavo}}
\makeatother

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[portuguese]{babel}
\usepackage{bibref,autind}

%Bibliografia
\usepackage[fixlanguage]{babelbib}
\selectbiblanguage{brazil} 
\setbtxfallbacklanguage{portuguese}
\usepackage[version=4]{mhchem} %For chemical equations
\usepackage{lettrine}

% Optical margins, kerning etc.
\usepackage[
  activate={true,nocompatibility},
  final,
  tracking=true,
  kerning=true,
  spacing=true,
  babel=true,
]{microtype} 
%\usepackage{xspace}
\usepackage{emptypage}
%\usepackage{cfr-lm} % you have ebgaramond later
\usepackage{enotez}

\usepackage[
  autostyle=false,
  csdisplay=true,
  threshold=1,
  thresholdtype=words,
  csdisplay=true,
]{csquotes}

% Decrease font size when quoting 
\usepackage{relsize,etoolbox}
\usepackage{ebgaramond}%Nice font for text books (no Math needed)

\usepackage{lipsum}

\AtBeginEnvironment{quote}{\smaller}
\AtBeginEnvironment{quotation}{\smaller}

%Insert () for endnotes
\renewcommand\enmark{\textsuperscript{(\theenmark)}}
\DeclareInstance{enotez-list}{custom}{paragraph}
 {
  heading = \chapter{Glossário},
  notes-sep = 0pt,
  format = \normalfont,
  number = \textsuperscript{(#1)}
 }

\newcommand{\nomedepgm}[1]{\textsf{\smaller #1}}% Used with program names

% Nice for pages like \putoncenter{The end}
\newcommand{\putoncenter}[1]{%
  \cleardoublepage
  \thispagestyle{empty}
  \vspace*{\fill}
  \begin{center}
  \scshape #1
  \end{center}
  \vspace*{\fill}
}

% New index
\newindex{idenomes}{ndx}{nnx}{\'{I}ndice de nomes}
%\index[idenomes]{John7 Doe1}

% fix the headers
\patchcmd{\tableofcontents}{\MakeUppercase}{}{}{}
\patchcmd{\tableofcontents}{\MakeUppercase}{}{}{}
\patchcmd{\theindex}{\MakeUppercase}{}{}{}
\patchcmd{\theindex}{\MakeUppercase}{}{}{}
\patchcmd{\thebibliography}{\MakeUppercase}{}{}{}
\patchcmd{\thebibliography}{\MakeUppercase}{}{}{}


\begin{document}

\tableofcontents

\chapter{Prefácio}

\lipsum[1]
John\cite{baez/article} read\index[idenomes]{John Doe1}.
\lipsum[2]

\chapter{Here begins a story}

\lipsum[1-2]
He\index[idenomes]{Somebody Smith} said\footnote{This book contains footnotes.} 
something useful\cite{gillies}.
\lipsum[3-4]
A word\endnote{\emph{Word} is a set of letters with a meaning.}
\lipsum[5]
She\index[idenomes]{Mary Doe} said\footnote{This book contains footnotes.} 
something useful\cite{glashow}.
\lipsum[6]

\chapter{The story goes on}
\lipsum[7]\cite{stdmodel}
John\index[idenomes]{John Doe1}\endnote{\emph{Latin} is an old language.},
John\index[idenomes]{John Doe2}\endnote{\emph{Water}, \ce{H2O}, is a liquid.},
John\index[idenomes]{John Doe3}\endnote{\emph{\sc PC} stands for \emph{personal computer}.},
John\index[idenomes]{John Doe4}\endnote{\emph{John Doe} is a random name.},
John\index[idenomes]{John Doe5}\endnote{\emph{Minimal} should be less than two pages.},
John\index[idenomes]{John1 Doe1}\endnote{\emph{Lipsum} makes this: \lipsum[13]},
John\index[idenomes]{John2 Doe2}\endnote{\emph{Lipsum} makes also this: \lipsum[14]},
John\index[idenomes]{John3 Doe3},
John\index[idenomes]{John4 Doe4} and
John\index[idenomes]{John5 Doe5}\cite{murray}\nocite{reese}
said \lipsum[8]
\lipsum[6]\cite{aksin}
John\index[idenomes]{John6 Doe1},
John\index[idenomes]{John6 Doe2}\cite{bertram}
John\index[idenomes]{John6 Doe3}
John\index[idenomes]{John6 Doe4}
John\index[idenomes]{John6 Doe5}\cite{doody}
John\index[idenomes]{John7 Doe1}
John\index[idenomes]{John7 Doe2}
John\index[idenomes]{John8 Doe3}
John\index[idenomes]{John8 Doe4}
John\index[idenomes]{John90 Doe57}
John\index[idenomes]{John8 Doe5}
\lipsum[9]\cite{angenendt}

\chapter{And keep going}
\lipsum[10]\cite{stdmodel}
John\index[idenomes]{John Doe1}
John\index[idenomes]{John Doe2}
John\index[idenomes]{John Doe3}
John\index[idenomes]{John Doe4}
John\index[idenomes]{John Doe5}
John\index[idenomes]{John1 Doe1}
John\index[idenomes]{John2 Doe2}
John\index[idenomes]{John3 Doe3}
John\index[idenomes]{John4 Doe4}
John\index[idenomes]{John5 Doe5}
John\index[idenomes]{John90 Doe57}
said \lipsum[11]
\lipsum[6]\cite{aksin}
John\index[idenomes]{John6 Doe1},
John\index[idenomes]{John6 Doe2}\cite{bertram}
John\index[idenomes]{John6 Doe3}
John\index[idenomes]{John6 Doe4}
John\index[idenomes]{John6 Doe5}\cite{doody}
John\index[idenomes]{John7 Doe1}
John\index[idenomes]{John7 Doe2}
John\index[idenomes]{John8 Doe3}
John\index[idenomes]{John8 Doe4}
John\index[idenomes]{John8 Doe5}
John\index[idenomes]{John90 Doe57}
\lipsum[12]\cite{angenendt}

\chapter{Fill toc and index}
There was a time\ldots
John\index[idenomes]{John61 Doe1},
John\index[idenomes]{John62 Doe2}\cite{bertram}
John\index[idenomes]{John63 Doe3}
John\index[idenomes]{John64 Doe4}
John\index[idenomes]{John65 Doe5}\cite{doody}
John\index[idenomes]{John76 Doe1}
John\index[idenomes]{John77 Doe2}
John\index[idenomes]{John88 Doe3}
John\index[idenomes]{John89 Doe4}
John\index[idenomes]{John90 Doe5}
John\index[idenomes]{John90 Doe57}

\chapter{Fill toc and index: part 2}
There was a time\ldots
John\index[idenomes]{John61 Doe11},
John\index[idenomes]{John62 Doe22}\cite{sarfraz}
John\index[idenomes]{John63 Doe33}
John\index[idenomes]{John64 Doe44}
John\index[idenomes]{John65 Doe55}\cite{shore}
John\index[idenomes]{John76 Doe15}
John\index[idenomes]{John77 Doe26}
John\index[idenomes]{John88 Doe36}
John\index[idenomes]{John89 Doe46}
John\index[idenomes]{John90 Doe57}

\chapter{Fill just toc}
There was a time\ldots 
\chapter{Fill toc: part 2}
There was a time\ldots
\chapter{Fill toc: part 3}
There was a time\ldots
\chapter{Fill toc: part 4}
There was a time\ldots
\chapter{Fill toc: part 5}
There was a time\ldots
\chapter{Fill toc: part 6}
There was a time\ldots
\chapter{Fill toc: part 7}
There was a time\ldots
\chapter{Fill toc: part 8}
There was a time\ldots

\cleardoublepage
\backmatter

%Bibliography
\bibliographystyle{unsrt}
\bibliography{biblatex-examples.bib}

%I used a kind of glossary, but like a chapter
\printendnotes[custom]

% Here comes a name index
\printindex[idenomes]

\end{document}

相关内容