如何才能让 LaTeX 正确地在图形之间断线?

如何才能让 LaTeX 正确地在图形之间断线?

考虑以下代码:

\documentclass[]{scrartcl}
\usepackage[demo]{graphicx}
\setlength{\parindent}{0cm}

\begin{document}
\includegraphics[width=3.5cm]{}
\includegraphics[width=3.5cm]{}
\includegraphics[width=3.5cm]{}
\includegraphics[width=3.5cm]{}
\includegraphics[width=3.5cm]{}
\includegraphics[width=3.5cm]{}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus molestie
nunc non lectus convallis auctor. Cras nisl arcu, placerat et pretium at,
blandit ut nunc. Proin ut est ac dolor porttitor pellentesque. Donec commodo
ornare nisi. Nam non elit in arcu placerat rhoncus nec sed erat. Donec non mi
velit, quis malesuada ante.
\end{document}

输出结果如下:

文档开头

为什么当没有剩余空间容纳整个图形时,LaTeX 不会换行?如何确保 LaTeX 正确换行?

答案1

在此处输入图片描述

\documentclass[]{scrartcl}
\usepackage[demo]{graphicx}
\setlength{\parindent}{0cm}

\begin{document}
\sloppy
\includegraphics[width=3.5cm]{}
\includegraphics[width=3.5cm]{}
\includegraphics[width=3.5cm]{}
\includegraphics[width=3.5cm]{}
\includegraphics[width=3.5cm]{}
\includegraphics[width=3.5cm]{}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus molestie
nunc non lectus convallis auctor. Cras nisl arcu, placerat et pretium at,
blandit ut nunc. Proin ut est ac dolor porttitor pellentesque. Donec commodo
ornare nisi. Nam non elit in arcu placerat rhoncus nec sed erat. Donec non mi
velit, quis malesuada ante.
\end{document}

相关内容