..png)
해결할 수 없는 문제가 있습니다.
내 그림 목록은 각 장의 그림 사이에 공백을 두고 장별로 그룹화되어 있습니다. 그래도 내가 갖고 싶은 것은 공간뿐만 아니라 장의 번호와 제목을 명시하는 장 제목도 있지만~ 아니다장의 페이지.
이를 수행할 수 있는 방법이 있습니까? tocloft
어떤 이유로 TOC 및 LOF 상단에 제거할 수 없는 거대한 공간을 추가하는 패키지가 없는 것이 좋습니다 . 또한 포함하면 LOF가 TOC에 표시되지 않습니다.
어떤 아이디어가 있나요?
편집: 이것이 최소한의 예에 해당하는지 모르겠지만 이것이 문제를 보여주는 예가 될 것입니다.
\documentclass[12pt,headsepline,toc=bibliography,toc=listof]{scrreprt}
\begin{document}
\chapter{Chapter 1}
\begin{figure}
\caption{Figure 1}
\end{figure}
\begin{figure}
\caption{Figure 2}
\end{figure}
\chapter{Chapter 2}
\begin{figure}
\caption{Figure 3}
\end{figure}
\listoffigures
\end{document}
다음과 같은 결과가 생성됩니다.
그림이 장 사이에 공백을 두고 그룹별로 나열되어 있는 것을 볼 수 있습니다. 각 그룹 위에 "(장 번호) (공백) (장 제목)"을 표시하고 싶지만 그 옆에는 페이지 번호가 없습니다(그림 옆의 페이지 번호는 계속 표시되어야 합니다). (공백)이란 장 제목의 첫 글자가 나열된 그림의 번호와 정확히 동일한 여백에서 시작되도록 충분한 공간을 의미합니다.
답변1
모든 목록에 모든 장을 삽입하는 KOMA 옵션이 있습니다:
chapteratlists=entry
(또는 chapteratlists
또는 listof=chapterentry
)
장 페이지 번호가 그림 목록(lof)에 표시되지 않아야 하는 경우 를 사용할 수 있습니다 \AfterTOCHead[lof]{\addtokomafont{chapterentrypagenumber}{\nullfont}}
.
암호:
\documentclass[12pt,headsepline,toc=bibliography,toc=listof,chapteratlists=entry]{scrreprt}
\AfterTOCHead[lof]{\addtokomafont{chapterentrypagenumber}{\nullfont}}
\begin{document}
\chapter{Chapter 1}
\begin{figure}
\caption{Figure 1}
\end{figure}
\begin{figure}
\caption{Figure 2}
\end{figure}
\chapter{Chapter 2}
\begin{figure}
\caption{Figure 3}
\end{figure}
\listoffigures
\tableofcontents
\end{document}
업데이트
나는 찾았다Markus Kohm의 제안이 장에 그림(표, ...)이 하나 이상 있는 경우 그림(표, ...) 목록에만 해당 장을 삽입합니다.
\documentclass[12pt,headsepline,toc=bibliography,toc=listof,chapteratlists=entry]{scrreprt}
\AfterTOCHead[lof]{\addtokomafont{chapterentrypagenumber}{\nullfont}}
\AfterTOCHead[lot]{\addtokomafont{chapterentrypagenumber}{\nullfont}}
%%%%% from http://www.komascript.de/comment/5070#comment-5070 (Markus Kohm)
\makeatletter
\let\chapterhas@original@addcontentsline\addcontentsline
\renewcommand*{\addcontentsline}[1]{%
\immediate\write\@auxout{\string\chapterhas{\thechapter}{#1}}%
\chapterhas@original@addcontentsline{#1}%
}
\newcommand*{\chapterhas}[2]{%
\global\@namedef{chapterhas@#1@#2}{true}%
}
\renewcommand*{\addchaptertocentry}[2]{%
\addtocentrydefault{chapter}{#1}{#2}%
\if@chaptertolists
\doforeachtocfile{%
\iftocfeature{\@currext}{chapteratlist}{%
\ifundefinedorrelax{chapterhas@\thechapter @\@currext}{%
}{%
\addxcontentsline{\@currext}{chapteratlist}[{#1}]{#2}%
}%
}{}%
}%
\@ifundefined{float@addtolists}{}{\scr@float@addtolists@warning}%
\fi
}
\makeatother
%%%%
\begin{document}
\chapter{Chapter 1}
\begin{figure}
\caption{Figure 1}
\end{figure}
\begin{figure}
\caption{Figure 2}
\end{figure}
\chapter{Chapter 2}
\chapter{Chapter 3}
\begin{figure}
\caption{Figure 3}
\end{figure}
\begin{table}
\caption{Table 1}
\end{table}
\listoffigures
\listoftables
\tableofcontents
\end{document}
세 번 달려서 얻으세요.