0

I want to set multiple figures in a horizontal row and I tried subfigure command of subcaption package to do this, referring to the snippet shown at this site. However, unexpectedly, the result is the figures are located in a vertical column instead of a horizontal row.

What is wrong? I'll show a part of my LaTeX code below:

my preamble:

\documentclass{jsarticle}

\usepackage[dvipdfmx]{graphicx} \usepackage{subcaption} \usepackage{amsmath,amssymb,bm,braket,ascmac}

figure section:

\begin{figure}[h!]
  \centering
  \begin{subfigure}[b]{0.2\linewidth}
    \includegraphics[width=\linewidth]{some.jpg}
    \caption{coffee}
  \end{subfigure}

\begin{subfigure}[b]{0.2\linewidth} \includegraphics[width=\linewidth]{some.jpg} \caption{coffee} \end{subfigure}

\begin{subfigure}[b]{0.2\linewidth} \includegraphics[width=\linewidth]{some.jpg} \caption{coffee} \end{subfigure}

\caption{The same coffees times.} \label{fig:coffees}

\end{figure}

I'll appreciate for any information.

Addition

I found I had got a warning below:

WARNING
The following warnings have been detected. You can output PDF, but please try to fix them.
/usr/local/texlive/2019/texmf-dist/tex/latex/caption/caption.sty
Package caption Warning: Unknown document class (or package),
(caption)                standard defaults will be used.
See the caption package documentation for explanation.

main.tex LaTeX Warning: !h' float specifier changed to!ht'.

https://texwiki.texjp.org/?LaTeX%20%E3%81%AE%E8%AD%A6%E5%91%8A%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8#g0cf562c

somia
  • 11

0 Answers0