1

I am facing a weird problem where I cannot put figures in the APS journal format. I am using the template. What happens is that the figures do not appear in the pdf in double column format if I put the size \includegraphics[height=65mm,width=0.65\textwidth]

They appear one below the other as shown in the image img The third image goes in the next page. As a result, a page can contain only 3 images and one side of the column remains blank.

I have tried using [ht], *, [!htb] but nothing seems to be working. The files are in eps format.

Here is the code

\documentclass[aps,prl,reprint]{revtex4-1}
\usepackage{blindtext}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{bm}        % for math
\usepackage{verbatim}   % for math
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{bm}
\usepackage{amssymb}
\usepackage{adjustbox}
\newcommand{\revtex}{REV\TeX\ }
\newcommand{\classoption}[1]{\texttt{#1}}
\newcommand{\macro}[1]{\texttt{\textbackslash#1}}
\newcommand{\m}[1]{\macro{#1}}
\newcommand{\env}[1]{\texttt{#1}}
\setlength{\textheight}{9.5in}
\usepackage{adjustbox}
\DeclareMathOperator{\RE}{Re}
\DeclareMathOperator{\IM}{Im}
\usepackage{stfloats}
\newenvironment{psmallmatrix}
  {\left[\begin{smallmatrix}}
  {\end{smallmatrix}\right]}
\usepackage{amsmath,amscd}
\usepackage {extarrows}
\usepackage{algorithm,algpseudocode}
\begin{document}
    \begin{figure}[ht]
\centering
 \begin{adjustbox}{center}
\includegraphics[height=65mm,width=.75\textwidth]{Profile}
 \end{adjustbox}
 \caption{Comparison}
\label{fig5}
\end{figure}

\begin{figure}
\centering
 \begin{adjustbox}{center}
\includegraphics[height=60mm,width=0.70\textwidth]{MSE_Theor_Sim}
 \end{adjustbox}
 \caption{Comparison}
\label{fig6}
\end{figure}

\end{document}

This is the output including all the figures using the solution. On page 8 there is a blank left on right hand side column. Fixing that by adjusting the width for this figure affects another page and then another page would have a blank space. This is the code used for all the images.

\begin{figure}[htb]
\centering
 \begin{adjustbox}{center}
\includegraphics[width=.75\columnwidth]{Fig}
 \end{adjustbox}
 \caption{Fig13}
\label{fig13}
\end{figure}

img3

3

Use \columnwidth not \textwidth in your width= ... parameters.

(I've simplified your example to remove unnecessary stuff.)

\documentclass[aps,prl,reprint]{revtex4-1}
\usepackage{blindtext}
\usepackage[demo]{graphicx}
\usepackage{adjustbox}
\setlength{\textheight}{9.5in}
\begin{document}
\blindtext   
\begin{figure}[htb]
 \centering
 \begin{adjustbox}{center}
   \includegraphics[height=65mm,width=.75\columnwidth]{Profile}
 \end{adjustbox}
 \caption{Comparison}
 \label{fig5}
\end{figure}
\bigskip

\blindtext
\begin{figure}[htb]
 \centering
 \begin{adjustbox}{center}
   \includegraphics[height=60mm,width=0.75\columnwidth]{MSE_Theor_Sim}
 \end{adjustbox}
 \caption{Comparison}
 \label{fig6}
\end{figure}
\end{document}

output of code

  • Thank you for your solution approach. In one page, I could get the figures and there is no blank space for the colum. However, for the next page, I have the same problem. I have uploaded a new image showing the problem. Is there something wrong with the dimension - text, width that I am specifying? The images are displayed squished and are narrow and ugly. – SKM Jun 22 '17 at 0:07
  • You can't use \textwidth because that's not a length relative to the column, which is why you need to use \columnwidth. But you shouldn't specify a height and width, just the width. When you specify both, you mess up the aspect ratio of the image. I should have mentioned that. I only left in your height specification because I didn't have the actual images you were using. If you need to have both values, then add keepaspectratio to the \includegraphics options. Then it will scale so as not to exceed the dimensions you give. – Alan Munn Jun 22 '17 at 0:16
  • I have not used \textwidth. From your solution, I have now included the keepaspectration and omitted the width. Still the same issue - a large space in either one of the column – SKM Jun 22 '17 at 0:37
  • @SKM Sorry, but your edit doesn't really help to diagnose anything, since your sample document is identical. Can you reproduce the issue with my sample document? If so, edit your question to show that version. You may also want to look at Keeping tables/figures close to where they are mentioned and for more detail How to influence the position of float environments like figure and table in LaTeX?. – Alan Munn Jun 22 '17 at 0:42
  • I have updated the question with the output obtained from your code snippet. I have put arbitrary figure labels, they are not in any order. Please help, I am perplexed and the images are coming so tiny. Increasing the width makes the images disappear form the pdf. – SKM Jun 22 '17 at 4:28

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.