我有一个附录标题页,我想在上面整齐地列出所有不同的附录。这是我的代码:
\documentclass[letter,12pt]{article}
\usepackage{enumitem}
\begin{document}
\vfill
\LARGE\rmfamily\bfseries\centering APPENDICES
\noindent\textcolor{complement2}{\rule{0.75\textwidth}{2mm}}\par
\Large
\begin{enumerate}
\item Appendix A\hfill CFD Results \\
\item Appendix B\hfill Pump and Inlet Pipe Specifications\\
\item Appendix C\hfill Technical Drawings \\
\item Appendix D\hfill Cost Breakdown \\
\item Appendix E\hfill Some super other different thing\\
\end{enumerate}
\vfill
\end{document}
本质上,我想用 分隔“附录 X”和“标题” \hfill
。但是,如您所见,文本重叠并扩展到下一行。
如何使‘规格’右对齐?
答案1
您可以在环境enumerate
中模拟另一个环境tabularx
:
\documentclass[letter,12pt]{article}
\usepackage{enumitem}
\usepackage[svgnames]{xcolor}
\usepackage{tabularx}
\begin{document}
\vfill
\LARGE\rmfamily\bfseries\centering APPENDICES
\noindent\textcolor{Peru!90}{\rule{0.75\textwidth}{2mm}}\par
\vspace{\dimexpr\baselineskip + \topsep\relax}
\Large
\renewcommand\arraystretch{1.4}
\newcounter{tabenum}\setcounter{tabenum}{0}
\newcommand{\tabitem}{\stepcounter{tabenum}\,\thetabenum.\hspace{\labelsep}}
\begin{tabularx}{\linewidth}{l>{\raggedleft\arraybackslash}X@{}}
\tabitem Appendix A & CFD Results \\
\tabitem Appendix B & Pump and Inlet Pipe Specifications\\
\tabitem Appendix C & Technical Drawings \\
\tabitem Appendix D & Cost Breakdown \\
\tabitem Appendix E & Some super other different thing
\end{tabularx}
\vfill
\end{document}
添加:
另一种(语义上更清晰的)可能性是使用软件包的部分目录功能titletoc
:在附录的开头,您可以使用以下命令,例如,
\appendix
\startcontents[appendices]
\section{CFD Results}
…
\section{Some super other different thing}
\stopcontents[appendices]
并使用以下命令将其打印到您想要的任何位置:
\printcontents[appendices]{Appendix}{1}{}