如何使用表格引用获取图表/表格的标题?

如何使用表格引用获取图表/表格的标题?

如何使用图表的参考文献获取其标题?

\refcaption{tab:mytable}将会打印类似于的内容This is a pretty table.,这是下表的标题。

\documentclass{article}
\usepackage{booktabs,longtable,tabu}
\begin{document}

\begin{longtabu}{lll}
    \toprule
    h1 & h2 & h3 \\
    \midrule
  \endhead
    \bottomrule
    \caption{This is a pretty table.}
    \label{tab:mytable}
  \endlastfoot
  a & b & c \\
  d & e & f \\
\end{longtabu}

Table~\ref{tab:mytable} looks good and its description is the following: \textbf{HOW TO GET DESC?}.

\end{document}

答案1

这里有一些可以玩的东西。我希望你打算使用该包hyperref

在此处输入图片描述

\documentclass{article}
\usepackage{booktabs,longtable,tabu}
\usepackage{csquotes}
\usepackage{hyperref}
\begin{document}

\begin{longtabu}{lll}
    \toprule
    h1 & h2 & h3 \\
    \midrule
  \endhead
    \bottomrule
    \caption{This is a pretty table.}
    \label{tab:mytable}
  \endlastfoot
  a & b & c \\
  d & e & f \\
\end{longtabu}

\autoref{tab:mytable} looks good and its description is the following: \enquote{\nameref{tab:mytable}.} You can also have a look at \Nameref{tab:mytable}
\end{document}

相关内容