如何在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\listoffigurescommand. Inside this block, we override\addcontentslineto do nothing, which stops the LoF from being added to the TOC.\frontmatterand\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:
- The TOC starts with the Introduction chapter and no mention of the LoF.
- The List of Figures appears immediately after the TOC, fully populated with your figure captions.
内容的提问来源于stack exchange,提问作者user9469905
相关产品推荐
相关产品推荐

