自訂目錄、點和大小

自訂目錄、點和大小

我想在目錄中加入點,並修改其大小。我知道這種風格有很多問題,但我太蠢了。我什至不知道 \begin 命令是做什麼的。我也想改變語言。我不希望它寫“內容”,而是寫“table des matieres”,這是法語。

這是我的兩行

\newpage
  \tableofcontents
  \addtocontents{toc}{~\hfill\textbf{Page}\par} 

請告訴我應該添加什麼以及在哪裡。我嘗試了很多東西,但我沒有時間學習乳膠。

非常感謝

答案1

受到 @Bernard 評論的啟發並借鑒背頁和@cmhughes'回答對於類似的問題:

\documentclass[french]{article}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}

\usepackage{titletoc}

% \dottedcontents{<section>}[<left>]{<above-code>}{<label width>}{<leader width>}
\dottedcontents{section}[0em]{\bfseries}{2.9em}{1pc}
%\dottedcontents{subsection}[5em]{}{3.3em}{1pc}

\begin{document}

\tableofcontents

\vspace{2cm} % Add a 2cm space

\begin{abstract}
Ceci est un bref résumé du contenu du document écrit en français.
\end{abstract}

\section{Section d'introduction}
Il s'agit de la première section, nous ajoutons des éléments supplémentaires et tout sera correctement orthographiés. En outre, si un mot est trop long et doit être tronqué, babel va essayer de tronquer correctement en fonction de la langue.

\subsection{Subsection}

\section{Section théorèmes}
Cette section est de voir ce qui se passe avec les commandes de texte qui définissent.

\end{document}

輸出:

在此輸入影像描述

答案2

我真的不知道你在追求什麼:「改變尺寸」指的是什麼?你想在哪裡添加點?

然而,tocloft包裹就是答案。下面是一個 MWE,展示瞭如何使用它。

% tocprob4.tex SE 533373 Customize ToC, dots and size
\documentclass{report}
\usepackage{lipsum}
\usepackage{tocloft}
\renewcommand{\contentsname}{table des matieres} % change the title
\renewcommand{\cftchapdotsep}{\cftdotsep} % add dots for chapters
\renewcommand{\cftsecdotsep}{10} % increase space between dots for sections
\renewcommand{\cftdot}{\ensuremath{\ast}} % replace dots by asterisks
%\renewcommand{\cftdot}{\Large .} % make dots Large

\begin{document}
\addtocontents{toc}{\hfill \textbf{Page}\par} % put Page above page numbers
\tableofcontents

\chapter{A chapter}
\lipsum[1]
\section{A section}
Some text in a section.
\subsection{A subsection}
Some text in a subsection.
\end{document}

請閱讀文件 ( texdoc tocloft) 以了解更多資訊。

相關內容