我有多个图形,并且我有一个特定图形,我想删除其中的编号\listoffigures
,我们将其称为fig_x
我在其他线程上发现使用该caption
包允许包含\captionsetup{labelformat=empty}
,但这只会从文档正文中删除标题编号;然而,在图表列表中,图表编号仍然显示。
是否有其他方法可以从中删除图号lof
?
\documentclass[oneside, a4paper, 12pt]{book}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage{caption} % < caption package
\begin{document}
\frontmatter
\listoffigures % <<< my list of figures
\chapter{General Introduction}
\mainmatter
\chapter{CH1}
Some text here, figure:
\begin{figure}
\captionsetup{labelformat=empty} % <<< removes fig numb. from the caption; does not remove from lof
\caption{Diagram of Preemptive Dialogic Model}\vspace{5mm}
\includegraphics{fig_x}
\label{fig_x}
\end{figure}
\backmatter
\tableofcontents
\end{document}
答案1
使用\caption*{ ...}
将其从 LoF 中删除,并向 LoF 添加一行带有标题文本(不带图形编号)的行:\addcontentsline{lof}{figure}{<text>}
。
数字“b”未按编号列出。
同时显示所有图形。
\documentclass[oneside, a4paper, 12pt]{book}
\usepackage{shorttoc}
\usepackage{times}
\usepackage{titlesec}
\usepackage{anyfontsize}
\usepackage[french]{babel}
\usepackage{booktabs}
\usepackage{sectsty}
%\usepackage{arabtex}
\usepackage{caption}
%\usepackage{utf8}
\usepackage{enumerate}
%\setcode{utf8}
\usepackage{graphicx}
\begin{document}
\frontmatter
\listoffigures % <<< my list of figures
\chapter{General Introduction}
\mainmatter
\chapter{CH1}
Some text here, figure:
\begin{figure}[htp!]
\captionsetup{labelformat=empty} % <<< removes fig numb. from the caption; does not remove from lof
\caption{Diagram of Preemptive Dialogic Model a}\vspace{5mm}
\includegraphics{example-image-a}
\label{fig_x1}
\end{figure}
\begin{figure}[htp!]
\captionsetup{labelformat=empty} % <<< removes fig numb. from the caption; does not remove from lof
\caption*{Diagram of Preemptive Dialogic Model b} % without number and not in LoF
\addcontentsline{lof}{figure}{Diagram of Preemptive Dialogic Model b} % add to LoF without numbering
\vspace{5mm}
\includegraphics{example-image-b}
\label{fig_x2}
\end{figure}
\begin{figure}[htp!]
\captionsetup{labelformat=empty} % <<< removes fig numb. from the caption; does not remove from lof
\caption{Diagram of Preemptive Dialogic Model c}\vspace{5mm}
\includegraphics{example-image-c}
\label{fig_x3}
\end{figure}
\backmatter
\tableofcontents
\end{document}