4 Comments

  1. Anja

    Thank you, this is indeed very useful!

    I only have one question:

    What should I adjust if I have 3×2 subfigures?

    I followed your suggestion with adding an empty line after the third subfigure but I end up with 2 colums and 4 lines instead of 3 colums and 2 lines.

    • tom

      Hi Anja,

      Thanks for your question. The code below produces three columns. The trick is to split the line width into three equal parts instead of assigning a fixed width.

      Best, Tom

      \documentclass[varwidth, border=10pt]{standalone}
      \usepackage{subcaption}
      \usepackage[labelformat=parens,labelsep=quad,skip=3pt]{caption}
      \usepackage{graphicx}
      
      \begin{document}
      \begin{figure}
        \begin{subfigure}[b]{0.3\linewidth}
          \centering\rule{1cm}{1cm}
          \caption{Caption text 1}
        \end{subfigure}\hfill
        \begin{subfigure}[b]{0.3\linewidth}
          \centering\rule{1cm}{1cm}
          \caption{Caption text 2}
        \end{subfigure}\hfill
        \begin{subfigure}[b]{0.3\linewidth}
          \centering\rule{1cm}{1cm}
          \caption{Caption text 3}
        \end{subfigure}
        
          \begin{subfigure}[b]{0.3\linewidth}
            \centering\rule{1cm}{1cm}
          \caption{Caption text 4}
        \end{subfigure}\hfill
         \begin{subfigure}[b]{0.3\linewidth}
          \centering\rule{1cm}{1cm}
          \caption{Caption text 5}
        \end{subfigure}\hfill
        \begin{subfigure}[b]{0.3\linewidth}
          \centering\rule{1cm}{1cm}
          \caption{Caption text 6}
        \end{subfigure}
      \end{figure}
      \end{document}

Leave a Reply