Legendas longas com espaçamento simples em mais de uma linha na lista de figuras

Legendas longas com espaçamento simples em mais de uma linha na lista de figuras

Eu tentei a solução \caption[\protect\vspace{-0.5ex}{ long caption text}]{long caption text}, mas não faz nada. Preciso de um espaçamento duplo constante no LOF e quando se trata de legendas longas com mais de uma linha, deve ter espaçamento simples. Poderia ajudar por favor? obrigado.

\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}

Responder1

Portanto, defina a lista de figuras (e outros índices) com espaçamento simples, você pode adicionar um \singlespacingou \setstretch{1}logo no início, imediatamente após o título usando \AfterTOCHeadou imediatamente antes de ler o arquivo auxiliar do índice correspondente usando \BeforeStartingTOC, por exemplo

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

ou

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

Para ter a linha branca entre as entradas da lista de figuras, você pode alterar a opção beforeskip, por exemplo, usando

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

Isso deve ser feito para todos os tipos de entrada que deveriam tê-lo. Para tabelas copie o comando e substitua figurepor table.

Consulte o tocbasiccapítulo do manual KOMA-Script para obter mais informações.

Para entradas do índice você também pode usar

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

Consulte a parte II do manual KOMA-Script para obter mais informações sobre \RedeclareSectionCommand.

Para colocar a lista de figuras e a lista de tabelas no índice você também deve usar um recurso especial do KOMA-Script: opção listof=totoc. Para remover a lacuna do capítulo dessa lista, você também não precisa redefinir localmente, \addvspacemas pode usar a opção listof=nochaptergap.

Com essas alterações você não precisa mais usar o 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}

insira a descrição da imagem aqui

Responder2

A lista de figuras utiliza \l@figurepara fazer a formatação, então adicionei um arquivo \vspace{\baselineskip}. Isso deve funcionar com qualquer classe de documento.

O espaçamento duplo é feito por máquinas de escrever. Os compositores adicionam espaço extra entre as linhas.

\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}

informação relacionada