1

Belows is apart of my code and I want to reduce space between the two pictues and also want to make them larger. Please suggest me.

\begin{figure}[!htbp]
       % \centering
        \includegraphics[width=0.475\linewidth]{drww_pre_3.pdf}
        \includegraphics[width=0.475\linewidth]{drbb_pre_4.pdf}
     \caption{Distributions of the kinematic variables used in the analysis after preselection. The signal has been scaled by a factor of }
\end{figure}
Herohtar
  • 140
Higgs
  • 117
  • 1
    Add a % to the end of the first line containing \includegraphics. Otherwise, the end-of-line will introduce a stray space character. – Steven B. Segletes Mar 26 '19 at 18:43
  • 1
    there is only a word space between the figures, if you are seeing more space check that there is no white space in the pdfs themselves, if you use \fbox{includegraphics[width=0.475\linewidth]{drbb_pre_4.pdf}} is the frame tight around the image? – David Carlisle Mar 26 '19 at 19:27

2 Answers2

4

By adding a % to the end of a line, it will suppress the space that is otherwise introduced. NOTE: if a line ends with a bare macro, there is not extra space introduced.

This will allow a larger specification of width, without triggering a linefeed.

\documentclass{article}
\usepackage{graphicx}
\begin{document}
WITHOUT \%
\begin{figure}[!htbp]
       % \centering
        \includegraphics[width=0.475\linewidth]{example-image-a}
        \includegraphics[width=0.475\linewidth]{example-image-b}
     \caption{Distributions of the kinematic variables used in the analysis after preselection. The signal has been scaled by a factor of }
\end{figure}

WITH \%
\begin{figure}[!htbp]
       % \centering
        \includegraphics[width=0.5\linewidth]{example-image-a}%
        \includegraphics[width=0.5\linewidth]{example-image-b}
     \caption{Distributions of the kinematic variables used in the analysis after preselection. The signal has been scaled by a factor of }
\end{figure}
\end{document}

enter image description here

1

To remove the space between your figures, add a % to the end of the first line of \includegraphics. Why this is necessary is explained in detail here.

To make your figures larger, simply change the width to 0.5\linewidth, which is the maximum before the second figure "jumps" to a new line.

\begin{figure}[!htbp]
       % \centering
        \includegraphics[width=0.5\linewidth]{drww_pre_3.pdf}%
        \includegraphics[width=0.5\linewidth]{drbb_pre_4.pdf}
     \caption{Distributions of the kinematic variables used in the analysis after preselection. The signal has been scaled by a factor of }
\end{figure}
Superuser27
  • 1,312
  • For me space is not changing. I copied and past in the my code. – Higgs Mar 26 '19 at 19:10
  • This I used and felt no change.

    \documentclass[oneside]{book} \usepackage[demo]{graphicx} WITHOUT % \begin{figure}[!htbp] \includegraphics[width=0.475\linewidth]{ptbb_pre_1.pdf} \includegraphics[width=0.475\linewidth]{ptbb_pre_1.pdf} \caption{The signal has been scaled by a factor of } \end{figure} WITH % \begin{figure}[!htbp] \includegraphics[width=0.475\linewidth]{ptbb_pre_1.pdf}% \includegraphics[width=0.475\linewidth]{ptbb_pre_1.pdf} \caption{The signal has been scaled by a factor of } \end{figure}

    – Higgs Mar 26 '19 at 19:27