2

I want my list of figures and tables divided according to chapters like this:

 Figure 1.1..............
 Figure 1.2..............
 Figure 1.3..............

 Figure 2.1..............
 Figure 2.2..............
 Figure 2.3..............

instead of

 Figure 1.1..............
 Figure 1.2..............
 Figure 1.3..............
 Figure 2.1..............
 Figure 2.2..............
 Figure 2.3..............

I am using the abntex2 class derived of memoir class. I tried to use some tips from other forums, like etoolbox, but they did not work.

Lara
  • 187
  • 1
    Please provide a MWE as the default in memoir is to seperate the figures/tables by chapter as you want. It does not, though, put Figure before the number. Please show us what you have done. – Peter Wilson Feb 16 '17 at 18:35
  • 1
    Book class includes
    \addtocontents{lof}{\protect\addvspace{10\p@}}%
    \addtocontents{lot}{\protect\addvspace{10\p@}}%
    
    

    in the definition of \chapter to add the spaces.

    – John Kormylo Feb 17 '17 at 17:46
  • @John Kormylo so does memoir but in the form of a macro \insertchapterspace which combines the two pieces of code you mention. If there are other lists, then a simple extension to \insertchapterspace can handle spaces in those lists without having to fiddle with the internals of \chapter. – Peter Wilson Feb 17 '17 at 19:34
  • @Peter Wilson, I can't put Figure before the number and I am using the chapterstyle bianchi, it's the template. – Lara Feb 18 '17 at 01:30
  • @PeterWilson - I figured KOMA would probably have a different way to do the same thing, but it was late (here) and I was too tired to deal with KOMA. – John Kormylo Feb 18 '17 at 13:49
  • @Lara As you haven't provided a MWE as asked we don't know what you have done and I don't see how we can help you. – Peter Wilson Feb 18 '17 at 19:05
  • @Lara Have you read the user manual? If not, then please look at the \cftKname{SOMETHING } macro which lets you put SOMETHING before the K number in the listof, where K is anything from book through figure and subtable. – Peter Wilson Feb 18 '17 at 19:19
  • This solution works for figures and tables. But the chapter titles disappear of hyperref mark. :( – Lara Feb 19 '17 at 06:38
  • For a while, the solution is use \addtocontents{lof}{\protect\addvspace{10pt}} and \addtocontents{lot}{\protect\addvspace{10pt}} after \chapter. In the class style, I don't find the definition @chapter. – Lara Feb 19 '17 at 06:55
  • @Lara: Please add a compilable document –  Feb 19 '17 at 09:27
  • My template is abntex2. – Lara Feb 19 '17 at 14:18
  • @Lara: We asked you about a compilable document, not the link to the class. –  Feb 19 '17 at 16:30

1 Answers1

2

The abntex2 class uses

\renewcommand{\insertchapterspace}{}

i.e. the usage of \insertchapterspace is disabled effectively.

The original definition of \insertchapterspace inmemoir is

\newcommand*{\insertchapterspace}{%
  \addtocontents{lof}{\protect\addvspace{10pt}}%
  \addtocontents{lot}{\protect\addvspace{10pt}}}

i.e. it can be reinjected into the code.

The question is whether the publishers etc. will allow this.

\documentclass{abntex2}
\usepackage{pgffor}


\renewcommand*{\insertchapterspace}{%
  \addtocontents{lof}{\protect\addvspace{10pt}}%
  \addtocontents{lot}{\protect\addvspace{10pt}}}


\begin{document}

\listoffigures

\foreach \x in {1,...,10} {%
  \chapter{Foo \x}
  \begin{figure}
    \caption{Foo figure \x}
   \end{figure}
  \begin{figure}
    \caption{Foo other figure \x}
  \end{figure}
 }
\end{document}

enter image description here

  • The original definition of \insertchapterspace is rejected in the abntex2, I tried this. But, I did not know the pgffor package. The publishers will allow this because each university has its rules. Thank you for the help. – Lara Feb 19 '17 at 19:15
  • The pgffor package is just to produce a lot of fake figure environments instead of typing them. –  Feb 19 '17 at 19:18