A方便的宏 egreg 制作效果很好,但在标题方面却不太好。\protect
它可以防止 TeX 消亡,但它似乎被隐藏了\spacedallcaps
。
\documentclass{article}
\usepackage{xspace}
\usepackage[nochapters,beramono]{classicthesis}
%% from https://tex.stackexchange.com/a/71094/31523
\newcommand{\species}[3]{%
\newcommand{#1}{\gdef#1{\textit{#3}\xspace}\textit{#2}\xspace}}
\species{\ecoli}{Escherichia coli}{E.~coli}
\species{\celegans}{Caenorhabditis elegans}{C.~elegans}
%%
\title{\spacedallcaps{Studying \protect\celegans eating \protect\ecoli.}}
\begin{document}
\maketitle
\ecoli is an example of a model species. People study \ecoli because
people have studied \ecoli. But \celegans is better.
\end{document}
替换\title{\spacedallcaps{Studying \textit{Caenorhabiditis Elegans} eating \protect\ecoli.}}
另一个后\title
,看起来更符合预期
答案1
您不应该在标题中使用物种名称宏,因为它肯定不能被视为首次出现。
标题中应避免使用宏,因为出版商可能希望使用\title
它来自动生成网页。我认为你\spacedallcaps
也不应该在标题中使用宏。
如果该论文是供个人使用(可能确实如此,因为没有出版商会接受classicthesis
),请使用\lsstyle
并手动插入物种名称。
\title{%
\lsstyle
STUDYING \textit{CAENORHABIDITIS ELEGANS}
EATING \textit{ESCHERICHIA COLI}%
}
或使用\MakeUppercase
:
\documentclass{article}
\usepackage{xspace}
\usepackage[nochapters,beramono]{classicthesis}
%% from http://tex.stackexchange.com/a/71094/31523
\newcommand{\species}[3]{%
\newcommand{#1}{\gdef#1{\textit{#3}\xspace}\textit{#2}\xspace}}
\species{\ecoli}{Escherichia coli}{E.~coli}
\species{\celegans}{Caenorhabditis elegans}{C.~elegans}
%%
\title{\lsstyle\MakeUppercase{%
Studying \textit{Caenorhabditis elegans}
eating \textit{Escherichia coli}}%
}
\begin{document}
\maketitle
\ecoli is an example of a model species. People study \ecoli because
people have studied \ecoli. But \celegans is better.
\end{document}
还要注意不要在章节标题中使用宏。问题是一样的:出现在那里的宏绝不能被视为第一个。如果你有目录,你会有一些惊喜。