我正在使用该subcaption
包将图形并排放置,并且我需要在图形的左上角以字母的形式粘贴标签。
即我正在努力实现
A [Figure] B [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
[Figure] [Figure]
其中单个图像表示为:
[Figure]
[Figure]
[Figure]
[Figure]
[Figure]
我很高兴我的身材能够与花车顶部对齐。
我努力了:
\documentclass[12pt,a4paper,twoside,table]{report}
\usepackage[font=small]{caption}
\usepackage[labelformat = empty,position=top]{subcaption}
\begin{document}
\begin{figure}[tb]
\centering
\begin{subfigure}[t]{0.05\textwidth}
\textbf{A}
\end{subfigure}
\begin{subfigure}[t]{0.45\textwidth}
\includegraphics[width=\textwidth]{figures/figure1.pdf}
\end{subfigure}
\begin{subfigure}[t]{0.05\textwidth}
\textbf{B}
\end{subfigure}
\begin{subfigure}[t]{0.45\textwidth}
\includegraphics[width=\textwidth]{figures/figure2.pdf}
\end{subfigure}
\caption[This is for my LOF]{Yay I am usually a huge figure caption}
\label{Iamalabel}
\end{figure}
\end{document}
我如何获得标签
(1)字母 A、B......
(2)实际上定位正确吗?
答案1
像这样吗?
代码
\documentclass[12pt, a4paper, twoside]{report}
\usepackage[font=small]{caption}
\usepackage[labelformat=empty, position=top]{subcaption}
\usepackage[demo]{graphicx}
\usepackage[export]{adjustbox}
\begin{document}
\begin{figure}[tb]
\centering
\begin{subfigure}[t]{0.03\textwidth}
\textbf{A}
\end{subfigure}
\begin{subfigure}[t]{0.45\textwidth}
\includegraphics[width=\linewidth, valign=t]{figures/figure1.pdf}
\end{subfigure}\hfill
\begin{subfigure}[t]{0.03\textwidth}
\textbf{B}
\end{subfigure}
\begin{subfigure}[t]{0.45\textwidth}
\includegraphics[width=\linewidth, valign=t]{figures/figure2.pdf}
\end{subfigure}
\caption[This is for my LOF]{Yay I am usually a huge figure caption}
\label{Iamalabel}
\end{figure}
\end{document}
诀窍是将选项添加valign=t
到,该选项由带有选项的\includegraphics
包提供。adjustbox
export
具有多个图形的示例:
\documentclass[12pt, a4paper, twoside]{report}
\usepackage[font=small]{caption}
\usepackage[labelformat=empty, position=top]{subcaption}
\usepackage[demo]{graphicx}
\usepackage[export]{adjustbox}
\begin{document}
\begin{figure}[tb]
\centering
\begin{subfigure}[t]{0.03\textwidth}
\textbf{A}
\end{subfigure}
\begin{subfigure}[t]{0.45\textwidth}
\includegraphics[width=\linewidth, valign=t]{figures/figure1.pdf}\\[3pt]
\includegraphics[width=\linewidth]{figures/figure1.pdf}\\[3pt]
\includegraphics[width=\linewidth]{figures/figure1.pdf}
\end{subfigure}\hfill
\begin{subfigure}[t]{0.03\textwidth}
\textbf{B}
\end{subfigure}
\begin{subfigure}[t]{0.45\textwidth}
\includegraphics[width=\linewidth, valign=t]{figures/figure2.pdf}\\[3pt]
\includegraphics[width=\linewidth]{figures/figure1.pdf}\\[3pt]
\includegraphics[width=\linewidth]{figures/figure1.pdf}
\end{subfigure}
\caption[This is for my LOF]{Yay I am usually a huge figure caption}
\label{Iamalabel}
\end{figure}
\end{document}
请注意,由于您没有为子图使用子标题,因此您可以将所有subfigure
s 替换为minipage
s。