
我確實花了大約 20-30 分鐘的時間來尋找,但沒有成功實現我想要的。這很簡單。
我正在使用文章類,我想要它,以便我的附錄的標題
附錄 A:{插入標題}
現在我正在使用
\documentclass[a4,12pt]{article}
\usepackage[titletoc,toc,title]{appendix}
\begin{document}
<main body of text>
\begin{appendices}
\section{Magnetic flux tubes}
Bunch of text
\end{appendices}
但我一直把它當作我的附錄標題。
A. 磁通管。
我如何理解附錄 A:磁通管。
理想情況下,我想更改附錄標題的大小。
編輯:我的問題是我的文件序言中有這個
\usepackage{titlesec}
\usepackage{secdot}\sectiondot{subsection}\sectiondot{subsubsection}
%\renewcommand{\thesubsection}{\normalfont\arabic{section}.\arabic{subsection}}
\titleformat{\section}{\bf}{\thesection .}{0.5em}{}
\titleformat{\subsection}{\normalfont \it}{\thesubsection .}{0.5em}{}
\titleformat{\subsubsection}{\normalfont \it}{\thesubsubsection .}{0.6em}{}
我用它來讓文件標題看起來像我想要的那樣,但不幸的是這些新命令會傳遞到附錄部分。有沒有辦法只為附錄撤銷標題格式?
答案1
您可以\titleformat
在附錄之前再次使用以提供所需的格式:
\documentclass{article}
\usepackage{titlesec}
\usepackage[titletoc,toc,title]{appendix}
\titleformat{\section}{\bfseries}{\thesection.}{0.5em}{}
\titleformat{\subsection}{\normalfont\itshape}{\thesubsection.}{0.5em}{}
\titleformat{\subsubsection}{\normalfont\itshape}{\thesubsubsection.}{0.6em}{}
\begin{document}
\section{A regular section}
\titleformat{\section}{\large\bfseries}{\appendixname~\thesection .}{0.5em}{}
\begin{appendices}
\section{Magnetic flux tubes}
Bunch of text
\end{appendices}
\end{document}
要恢復部分的原始格式,但在您需要的數字後面添加單字「附錄」和點
\titleformat{\section}{\normalfont\Large\bfseries}{\appendixname~\thesection.}{1em}{}
兩個字母字體命令(\it
和\bf
類似命令)是舊的 TeX 命令,在現代 LaTeX 文件中不應再使用;使用\itshape
,\bfseries
代替。
答案2
我認為這應該可以解決問題。我的主程式碼如下所示:
\documentclass[10pt,twoside,a4paper]{report}
\usepackage[pdftex]{graphicx}
\begin{document}
\include{Introduction}
\include{Theory}
\renewcommand{\chaptername}{Appendix} % To change title from chapter to Appendix
\appendix
\renewcommand{\thepage}{\thechapter.\arabic{page}} % This to change the page numebering format for the Appendices
\setcounter{page}{1}
\include{FluxCalc}
\include{ForceFieldCalc}
\end{document}
我習慣於\include{}
為我的章節和附錄調用單獨的 .tex 檔案。我更喜歡這個,因為它使我的主要程式碼看起來更加整潔。這裡我呼叫了 4 個 .tex 檔 - 簡介、理論、FluxCalc(本例為附錄 A)和 ForceFieldCalc(本例為附錄 B)。輸出的 pdf 頁面如下圖所示。