我希望章节标题自动变为大写。因此,我将命令\titleformat
与titlesec
包一起使用。附带效果是章节标题的脚注也以大写形式显示。事实上,除了大写之外,它\protect\footnote
适用于所有文本格式(例如\slshape
)!
我该怎么办?这里有一个MWE:
\documentclass[english]{article}
\usepackage{titlesec}
\titleformat{\section}{\slshape\MakeUppercase}{\thesection.}{0.5em}{}
\usepackage{babel}
\begin{document}
\section{I want section title to be uppercase\protect\footnote{But I want the footnote text of a section title to be not uppercase}}
This is the section text
\end{document}
在上面的例子中:
章节标题是斜体和大写(均正确)
脚注不是斜体(这是正确的),但仍然是大写(我不想要这个!)
答案1
\documentclass[english]{article}
\usepackage{titlesec}
\titleformat{\section}{\slshape\MakeUppercase}{\thesection.}{0.5em}{}
\usepackage{babel}
\begin{document}
\tableofcontents
\section[I want section title to be uppercase]{I want section title to be uppercase\protect\footnotemark}
\footnotetext{But I want the footnote text of a section title to be not uppercase}
This is the section text
\end{document}