markdown多行公式对齐

http://sparkandshine.net/latex-use-notes-mathematical-formula/


1. 公式多行多列对齐

当讨论一个函数因自定义变量取值不同而表达不同时,通常是写一个大括号,用cases完成,源代码如下:

 
 
  1. \begin{equation}
  2. \begin{cases}
  3. f(x)=\frac{1}{12} \cdot x \quad g(x) = \frac{1}{24} \cdot x, & x<12 \\
  4. f(x)=1 \quad g(x) = \frac{1}{8} \cdot x - 1, & 12 \le x < 16 \\
  5. f(x)=1 \quad g(x) = 1, & x \ge 16
  6. \end{cases}
  7. \end{equation}

结果如下:

image

你也看到了,上面的等式不够美观,g(x)不对齐。期待的结果是这样的:

image

源代码如下:

 
 
  1. \begin{equation}
  2. \left\{\begin{aligned}
  3. f(x)&=\tfrac{1}{12} \cdot r, & g(x) &= \tfrac{1}{24} \cdot x, & x&<12 \\
  4. f(x)&=1, &g(x) &= \tfrac{1}{8} \cdot x - 1, & 12 &\le x < 16 \\
  5. f(x)&=1, &g(x) &= 1, & x &\ge 16
  6. \end{aligned}
  7. \right.
  8. \end{equation}

参考资料:
[1]TeX: How can I align multirow and multicolumn equations?


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值