# List of Boxes Detail

I was wondering if someone knows how to "tell" LaTeX to print an Index of Boxes ("Recuadros" for me), in a similar way to the regular Index of Tables. In the last case there is an extra space between tables from different sections, something I have been unable to to in the case of boxes.

The way I am doing the boxes is first to define the style and then the numbering for the boxes (using mdframed): ....

\usepackage[framemethod=TikZ]{mdframed}
\mdfdefinestyle{MyFrame}{%
nobreak,
linecolor=blue,
outerlinewidth=0.5pt,
roundcorner=20pt,
innertopmargin=\baselineskip,
innerbottommargin=\baselineskip,
innerrightmargin=20pt,
innerleftmargin=20pt,
frametitlealignment=\center,
backgroundcolor=gray!30!white}
\usepackage{tocloft}
\newcounter{infobox}
\newenvironment{infobox}[1][]{%
\refstepcounter{infobox}%
\begin{mdframed}[%
style=MyFrame,
]%
}{%
\end{mdframed}
}
\makeatletter
\newcommand\listofboxes{
\chapter*{\listboxname}
\@starttoc{lob}
}
\renewcommand{\theinfobox}{\thechapter.\arabic{infobox}}
\makeatother
....


The way LaTeX prints the results for tables and boxes are:

You can see there is an extra space between tables from different chapters which is what I am trying to do for the boxes.

• This requires adding code to the \chapter command and this depends on the used documentclass. Side comment: You're using tocloft already, which provides 'easier' ways to define such \listof... commands ;-) – user31729 Dec 6 '15 at 23:05

Here's a solution for the book class: Modifying \@chapter slightly to add automatically vertical spacing to the .lob file after each \chapter starts.

\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[framemethod=TikZ]{mdframed}
\mdfdefinestyle{MyFrame}{%
nobreak,
linecolor=blue,
outerlinewidth=0.5pt,
roundcorner=20pt,
innertopmargin=\baselineskip,
innerbottommargin=\baselineskip,
innerrightmargin=20pt,
innerleftmargin=20pt,
frametitlealignment=\center,
backgroundcolor=gray!30!white}
\usepackage{tocloft}
\usepackage{xpatch}

\newcounter{infobox}[chapter]
\newenvironment{infobox}[1][]{%
\refstepcounter{infobox}%
\begin{mdframed}[%
style=MyFrame,
]%
}{%
\end{mdframed}
}

\makeatletter
\xpatchcmd{\@chapter}{%
\chaptermark{#1}%
}{
\chaptermark{#1}%
}{\typeout{success}}{}

%
\newcommand\listofboxes{%
\chapter*{\protect\listboxname}
\@starttoc{lob}
}
\renewcommand{\theinfobox}{\thechapter.\arabic{infobox}}
\makeatother

\begin{document}
\tableofcontents
\listofboxes
\listoffigures
\chapter{First}
\begin{infobox}[Some box]
And now for something completely different
\end{infobox}
\begin{figure}
\caption{second}
\end{figure}

\begin{figure}
\caption{second}
\end{figure}

\begin{figure}
\caption{second}
\end{figure}

\chapter{Second}
\begin{infobox}[Some box]
And now for something completely different
\end{infobox}

\begin{infobox}[Some box]
And now for something completely different
\end{infobox}

\begin{figure}
\caption{second}
\end{figure}

\end{document}


• Thank you Christian, unfortunately it is still throwing the output in same way. Could it be because I am using "LaTex + Bib(la) tex + LaTex (x2) + dvip + ps2pdf + Ver PDF"? – Fernando Dec 7 '15 at 17:59
• @Fernando: I would say: No -- it's perhaps a different document class, but you did not say which class you're using. I asked you already in a comment below your question, but you did not give feedback to it :-( – user31729 Dec 7 '15 at 19:14
• I am sorry Christian. I forgot that. What I am using is: "\documentclass[twoside]{book}". Thank you very much! – Fernando Dec 8 '15 at 19:52
• @Fernando: I've used book too, I don't know what breaks in your case. – user31729 Dec 9 '15 at 16:34