0

I want to add two photos horizontally, this works with my commands but I am restricted to width=0.45 for each (probably because of my margins) the problem is that the photos with this size are not clear (they are scanning electron microscope images so the resolution really matters). here are my commands with all packages:

\documentclass[14pt]{extarticle}
\usepackage{graphicx, epstopdf}
\usepackage[version=4]{mhchem} 
\usepackage{hyperref}
\usepackage{url}
\usepackage[articletitle]{achemso}
\usepackage{amsmath}
\usepackage{gensymb}
\usepackage{fancyhdr}
\usepackage[section]{placeins}
\usepackage{geometry}
\geometry{a4paper,left=3.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm}
\begin{document}

\FloatBarrier \section{Scanning electron microscopy} \begin{figure}[h] \centering \subfigure{\includegraphics[width=0.45\textwidth]{Sempic.png}} \subfigure{\includegraphics[width=0.45\textwidth]{Sempic2.png}} \caption{SEM images of \ce{ZnCr2O4}} \label{SEM} \end{figure}

\end{document}

What I really want to know is if there is a way to tell latex that it's ok to exceed the margins for these photos only

mickep
  • 8,685
  • In your document can you add a page in landscape? Maybe then you can use [width=1\textwidth] – CrocoDuck Apr 04 '22 at 19:13
  • There are solutions here: https://tex.stackexchange.com/questions/16582/center-figure-that-is-wider-than-textwidth – CrocoDuck Apr 04 '22 at 20:13
  • 1
    you can use .5 rather than .45 so long as you remove the space between them. (even with a space they could be bigger than .45, a word-space does not take up 10% of the text width.) – David Carlisle Apr 04 '22 at 20:54

1 Answers1

2

With rectangular figures you can show more area by placing them vertically: +40% width and staying within the margins, (Perhaps for looking a SEM does not matter)

a

\documentclass[14pt]{extarticle}
\usepackage{graphicx, epstopdf}
\usepackage[version=4]{mhchem} 
\usepackage{hyperref}
\usepackage{url}
\usepackage[articletitle]{achemso}
\usepackage{amsmath}
\usepackage{gensymb}
\usepackage{fancyhdr}
\usepackage[section]{placeins}
\usepackage{geometry}
\geometry{a4paper,left=3.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm}

\usepackage{subcaption} % added <<<<<<<<<<<<<<<<<<<<<<<<<<<

\usepackage{showframe} % ONLY to show the margins

\begin{document}

\FloatBarrier \section{Scanning electron microscopy}

\begin{figure}[h] \begin{subfigure}[b]{0.45\linewidth} \centering \includegraphics[width=1.4\linewidth, angle=90]{example-image-a} % changed <<<<<<<<<<<< \caption{Scan I} \label{fig:scanI} \end{subfigure} \qquad \begin{subfigure}[b]{0.45\linewidth} \centering \includegraphics[width=1.4\linewidth,angle=90]{example-image-b} % changed <<<<<<<<<<<< \caption{scan II} \label{fig:scanII} \end{subfigure} \caption{SEM images of \ce{ZnCr2O4}} \label{fig:SEM} \end{figure}

The figure~\ref*{fig:SEM} shows ...

\end{document}

If necessary, the margins can be trespass. (LaTeX will issue a warning)

b

\documentclass[14pt]{extarticle}
\usepackage{graphicx, epstopdf}
\usepackage[version=4]{mhchem} 
\usepackage{hyperref}
\usepackage{url}
\usepackage[articletitle]{achemso}
\usepackage{amsmath}
\usepackage{gensymb}
\usepackage{fancyhdr}
\usepackage[section]{placeins}
\usepackage{geometry}
\geometry{a4paper,left=3.5cm,top=2.5cm,right=2.5cm,bottom=2.5cm}

\usepackage{caption} % captionof <<<<<<<<<<<<<<<

\usepackage{showframe} % ONLY to show the margins

\begin{document}

\FloatBarrier\section{Scanning electron microscopy}

\hspace*{-2cm}\begin{minipage}{1.1\linewidth}
\includegraphics[width=0.55\linewidth]{example-image-a}\quad    
\includegraphics[width=0.55\linewidth]{example-image-b} 
\captionof{figure}{SEM images of \ce{ZnCr2O4}}
\label{fig:SEM}
\vspace*{\baselineskip}
\end{minipage} 

The figure~\ref*{fig:SEM} shows ...

\end{document}

Or mix the two techniques.

Maximum page coverage for comparing two images would be achieved by having one on top of the other.

d

    \noindent\begin{minipage}{\linewidth}
    \includegraphics[width=\linewidth]{example-image-a}
    \includegraphics[width=\linewidth]{example-image-b} 
    \captionof{figure}{SEM images of \ce{ZnCr2O4}}
    \label{fig:SEM}
    \end{minipage}  
Simon Dispa
  • 39,141
  • Thanks a lot, It works! – Naseebah Apr 05 '22 at 03:42
  • I used the second method you placed (when you said that margins can be trespass) and it works, but the problem is that this picture is on top of a page, I want it to move to the previous page(there is enough space) @Simon Dispa – Naseebah Apr 27 '22 at 13:17
  • 1
    @Naseebah Try removing \FloatBarrier (from the placeins package, prevents floats figures pass some point). – Simon Dispa Apr 27 '22 at 13:33