首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >乳胶图形;当绘制四部分图形时,其中一个(b)比另一个高,我找不到任何原因

乳胶图形;当绘制四部分图形时,其中一个(b)比另一个高,我找不到任何原因
EN

Stack Overflow用户
提问于 2021-02-06 00:41:44
回答 1查看 479关注 0票数 2

我正在用latex写一篇文章,出于某种原因,我的一个人物神秘地漂浮在周围。我试着制作四个数字中的一个(a,b,c,d),而b数字只是浮动在它应该在的位置上。我已经检查了图形大小和定义图形后的任何额外标志,但似乎找不到问题。

有没有人看到问题出在哪里?

代码语言:javascript
复制
\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}
EN

回答 1

Stack Overflow用户

发布于 2021-02-06 01:02:00

subfigure环境的第一个可选参数用于外部位置。实际上,bc是允许的值,其他值将默认为c。您的第二个图像未对齐,因为您指示它底部对齐。

其他一些评论:

  • mathtools已经加载了amsmath

  • load hyperref after the other packages

如果还加载hyperref,则

  • 不需要url

  • subcaption已经加载了caption

代码语言:javascript
复制
\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}

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66067157

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档