找回密码
 快速注册
搜索
查看: 69|回复: 1

align环境 不如equation环境嵌套split环境

[复制链接]

3149

主题

8386

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65391
QQ

显示全部楼层

hbghlyj 发表于 2022-12-2 07:13 |阅读模式
LaTeX to HTML写道:
I had used the align environment for multiple-line equations. These were rendered differently from the equations written in the equation environment. I learned that it is generally preferable to use the split environment within the equation environment for multiple-line equations, even for the PDF and paper versions. For example,
     \begin{equation}
     \begin{split}
     1 \times 2^3 + 0 \times 2^2 + 1 \times 2^1 + 1 \times 2^0
        &= 8 + 0 + 2 + 1\\
        &= 11
     \end{split}
     \end{equation}

730

主题

1万

回帖

9万

积分

积分
93593
QQ

显示全部楼层

kuing 发表于 2022-12-2 13:56
不同意,equation 套 split 并不是一个好选择。

第一、这种方式只能整块多行公式编一个号(位于中间),而 align 可以多个。

第二、split 环境不能多列,就是说它不能像下面这样
  1. \begin{split}
  2. a & =b  &  c & =d  &  e & =f\\
  3. ...
  4. \end{split}
复制代码
所以还不如嵌套 aligned 环境。

第三、也是最重要的一点,就是这种方式的多行公式无法断开,如果公式行数很多且恰好到达页尾,位置不够时,那它就只能整块挤到下一页,原先的地方就会有一大片空白。
而对于 align ,只要在导言区设置了 \allowdisplaybreaks ,那它就可以断开。


来测试一下,为了更清楚对比,用了双栏:
  1. \documentclass{article}
  2. \usepackage{amsmath}
  3. \usepackage[a6paper,landscape,twocolumn,showframe]{geometry}
  4. \columnseprule=0.4pt
  5. \allowdisplaybreaks
  6. \newcommand\addtag{\refstepcounter{equation}\tag{\theequation}}
  7. \begin{document}
  8. split within equation
  9. split within equation
  10. split within equation
  11. split within equation
  12. split within equation
  13. \begin{equation}\label{eqa}
  14. \begin{split}
  15. a&=b\\
  16. &=b\\
  17. &=b\\
  18. &=b\\
  19. &=b\\
  20. &=b\\
  21. &=b\\
  22. &=b\\
  23. &=b\\
  24. &=b\\
  25. &=b
  26. \end{split}
  27. \end{equation}
  28. ref of \eqref{eqa}.
  29. \newpage
  30. align*
  31. align*
  32. align*
  33. align*
  34. align*
  35. \begin{align*}
  36. a&=b\addtag\label{eqb}\\
  37. &=b\\
  38. &=b\\
  39. &=b\\
  40. &=b\\
  41. &=b\\
  42. &=b\\
  43. &=b\\
  44. &=b\\
  45. &=b\\
  46. &=b\addtag\label{eqc}
  47. \end{align*}
  48. ref of \eqref{eqb} and \eqref{eqc}.
  49. \end{document}
复制代码

效果:
QQ截图20221202145847.png

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 11:59

Powered by Discuz!

× 快速回复 返回顶部 返回列表