# custom listof with endash separator

I'm using floatrow to create a new environment Quadros (it means frames) but despite showing the correct separator within caption the List Of Quadros still displays a empty space instead. Just need the endash after the float number. I did search for similar questions but couldn't find anything that fixed my problem.

Edit 2: To keep up with my thesis layout I'v adpated C. Hupfer solution into this :

\DeclareCaptionListFormat{quadro}{\llap{{#1}}{#2}\hfill\rlap{\textendash}\hfill\hspace{0.5em}}

Displays exactly like the default list of figure, except by a pixel or two but that's probably due to microtype or simply different characters.

Edit: the current solution from C. Hupfer:

\makeatletter
\makeatother


Leads me to problems with the double digit floats:

I'v tried to add a \hspace{0.15em} before the \textendash but doesn't work properly either.

Here is my MWE:

\documentclass{memoir}
\usepackage[T1]{fontenc}
\let\newfloat\relax                     % % % % % % % % % % % % % % % % % % % % % %
\let\tmp\newinsert                      %
\let\newinsert\newbox                   % This is to fix some bug of floatrow
\usepackage{floatrow}                   %
\let\newinsert\tmp                      % % % % % % % % % % % % % % % % % % % % % %
\floatsetup{objectset=centering,capposition=top}
\usepackage{caption}

justification=justified,
position=above,
skip=\onelineskip,
width=0.95\linewidth,
labelsep=endash, %% ABNT thing requires to use dash
labelfont={small},
font={footnotesize},
}
\begin{document}

\begingroup
\let\oldnumberline\numberline
\endgroup

content...
content...

content...
content...
content...
content...
content...
content...
content...
content...
content...
\end{document}

• The endash setup in labelsep is only for printing the caption where the float appears, but not for the List of .... – user31729 Mar 5 '16 at 21:17

There's a built-in support for providing specialized list-of formats in caption package with the setup

\DeclareCaptionListFormat{quadro}{#1\textendash\ #2}


and using listformat=quadro in \captionsetup.

The name quadro is arbitrary (as long it's not figure etc. )

Since the spacing after the quadro number may be too wide the \l@quadro macro must be redefined.

\makeatletter
\makeatother


The last parameter (the one with 1.7em) contains the numwidth, i.e. the width of the number section. Usually, this is 2.3em, I reduced it to 1.7em.

    \documentclass{memoir}
\usepackage[T1]{fontenc}
\let\newfloat\relax                     % % % % % % % % % % % % % % % % % % % % % %
%    \let\tmp\newinsert                      %
%    \let\newinsert\newbox                   % This is to fix some bug of floatrow
\usepackage{floatrow}                   %
%    \let\newinsert\tmp                      % % % % % % % % % % % % % % % % % % % % % %
\floatsetup{objectset=centering,capposition=top}

\usepackage{caption}

justification=justified,
position=above,
skip=\onelineskip,
width=0.95\linewidth,
labelsep=endash, %% ABNT thing requires to use dash
labelfont={small},
font={footnotesize},
}

\begin{document}

\begingroup
\let\oldnumberline\numberline
\makeatletter
\makeatother
\endgroup

content...
content...
\end{document}


Update

I've added a \llap statement in the definition of the list format. The \renewcommand{\l@quadro}... isn't necessary any longer then, since aligning the quadro number to the right boundary requires more horizontal spacing than 1.7em.

\documentclass{memoir}
\usepackage[T1]{fontenc}
\let\newfloat\relax                     % % % % % % % % % % % % % % % % % % % % % %
\usepackage{floatrow}                   %
\floatsetup{objectset=centering,capposition=top}

\usepackage{caption}

justification=justified,
position=above,
skip=\onelineskip,
width=0.95\linewidth,
labelsep=endash, %% ABNT thing requires to use dash
labelfont={small},
font={footnotesize},
}

\begin{document}

\begingroup
\let\oldnumberline\numberline
\makeatletter
\makeatother
\endgroup

content...
content...

content...

content...

content...

content...

content...

content...

content...

content...

content...


• That was fast! It works quite well, except... it's misplaced, I'm using \DeclareCaptionListFormat{quadro}{#1#2 \textendash}' ... there is still a extra space after the endash and little space before. – G. Bay Mar 5 '16 at 21:46
• @DavidCarlisle: I concentrated on the main issue -- not \newinsert ;-) – user31729 Mar 5 '16 at 21:49
• @G.Bay: Sorry, I was misreading the order of --` etc. I'll try to track the cause of the additional space. – user31729 Mar 5 '16 at 22:01