我正在用经典论文写论文。是否可以包含章节标题,但只有当其中有图时才可以将其添加到 lof 中?
KOMA 选项中使用 listof = chapterentry 也包括没有图片的章节,我会避免这些。
谢谢你!!
平均能量损失
\documentclass[10pt, a4paper, twoside, openright, titlepage, fleqn, headinclude, footinclude, BCOR5mm, numbers=noenddot, cleardoublepage=empty,
listof = withchapterentry]{scrbook}
%classic thesis template
\usepackage[eulerchapternumbers, eulermath, pdfspacing, listings, floatperchapter,parts]{classicthesis}
\begin{document}
\listoffigures
\chapter{Introduction with no Figures}
\chapter{Test Chapter with Figures}
\begin{figure}
\caption{caption text}
\end{figure}
\begin{figure}
\caption{caption text}
\end{figure}
\chapter{Test Chapter with no Figures}
\chapter{Another Test Chapter with Figures}
\begin{figure}
\caption{caption text}
\end{figure}
\end{document}
正如您在图片中看到的,介绍和第一章也列出了,但没有图片。我会避免列出没有图片的章节。
答案1
\documentclass[10pt, a4paper, twoside, openright, titlepage, fleqn, headinclude, footinclude, BCOR5mm, numbers=noenddot, cleardoublepage=emptyast]{scrbook}
%classic thesis template
\usepackage[eulerchapternumbers, eulermath, pdfspacing, listings, floatperchapter,parts]{classicthesis}
\makeatletter
\newcommand{\chapterwithfigures}{\addxcontentsline{lof}{chapteratlist}[{\thechapter}]{\scr@ds@tocentry}}%
\makeatother
\begin{document}
\listoffigures
\chapter{Introduction with no Figures}
\chapter{Test Chapter with Figures}
\chapterwithfigures
\begin{figure}
\caption{caption text}
\end{figure}
\begin{figure}
\caption{caption text}
\end{figure}
\chapter{Test Chapter with no Figures}
\chapter{Another Test Chapter with Figures}
\chapterwithfigures
\begin{figure}
\caption{caption text}
\end{figure}
\end{document}