Skip to main content
added 146 characters in body
Source Link
user31729
user31729

A patch answer by changing \@part a little bit and explicitly adding \addcontentsline with lof instead of toc again.

I have kept the vertical chapter gap in the LoF in order make the elements of figures origination from different chapters more outstanding.

\documentclass{report} \usepackage{xpatch} \makeatletter \xpatchcmd{\@part}{% \markboth{}{}% Find a hook in order to append content. }{% \markboth{}{}% \ifnum\c@secnumdepth>-2\relax \addcontentsline{lof}{part}{\thepart\hspace{1em}#1}% \else \addcontentsline{lof}{part}{#1}% \fi }{\typeout{Success}}{\typeout{Patch failure}} \makeatother \usepackage{hyperref} \begin{document} \tableofcontents \listoffigures \part{Number Three -- the Larch} \chapter{A dummy chapter} \begin{figure} \caption{First figure} \end{figure} \begin{figure} \caption{Second figure} \end{figure} \part{And now for something completely different} \begin{figure} \caption{Third figure} \end{figure} \end{document} 

enter image description here

A patch answer by changing \@part a little bit and explicitly adding \addcontentsline with lof instead of toc again.

\documentclass{report} \usepackage{xpatch} \makeatletter \xpatchcmd{\@part}{% \markboth{}{}% Find a hook in order to append content. }{% \markboth{}{}% \ifnum\c@secnumdepth>-2\relax \addcontentsline{lof}{part}{\thepart\hspace{1em}#1}% \else \addcontentsline{lof}{part}{#1}% \fi }{\typeout{Success}}{\typeout{Patch failure}} \makeatother \usepackage{hyperref} \begin{document} \tableofcontents \listoffigures \part{Number Three -- the Larch} \chapter{A dummy chapter} \begin{figure} \caption{First figure} \end{figure} \begin{figure} \caption{Second figure} \end{figure} \part{And now for something completely different} \begin{figure} \caption{Third figure} \end{figure} \end{document} 

enter image description here

A patch answer by changing \@part a little bit and explicitly adding \addcontentsline with lof instead of toc again.

I have kept the vertical chapter gap in the LoF in order make the elements of figures origination from different chapters more outstanding.

\documentclass{report} \usepackage{xpatch} \makeatletter \xpatchcmd{\@part}{% \markboth{}{}% Find a hook in order to append content. }{% \markboth{}{}% \ifnum\c@secnumdepth>-2\relax \addcontentsline{lof}{part}{\thepart\hspace{1em}#1}% \else \addcontentsline{lof}{part}{#1}% \fi }{\typeout{Success}}{\typeout{Patch failure}} \makeatother \usepackage{hyperref} \begin{document} \tableofcontents \listoffigures \part{Number Three -- the Larch} \chapter{A dummy chapter} \begin{figure} \caption{First figure} \end{figure} \begin{figure} \caption{Second figure} \end{figure} \part{And now for something completely different} \begin{figure} \caption{Third figure} \end{figure} \end{document} 

enter image description here

Source Link
user31729
user31729

A patch answer by changing \@part a little bit and explicitly adding \addcontentsline with lof instead of toc again.

\documentclass{report} \usepackage{xpatch} \makeatletter \xpatchcmd{\@part}{% \markboth{}{}% Find a hook in order to append content. }{% \markboth{}{}% \ifnum\c@secnumdepth>-2\relax \addcontentsline{lof}{part}{\thepart\hspace{1em}#1}% \else \addcontentsline{lof}{part}{#1}% \fi }{\typeout{Success}}{\typeout{Patch failure}} \makeatother \usepackage{hyperref} \begin{document} \tableofcontents \listoffigures \part{Number Three -- the Larch} \chapter{A dummy chapter} \begin{figure} \caption{First figure} \end{figure} \begin{figure} \caption{Second figure} \end{figure} \part{And now for something completely different} \begin{figure} \caption{Third figure} \end{figure} \end{document} 

enter image description here