
Tengo el siguiente problema: Mis tablas están formateadas mediante caption[title]{long description...}
. Ahora necesito agregar las fuentes de algunos de ellos como una nota al pie agregada al título, como en el siguiente ejemplo:
Probé esto:Usando \footnote en el \caption de una figura, pero el problema es que las notas a pie de página también aparecen en la lista de tablas al principio del documento.
Tenga en cuenta que 'El zorro rojo - atributos' es el [title]
y el resto del texto es el {long description}
, usado como aquí:Agregar títulos de tablas a partir de subtítulos en la clase scrreprt
Además, no estoy usando notas a pie de página para cada título, por lo que la solución tendría que ser flexible ya que brinda la opción de agregar una (pero no es obligatoria).
¿Es posible el formato anterior?
Buscando una solución que funcione de forma segura y sin resultados no deseados.
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}
Gracias.
Respuesta1
Si elsoloLa diferencia es que a veces necesitas un \footnotemark
al final del título, puedes definir un interruptor (generalización de las macros destacadas) +
que lo agregue.
\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}
Luego \caption
funciona como en tu MWE y \caption+
hace lo mismo pero agrega \footnotemark
al final del título (esa es la \IfBooleanT
línea). Para hacerlo claro:
- tabla con fuente:
\caption+[title]{description}
y\footnotetext
después - tabla sin fuente:
\caption[title]{description}
solo
Respuesta2
No es muy elegante pero 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}
Sin embargo, espero que alguien más pueda sugerir algo mejor, por lo que solo recomendaría esto si el tiempo es esencial.