1

I Need to reduce the distance between two Pictures in landscape mode. I think they should fit on the page, if the unnecessary spacing wouldnt be there. \hspace{.25cm} doesnt work either. Please find below the Code. And attached the two Pictures, if that helps...enter image description here enter image description here

\documentclass[a4paper, 12pt]{article}
\DeclareUnicodeCharacter{FB01}{fi}
\DeclareUnicodeCharacter{FB02}{fl}
%\usepackage[space]{grffile}
\usepackage{apacite}
\usepackage{makecell}
\usepackage{afterpage}
\usepackage{dblfloatfix}
\usepackage[referable]{threeparttablex}
\usepackage[paper=portrait,pagesize]{typearea}
\usepackage{mleftright}
\usepackage{lscape}
\usepackage{a4wide}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[onehalfspacing]{setspace}
\usepackage{float, afterpage, rotating, graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz, epstopdf,pgfplots}
\usepackage{longtable, booktabs, tabularx}
\usepackage{fancyvrb, moreverb, relsize}
\usepackage{eurosym, calc, chngcntr}
\usepackage{amsmath, amssymb, amsfonts, amsthm, bm}
\usepackage{mathtools}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
\usepackage[labelfont={bf}, skip=5pt]{caption}
\usepackage{mdwlist}
\usepackage{tabularx, booktabs}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\usepackage{xfrac}
\usepackage{setspace,geometry}
\usepackage{xcolor}
\usepackage{lmodern}
\usepackage{upgreek}
\usepackage{afterpage}
\usepackage{wrapfig}
\usepackage{pdflscape}
\usepackage{multirow, booktabs, makecell, caption}
\usepackage{fancyhdr}
\usepackage[toc]{glossaries}
\usepackage{subcaption}
\usepackage{lipsum}  
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{eurosym}
\usepackage{amsfonts}
\usepackage{booktabs}
\usepackage{abstract}
\usepackage{dcolumn}
\usepackage{graphicx}
\usepackage[hyphens]{url}
\usepackage{acronym}
\usepackage[english]{babel}
\usepackage[round, sort&compress]{natbib} %sort&compress orders in text citation automatically
\usepackage{pgfplots}
\usepackage{threeparttable}
\usepackage{siunitx} %setze S in Tabelle, um nach dem Punkt auszurichten
\usepackage[export]{adjustbox}
\usepackage{etoolbox}
\usepackage[hyperfootnotes=false]{hyperref}
\usepackage{footnotebackref}
\usepackage{appendix}
\usepackage[bottom,hang,flushmargin]{footmisc} %footnotes always appear on bottom and not end of text on single page
\geometry{a4paper, top=30mm, left=30mm, right=30mm, bottom=30mm,headsep=10mm, footskip=12mm}

%try to prevent widows and orphans (single lines on top/bottom of page)
\widowpenalty10000 
\clubpenalty10000

\begin{document}

\newgeometry{top=30mm, left=10mm, right=10mm, bottom=30mm,headsep=10mm, footskip=12mm}

\begin{landscape}
\begin{figure}
\begin{subfigure}{0.7\hsize}\centering
    \includegraphics[width=0.9\hsize]{heatmap_bull_unscaled.png}\hspace{.25cm}
\caption{Sub figure A}
    \label{fig:sub1}
\end{subfigure}%
%\hfill <-- it is superfluous 
\begin{subfigure}{0.7\hsize}\centering
    \includegraphics[width=0.9\hsize]{heatmap_bear_unscaled.png}
\caption{Sub figure B}
    \label{fig:sub2}
\end{subfigure}
\caption{Figure in landscape orientation}
    \label{fig:sub2}
\end{figure}
\end{landscape}

\restoregeometry


\end{document}

I want them to be next to each other, like here, but without the spacing between them:

enter image description here

MANGo 92
  • 179
  • How you like positioned these pictures? One above other or that they are parallel? – Zarko Oct 09 '19 at 11:14
  • I cant reproduce your result. In case, that images are parallel, there is no vertical space between them, in case that images is one above other, the space is very small. Unfortunately I cant test this with your images. It can be, that they are to large that can be fit in one page. – Zarko Oct 09 '19 at 11:21
  • Off-topic: Do you really need all package which you load in document preamble? Many of them are loaded twice ... Please, clean-up your preamble and then provide MWE which has only relevant package needed to reproduce your problem. – Zarko Oct 09 '19 at 11:23

1 Answers1

1

I cant reproduce your result with test images provided by graphicx package with option demo.

\documentclass[a4paper, 12pt]{article}
\usepackage{geometry}
\geometry{a4paper, top=30mm, left=30mm, right=30mm, bottom=30mm,headsep=10mm, footskip=12mm}
\usepackage[demo, export]{adjustbox}
\usepackage{subcaption}
\usepackage{pdflscape}

\begin{document}

\newgeometry{top=30mm, left=10mm, right=10mm, bottom=30mm,headsep=10mm, footskip=12mm}
\begin{landscape}
\begin{figure}
\begin{subfigure}{0.49\linewidth}
    \includegraphics[width=\linewidth]{heatmap_bull_unscaled.png}
\caption{Sub figure A}
    \label{fig:sub1}
\end{subfigure}
\hfill
\begin{subfigure}{0.49\linewidth}
    \includegraphics[width=\linewidth]{heatmap_bear_unscaled.png}
\caption{Sub figure B}
    \label{fig:sub2}
\end{subfigure}
\caption{Figure in landscape orientation}
    \label{fig:sub2}
\end{figure}
\end{landscape}

\restoregeometry
\end{document}

enter image description here

If you cant reproduce similar result with your actual images means, that images has white space around them. This you can check with enclose \incledegraphics... into \fbox:

\begin{subfigure}{0.49\linewidth}
\fbox{
    \includegraphics[width=\linewidth]{heatmap_bull_unscaled.png}
    }
\caption{Sub figure A}
    \label{fig:sub1}
\end{subfigure}

I f white space is there, you can trim it out for example with tools in program by which they are generated, or with some other tools or with appropriate settings of trim options in \includegraphics:

\includegraphics[trim={5cm 0 0 0},clip]{example-image-a}

where trim modify the bounding box specified in the file. The four values specify the amounts to remove from the left, bottom, right and top of the original box; and clip clip the graphics to the bounding box (specified with trim)

Zarko
  • 296,517