如何使长对齐的方程式自动跨行和跨页环绕?

如何使长对齐的方程式自动跨行和跨页环绕?

我有如下身份列表。

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
 \sum _{i=1}^n i&=\frac{1}{2} n (n+1) \\
 \sum _{i=1}^n i^2&=\frac{1}{6} n (n+1) (2 n+1) \\
 \sum _{i=1}^n i^3&=\frac{1}{4} n^2 (n+1)^2 \\
 \sum _{i=1}^n i^4&=\frac{1}{30} n (n+1) (2 n+1) \left(3 n^2+3 n-1\right) \\
 \sum _{i=1}^n i^5&=\frac{1}{12} n^2 (n+1)^2 \left(2 n^2+2 n-1\right) \\
 \sum _{i=1}^n i^6&=\frac{1}{42} n (n+1) (2 n+1) \left(3 n^4+6 n^3-3 n+1\right) \\
 \sum _{i=1}^n i^7&=\frac{1}{24} n^2 (n+1)^2 \left(3 n^4+6 n^3-n^2-4 n+2\right) \\
 \sum _{i=1}^n i^8&=\frac{1}{90} n (n+1) (2 n+1) \left(5 n^6+15 n^5+5 n^4-15 n^3-n^2+9 n-3\right) \\
 \sum _{i=1}^n i^9&=\frac{1}{20} n^2 (n+1)^2 \left(n^2+n-1\right) \left(2 n^4+4 n^3-n^2-3 n+3\right) \\
 \sum _{i=1}^n i^{10}&=\frac{1}{66} n (n+1) (2 n+1) \left(n^2+n-1\right) \left(3 n^6+9 n^5+2 n^4-11 n^3+3
   n^2+10 n-5\right) \\
 \sum _{i=1}^n i^{11}&=\frac{1}{24} n^2 (n+1)^2 \left(2 n^8+8 n^7+4 n^6-16 n^5-5 n^4+26 n^3-3 n^2-20
   n+10\right) \\
 \sum _{i=1}^n i^{12}&=\frac{n (n+1) (2 n+1) \left(105 n^{10}+525 n^9+525 n^8-1050 n^7-1190 n^6+2310
   n^5+1420 n^4-3285 n^3-287 n^2+2073 n-691\right)}{2730} \\
 \sum _{i=1}^n i^{13}&=\frac{1}{420} n^2 (n+1)^2 \left(30 n^{10}+150 n^9+125 n^8-400 n^7-326 n^6+1052
   n^5+367 n^4-1786 n^3+202 n^2+1382 n-691\right) \\
 \sum _{i=1}^n i^{14}&=\frac{1}{90} n (n+1) (2 n+1) \left(3 n^{12}+18 n^{11}+24 n^{10}-45 n^9-81 n^8+144
   n^7+182 n^6-345 n^5-217 n^4+498 n^3+44 n^2-315 n+105\right) \\
 \sum _{i=1}^n i^{15}&=\frac{1}{48} n^2 (n+1)^2 \left(3 n^{12}+18 n^{11}+21 n^{10}-60 n^9-83 n^8+226
   n^7+203 n^6-632 n^5-226 n^4+1084 n^3-122 n^2-840 n+420\right) \\
 \sum _{i=1}^n i^{16}&=\frac{1}{510} n (n+1) (2 n+1) \left(15 n^{14}+105 n^{13}+175 n^{12}-315 n^{11}-805
   n^{10}+1365 n^9+2775 n^8-4845 n^7-6275 n^6+11835 n^5+7485 n^4-17145 n^3-1519 n^2+10851 n-3617\right)
   \\
 \sum _{i=1}^n i^{17}&=\frac{1}{180} n^2 (n+1)^2 \left(10 n^{14}+70 n^{13}+105 n^{12}-280 n^{11}-565
   n^{10}+1410 n^9+2165 n^8-5740 n^7-5271 n^6+16282 n^5+5857 n^4-27996 n^3+3147 n^2+21702 n-10851\right)
   \\
 \sum _{i=1}^n i^{18}&=\frac{n (n+1) (2 n+1) \left(105 n^{16}+840 n^{15}+1680 n^{14}-2940 n^{13}-9996
   n^{12}+16464 n^{11}+48132 n^{10}-80430 n^9-167958 n^8+292152 n^7+380576 n^6-716940 n^5-454036
   n^4+1039524 n^3+92162 n^2-658005 n+219335\right)}{3990} \\
 \sum _{i=1}^n i^{19}&=\frac{1}{840} n^2 (n+1)^2 \left(42 n^{16}+336 n^{15}+616 n^{14}-1568 n^{13}-4263
   n^{12}+10094 n^{11}+22835 n^{10}-55764 n^9-87665 n^8+231094 n^7+213337 n^6-657768 n^5-236959
   n^4+1131686 n^3-127173 n^2-877340 n+438670\right) \\
 \sum _{i=1}^n i^{20}&=\frac{330 n^{21}+3465 n^{20}+11550 n^{19}-65835 n^{17}+426360 n^{15}-2238390
   n^{13}+8817900 n^{11}-24551230 n^9+44767800 n^7-47625039 n^5+24126850 n^3-3666831 n}{6930} \\
