\caption
aと aを含む新しい環境を宣言した\label
ので、それを参照できます。
私のヘッダーで:
\DeclareFloatingEnvironment[name=Tableau]{tableau}
\newenvironment{ptab}{\captionsetup{type=tableau}}{}
私の .tex ドキュメントでは:
\begin{ptab}
\caption{A caption for my table}
\label{ptab:myTab}
\end{ptab}
Some text with a reference (Tableau~\ref{ptab:myTab}) % Works fine !
\newcommand
問題:これを書いてくれるa を宣言して時間を稼ぎたい。しかし、テキスト内の参照はもう機能していません!
私のヘッダーに追加されました:
\newcommand{\tabref}[2]{%
\begin{ptab}
\label{#1}
\caption{#2}
\end{ptab}}
.tex ドキュメント内:
\tabref{ptab:myTab}{A caption for my table}
Some text with a reference (Tableau~\ref{ptab:myTab}) % Not working "(Tableau ??)"
以前にも同様の質問があったことは承知していますが、それは新しい環境に関するものではありませんでした。 LATEX の newcommand 内でラベルを参照するには?