Títulos largos a espacio simple de más de una línea en la Lista de Figuras

Títulos largos a espacio simple de más de una línea en la Lista de Figuras

Probé la solución \caption[\protect\vspace{-0.5ex}{ long caption text}]{long caption text}, pero no hace nada. Necesito un espacio doble constante en LOF y cuando se trata de títulos largos de más de una línea, debe ser un espacio simple. ¿Podrias ayudarme por favor? gracias.

\documentclass[12pt,oneside,letterpaper,chapterprefix=on,numbers=noenddot]{scrbook}
\setuptoc{toc}{leveldown}% if ToC should be on section level
\usepackage[english]{babel}
%%% document setup
\usepackage[demo]{graphicx}


\usepackage[list-entry=heading]{caption}
\usepackage{booktabs}% table
\usepackage[doublespacing]{setspace}% <- changed


\setkomafont{captionlabel}{\bfseries}%make caption label bold
\setkomafont{caption}{\bfseries}%make caption bold
\setcapindent{0pt}%removes hanging indent from captions





%----------------%-------------------------%-----------
\begin{document}

\begingroup
\def\addvspace#1{}
\clearpage % to force a new page
\addcontentsline{toc}{chapter}{LIST OF FIGURES}
\listoffigures
%\doublespacing
\endgroup
\mainmatter

\begin{figure}
\includegraphics{test}
\caption[\protect\vspace{-0.25ex}{ llong caption text 2long caption text 3long caption text 4long caption text 5long caption text }]{1long caption text 2long caption text 3long caption text 4long caption text 5long caption text 6long caption text}
\end{figure}
\begin{figure}


\includegraphics{test2}
\caption[\protect\vspace{-0.5ex}{ llong caption text 2long caption text 3long caption text 4long caption text 5long caption text }]{1long caption text 2long caption text 3long caption text 4long caption text 5long caption text 6long caption text}
\end{figure}
\end{document}

Respuesta1

Por lo tanto, configure la lista de figuras (y otros TOC) a espacio simple; puede agregar un \singlespacingo \setstretch{1}al principio, ya sea inmediatamente después del encabezado usando \AfterTOCHeado inmediatamente antes de leer el archivo auxiliar del TOC correspondiente usando \BeforeStartingTOC, por ejemplo

\BeforeStartingTOC[lof]{\singlespacing}% for the list of figures only

o

\BeforeStartingTOC{\singlespacing}% for every TOC (i.e. table of contents, list of figures, list of tables)

Para tener la línea blanca entre las entradas de la lista de figuras, puede cambiar la opción beforeskip, por ejemplo, usando

\DeclareTOCStyleEntry[beforeskip=\baselineskip]{tocline}{figure}

Esto debe hacerse para todos los tipos de entrada que deban tenerlo. Para tablas, copie el comando y reemplácelo figurepor table.

Consulte el tocbasiccapítulo del manual de KOMA-Script para obtener más información.

Para entradas a la tabla de contenido también puedes usar

\RedeclareSectionCommands[tocbeforeskip=\baselineskip]{section,subsection}

Consulte la parte II del manual KOMA-Script para obtener más información sobre \RedeclareSectionCommand.

Para poner la lista de figuras y la lista de tablas en la tabla de contenido, también debe usar una característica especial de KOMA-Script: opción listof=totoc. Para eliminar el espacio entre capítulos de esta lista, tampoco es necesario redefinirlo localmente, \addvspacepero puede usar la opción listof=nochaptergap.

Con estos cambios ya no es necesario utilizar el argumento opcional de \caption.

\documentclass[12pt,oneside,letterpaper,chapterprefix=on,numbers=noenddot,
  listof=totoc,listof=nochaptergap% <--- ADDED
]{scrbook}
\setuptoc{toc}{leveldown}% if ToC should be on section level
\usepackage[english]{babel}
%%% document setup
\usepackage[demo]{graphicx}


\usepackage[list-entry=heading]{caption}
\usepackage{booktabs}% table
\usepackage[doublespacing]{setspace}

\setkomafont{captionlabel}{\bfseries}%make caption label bold
\setkomafont{caption}{\bfseries}%make caption bold
\setcapindent{0pt}%removes hanging indent from captions

\BeforeStartingTOC{\singlespacing}% <--- ADDED
\DeclareTOCStyleEntry[beforeskip=\baselineskip]{tocline}{figure}
\DeclareTOCStyleEntry[beforeskip=\baselineskip]{tocline}{table}    

%----------------%-------------------------%-----------
\begin{document}

\frontmatter% <--- ADDED (without \mainmatter wouldn't make sense)

% CHANGED:
\listoffigures
\mainmatter

\begin{figure}
\includegraphics{test}
\caption{llong caption text 2long caption text 3long caption text 4long caption text 5long caption text}
\end{figure}
\begin{figure}


\includegraphics{test2}
\caption{llong caption text 2long caption text 3long caption text 4long caption text 5long caption text}
\end{figure}
\end{document}

ingrese la descripción de la imagen aquí

Respuesta2

La lista de figuras se utiliza \l@figurepara dar formato, así que agregué un archivo \vspace{\baselineskip}. Esto debería funcionar con cualquier clase de documento.

El doble espacio se hace con máquinas de escribir. Los tipógrafos agregan espacio adicional entre líneas.

\documentclass[12pt,oneside,letterpaper,chapterprefix=on,numbers=noenddot]{scrbook}
\setuptoc{toc}{leveldown}% if ToC should be on section level
\usepackage[english]{babel}
%%% document setup
\usepackage[demo]{graphicx}


\usepackage[list-entry=heading]{caption}
\usepackage{booktabs}% table
%\usepackage[doublespacing]{setspace}% <- changed


\setkomafont{captionlabel}{\bfseries}%make caption label bold
\setkomafont{caption}{\bfseries}%make caption bold
\setcapindent{0pt}%removes hanging indent from captions

\makeatletter
\let\oldl@figure=\l@figure
\renewcommand{\l@figure}{\vspace{\baselineskip}\oldl@figure}
\makeatother

\begin{document}

\begingroup
\def\addvspace#1{}
\clearpage % to force a new page
\addcontentsline{toc}{chapter}{LIST OF FIGURES}
\listoffigures}%\doublespacing
\endgroup
\mainmatter

\begin{figure}
\includegraphics{test}
\caption{1long caption text 2long caption text 3long caption text 4long caption text 5long caption text 6long caption text}
\end{figure}
\begin{figure}


\includegraphics{test2}
\caption[\protect\vspace{-0.5ex}{ llong caption text 2long caption text 3long caption text 4long caption text 5long caption text }]{1long caption text 2long caption text 3long caption text 4long caption text 5long caption text 6long caption text}
\end{figure}
\end{document}

información relacionada