1

My codes are:

\documentclass[aps,pra,twocolumn,margin=1mm]{revtex4-2} 
\usepackage{graphicx}
\usepackage{overpic}

%%%%%% \begin{document} \begin{figure} %\centering \begin{overpic}[width=3in]{tree.jpg}\put(6,68){(a)}\end{overpic} \hspace{-3mm} \begin{overpic}[width=3in]{tree.jpg}\put(6,68){(b)}\end{overpic}
\begin{overpic}[width=3in]{tree.jpg}\put(6,68){(c)}\end{overpic} \hspace{-3mm} \begin{overpic}[width=3in]{tree.jpg}\put(6,68){(d)}\end{overpic}\end{figure
}

\end{document}

And this is what I get enter image description here

I want to get rid of the useless white edge, I have tried the {standlone}, but something is wrong, so what can I do? The tree picture is: enter image description here

jlab
  • 1,834
  • 1
  • 13
karry
  • 137
  • you are forcing the images to be 3in wide [width=3in] so naturally if the page is wider than 6in you get white space – David Carlisle Mar 13 '24 at 09:36
  • also don't do \hspace{-3mm} which i am guessing is trying to compensate for the inter-word space between the images, just omit the space by commenting out the end of lines with % – David Carlisle Mar 13 '24 at 09:38
  • It appears that overpic is adding the space internally (bug). If you use \includegraphics by itself, the space goes away. – John Kormylo Mar 13 '24 at 15:35

2 Answers2

1

If you want that the pictures occupy the whole text width, tell LaTeX so.

\documentclass[aps,pra,twocolumn]{revtex4-2}
\usepackage{graphicx}
\usepackage{overpic}

\usepackage{showframe}

%%%%%% \begin{document}

\begin{figure*}

\begin{overpic}[width=0.5\textwidth]{tree.jpg}\put(6,68){(a)}\end{overpic}% \begin{overpic}[width=0.5\textwidth]{tree.jpg}\put(6,68){(b)}\end{overpic}

\begin{overpic}[width=0.5\textwidth]{tree.jpg}\put(6,68){(c)}\end{overpic}% \begin{overpic}[width=0.5\textwidth]{tree.jpg}\put(6,68){(d)}\end{overpic}

\end{figure*}

\end{document}

The showframe package is loaded just to show the margins of the text block. Don't load it in the final version of your document.

Note that the option margin=1mm is invalid, so I removed it.

I also removed \hspace{-3mm}: the % at the end of the line prevents the space you were trying to cancel out. The second row of picture should be separated by a blank line as in the code above.

enter image description here

egreg
  • 1,121,712
0

This replaces overpic with \llap. I'm not sure if I got the scale the same as overpic.

\documentclass[aps,pra,twocolumn]{revtex4-2}
\usepackage{graphicx}
\usepackage{showframe}

%%%%%% \begin{document}

\begin{figure*} \setlength{\lineskip}{0pt}% \setlength{\unitlength}{0.005\textwidth}% \includegraphics[width=0.5\textwidth]{example-image}% \includegraphics[width=0.5\textwidth]{example-image}\llap{% overlap pictures \makebox[0.5\textwidth][l]{\put(6,68){(a)}}\makebox[0.5\textwidth][l]{\put(6,68){(b)}}}

\includegraphics[width=0.5\textwidth]{example-image}% \includegraphics[width=0.5\textwidth]{example-image}\llap{% overlap pictures \makebox[0.5\textwidth][l]{\put(6,68){(c)}}\makebox[0.5\textwidth][l]{\put(6,68){(d)}}} \end{figure*}

\end{document}

John Kormylo
  • 79,712
  • 3
  • 50
  • 120