我无法从 Latex 文档中删除内容标题,可能是因为我使用了标题页。
我尝试过在网上找到的标准方法,例如:
选项1
\tableofcontents*
选项 2
\makeatletter
\renewcommand\tableofcontents{%\@starttoc{toc}%}
\makeatother
选项 3
\makeatletter
\@starttoc{toc}
\makeatother
选项 4
\begin{KeepFromToc}
\tableofcontents
\end{KeepFromToc}
我使用的代码在这里:
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage[margin=0.9in]{geometry}
\renewcommand*\familydefault{\sfdefault}
\usepackage{titling}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{titlesec}
\titleformat{\section}[frame]
{\normalfont} {} {5pt} {\Large\bfseries\thesection.\quad}
\begin{document}
\begin{titlepage}
\begin{tikzpicture}[overlay,remember picture]
\draw [line width=0.5mm,decorate]
($ (current page.north west) + (0.5cm,-0.5cm) $)
rectangle
($ (current page.south east) + (-0.5cm,0.5cm) $);
\end{tikzpicture}
\centering
\vfill
{\huge Title}
\vfill
\tableofcontents
\vfill
\end{titlepage}
\end{document}
有人有什么想法吗?
谢谢,
克里斯。
答案1
这对我有用:
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage[margin=0.9in]{geometry}
\renewcommand*\familydefault{\sfdefault}
\usepackage{titling}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathmorphing}
\makeatletter
\renewcommand{\tableofcontents}{%
\@starttoc{toc}%
}
\makeatother
\usepackage{titlesec}
\titleformat{\section}[frame]
{\normalfont} {} {5pt} {\Large\bfseries\thesection.\quad}
\begin{document}
\begin{titlepage}
\begin{tikzpicture}[overlay,remember picture]
\draw [line width=0.5mm,decorate]
($ (current page.north west) + (0.5cm,-0.5cm) $)
rectangle
($ (current page.south east) + (-0.5cm,0.5cm) $);
\end{tikzpicture}
\centering
\vfill
{\huge Title}
\vfill
\tableofcontents
\vfill
\end{titlepage}
\section{Some content}
\end{document}