![在目录中的 A 前添加“附录”一词](https://linux22.com/image/386677/%E5%9C%A8%E7%9B%AE%E5%BD%95%E4%B8%AD%E7%9A%84%20A%20%E5%89%8D%E6%B7%BB%E5%8A%A0%E2%80%9C%E9%99%84%E5%BD%95%E2%80%9D%E4%B8%80%E8%AF%8D.png)
你好,我想在目录中的字母 A 或 B 前添加单词“附录”。
我一直在浏览解决方案,但运气不佳。使用 \appendices 时,我失去了目录中我想保留的“子部分附录”功能。
这是我目前所拥有的:
\documentclass[12pt]{article}
%% Language and font encodings
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[toc,page]{appendix}
%% Sets page size and margins
\usepackage[a4paper,top=1in,bottom=1in,left=1in,right=1in]{geometry}
%% Useful packages
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage[colorlinks=true, allcolors=black]{hyperref}
\usepackage{url}
\usepackage[natbibapa]{apacite}
\usepackage{nameref}
\usepackage{setspace}
\usepackage{float}
\usepackage{titlesec}
\usepackage{makecell}
\usepackage{adjustbox}
\usepackage{titling}
\usepackage{fancyhdr}
\usepackage{changepage}
\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{}
\lfoot{}
\cfoot{\thepage}
\rfoot{\includegraphics[scale=0.17]{Images/umlogo.jpg}}
\renewcommand\headrulewidth{0pt}
\renewcommand\footrulewidth{0pt}
\usepackage[stable]{footmisc}
\begin{document}
\doublespacing
\renewcommand{\contentsname}{Table of contents}
\newpage
\tableofcontents
\newpage
\input{"Appendix.tex"}
\end{document}
对于附录文件:
\titleformat{\subsection}{\large\bfseries}{\appendixname~\thesubsection :}{0.5em}{}
\appendix
\section*{Appendices}
\addcontentsline{toc}{section}{Appendices}
\renewcommand{\thesubsection}{\Alph{subsection}}
\subsection{Pretests}
\label{apx:pretests}
\subsection{Another appendix Subsection}
答案1
使用appendices
环境和title
和titletoc
选项:
\documentclass[12pt]{article}
%% Language and font encodings
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[toc,page, title, titletoc]{appendix}
%% Sets page size and margins
\usepackage[a4paper,top=1in,bottom=1in,left=1in,right=1in]{geometry}
%% Useful packages
\usepackage{amsmath}
\usepackage[demo]{graphicx}
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{url}
\usepackage[natbibapa]{apacite}
\usepackage{nameref}
\usepackage{setspace}
\usepackage{float}
\usepackage{titlesec}
\usepackage{makecell}
\usepackage{adjustbox}
\usepackage{titling}
\usepackage{fancyhdr}
\usepackage{changepage}
\usepackage[colorlinks=true, allcolors=black]{hyperref}
\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{}
\lfoot{}
\cfoot{\thepage}
\rfoot{\includegraphics[scale=0.17]{Images/umlogo.jpg}}
\renewcommand\headrulewidth{0pt}
\renewcommand\footrulewidth{0pt}
\usepackage[stable]{footmisc}
\begin{document}
\doublespacing
\renewcommand{\contentsname}{Table of contents}
\newpage
\tableofcontents
\begin{appendices}
\section{Pretests}
\label{apx:pretests}
\section{Another appendix Subsection}
\end{appendices}
\end{document}