這個答案可能是一個長長的,但這個問題和previous question ,我想我知道你真的以後。如果這是完全錯誤的,請讓我知道,我會刪除這個答案。
我假設你希望你的文件看起來像以下:
要做到這一點,你應該使用report
文檔類,它給你切片額外的水平, \chapter
。每章包含多個部分,每個部分包含小節,子小節,段落等。爲您的文檔的基本設置是
\documentclass{report}
\begin{document}
% Frontmatter
\tableofcontents
% Main part
\chapter{Introduction}
My project is awesome! In this chapter, I am telling you why.
\chapter{Product Design}
\section{Product Perspective}
The product is supposed to be very nice and cool.
It shall satisfy all conditions and look awesome.
\end{document}
現在,實現了標題格式,你在這個問題要求,我們加載titlesec
包和配置\chapter
如下圖所示:
% Title formating
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\Large\bfseries} % Make title \large and bold
{\huge Chapter~\thechapter} % Write Chapter X in \huge font
{20pt} % 20pt distance between Chapter X and title
{}
[\vspace{1ex}\titlerule] % Add a line below chapter title
如果您雙面打印文檔,並希望所有章節都從雙頁的右側開始,那麼您可以簡單更改以下行替換\documentclass{report}
,並且不必在每章之前撥打\cleardoublepage
。這也使得邊際對稱。
\documentclass[twoside, openright]{report}
然後,在上一個問題中,您還有一個抽象和確認,其中包含羅馬頁碼。 默認情況下,LaTeX不會在內容列表中放置無編號的章節,如「摘要」,因此我們必須手動執行此操作。 這是做如下:
% Frontmatter
\pagenumbering{roman} % Frontmatter with roman page numbering
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract} % Add unnumbered chapter to table of contents
This is the short version of my work.
\chapter*{Acknowledgement}
\addcontentsline{toc}{chapter}{Acknowledgement} % Add unnumbered chapter to table of contents
I would like to thank everybody who helped me.
當然
,你就必須在第一章之前切換回阿拉伯數字頁碼。下面顯示了具有上述部分的整個代碼。
\documentclass{report}
% Title formating
\usepackage{titlesec}
\titleformat{\chapter}[display]
{\normalfont\Large\bfseries} % Make title \large and bold
{\huge Chapter~\thechapter} % Write Chapter X in \huge font
{20pt} % 20pt distance between Chapter X and title
{}
[\vspace{1ex}\titlerule] % Add a line below chapter title
\begin{document}
% Frontmatter
\pagenumbering{roman} % Frontmatter with roman page numbering
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract} % Add unnumbered chapter to table of contents
This is the short version of my work.
\chapter*{Acknowledgement}
\addcontentsline{toc}{chapter}{Acknowledgement} % Add unnumbered chapter to table of contents
I would like to thank everybody who helped me.
\tableofcontents
% Main part
\cleardoublepage
\pagenumbering{arabic} % Main part with arabic page numbering
\chapter{Introduction}
My project is awesome! In this chapter, I am telling you why.
\chapter{Product Design}
\section{Product Perspective}
The product is supposed to be very nice and cool.
It shall satisfy all conditions and look awesome.
\end{document}
我希望這真的是你希望你的文件看起來如何。如果沒有 - 或者如果您對我在此處展示的內容有任何其他疑問,請發表評論。 最後,還有一個單獨的網站,僅針對TeX, LaTeX and friends的問題,並且LaTeX上的問題應該發佈在那裏。
這屬於[tex.stackexchange.com](http://tex.stackexchange.com)。 –
用'\ setcounter {section} {3}替換'\ setcounter {subsection} {3}' –
通過使用它,它從3.6開始而不是從3.1 – Mitali