Insertar texto de título en el cuerpo

Insertar texto de título en el cuerpo

El \refcomando puede hacer referencia solo al número de la tabla, como el siguiente código.

\documentclass{article}
\begin{document}
According to Table \ref{table} [[HERE]], we blah blah.
\begin{table}[tb]
  \caption{The caption of the table}
  \label{table}
  \begin{center}
    \begin{tabular}{ll}\hline foo & bar \\ \hline\end{tabular}
  \end{center}
\end{table}
\end{document}

Me gustaría insertar el texto del título en el cuerpo después de \ref(la posición [[AQUÍ]]).

como

Según la Tabla 1: "El título de la tabla", bla, bla.

No

Según la Tabla 1, bla, bla.

¿Hay alguna forma de insertar texto de título en el cuerpo?

Respuesta1

Por ejemplo, paquetes namerefo titlerefproporciona para hacer referencia al título de los subtítulos (y secciones,...):

\documentclass{article}
\usepackage{booktabs}% nicer table lines
\usepackage{nameref}
\usepackage{csquotes}% quotes with multilingual support
\usepackage{caption}% fixes the spacing around caption for tables
\begin{document}
According to Table \ref{table} \enquote{\nameref{table}}, we blah blah.
\begin{table}[tb]
  \centering % avoids additional vertical space of environment center
  \caption{The caption of the table}
  \label{table}
  \begin{tabular}{ll}
    \toprule
    foo & bar \\
    \bottomrule
  \end{tabular}
\end{table}
\end{document}

Resultado

Con paquete titleref:

\usepackage{titleref}
...\titleref{...}...

Consulte también los comentarios para obtener sugerencias adicionales.

información relacionada