我尝试将两个图形并排放置,如下所示,结果图形太宽,它们超出了文档的右边框。在调整图像大小时,我是否必须考虑间隙?如果需要,我该怎么做,以便在全局更改间隙大小时不必进行调整?
MWE:(Fancyhdr 用于显示主文本区域的实际宽度)
\documentclass{report}
\usepackage{caption} %we base the subfigures on this
\usepackage[list=on]{subcaption} %we base the subfigures on this
\usepackage{floatrow} %subfigures
\usepackage[demo]{graphicx}
\usepackage{adjustbox} %limit graphics sizes
%floatrow setup
\floatsetup{style=ruled,footposition=caption,capposition=bottom, heightadjust=object} %make graphics look like booktables
\floatsetup[table]{style=plain,footposition=bottom}
\floatsetup[subfigure]{style= plain, heightadjust=object, valign=t}
\DeclareCaptionSubType[alph]{figure}
\captionsetup[subfigure]{labelformat=brace,justification=centerlast}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{1.0pt}
\makeatletter
%\renewcommand\fps@figure{!htb}
\setlength\@fptop{0pt}
\makeatother
\begin{document}
\begin{figure}[t]
\centering
\ffigbox[\FBwidth]{
\begin{subfloatrow}
\ffigbox[.5\Xhsize]{\caption{cap1}}{\includegraphics[width=.5\Xhsize]{}}
\ffigbox[\Xhsize]{\caption{cap2}}{\includegraphics[width=\Xhsize, height=5cm]{}}
\end{subfloatrow}}
{\caption{Tile network}}
\end{figure}
\end{document}
答案1
您已将 修复为\includegraphics
完全一样大\ffigbox
。可能问题只是内容不能与容器一样大。
将图像缩小一点,例如缩小到.45\Xhsize
和.95\Xhsize
,似乎可以解决问题,而且更优雅(当然,恕我直言)。使用 和 时,.499\Xhsize
即使.999 \Xhsize
放大 400%,规则和图像边距之间的水平差异也几乎不可察觉。