你好,我正在尝试更改每个子情节中指定角色的定位。目前我有三个相邻的子情节:
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.31\textwidth}
\centering
\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm},clip,width=\textwidth]{My_first_subplot}
\caption{}
\label{My first subplot label}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.31\textwidth}
\centering
\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm},clip,width=\textwidth]{my second subplot}
\caption{}
\label{my second subplot label}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.31\textwidth}
\centering
\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm},clip,width=\textwidth]{my third subplot}
\caption{}
\label{My third subplot label}
\end{subfigure}
\caption{Caption of all tree plots}
\label{label of all three plots}
\end{figure}
不幸的是,我的文档中已经有很多这样的图,所以我希望可以对我的代码进行轻微的调整。但如果我必须重新制作,那就这样吧:)
可以看到,此代码生成了三个子图,其下方分别为 (A)、(B)、(C)。我希望每个子图的左上角都有字符,但不带括号。
我希望我的问题很清楚并且有人可以帮助我,因为我对乳胶还很陌生。
谢谢你!
答案1
\documentclass{article}
\usepackage[labelformat=simple, singlelinecheck=off]{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.31\textwidth}
\centering
\caption{}
\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-a}
\label{My first subplot label}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.31\textwidth}
\centering
\caption{}
\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-b}
\label{my second subplot label}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.31\textwidth}
\centering
\caption{}
\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-c}
\label{My third subplot label}
\end{subfigure}
\caption{Caption of all tree plots}
\label{label of all three plots}
\end{figure}
\end{document}
编辑:图片内有说明stackengine
\documentclass{article}
\usepackage{stackengine}
\usepackage[labelformat=simple, singlelinecheck=off]{subcaption}
\usepackage{graphicx}
\begin{document}
\begin{figure}[h!]
\centering
\begin{subfigure}[b]{0.31\textwidth}
\centering
\phantomcaption
\stackinset{l}{2pt}{t}{2pt}{\captiontext*}
{\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-a}}
\label{My first subplot label}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.31\textwidth}
\centering
\phantomcaption
\stackinset{l}{2pt}{t}{2pt}{\captiontext*}
{\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-b}}
\label{my second subplot label}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.31\textwidth}
\centering
\phantomcaption
\stackinset{l}{2pt}{t}{2pt}{\captiontext*}
{\includegraphics[trim={4,2cm 3,1cm 4,2cm 3,1cm}, clip, width=\textwidth]{example-image-c}}
\label{My third subplot label}
\end{subfigure}
\caption{Caption of all tree plots}
\label{label of all three plots}
\end{figure}
\end{document}