You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在LaTeX的report类中移除目录中的图表列表?

Solution to Customize Your TOC and List of Figures

Absolutely, this is totally feasible! Let's break down how to fix both your requirements: making the TOC start with the Introduction, and keeping the List of Figures (LoF) after the TOC without it appearing in the TOC.

Step-by-Step Code Solution

Here's a modified version of your code with the necessary adjustments:

\documentclass[a4paper, 9pt]{report}
\usepackage{graphicx}

% Optional: Use frontmatter for unnumbered content (title page, abstract) that won't appear in TOC
\frontmatter
% Add your title page, abstract, or other front matter here

\mainmatter
% Generate the Table of Contents first
\tableofcontents

% Generate List of Figures without adding it to the TOC
\begingroup
  % Temporarily disable adding entries to the TOC
  \renewcommand{\addcontentsline}[3]{}
  \listoffigures
\endgroup

% Start your first numbered chapter (Introduction)
\chapter{Introduction}
% Your introduction content here

% Example figure to test the LoF
\begin{figure}
  \centering
  \includegraphics[width=0.5\textwidth]{example-image}
  \caption{A sample figure for demonstration}
\end{figure}

Key Explanations

  • \begingroup ... \endgroup: This creates a local scope so our change only affects the \listoffigures command. Inside this block, we override \addcontentsline to do nothing, which stops the LoF from being added to the TOC.
  • \frontmatter and \mainmatter: These commands separate unnumbered front content (like abstracts) from your main numbered chapters. The TOC will automatically start with the first chapter in \mainmatter (your Introduction) since front matter entries aren't included.

Alternative Package-Based Approach

If you prefer using a package for more control, try the tocvsec2 package:

\documentclass[a4paper, 9pt]{report}
\usepackage{graphicx}
\usepackage{tocvsec2}

\frontmatter
% Front matter content

\mainmatter
\tableofcontents

% Temporarily set TOC depth to -1 (hides chapter-level entries like LoF)
\settocdepth{-1}
\listoffigures
% Reset TOC depth back to default (includes sections/subsections)
\settocdepth{2}

\chapter{Introduction}
% Your content here

Verification

After compiling your document at least twice (to update the TOC and LoF), you’ll see:

  1. The TOC starts with the Introduction chapter and no mention of the LoF.
  2. The List of Figures appears immediately after the TOC, fully populated with your figure captions.

内容的提问来源于stack exchange,提问作者user9469905

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 09:02:04