手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

latex公式如何对齐

时间:2024-10-14 14:34:41

1、首先,给出演示素材,比如要写出如下的公式:

latex公式如何对齐

2、如上图所示公式,最为关键的是如何对齐等号,一种简单的方式就是利用&符号来对齐,在每个等号前添加&符号即可,代码如下:A & =(x-y)(x+y) \\ & =x*x+x*y-y*x-y*y\\ & = x^2 - y^2

3、当然,对齐时需要设置特定格式或则说环境,酋篚靶高需要添加如下语句说明:\begin{aligned} % requires amsmath稆糨孝汶; align* for no eq. numberA & =(x-y)(x+y) \\ & =x*x+x*y-y*x-y*y\\ & = x^2 - y^2\end{aligned}

4、所以完整latex代码如下所示:\documentclass{article}\usepackage{amssymb,amsmath}\begin{document}\be爿讥旌护gin{equation*}\begin{aligned} % requires amsmath; align* for no eq. numberA & =(x-y)(x+y) \\ & =x*x+x*y-y*x-y*y\\ & = x^2 - y^2\end{aligned}\end{equation*}\end{document}

latex公式如何对齐

5、需要注意的是,在打印预览时,需要选择合适的排版系统(如LaTex、XeTex)等。

© 手抄报圈