\documentclass{memoir}
\usepackage[demo]{graphicx} % remove [demo] in your file
\usepackage{subfig} % for subfigures
\usepackage{caption}
\usepackage{lipsum}
\captionsetup[figure]{labelfont={bf,small},textfont={it,small}}
\captionsetup[subfloat]{labelfont={bf,small},textfont={it,small},
subrefformat=parens} %<-----designing subcaption
\newcommand{\myfigref}[2]{~\ref{#1}.\subref{#2}}% <---- a new macro for referring to a subfigure
%
\begin{document}
%=========================
\chapter{First chapter}
\lipsum[1-4]
%=========================
%=========================
\begin{figure}[ht]
\centering
\subfloat[My first picture]{\label{fig:mdleft}{\includegraphics[width=0.4\textwidth]{my figure}}}\hfill
\subfloat[My second picture]{\label{fig:mdright}{\includegraphics[width=0.4\textwidth]{my figure}}}
\caption{My two big pictures}
\label{fig:subfigures}
\end{figure}
%===========================
From figure~\ref{fig:subfigures}.\subref{fig:mdleft}, we can see a small cat, in
\myfigref{fig:subfigures}{fig:mdright} both can be used to refer figures.
\end{document}
Latex多幅图片并排显示
最新推荐文章于 2025-04-21 17:26:44 发布