0

I have the following:

enter image description here

\documentclass[prb,twocolumn,showpacs,preprintnumbers,amsmath,amssymb,float]{revtex4}
\usepackage{pstricks}
\usepackage{graphicx}
\begin{document}
\begin{figure}[t]
\includegraphics[width=3cm]{example-image}
\includegraphics[width=3cm]{example-image}
\includegraphics[width=3cm]{example-image}
\includegraphics[width=3cm]{example-image}
\caption{...}
\end{figure}
\end{document}

Now, I am not happy with the arrangement of figures, so I decide to use \rput in order to move figures around as I wish. Such that:

\documentclass[prb,twocolumn,showpacs,preprintnumbers,amsmath,amssymb,float]{revtex4}
\usepackage{pstricks}
\usepackage{graphicx}
\begin{document}
\begin{figure}[t]
\rput[tr](-0.45\columnwidth,0.45\columnwidth){\includegraphics[width=3cm]{fig_1}}
\rput[tr](-0.45\columnwidth,0.45\columnwidth){\includegraphics[width=3cm]{fig_2}}
\rput[tr](-0.45\columnwidth,0.45\columnwidth){\includegraphics[width=3cm]{fig_3}}
\rput[tr](-0.45\columnwidth,0.45\columnwidth){\includegraphics[width=3cm]{fig_4}}
\caption{...}
\end{figure}
\end{document}

But this a mess because there is "no room allocated" for the figures. Is there something like an empty box I could put, and then put my figures on top of this empty box?

Thank you.

3
  • \rput is from pstricks? (it is best to make your examples complete so people can test them) normally it is used in pspicture (you could use \put from the standard picture in a similar way. Often people use tabular with one image in each cell. Your original is just a paragraph with one word space between each picture and so the layout depends on the text width which you haven't shown. But quite likely as it is trying to justify a paragraph the first row is set full width but any on the last row are set flush left, being the end of the paragraph. perhaps \centering would help Commented Mar 5, 2016 at 14:24
  • I just edited it @DavidCarlisle could you give and example as a solution to my problem please? Thank you very much!
    – Mencia
    Commented Mar 5, 2016 at 14:39
  • hard to answer as your example makes ! Undefined control sequence. l.5 \includegraphics and you haven't said what output you want. Unless you are using pstricks elsewhere I certainly would not use it for this as it means you can not use pdflatex. Commented Mar 5, 2016 at 14:43

1 Answer 1

2

You don't say exactly what layout you want, but here I used \centering to centre the image block in the column, and added a bit of vertical and horizontal space, no special commands or packages are needed here, images can be positioned exactly the same way as letters.

enter image description here

\documentclass[prb,twocolumn,showpacs,preprintnumbers,amsmath,amssymb,float]{revtex4}
%\usepackage{pstricks}
\usepackage{graphicx}
\begin{document}
\begin{figure}[t]
\centering
\includegraphics[width=3cm]{example-image}\hspace{1cm}%
\includegraphics[width=3cm]{example-image}\\[10pt]
\includegraphics[width=3cm]{example-image}\hspace{1cm}%
\includegraphics[width=3cm]{example-image}
\caption{...}
\end{figure}
\end{document}

If you need to adjust individual figures you can use for example

\raisebox{3pt}{\includegraphics{..}}

to raise it or

\hspace*{3pt}{\includegraphics{..}}\hspace*{-3pt}

to move it to the right.

or any other LaTeX construct (none of the positioning commands are specific to image inclusion).

5
  • I don't specify the layout, but I do say that I would like to move figures around as I wish. By putting coordinates for example, as you do when you use \rput. What if I wanted to shift the upper left figure upwards (slightly higher than the upper rigth figure)?
    – Mencia
    Commented Mar 5, 2016 at 14:56
  • 1
    @Mencia as with a letter you could use \raisebox{2pt}{\includegraphics....} to raise it for example. Commented Mar 5, 2016 at 14:58
  • This exactly what I needed! Thanks! Edit your answer maybe since the key point of my question is to MOVE FIgURES AROUND AS I WISH.
    – Mencia
    Commented Mar 5, 2016 at 15:03
  • What about shifting right, left and downwards?
    – Mencia
    Commented Mar 5, 2016 at 15:04
  • @Mencia I have shown up and right: left and down are the same but with negative numbers Commented Mar 5, 2016 at 15:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .