The \ref command can refer only the number of the table, like the following code.

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

I would like to insert the caption text into body after \ref (the position [[HERE]]).


According to Table 1: "The caption of the table", we blah blah.


According to Table 1, we blah blah.

Are there any ways to insert caption text into body?

1 Answer 1


For example, packages nameref or titleref provides to reference the title of captions (and sections, ...):

\usepackage{booktabs}% nicer table lines
\usepackage{csquotes}% quotes with multilingual support
\usepackage{caption}% fixes the spacing around caption for tables
According to Table \ref{table} \enquote{\nameref{table}}, we blah blah.
  \centering % avoids additional vertical space of environment center
  \caption{The caption of the table}
    foo & bar \\


With package titleref:


See also the comments for additional hints.

  • Thank you very much! Your answer works in my environment, too.
    – Nyoho
    Mar 27, 2016 at 11:13
  • LyX users only: Simply select the "Textual reference" format in the Cross-reference dialog (this use nameref in the background, do not mess with the LaTeX preamble for this).
    – Fran
    Mar 27, 2016 at 11:24
  • And I found that you are one of the main­tainers of nameref! Thank you again for making useful pakcage! (and one of my friends also appreciates that.)
    – Nyoho
    Mar 27, 2016 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.