
我正在用latex写一篇文章,出于某种原因,我的一个人物神秘地漂浮在周围。我试着制作四个数字中的一个(a,b,c,d),而b数字只是浮动在它应该在的位置上。我已经检查了图形大小和定义图形后的任何额外标志,但似乎找不到问题。
有没有人看到问题出在哪里?
\documentclass[11pt]{article}
\usepackage[left=25mm, right=25mm, top=25mm, bottom=25mm, includehead=true, includefoot=true]{geometry}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[table,xcdraw]{xcolor}
\usepackage{hyperref}
\usepackage{mathtools}
%\usepackage[caption=false]{subfig}
\usepackage{amsmath}
\usepackage{multirow}
\graphicspath{ {./images/} }
\usepackage{url}
\usepackage{caption}
\usepackage[round]{natbib} % For referencing
\usepackage{authblk} % For author lists
\usepackage[parfill]{parskip} % Line between paragraphs
\usepackage[normalem]{ulem}
\usepackage{multicol}
\pagenumbering{gobble} % Turn off page numbers
% Make all headings the same size (11pt):
\usepackage{sectsty}
\sectionfont{\normalsize}
\subsectionfont{\normalsize}
\subsubsectionfont{\normalsize}
\paragraphfont{\normalsize}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[a]{0.45\linewidth}
\includegraphics[width=\linewidth]{6_5_model_building_90_0}
\caption{}
\label{fig:3a}
\end{subfigure}\hfill
\begin{subfigure}[b]{0.45\linewidth}
\includegraphics[width=\linewidth]{6_5_model_building_87_0}
\caption{}
\label{fig:3b}
\end{subfigure}
%add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc.
%(or a blank line to force the subfigure onto a new line)
\begin{subfigure}[c]{0.5\linewidth}
\includegraphics[width=\linewidth]{14_5_fisrt_paper_figures_46_1}
\caption{}
\label{fig:3c}
\end{subfigure}\hfill
\begin{subfigure}[d]{0.5\linewidth}
\includegraphics[width=\linewidth]{14_5_fisrt_paper_figures_45_0}
\caption{}
\label{fig:3d}
\end{subfigure}
\caption{My caption}
\label{fig:3}
\end{figure}
\vfill
\clearpage
\newpage
\bibliographystyle{plainnat}
\bibliography{MyLibrary}
\end{multicols}
\end{document}发布于 2021-02-06 01:02:00
subfigure环境的第一个可选参数用于外部位置。实际上,b和c是允许的值,其他值将默认为c。您的第二个图像未对齐,因为您指示它底部对齐。
其他一些评论:
mathtools已经加载了amsmathhyperref after the other packages如果还加载hyperref,则
urlsubcaption已经加载了caption\documentclass{article}
\usepackage[left=25mm, right=25mm, top=25mm, bottom=25mm, includehead=true, includefoot=true]{geometry}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[table,xcdraw]{xcolor}
\usepackage{mathtools}
%\usepackage[caption=false]{subfig}
%\usepackage{amsmath}
\usepackage{multirow}
\graphicspath{ {./images/} }
%\usepackage{url}
%\usepackage{caption}
\usepackage[round]{natbib} % For referencing
\usepackage{authblk} % For author lists
\usepackage[parfill]{parskip} % Line between paragraphs
\usepackage[normalem]{ulem}
\usepackage{multicol}
\pagenumbering{gobble} % Turn off page numbers
% Make all headings the same size (11pt):
\usepackage{sectsty}
\sectionfont{\normalsize}
\subsectionfont{\normalsize}
\subsubsectionfont{\normalsize}
\paragraphfont{\normalsize}
\usepackage{hyperref}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[c]{0.45\linewidth}
\includegraphics[width=\linewidth]{example-image-duck}
\caption{}
\label{fig:3a}
\end{subfigure}\hfill
\begin{subfigure}[c]{0.45\linewidth}
\includegraphics[width=\linewidth]{example-image-duck}
\caption{}
\label{fig:3b}
\end{subfigure}
%add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc.
%(or a blank line to force the subfigure onto a new line)
\begin{subfigure}[c]{0.5\linewidth}
\includegraphics[width=\linewidth]{example-image-duck}
\caption{}
\label{fig:3c}
\end{subfigure}\hfill
\begin{subfigure}[c]{0.5\linewidth}
\includegraphics[width=\linewidth]{example-image-duck}
\caption{}
\label{fig:3d}
\end{subfigure}
\caption{My caption}
\label{fig:3}
\end{figure}
\vfill
\clearpage
\newpage
\bibliographystyle{plainnat}
\bibliography{MyLibrary}
%\end{multicols}
\end{document}

https://stackoverflow.com/questions/66067157
复制相似问题