How to use subcaption package? I want to fix my subfigures in the pdf. As shown in the image below, my subfigures are going out of the page. I have listened that it could be fixed with subcaption package.
Kindly help
Asked
Active
Viewed 1,433 times
-1
faiza
- 227
- 4
- 16
1 Answers
1
Here is what you can do
\documentclass{book}
\usepackage{graphicx,subcaption}
\begin{document}
\begin{figure}
\begin{subfigure}[b]{.3\textwidth}
\centering\includegraphics[width=\textwidth]{example-image}
\caption{A subfigure}\label{fig:1a}
\end{subfigure}\hfill
\begin{subfigure}[b]{.3\textwidth}
\centering\includegraphics[width=\textwidth]{example-image}
\caption{Another subfigure}\label{fig:1b}
\end{subfigure}\hfill
\begin{subfigure}[b]{.3\textwidth}
\centering\includegraphics[width=\textwidth]{example-image}
\caption{Another subfigure}\label{fig:1c}
\end{subfigure}\hfill
\begin{subfigure}[b]{.3\textwidth}
\centering\includegraphics[width=\textwidth]{example-image}
\caption{Another subfigure}\label{fig:1d}
\end{subfigure}\hfill
\begin{subfigure}[b]{.3\textwidth}
\centering\includegraphics[width=\textwidth]{example-image}
\caption{Another subfigure}\label{fig:1e}
\end{subfigure}\hfill
\begin{subfigure}[b]{.3\textwidth}
\centering\includegraphics[width=\textwidth]{example-image}
\caption{Another subfigure}\label{fig:1f}
\end{subfigure}
\caption{A figure}\label{fig:1}
\end{figure}
\end{document}
touhami
- 19,520
-
-
@faiza and I am not a lyx user but I think there is a
.texfile in your work folder open it as text file and replace your old corresponding code – touhami Aug 25 '15 at 20:40 -

\documentclass{...} ... essential packages, which you use ..\begin{document} ... \end{document}. Normally if you put empty line after selected number ofsubfloats, they should appear in two lines. – Zarko Aug 25 '15 at 18:01