
私はクラスcleveref
内のフロート (この場合はサブフィギュア) を参照するためにパッケージを使用していますmemoir
。現在、出力は次のようになります (デンマーク語で申し訳ありませんが、問題ないと思います)。
次の入力を使用します (もちろん、すべてのパッケージが含まれているわけではありません)。
\documentclass[oneside,article,12pt,danish]{memoir}
\usepackage{graphicx}
\newsubfloat{figure}
\captiontitlefont{\slshape}
\subcaptionfont{\slshape}
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\begin{document}
\begin{figure}[h!]
\centering
\subbottom[Subfigure 1 caption]{\rule{3cm}{1cm}\label{sub1}}
\hspace{1cm}
\subbottom[Subfigure 2 caption]{\rule{3cm}{1cm}\label{sub2}}
\caption{Figure text.}
\label{fig:secondfig}
\end{figure}
\cref{sub1,sub2}
\end{document}
図/サブ図の設定方法は気に入っていますが、図/サブ図のキャプションを変更せずに、参照を または5a
と表示したいです。文書全体でこれを実行し、多少ランダムな表記に簡単に変更できる一般的な方法はありますか?5.a
5(a)
答え1
このソリューションでは、ロードする必要がなくなりcaption
、 の機能を維持できますmemoir
。少なくとも、私のテストは最小限ですが、そのように見えます。気分に応じて、ドットありまたはドットなしの書式設定を実現するには、適切な行をコメント解除/コメント化します。
\documentclass[oneside,article,12pt,danish]{memoir}
\newsubfloat{figure}
\captiontitlefont{\slshape}
\subcaptionfont{\slshape}
% \renewcommand{\thesubfigure}{\alph{subfigure}}% plain version
\renewcommand{\thesubfigure}{.\alph{subfigure}}% dotted version
\makeatletter
\renewcommand{\@thesubfigure}{(\alph{subfigure})%
\if@tightsubcap\hskip\subfloatlabelskip\else\space\fi}
\makeatother
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\begin{document}
\begin{figure}[h!]
\centering
\subbottom[Subfigure 1 caption]{\rule{3cm}{1cm}\label{sub1}}
\hspace{1cm}
\subbottom[Subfigure 2 caption]{\rule{3cm}{1cm}\label{sub2}}
\caption{Figure text.}
\label{fig:secondfig}
\end{figure}
\cref{sub1,sub2}
\end{document}
ロードするxcolor
と、キャプションやその他の参照に影響を与えずに、サブ図のビットへの参照だけを巨大な青い小文字でタイプセットすることができます (意外にも)。
\renewcommand{\thesubfigure}{\Huge\color{blue}.\alph{subfigure}}% dotted version
明らかに、これはひどい選択ですが、サブキャプションの形式と のインターフェースを維持しながら、形式を簡単に「多少ランダムな表記に変更」できることを示していますmemoir
。
答え2
subfig
OK、とを使用した部分的な提案ですcaption
。memoir クラスはこれまで使用したことがありません。article を使用すると、図には「1.a」というラベルが付けられますが、memoir に切り替えると「0.1.a」になります。コードの一部はコンパイルされません。コメント アウトしました。後者を使用したことがないため、図を自分のコードに似たもの (つまり、 ではsubfloat
ないsubbottom
) に変更しました。以前リンクした質問への回答を組み込みました。
したがって、コンパイルされないコードに関する上記の注意事項を踏まえると、ここでの私の例は、図のラベル付けに関して必要なことを実行していると思います。
おそらくもっと良い解決策があるでしょう。
\documentclass[12pt]{memoir}
\usepackage{graphicx}
%%%%These do not work for me - is there a missing package?
%\newsubfloat{figure}
%\captiontitlefont{\slshape}
%\subcaptionfont{\slshape}
%%%%
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{cleveref}
\usepackage[font=sl,labelfont=up]{caption}
\usepackage[font=sl,labelfont=up]{subfig}
\renewcommand\thesubfigure{\alph{subfigure}} % default: "(\alph{subfigure})"
\makeatletter
\renewcommand{\p@subfigure}{\thefigure.} % default: "\thefigure" (without the ".")
\makeatother
\begin{document}
\begin{figure}
\centering
\subfloat[Subfigure 1 caption]{\rule{3cm}{1cm}\label{sub1}}
\hspace{1cm}
\subfloat[Subfigure 2 caption]{\rule{3cm}{1cm}\label{sub2}}
\caption{Figure text.}
\label{fig:secondfig}
\end{figure}
\cref{sub1,sub2}
\end{document}