我试图列出 4 个弱组合的例子,我的代码如下所示:
Weak compositions of $4$ into three parts are: \[(4,0,0), (0,4,0),(0,0,4),(3,1,0),(3,0,1),(0,1,3)\linebreak(0,3,1),(1,0,3),(1,3,0),(2,2,0),(2,0,2),(0,2,2),\linebreak(2,1,1),(1,2,1),(1,1,2)\]
但是,换行符不起作用,列表溢出页面。发生这种情况时有什么修复/惯例吗?
答案1
我按照你指示的位置换行,但我认为在逗号后换行会更自然
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Weak compositions of $4$ into three parts are:
\begin{multline*}
(4,0,0), (0,4,0),(0,0,4),(3,1,0),(3,0,1),(0,1,3)\\
(0,3,1),(1,0,3),(1,3,0),(2,2,0),(2,0,2),(0,2,2),\\
(2,1,1),(1,2,1),(1,1,2)
\end{multline*}
\end{document}
答案2
你有 15 个三元组,因此你可以按每行 5 个(按你的顺序)或按字典顺序排列它们
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Weak compositions of $4$ into three parts are:
\begin{align*}
&(4,0,0),(0,4,0),(0,0,4),(3,1,0),(3,0,1),\\
&(0,1,3),(0,3,1),(1,0,3),(1,3,0),(2,2,0),\\
&(2,0,2),(0,2,2),(2,1,1),(1,2,1),(1,1,2)
\end{align*}
Weak compositions of $4$ into three parts are:
\begin{align*}
&(0,0,4),(0,1,3),(0,2,2),(0,3,1),(0,4,0),\\
&(1,0,3),(1,1,2),(1,2,1),(1,3,0),\\
&(2,0,2),(2,1,1),(2,2,0),\\
&(3,0,1),(3,1,0),\\
&(4,0,0)
\end{align*}
\end{document}