我有五个数字。我想以 2x2 的格式将 1 个数字放在左边,将其余四个数字放在右边。有人能帮我解决这个问题吗?
答案1
使用该包的两种替代方案subcaption
:
\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\begin{subfigure}{0.525\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption{}\label{subfig:key-a}
\end{subfigure}\hfill
\begin{minipage}{0.45\linewidth}
\begin{subfigure}{0.475\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption{}\label{subfig:key-b}
\end{subfigure}\hfill
\begin{subfigure}{0.475\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption{}\label{subfig:key-c}
\end{subfigure}
\medskip
\begin{subfigure}{0.475\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption{}\label{subfig:key-d}
\end{subfigure}\hfill
\begin{subfigure}{0.475\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption{}\label{subfig:key-e}
\end{subfigure}\hfill
\end{minipage}
\caption{shared caption for all 5 images}
\label{fig:example-key}
\end{figure}
\begin{figure}
\begin{minipage}[b]{0.575\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption{caption for the image in the left}\label{fig:left}
\end{minipage}\hfill
\begin{minipage}[b]{0.375\linewidth}
\begin{subfigure}{0.475\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption{}\label{subfig:key-a1}
\end{subfigure}\hfill
\begin{subfigure}{0.475\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption{}\label{subfig:key-b1}
\end{subfigure}
\medskip
\begin{subfigure}{0.475\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption{}\label{subfig:key-c1}
\end{subfigure}\hfill
\begin{subfigure}{0.475\linewidth}
\includegraphics[width=\linewidth]{example-image}
\caption{}\label{subfig:key-d1}
\end{subfigure}
\caption{shared caption for the 4 images on the right}
\label{fig:key-right}
\end{minipage}
\end{figure}
\end{document}
答案2
在 s内设置图像允许使用可选参数( op 或ottom)tabular
轻松堆叠以及垂直对齐。[t]
[b]
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{figure}
\centering
\begin{tabular}{ c }
\includegraphics[width=.29\linewidth]{example-image}
\end{tabular}%
\begin{tabular}{ c c }
\includegraphics[width=.29\linewidth]{example-image-a} &
\includegraphics[width=.29\linewidth]{example-image-b} \\
\includegraphics[width=.29\linewidth]{example-image-c} &
\includegraphics[width=.29\linewidth]{example-image-a}
\end{tabular}
\caption{A figure caption}
\end{figure}
\end{document}
答案3
您还可以使用minipage
:
\documentclass[a4paper,14pt]{extreport}
\usepackage[left=1.5cm,right=1.5cm,
top=1.5cm,bottom=2cm,bindingoffset=0cm]{geometry}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\begin{document}
\begin{minipage}{0.35\textwidth}
\center{\includegraphics[width=0.9\linewidth]{example-image-a.png} A)}
\end{minipage}
\hfill
\begin{minipage}{0.6\textwidth}
\begin{minipage}[h]{0.47\linewidth}
\center{\includegraphics[width=1\linewidth]{example-image-a.png}} a)\\
\end{minipage}
\hfill
\begin{minipage}[h]{0.47\linewidth}
\center{\includegraphics[width=1\linewidth]{example-image-a.png}} \\ b)
\end{minipage}
\vfill
\begin{minipage}[h]{0.47\linewidth}
\center{\includegraphics[width=1\linewidth]{example-image-a.png}} c) \\
\end{minipage}
\hfill
\begin{minipage}[h]{0.47\linewidth}
\center{\includegraphics[width=1\linewidth]{example-image-a.png}} d) \\
\end{minipage}
\end{minipage}
\end{document}