![異なるタイプの図を参照する方法(「図」や「図版」など)](https://rvso.com/image/420945/%E7%95%B0%E3%81%AA%E3%82%8B%E3%82%BF%E3%82%A4%E3%83%97%E3%81%AE%E5%9B%B3%E3%82%92%E5%8F%82%E7%85%A7%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95%EF%BC%88%E3%80%8C%E5%9B%B3%E3%80%8D%E3%82%84%E3%80%8C%E5%9B%B3%E7%89%88%E3%80%8D%E3%81%AA%E3%81%A9%EF%BC%89.png)
ドキュメントに 2 種類の数字 (異なるカウンター付き) を追加したい
- 数字
- プレート(一般的なものであれば、白黒、カラープレートを区別することが可能です)
どの環境をカスタマイズする必要があるのかわかりません (図? 参照? ラベル?)。
理由: すべての図面には名前を付けてfig. XX
、本文に含めます。写真は最後に配置し、 として参照します。[参考までに] 白黒写真とカラー写真pl. XX
を区別すると便利です。pl. XX
c. pl. XX
レンダリングされたテキストの例は次のようになります。
From the diagram (fig. 1, p. 1), the X-Ray imagery (pl. 1, p. 32)
or the colored tomography (c. pl. 1, p. 104), we deduce that ....
fig. 1
、 3つの異なる画像pl. 1
がc. pl. 1
含まれています
\begin{figure}
\includegraphics[width=10mm]{fig_1}
\label{fig_1}
\end{figure}
\begin{figure}
\includegraphics[width=10mm]{pl_1}
\label{pl_1}
\end{figure}
\begin{figure}
\includegraphics[width=10mm]{c_pl_1}
\label{c_pl_1}
\end{figure}
私はxelatex
パッケージをvarioref, hyperref, cleveref
この順序で使用します (cleverref
マニュアル 12.1、p. 23 に指定されているとおり)。私のドキュメントではさまざまな言語 (英語、フランス語、ドイツ語) を使用していますが、すべての参照は "fig/pl." にする必要があります (つまり、"Abb." に翻訳する必要はありません)。
答え1
数字と 2 種類の「プレート」に別々で独立したカウンターが必要なので、パッケージの仕組みを使用して、(たとえば)とnewfloat
という 2 つの新しいフローティング環境を作成する必要があると思います。次に、を実行するときに使用するプレフィックス ラベルを指示するディレクティブを使用します。bwplate
clrplate
\crefname
cleveref
\cref
\documentclass[11pt]{scrartcl}
\usepackage[ngerman,french,english]{babel}
\usepackage[a4paper,vmargin=1cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[demo]{graphicx} % remove 'demo' option in real doc.
\usepackage{newfloat} % for '\DeclareFloatingEnvironment' macro
\usepackage{varioref}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage[nameinlink]{cleveref}
\DeclareFloatingEnvironment[name=Plate]{bwplate} % or 'name=B\&W Plate'
%% declare labels for use with \cref:
\crefname{bwplate}{b\&w pl.}{b\&w pls.}
\Crefname{bwplate}{B\&W Plate}{B\&W Plates}
\DeclareFloatingEnvironment[name=Color Plate]{clrplate}
%% declare labels for use with \cref:
\crefname{clrplate}{clr. pl.}{clr. pls.}
\Crefname{clrplate}{Color Plate}{Color Plates}
\begin{document}
Cross-references to \cref{fig:1,pl:1,cpl:1,pl:2,cpl:2}.
\Cref{fig:1}. \Cref{pl:1,pl:2}. \Cref{cpl:1,cpl:2}.
\begin{figure}[h!]
\centering
\includegraphics[width=0.4\textwidth]{fig_1}
\caption{A graphic}\label{fig:1}
\end{figure}
\begin{bwplate}[h!]
\centering
\includegraphics[width=0.4\textwidth]{pl_1}
\caption{A first B\&W image}\label{pl:1}
\end{bwplate}
\begin{clrplate}[h!]
\centering
\includegraphics[width=0.4\textwidth]{c_pl_1}
\caption{A first color image}\label{cpl:1}
\end{clrplate}
\begin{bwplate}[h!]
\centering
\includegraphics[width=0.4\textwidth]{pl_2}
\caption{A second B\&W image}\label{pl:2}
\end{bwplate}
\begin{clrplate}[h!]
\centering
\includegraphics[width=0.4\textwidth]{c_pl_2}
\caption{A second color image}\label{cpl:2}
\end{clrplate}
\end{document}