[Tex/LaTex] How to write multiple line caption with figure

captionsfloats

How to split a long figure caption to multiple line? Using \\ doesn't work.

\begin{figure}[H]
\includegraphics[width=1\textwidth]{x.jpg}
\caption{line 1...
    line 2...
    line 3...} 
\label{fig1}
\end{figure}

Best Answer

Load the caption package; now you can use the standard line change command \\:

\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{caption}

\begin{document}

\begin{figure}
\includegraphics[width=1\textwidth]{x}
\caption{line 1 \\line 2 \\ line 3 } 
\label{fig1}
\end{figure}

\end{document}

enter image description here

The demo option for graphicx simply replaces actual figures with black rectangles; do not use that option in your actual document.