
Estou procurando uma maneira de dar a todas as minhas tabelas o mesmo título no documento, que é usado na lista de tabelas via caption[title]{long description...}
. A razão é que minhas tabelas são originárias de R (xtable), que usa exatamente o formato acima toda vez que eu as recalculo, e não posso mudar isso. Infelizmente, não pude usar nenhuma solução diferente. Este é um assunto muito importante para mim porque tenho muitas tabelas em meu documento.
Aqui está um MWE. Como você pode ver, os títulos estão faltando e apenas os rótulos estão visíveis. O recuo na descrição mais longa é proposital.
Editar:
Fiz uma foto para ilustrar melhor isso:
\documentclass[a4paper, 12pt, headsepline, smallheadings]{scrreprt}
\usepackage[labelfont={small,bf}, textfont=small, labelsep=colon,singlelinecheck=false,format=plain, parindent=1em]{caption}
\newlength\myindention
\DeclareCaptionFormat{myformat}%
{#1#2\\\hspace*{\myindention}#3}
\setlength\myindention{1em}
\captionsetup{format=myformat}
\usepackage{chngcntr}
\counterwithout{table}{chapter}
\begin{document}
\listoftables
\chapter{Introduction}
\begin{table}[h]
\caption[title table 1]{description table 1}
\fbox{content}
\end{table}
\begin{table}[h]
\caption[title table 2]{description table 2}
\fbox{content}
\end{table}
\end{document}
Obrigado por qualquer ajuda. Atenciosamente, Tom.
Responder1
Se você tem certeza de que todas as suas legendas possuem este formato, adicione as seguintes linhas no preâmbulo:
\let\oldcaption\caption
\renewcommand*\caption[2][]{%
\oldcaption[#1]{#1\\\hspace*{\myindention}#2}%
}
e removendo o seguinte
\DeclareCaptionFormat{myformat}%
{#1#2\\\hspace*{\myindention}#3}
\captionsetup{format=myformat}
você deve conseguir o que deseja.
MWE
\documentclass[a4paper, 12pt, headsepline, smallheadings]{scrreprt}
\usepackage[labelfont={small,bf}, textfont=small, labelsep=colon,singlelinecheck=false,format=plain, parindent=1em]{caption}
\newlength\myindention
\setlength\myindention{1em}
\usepackage{chngcntr}
\counterwithout{table}{chapter}
\let\oldcaption\caption
\renewcommand*\caption[2][]{%
\oldcaption[#1]{#1\\\hspace*{\myindention}#2}%
}
\begin{document}
\listoftables
\chapter{Introduction}
\begin{table}[h]
\caption[title table 1]{description table 1}
\fbox{content}
\end{table}
\begin{table}[h]
\caption[title table 2]{description table 2}
\fbox{content}
\end{table}
\end{document}
Saída: