我有一个文档,其中包含非常大的集合,由数百个大数字组成,这些数字必须表示为其素数因子的乘积。因此,我需要使用包dseries*
的环境breqn
,以防止在乘积表达式中间自动换行。这是我的此类集合的 tex 代码:
\begin{dseries*}
$A_{1} = \{$
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math}
% and a few hundreds of more numbers
$\}$
\end{dseries*}
我对这段代码有两个问题:第一个也是最重要的一个问题是,结果 pdf 不会突破页面,它似乎是一个牢不可破的盒子,只能放入一页。
第二个不太重要的问题是,我更喜欢 Latex 为集合的第二行和其后面的行添加一点点缩进。
请记住,我需要 Latex 自动分页,而不是通过命令手动分页\newpage
。我还需要每个数字不超过一行,所以我必须使用dseries*
环境。请帮我解决这个问题。提前致谢。
答案1
我可以为您提供一个没有 的解决方案breqn
。区别在于,如果有换行符,乘号将位于行尾。我认为这不会造成太大麻烦。
这个想法是定义,
一个“好的断点”,如果出现断点,则填充行。还\times
重新定义,以便在之后出现断点的情况下,下一行会缩进。
\documentclass{article}
\usepackage{showframe}
\newenvironment{longlist}
{
\par\nobreak\vspace{\abovedisplayskip}%
\begingroup\lccode`~=`, \lowercase{\endgroup\def~}{,\hfil\penalty0\hfilneg}%
\catcode`,=\active
\let\originaltimes\times
\renewcommand{\times}{\originaltimes{}\discretionary{}{\kern1em}{}}%
\setlength{\parindent}{0pt}%
\hangindent=1em \hangafter=1
}
{\par\vspace{\belowdisplayskip}}
\begin{document}
\begin{longlist}
$A_{1} = \{$
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \times 97 \times 103 \times 257 \times 65537\end{math},
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \times 97 \times 103 \times 257 \times 65537\end{math},
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \times 97 \times 103 \times 257 \times 65537\end{math},
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \times 97 \times 103 \times 257 \times 65537\end{math},
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \times 97 \times 103 \times 257 \times 65537\end{math},
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \times 97 \times 103 \times 257 \times 65537\end{math},
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \times 97 \times 103 \times 257 \times 65537\end{math},
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \times 97 \times 103 \times 257 \times 65537\end{math},
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \times 97 \times 103 \times 257 \times 65537\end{math},
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \times 97 \times 103 \times 257 \times 65537\end{math},
\begin{math} 2 \times 3 \end{math},
\begin{math} 3^2 \times 5^2 \times 7^2 \end{math},
\begin{math} 2^6 \times 3^3 \times 19 \times 23 \times 29 \times 37 \times 43 \end{math},
\begin{math} 3^2 \times 5^2 \times 7 \times 17 \times 19 \times 23 \times 29 \times 37 \times 41 \times 47 \times 53 \end{math},
\begin{math} 2^5 \times 3 \times 5 \times 7^2 \times 11 \times 13 \times 19 \times 23 \times 29 \times 31 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \end{math},
\begin{math} 2^7 \times 3^4 \times 5^2 \times 7^2 \times 11 \times 13 \times 17 \times 19 \times 23 \times 29 \times 31 \times 37 \times 41 \times 43 \times 47 \times 53 \times 97 \times 103 \times 257 \times 65537\end{math},
% and a few hundreds of more numbers
$\}$
\end{longlist}
\end{document}
如果所有产品都适合放在一行,则可以修改代码,使其在 处不间断\times
,而仅在逗号处中断。