6

I have a five pics presented on one page. I find that the pics are so small I want to magnify them. But when I use larger \linewidth in the \includegraphics, pics are overlapped together. I think the best way is to move the (a)(c) a little bit left and the (b)(d) a little bit right. Then I have the space to zoom them. Is there any method? Thanks for your helping.

enter image description here

\begin{figure}
\centering
\begin{subfigure}{0.4\linewidth}
    \centering
    \includegraphics[width=1.2\linewidth]{images/energy_ratio/linear0001.eps}
    \caption{}
    \label{fig:hard_cokntact}
    \end{subfigure}
\qquad 
\begin{subfigure}{0.4\linewidth}
    \centering
    \includegraphics[width=1.2\linewidth]{images/energy_ratio/linear001.eps}
    \caption{}
    \label{fig:penaltyh method}
\end{subfigure}
\begin{subfigure}{0.4\linewidth}
\centering
\includegraphics[width=1.2\linewidth]{images/energy_ratio/linear01.eps}
\caption{}
\label{fig:hard_cokntact}
\end{subfigure}
    \qquad 
\begin{subfigure}{0.4\linewidth}
    \centering
    \includegraphics[width=1.2\linewidth]{images/energy_ratio/linear03.eps}
    \caption{}
    \label{fig:penaltyh method}
\end{subfigure}
\begin{subfigure}{0.4\linewidth}
    \centering
    \includegraphics[width=1.2\linewidth]{images/energy_ratio/linear05.eps}
    \caption{}
    \label{fig:hard_cokntact}
\end{subfigure}
\end{figure}  
  • Welcome to TeX.SE. Please let us know if you use the subcaption or the subfig package. – Mico Apr 29 '19 at 6:48
  • 1
    Not clear on zooming in the extra space. Can you add an image of the page layout as per your need. – sandu Apr 29 '19 at 7:00
  • It looks like you are using TeX's default page layout, which was originally intended to be used with the Journal of the American Mathematical Society's 7″ x 10″ pages, and produces very large margins on either "letter"-sized or A4 paper. Consider adding \usepackage[margin=1in,letterpaper]{geometry} or \usepackage[margin=3cm,a4paper]{geometry} to the preamble of your document, depending on which size paper you intend to print on. – zwol Apr 29 '19 at 15:13
5

Additionally to Mico's suggestion you can indeed use (parts of) the page margins, if you need. KOMA-Script provides an environment addmargin to increase or decrease the current margins of an area. If you do not use a KOMA-Script class you can use package scrextend as shown here:

\documentclass{article}
\usepackage{subcaption,graphicx,scrextend}

\usepackage{showframe}% only to illustrate the page areas

\begin{document}
\begin{figure}
  \begin{addmargin}{-\dimexpr\marginparwidth+\marginparsep\relax}
    \centering
    \begin{subfigure}{0.475\linewidth}
      \includegraphics[page=1,width=1.0\linewidth]{example-image-duck}
      \caption{}
      \label{fig:hard_cokntact}
    \end{subfigure}%
    \hfill
    \begin{subfigure}{0.475\linewidth}
      \includegraphics[page=2,width=1.0\linewidth]{example-image-duck}
      \caption{}
      \label{fig:penaltyh method}
    \end{subfigure}

    \medskip
    \begin{subfigure}{0.475\linewidth}
      \includegraphics[page=3,width=1.0\linewidth]{example-image-duck}
      \caption{}
      \label{fig:hard_cokntact}
    \end{subfigure}
    \hfill
    \begin{subfigure}{0.475\linewidth}
      \includegraphics[page=4,width=1.0\linewidth]{example-image-duck}
      \caption{}
      \label{fig:penaltyh method}
    \end{subfigure}

    \medskip
    \begin{subfigure}{0.475\linewidth}
      \includegraphics[page=5,width=1.0\linewidth]{example-image-duck}
      \caption{}
      \label{fig:hard_cokntact}
    \end{subfigure}
  \end{addmargin}
\end{figure} 
\end{document}

five ducks partly in the margin

There are other packages, that provide similar environments.

See also, e.g.:

5

I suggest you make the following changes:

  • Change all five instances of \begin{subfigure}{0.4\linewidth} to \begin{subfigure}{0.475\linewidth}. This will make the graphs wider.

  • Change all five instances of [width=1.2\linewidth] to [width=1\linewidth]. This will get rid of the overlaps within each row.

  • Replace both instances of \qquad with \hfill.

  • Optional: Delete (or comment out) all instances of \centering except the very first one.

  • Optional: Provide for a bit of vertical whitespace between the rows, by inserting \medskip (or \bigskip) instructions.

enter image description here

\documentclass[demo]{article} % remove "demo" option in real document
\usepackage{subcaption,graphicx}

\begin{document}
\begin{figure}
\centering
\begin{subfigure}{0.475\linewidth}
    %%\centering
    \includegraphics[width=1.0\linewidth]{images/energy_ratio/linear0001.eps}
    \caption{}
    \label{fig:hard_cokntact}
    \end{subfigure}
\hfill
\begin{subfigure}{0.475\linewidth}
    %%\centering
    \includegraphics[width=1.0\linewidth]{images/energy_ratio/linear001.eps}
    \caption{}
    \label{fig:penaltyh method}
\end{subfigure}

\medskip
\begin{subfigure}{0.475\linewidth}
%%\centering
\includegraphics[width=1.0\linewidth]{images/energy_ratio/linear01.eps}
\caption{}
\label{fig:hard_cokntact}
\end{subfigure}
    \hfill
\begin{subfigure}{0.475\linewidth}
    %%\centering
    \includegraphics[width=1.0\linewidth]{images/energy_ratio/linear03.eps}
    \caption{}
    \label{fig:penaltyh method}
\end{subfigure}

\medskip
\begin{subfigure}{0.475\linewidth}
    %%\centering
    \includegraphics[width=1.0\linewidth]{images/energy_ratio/linear05.eps}
    \caption{}
    \label{fig:hard_cokntact}
\end{subfigure}
\end{figure} 
\end{document}
  • @Teepeemm - oh no! :-( fixed now... – Mico Apr 29 '19 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.