章节标题自动大写

章节标题自动大写

我有一个大型项目(报告类),其中我要导入单独的文件。我想做的是将主文档和目录中章节/节/小节标题中的每个单词大写,就像通常的书籍标题的组织方式一样。如何在报告类中实现所需的输出(请参阅文章底部)?

\documentclass[a4paper,11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{import} 
% For subsubsection in report class
\setcounter{secnumdepth}{3} 
\setcounter{tocdepth}{3}

%%%%%%%%%%%%%%%%%%%%%
% LINE SPACING
\newcommand{\linespacing}{1.5}
\renewcommand{\baselinestretch}{\linespacing}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\pagestyle{plain}
% ANY OTHER DECLARATIONS HERE:
%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% HYPERREF
\usepackage[colorlinks,pagebackref,pdfusetitle,urlcolor=blue,citecolor=blue,linkcolor=blue,bookmarksnumbered,plainpages=false]{hyperref}

% For capitalization of all label names throughout the document (not working)

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

% TABLE OF CONTENTS, LISTS OF TABLES & FIGURES
\newpage
\pdfbookmark[0]{Contents}{contents_bookmark}
\tableofcontents
%%%%%%%%%%

\chapter{Introduction}
\input{file1}
    
\end{document}

在 file1.tex 中,我有这些。

    \section{section file1}\label{file1}
    \subsection{capital letter for first letters except for `and', `in', `for', etc.}
    \subsubsection{the theory of everything}
    \subsubsection{how it works}
    \subsubsection{relationship between A and B}

期望的结果是 在此处输入图片描述 在此处输入图片描述

相关内容