
コマンド\ref
は、次のコードのように、テーブル番号のみを参照できます。
\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}
\ref
キャプションテキストを本文の後ろ(位置[[HERE]])に挿入したいと思います。
のように
表 1 の「表のキャプション」によれば、私たちはこうなります。
ない
表 1 によれば、私たちはこうなります。
本文にキャプションテキストを挿入する方法はありますか?
答え1
たとえば、パッケージnameref
またはtitleref
提供は、キャプション (およびセクションなど) のタイトルを参照します。
\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}
パッケージ付きtitleref
:
\usepackage{titleref}
...\titleref{...}...
追加のヒントについてはコメントも参照してください。