如何使用子图添加 2x2 PNG 图形?我不确定自然高度/宽度 (natwidth、natheight) 是什么意思,而且图形之间存在巨大差距。
这是我的代码:
\documentclass[a4paper,10pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{tocbibind}
\usepackage{amssymb}
\usepackage{epsfig}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{fleqn}
\usepackage{amsmath} %%I am adding this!
\usepackage{bm}
\usepackage[normalem]{ulem}
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\usepackage{empheq}
\usepackage{stackengine}
\usepackage{multirow}
\usepackage{tabulary}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}{0.5\textwidth}\hfill
\includegraphics[width=2\textwidth,natwidth=610,natheight=642] {![https://i.stack.imgur.com/5LWRc.png][1]}
\caption{x}
\label{fig:First_figure}
% \label{fig:gull}
\end{subfigure}%
~ %add desired spacing between images, e. g. ~, \quad, \qquad etc.
%(or a blank line to force the subfigure onto a new line)
\hfill
\begin{subfigure}{0.5\textwidth}
\includegraphics[width=2\textwidth,natwidth=610,natheight=642]{![https://i.stack.imgur.com/9ICcj.png][2]}
\caption{x} \label{sf:Second_Figure}
\end{subfigure}\\
\begin{subfigure}{0.5\textwidth}%
\includegraphics[width=2\textwidth,natwidth=610,natheight=642]{![ https://i.stack.imgur.com/EBLCq.png][3]}
\caption{x}
\label{fig:Third_Figure}
\end{subfigure}%
\begin{subfigure}{0.5\textwidth}
\includegraphics[width=2\textwidth,natwidth=610,natheight=642]{![https://i.stack.imgur.com/o8lB6.png][4]}
\caption{x}
\label{fig:Forth_Figure}
\end{subfigure}
\caption{bla}
\end{figure}
\end{document}
答案1
\documentclass[a4paper,10pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{setspace}
\usepackage{tocbibind}
\usepackage{amssymb}
% no!\usepackage{epsfig}
\usepackage[demo]{graphicx}% remove in real case
\usepackage{fancyhdr}
\usepackage{fleqn}
\usepackage{amsmath} %%I am adding this!
\usepackage{bm}
\usepackage[normalem]{ulem}
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\usepackage{empheq}
\usepackage{stackengine}
\usepackage{multirow}
\usepackage{tabulary}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}{0.4\textwidth}\centering%no!\hfill
\includegraphics[width=\linewidth]{a}
\caption{w}
\label{fig:First_figure}
\end{subfigure}%
%no, don't use ~! ~ %add desired spacing between images, e. g. ~, \quad, \qquad etc.
%(or a blank line to force the subfigure onto a new line)
\hfill
\begin{subfigure}{0.4\textwidth}\centering
\includegraphics[width=\linewidth]{b}
\caption{x}
\label{fig:Second_figure}
\end{subfigure}%
\hfill
\begin{subfigure}{0.4\textwidth}\centering
\includegraphics[width=\linewidth]{c}
\caption{y}
\label{fig:Third_figure}
\end{subfigure}%
\hfill
\begin{subfigure}{0.4\textwidth}\centering
\includegraphics[width=\linewidth]{d}
\caption{z}
\label{fig:First_figure}
\end{subfigure}%
\caption{4 figures}
\end{figure}
\end{document}