似乎在使用该类时\tableofcontents
会分配编号。我想要删除它 — 基本上,删除并保持其他所有内容不变。0
article
0
这是代码:
\documentclass[a4paper,
12pt]{report}
\usepackage[a4paper,
right = 25mm,
left = 30mm,
top = 25mm,
bottom = 25mm,
head = 12.5mm,
foot = 12.5mm]{geometry}
\usepackage{times}
\usepackage{indentfirst}
\usepackage{titlesec}
\usepackage{blindtext}
\renewcommand{\baselinestretch}{1.5}
\renewcommand{\contentsname}{CONTENTS}
\setlength{\parindent}{12.5mm}
\titleformat{\chapter}{\centering \bfseries}{}{14pt}{\thechapter. ~}
\titleformat{\section}{\bfseries}{}{14pt}{\thesection.\quad}
\titleformat{\subsection}{\bfseries}{}{14pt}{\thesubsection.\quad}
\tableofcontents
\pagenumbering{roman}
\begin{document}
\chapter{FOO}
\section{Foo}
\blindtext
\blindtext
\subsection{Bar}
\end{document}
答案1
这应该是你所需要的:
\documentclass[a4paper,
12pt]{report}
\usepackage[a4paper,
right = 25mm,
left = 30mm,
top = 25mm,
bottom = 25mm,
head = 12.5mm,
foot = 12.5mm]{geometry}
\usepackage{times}
\usepackage{indentfirst}
\usepackage{titlesec}
\usepackage{blindtext}
\renewcommand{\baselinestretch}{1.5}
\renewcommand{\contentsname}{CONTENTS}
\setlength{\parindent}{12.5mm}
\titleformat{\chapter}{\centering \bfseries}{\thechapter.}{14pt}{}% Don't need ~ here
\titleformat{\section}{\bfseries}{}{14pt}{\thesection.\quad}
\titleformat{\subsection}{\bfseries}{}{14pt}{\thesubsection.\quad}
\pagenumbering{roman}
\begin{document}
\tableofcontents
\chapter{FOO}
\section{Foo}
\blindtext
\blindtext
\subsection{Bar}
\end{document}
答案2
你的\titleformat
声明是错误的。
\documentclass[
a4paper,
12pt
]{report}
\usepackage[
a4paper,
right = 25mm,
left = 30mm,
top = 25mm,
bottom = 25mm,
head = 12.5mm,
foot = 12.5mm,
heightrounded,
]{geometry}
%\usepackage{times}
\usepackage{newtxtext}
\usepackage{indentfirst}
\usepackage{titlesec}
\usepackage{blindtext}
\renewcommand{\contentsname}{CONTENTS}
\titleformat{\chapter}
{\filcenter\bfseries}
{\thechapter. }
{0pt}
{}
\titleformat{\section}
{\bfseries}
{\thesection.}{1em}
{}
\titleformat{\subsection}
{\bfseries}
{\thesubsection.}
{1em}
{}
\linespread{1.5}
\setlength{\parindent}{12.5mm}
\begin{document}
\pagenumbering{roman}
\tableofcontents
\clearpage
\pagenumbering{arabic}
\chapter{FOO}
\section{Foo}
\blindtext
\blindtext
\subsection{Bar}
\end{document}
第三个参数\titleformat
用于编号;对于未编号的节单元,它将与下一个参数中指定的间距一起被省略。
如果您想要缩进的章节标题,那么请使用相应的\titlespacing
声明。
我还做了一些修改:
该
times
包已过时;如果您的文档包含数学,newtxtext
请使用;newtxmath
我
heightrounded
在 的选项中加入了geometry
,这样文本高度会稍微调整,以保证行数为整数;我把的重新定义改为
\baselinestretch
更好的\linespread
声明;在
\titleformat
声明中,\filcenter
应优先于\centering
。