
Estou com o seguinte problema: Minhas tabelas estão formatadas via caption[title]{long description...}
. Agora preciso adicionar as fontes de alguns deles como uma nota de rodapé adicionada à legenda, como no exemplo a seguir:
Eu tentei isso:Usando \footnote na \caption de uma figura, mas o problema é que as notas de rodapé também aparecem na lista de tabelas no início do documento.
Observe que 'A raposa vermelha - atributos' é o [title]
e o restante do texto é o {long description}
, usado como aqui:Adicione títulos de tabelas de legendas na classe scrreprt
Além disso, não estou usando notas de rodapé para cada legenda, portanto a solução teria que ser flexível, pois oferece a opção de adicionar uma (mas não obrigatória).
O formato acima é possível?
Procurando uma solução que funcione com segurança e sem resultados indesejados.
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}
\end{document}
Obrigado.
Responder1
Se oapenasA diferença é que às vezes você precisa de um \footnotemark
no final do título, você pode definir um toggle (generalização das macros com estrela) +
que o adiciona.
\documentclass{scrreprt}
\usepackage[labelfont={small,bf}, textfont=small, labelsep=colon,
singlelinecheck=false,format=plain, parindent=1em]{caption}
\usepackage{xparse}
\newlength\myindention
\setlength\myindention{1em}
\let\oldcaption\caption
\RenewDocumentCommand { \caption } { t{+} O{} m } {%
\oldcaption[#2]{%
#2%
\IfBooleanT{#1}{\footnotemark}
\\%
\hspace*{\myindention}#3
}%
}
\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}
\footnotetext{Source.}
\end{document}
Então \caption
funciona como no seu MWE e \caption+
faz o mesmo, mas adiciona \footnotemark
no final do título (essa é a \IfBooleanT
linha). Para deixar claro:
- tabela com fonte:
\caption+[title]{description}
e\footnotetext
depois - tabela sem fonte:
\caption[title]{description}
apenas
Responder2
Não é muito elegante, mas parece funcionar:
\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}
\usepackage{xparse}
\let\oldcaption\caption
\RenewDocumentCommand\caption{D [] {} D [] {} m}{%
\def\tempa{}%
\def\tempb{#1}%
\def\tempc{#2}%
\ifx\tempa\tempb\def\tempb{#3}\fi%
\ifx\tempa\tempc\let\tempc\tempb\fi%
\oldcaption[\tempb]{\tempc\\\hspace*{\myindention}#3}%
}
\begin{document}
\listoftables
\chapter{Introduction}
\begin{table}[h]
\caption[title table 1][title table 1\footnotemark]{description table 1}
\fbox{content}
\end{table}
Anywhere on the same page where the float appears\footnotetext{blah}
but at least before the next footnote\footnote{the nextone}
\end{document}
Espero que outra pessoa seja capaz de sugerir algo melhor, então eu só recomendaria isso se o tempo fosse essencial!