I try to place to figures side by side, as can be seen below the resulting figures are to wide, they expand over the right document border. Do I have to take the gap into account when sizing the images, and if so how do I do it, so that I don"t have to adjust if I globally change the gap size?
MWE: (Fancyhdr is used to show tha actual width of the main text area)
\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}
\Xhsize
comes from the floatrow package. It tells you how much you have left on that floatrow. In the beginning I take half the width since I have the entire row. After placing the first picture I have used half the page therefore \Xhsize is now '\linewidth'-half a page = half a page..5\linewidth
as you will see the renders will become to small. (Must be with thefloatrow
enviornment I think it uses minipages internallz or something).\XHsize
is what thefloatrow
package offers if you want to fill a line.