0

I want to have the same alignment of figures as stated in the linked question:

(a) (b)
  (c)

I followed the exact answers given in the link with minipage and subfigure. Both of them are compiling fine. However, the PDF file do not have any of the figures. I have tried this with two Linux machines, Ubuntu and CentOS. Same result.

I am trying this in a two column document with \begin{figure}..\end{figure}.

This is my code which is not rendering any image:

\documentclass[sigconf, 10pt]{acmart}

\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{caption}
\usepackage[font={footnotesize}]{subcaption}
\captionsetup[subfigure]{position=b}   
\begin{document} 
\begin{figure}[!t]
        \centering
        \begin{subfigure}[t]{0.49\columnwidth}
            \centering
            \includegraphics[width=\textwidth]{example-image-a}
            \caption{}
        \end{subfigure}\hfil
        \begin{subfigure}[t]{0.49\columnwidth}
            \centering
            \includegraphics[width=\textwidth]{example-image-b}
            \caption{}
        \end{subfigure}\newline
        \begin{subfigure}[t]{0.49\columnwidth}
            \centering
            \includegraphics[width=\textwidth]{example-image-c}
            \caption{}
        \end{subfigure}
        \caption{}
\end{figure}
\end{document}

If I change the first two subfigure sizes to 0.33\columnwidth, then it works and I can see the figures in the PDF. However, that looks bad and not what I want.

Can anybody guess or suggest what is happening? Pretty clueless at this point.

  • Maybe try the floatrow package. – Bernard Oct 14 '19 at 9:35
  • 1
    Off-topic: The three \centering instructions contained inside the subfigure environments are redundant -- and should be removed to reduce code clutter. – Mico Oct 14 '19 at 10:58
3

Your code fragment is fine. You should see figures:

enter image description here

If you not, than you have something in document, what you not show us. So you need always to provide MWE (Minimal Working example) which reproduce your problem and not only a code fragment. My testing MWE is:

\documentclass[twocolumn]{article}
\usepackage{graphicx}
\usepackage{subcaption}

\begin{document}
\begin{figure}[ht]
    \centering
    \begin{subfigure}[t]{0.49\linewidth}
        \includegraphics[width=\linewidth]{example-image-a}
        \caption{}
    \end{subfigure}\hfil
    \begin{subfigure}[t]{0.49\columnwidth}
        \includegraphics[width=\linewidth]{example-image-b}
        \caption{}
    \end{subfigure}

    \medskip
    \begin{subfigure}[t]{0.49\linewidth}
        \includegraphics[width=\linewidth]{example-image-c}
        \caption{}
    \end{subfigure}
    \caption{}
\end{figure}
\end{document}

Observe difference how are defined widths for the subfigure and image in above MWE and your code fragment. It also works in one column document.

  • I tried your solution with linewidth. Still, I can't see the figures. Updated my main post's MWE. – soham Oct 14 '19 at 10:08
  • Your MWE now compile fine (except that your MWE not define \bibliofont) Result is the same as I show in my answer. You have something broken in your pdf viewer installation. I see the same result in Sumatra as well in Acrobat Reader DC. – Zarko Oct 14 '19 at 10:19
  • It's hard to believe that it is a viewer problem because I have opened the PDF with evince and okular, and could not see any figure. Also, the captions, if I put something, are not coming. Could it be a compilation flag issue which I am missing? – soham Oct 14 '19 at 10:30
  • 1
    Considr to showed MWE, this is NOT a LaTeX issues. – Zarko Oct 14 '19 at 10:30
  • 2
    Try to upgrade your LaTeX installation than. I (and anyone else here) can not reproduce your problem as it is presented, also we are not able to see in your computer, that we see what is going on at you. For test try to use Overleaf. – Zarko Oct 14 '19 at 10:44

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.