![章节标题采用大写字母](https://linux22.com/image/373009/%E7%AB%A0%E8%8A%82%E6%A0%87%E9%A2%98%E9%87%87%E7%94%A8%E5%A4%A7%E5%86%99%E5%AD%97%E6%AF%8D.png)
参考我之前的问题:目录样式变更
如何实现这个才能得到我在标题中提到的效果。例如。第 1 章,第 2 章等等,甚至在目录和章节开头。任何帮助都非常感谢。
答案1
重新定义\chaptername
为\MakeUppercase{\chapoldname}
并将更改写入 ToC 本身。
\documentclass[11pt]{report}
\usepackage{amsmath, mathrsfs}
\usepackage{amssymb}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{tocloft}
\usepackage[nottoc,notlot]{tocbibind}
\let\chapnameold\chaptername
\addtolength{\cftchapnumwidth}{65pt}
\renewcommand{\cftchappresnum}{\textbf{\chaptername}~}
\makeatletter
\AtBeginDocument{%
\renewcommand{\bibname}{References}
\addtocontents{toc}{\protect\renewcommand{\protect\chaptername}{\MakeUppercase{\protect\chapnameold}}}
\renewcommand{\chaptername}{\MakeUppercase{\chapnameold}}
}
\makeatother
%\linespread{1.4}
\pagestyle{myheadings}
\title{This is the title}
\author{Author A and Author B}
\date{}
\begin{document}
\maketitle
\cite{Lam94}
\tableofcontents
\chapter{Foo}
\section{This is section 1}
\subsection{This is a subsection}
\section{This is section 2}
\subsection{This is a subsection}
\chapter{Foobar}
\clearpage
\bibliographystyle{abbrv}
\bibliography{biblio}
\end{document}