I want to center the Table of Contents heading and add a few spaces between them.

Asked 1 years ago, Updated 1 years ago, 239 views

I am writing my paper in LaTeX (the document class is jlreq and the option is book).
The file is organized by dividing the files into chapters and putting them together in merge.tex.

If you type \tableofcontents in merge.tex, the table of contents will be displayed, but it is not my favorite display.
Therefore, I am thinking of correcting it.
Specifically, you should center the table of contents, such as the table of contents.

Therefore, after loading the tocloft package using the here site, I added the following to merge.tex:

\renewcommand {\cftoctitlefont} {\hfill\large\bfseries}
US>\renewcommand

"Then, it became central, but the part of ""Chapter 章"" and the name of the chapter overlapped."
Also, the space between them has not been resolved.

Is there any way?
Please let me know.

latex

2022-11-06 14:10

1 Answers

The tocloft package is not supposed to be in Japanese.If you just want to change the jlreq table of contents heading, you just need to redefine \contentsname without using tocloft.

%#!uplatex
\ documentclass [book] {jlreq}

US>\renewcommand{\contentsname}{%
  \makebox[\linewidth] \hfill order \hspace{2zw}next \hfill}}

\begin { document }

\tableofcontents

\chapter
\chapter {some content}

\end { document }

Composition results

Also, if you change only the heading of the table of contents, it seems that the design will not be consistent with other headings, so we recommend that you consider balancing the overall design separately.


2022-11-07 02:17

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.