\end{align*}
\end{document}

在此处输入图片描述

如何使长对齐方程自动跨行和跨页环绕?我想打印前 100 个或更多恒等式的列表以增加趣味。

答案1

\parbox(我简化了答案,只要求在等式的右边使用指令。)

这是一个解决方案,它使用 来\parbox表示粒子右侧的材料&=;这样,LaTeX 可以根据需要插入换行符。请注意,必须

  • 删除所有\left和指令,因为在和\right包围的组中允许换行。(在您的等式中,和指令无论如何都是多余的。),并\left(\right)\left\right

  • 将表达式修改\frac{<very long expression>}{<number>}

    `\frac{1}{<number>}(<very long expression>)`
    

最后,对于你的方程组的情况,请注意只有从第 10 个方程(左右)开始才真正需要换行。

在此处输入图片描述

\documentclass{article}
\usepackage{amsmath}  % for "align*" environment
\allowdisplaybreaks % allow page breaks, if needed
\usepackage{setspace} % for "\setstretch" macro

\newcommand\mybox[1]{\parbox[t]{0.75\textwidth}{%
    \setstretch{1.33}\raggedright$\displaystyle #1$}}

\begin{document}
\begin{align*}
\sum_{i=1}^n i  &=\tfrac{1}{2} n (n+1) \\
\sum_{i=1}^n i^2&=\tfrac{1}{6} n (n+1) (2 n+1) \\
\sum_{i=1}^n i^3&=\tfrac{1}{4} n^2 (n+1)^2 \\
\sum_{i=1}^n i^4&=\tfrac{1}{30}n(n+1)(2n+1)(3n^2+3n-1) \\
&\vdots \\
\sum_{i=1}^n i^9&=\mybox{\tfrac{1}{20} n^2 (n+1)^2 
   (n^2+n-1) (2 n^4+4 n^3-n^2-3 n+3)} \\
\sum_{i=1}^n i^{10}&=\mybox{\tfrac{1}{66} n (n+1) 
   (2 n+1) (n^2+n-1) (3 n^6+9 n^5+2 n^4-11 n^3+3
   n^2+10 n-5)} \\
&\vdots \\
\sum_{i=1}^n i^{19}&=\mybox{\tfrac{1}{840} n^2 (n+1)^2 
   (42 n^{16}+336 n^{15}+616 n^{14}-1568 n^{13}-4263 n^{12}
   +10094 n^{11}+22835 n^{10}-55764 n^9-87665 n^8+231094 n^7
   +213337 n^6-657768 n^5-236959 n^4+1131686 n^3
   -127173 n^2-877340 n+438670)} \\
\sum_{i=1}^n i^{20}&=\mybox{\tfrac{1}{6930}(330 n^{21}
   +3465 n^{20}+11550 n^{19}-65835 n^{17}+426360 n^{15}
   -2238390 n^{13}+8817900 n^{11}-24551230 n^9
   +44767800 n^7-47625039 n^5+24126850 n^3-3666831 n)} 
\end{align*}
\end{document}

相关内容