如何强制中断长行

如何强制中断长行

我注意到一些长行没有按预期中断。例如测试以下内容:

\documentclass[12pt,twoside]{article}
\usepackage[a4paper,inner=1.5cm,outer=1.5cm]{geometry}


\begin{document}

here some text here some text here some text here some text here some text here some text here
some text here some text here some text here some text here some text here some text here some
text here some text here some text here some text here some text.

The line that does not break as wanted

\noindent
\fbox{1}~$(x,y,z), (x,y,z), (x,y,z)$;
\qquad
\fbox{2}~$(x,y,z), (x,y,z), (x,y,z)$;
\qquad
\fbox{3}~$(x,y,z), (x,y,z), (x,y,z)$;
\qquad
\fbox{4}~$(x,y,z), (x,y,z), (x,y,z)$ 
\end{document}

例如,如果我将第三项的长度缩短一个字符 \fbox{3}~$(x,y,z), (x,y,z), (x,y,z)A$;

然后线条正确分割。(但如果我将我的添加A到第四项,则不起作用)

因此,我希望一条长线能够分开,即使其中一条会“太短”。

是否可以为此目的设置某种容差参数?

答案1

sloppypar可能有助于您:

\documentclass[12pt,twoside]{article}
\usepackage[a4paper,inner=1.5cm,outer=1.5cm]{geometry}

\usepackage{showframe}

\begin{document}

here some text here some text here some text here some text here some text here some text here
some text here some text here some text here some text here some text here some text here some
text here some text here some text here some text here some text.

The line that does not break as wanted


\begin{sloppypar}
\noindent\fbox{1}~$(x,y,z), (x,y,z), (x,y,z)$;
\qquad
\fbox{2}~$(x,y,z), (x,y,z), (x,y,z)$;
\qquad
\fbox{3}~$(x,y,z), (x,y,z), (x,y,z)$;
\qquad
\fbox{4}~$(x,y,z), (x,y,z), (x,y,z)$ 
\end{sloppypar}
\end{document}

在此处输入图片描述

请注意,添加了包showframe只是为了放置frame

相关内容