加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Latex中使用align来对齐多行公式的排版技巧

(2018-06-25 22:37:26)
分类: LaTex
转自:https://blog.csdn.net/rumswell/article/details/13505399

Latex代码如下:

 

[plain] view plain copy
  1. \documentclass{article}  
  2. \pagestyle{empty}  
  3. \setcounter{page}{6}  
  4. \setlength\textwidth{266.0pt}  
  5. \usepackage{CJK}  
  6. \usepackage{amsmath}  
  7.   
  8. \begin{CJK}{GBK}{song}  
  9. \begin{document}  
  10.   
  11. \begin{align}  
  12.   (a b)^3  &= (a b) (a b)^2        \\  
  13.              &= (a b)(a^2 2ab b^2) \\  
  14.              &= a^3 3a^2b 3ab^2 b^3  
  15. \end{align}  
  16. \begin{align}  
  17.   x^2  y^2                       \\  
  18.            \sqrt{1-y^2}  
  19. \end{align}  
  20. This example has two column-pairs.  
  21. \begin{align}    \text{Compare  
  22.   x^2 y^2 &=                
  23.   x^3 y^3 &=               \\  
  24.           &= \sqrt   {1-y^2}  
  25.           &= \sqrt[3]{1-y^3}  
  26. \end{align}  
  27. This example has three column-pairs.  
  28. \begin{align}  
  29.        &=       &=   
  30.        &= b+c               \\  
  31.     x'   &= y'     X' &= Y'  
  32.       a' &=                 \\  
  33.   x' &= y'             
  34.   X' &= Y' a'b &= c'b  
  35. \end{align}  
  36.   
  37. This example has two column-pairs.  
  38. \begin{flalign}  \text{Compare  
  39.   x^2 y^2 &=                
  40.   x^3 y^3 &=               \\  
  41.           &= \sqrt   {1-y^2}  
  42.           &= \sqrt[3]{1-y^3}  
  43. \end{flalign}  
  44. This example has three column-pairs.  
  45. \begin{flalign}  
  46.        &=       &=   
  47.        &= b+c               \\  
  48.     x'   &= y'     X' &= Y'  
  49.       a' &=                 \\  
  50.   x' &= y'             
  51.   X' &= Y' a'b &= c'b  
  52. \end{flalign}  
  53.   
  54. This example has two column-pairs.  
  55. \renewcommand\minalignsep{0pt}  
  56. \begin{align}    \text{Compare  
  57.   x^2 y^2 &=                
  58.   x^3 y^3 &=              \\  
  59.           &= \sqrt   {1-y^2}  
  60.           &= \sqrt[3]{1-y^3}  
  61. \end{align}  
  62. This example has three column-pairs.  
  63. \renewcommand\minalignsep{15pt}  
  64. \begin{flalign}  
  65.        &=       &=   
  66.        &= b+c              \\  
  67.     x'   &= y'     X' &= Y'  
  68.       a' &=                \\  
  69.   x' &= y'             
  70.   X' &= Y' a'b &= c'b  
  71. \end{flalign}  
  72.   
  73. \renewcommand\minalignsep{2em}  
  74. \begin{align}  
  75.        &=      && \text{by hypothesis} \\  
  76.       x' &= y'     && \text{by definition} \\  
  77.   x' &= y' && \text{by Axiom 1}  
  78. \end{align}  
  79.   
  80. \begin{equation}  
  81. \begin{aligned}  
  82.   x^2 y^2  &=               \\  
  83.            &= \sqrt{1-y^2}    \\  
  84.  \text{and also }y &= \sqrt{1-x^2}  
  85. \end{aligned}               \qquad  
  86. \begin{gathered}  
  87.  (a b)^2 a^2 2ab b^2    \\  
  88.  (a b) \cdot (a b) a^2 b^2  
  89. \end{gathered}      \end{equation}  
  90.   
  91. \begin{equation}  
  92. \begin{aligned}[b]  
  93.   x^2 y^2  &=               \\  
  94.            &= \sqrt{1-y^2}    \\  
  95.  \text{and also }y &= \sqrt{1-x^2}  
  96. \end{aligned}               \qquad  
  97. \begin{gathered}[t]  
  98.  (a b)^2 a^2 2ab b^2    \\  
  99.  (a b) \cdot (a b) a^2 b^2  
  100. \end{gathered}  
  101. \end{equation}  
  102. \newenvironment{rcase}  
  103.     {\left.\begin{aligned}}  
  104.     {\end{aligned}\right\rbrace}  
  105.   
  106. \begin{equation*}  
  107.   \begin{rcase}  
  108.     B' &= -\partial\times          \\  
  109.     E' &=  \partial\times 4\pi \,  
  110.   \end{rcase}  
  111.   \quad \text {Maxwell's equations}  
  112. \end{equation*}  
  113.   
  114. \begin{equation} \begin{aligned}  
  115.   V_j &= v_j                       
  116.   X_i &= x_i q_i x_j             
  117.       &= u_j \sum_{i\ne j} q_i \\  
  118.   V_i &= v_i q_i v_j             
  119.   X_j &= x_j                       
  120.   U_i &= u_i  
  121. \end{aligned} \end{equation}  
  122.   
  123. \begin{align}  
  124.   A_1 &= N_0 (\lambda \Omega')  
  125.           \phi \lambda \Omega')   \\  
  126.   A_2 &= \phi (\lambda \Omega')  
  127.             \phi (\lambda \Omega)     \\  
  128. \intertext{and finally}  
  129.   A_3 &= \mathcal{N} (\lambda \omega)  
  130. \end{align}  
  131. \end{CJK}  
  132. \end{document} 


0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有