如何製作報告目錄?

如何製作報告目錄?

目錄

我需要實現圖像中給出的目錄。我的問題是如何在目錄中產生這些部分。還有羅馬數字怎麼寫?

答案1

這是一個解決方案titletoc

\documentclass[openright]{report}
\usepackage[utf8]{inputenc}

\usepackage{titlesec}
\usepackage{titletoc}
\renewcommand\thesection{\arabic{section}}
\titlecontents{chapter}[1.05em]{\bigskip}%
{\contentslabel[\MakeUppercase{\romannumeral\thecontentslabel}]{1em}\enspace\textsc}%numbered\contentslabel
{\hspace*{-1em}\textsc}%numberless
{\hfill\contentspage}%
%
\titlecontents{section}[1.6em]{\smallskip}%
{\thecontentslabel.\enspace}%numbered
{}%numberless
{\titlerule*[1pc]{.}\contentspage}%

\setcounter{tocdepth}{1}

\usepackage{lipsum}

\begin{document}

\pagenumbering{roman}

\tableofcontents

\chapter*{Preface}

\addcontentsline{toc}{chapter}{Preface}
\clearpage
\pagenumbering{arabic}

\chapter{A first chapter}
\section{A first section}
\lipsum[1-4]
\section{Another section}
\lipsum[5-6]

\chapter{A second chapter}
\lipsum[7-12]

\end{document} 

在此輸入影像描述

相關內容