更改目录中章节后的编号

更改目录中章节后的编号

目录中的罗马章节,它对定理,定义等有影响。我想将目录中的章节编号改为罗马数字,就像图中的第一章一样。

在此处输入图片描述在此处输入图片描述

\documentclass[12pt,a4paper]{report}
\usepackage{amssymb,amsmath,amsthm,latexsym}
\usepackage{pdfpages}
%==============THEOREM=================
\newtheorem{thm}{Theorem}[chapter]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{prop}[thm]{Proposition}
\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}
\newtheorem{exam}[thm]{Example}
\newtheorem{rem}[thm]{Remark}
%=================Content=======================
\usepackage{tocloft}
\renewcommand{\chaptername}{CHAPTER}
\addtocontents{toc}{~\hfill{\small Page}\par}
\renewcommand{\cfttoctitlefont}{\hfill\Large\bfseries}  
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand\cftchappresnum{\chaptername\space} 
\renewcommand\cftchapnumwidth{7em} 
\renewcommand\cftsecindent{4em} 
\renewcommand\cftsecnumwidth{2em} 
\renewcommand\cftsubsecindent{6em}
\renewcommand\cftsubsecnumwidth{3em}
%=============Set Chapter in Page==============
\usepackage{titlesec}
\titleformat{\chapter}[display]{\normalfont\Large\bfseries\centering}{\chaptername\space\Roman{chapter}}{20pt}{\uppercase}

\begin{document}
\tableofcontents
\chapter{First}
\section{first section}
\section{second section}
\subsection{first}
\begin{thm}
ajsdkla sadjka $a=b$
\end{thm}
\chapter{Second}
\section{first section}
\begin{defn}
asjdk asdk sadjk $a=b$
\end{defn}
\end{document}

谢谢。

答案1

定义

\newcommand*{\Romannumeral}[1]{\uppercase\expandafter{\romannumeral#1}}

并改变

\renewcommand\cftchappresnum{\chaptername\space}

\renewcommand\cftchappresnum{\chaptername\space\Romannumeral}

然后你可能想要增加\cftchapnumwidth

\renewcommand\cftchapnumwidth{8em}

完成 MWE:

\documentclass[12pt,a4paper]{report}
\usepackage{amssymb,amsmath,amsthm,latexsym}
\usepackage{pdfpages}
%==============THEOREM=================
\newtheorem{thm}{Theorem}[chapter]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{prop}[thm]{Proposition}
\theoremstyle{definition}
\newtheorem{defn}[thm]{Definition}
\newtheorem{exam}[thm]{Example}
\newtheorem{rem}[thm]{Remark}
%=================Content=======================
\newcommand*{\Romannumeral}[1]{\uppercase\expandafter{\romannumeral#1}}
\usepackage{tocloft}
\renewcommand{\chaptername}{CHAPTER}
\addtocontents{toc}{~\hfill{\small Page}\par}
\renewcommand{\cfttoctitlefont}{\hfill\Large\bfseries}
\renewcommand{\cftaftertoctitle}{\hfill}
\renewcommand\cftchappresnum{\chaptername\space\Romannumeral}
\renewcommand\cftchapnumwidth{8em}
\renewcommand\cftsecindent{4em}
\renewcommand\cftsecnumwidth{2em}
\renewcommand\cftsubsecindent{6em}
\renewcommand\cftsubsecnumwidth{3em}
%=============Set Chapter in Page==============
\usepackage{titlesec}
\titleformat{\chapter}[display]{\normalfont\Large\bfseries\centering}{\chaptername\space\Roman{chapter}}{20pt}{\uppercase}

\begin{document}
\tableofcontents
\chapter{First}
\section{first section}
\section{second section}
\subsection{first}
\begin{thm}
ajsdkla sadjka $a=b$
\end{thm}
\chapter{Second}
\section{first section}
\begin{defn}
asjdk asdk sadjk $a=b$
\end{defn}
\end{document} 

输出:

在此处输入图片描述

相关内容