\documentclass[10pt]{article} \usepackage[verbose, a4paper, hmargin=2.5cm, vmargin=2.5cm]{geometry} \usepackage{fontspec} \usepackage{ctex} \usepackage{paratype} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{esint} \usepackage{stmaryrd} \usepackage[mathbf=sym]{unicode-math} \setmainfont{STIX Two Text} \setmathfont{STIX Two Math} \setsansfont{Arial} \setmonofont{Courier New} \usepackage{makecell} \usepackage{wasysym} \usepackage{pifont} \usepackage[export]{adjustbox} \usepackage{graphicx} \usepackage{mdframed} \usepackage{booktabs,array,multirow} \usepackage{tabularx} \usepackage{hyperref} \hypersetup{colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan,} \urlstyle{same} \usepackage[most]{tcolorbox} \definecolor{mygray}{RGB}{240,240,240} \tcbset{ colback=mygray, boxrule=0pt, } \graphicspath{ {./images/} } \newcommand{\HRule}{\begin{center}\rule{0.9\linewidth}{0.2mm}\end{center}} \newcommand{\customfootnote}[1]{ \let\thefootnote\relax\footnotetext{#1} } \newcommand{\lt}{\mathrel{<}} \newcommand{\gt}{\mathrel{>}} \newcommand*\circled[1]{\tikz[baseline=(char.base)]{\node[shape=circle,draw,inner sep=1.5pt] (char) {\small #1};}} \setcounter{MaxMatrixCols}{256} \begin{document} \section*{LaTeX 公式编辑与导出练习} 这是一份自编样例,用于核对公式源码、预览和 Word 成品。 \section*{1. 行内上下标} 勾股关系: \({a}_1^2 + {b}_1^2 = {c}_1^2\) 。 \section*{2. 分式与求和} \[ y = \frac{x + 1}{x - 1},\;x \neq 1 \] 另起一段,核对求和等式: \[ \mathop{\sum }\limits_{k = 1}^{n}k = \frac{n\left( {n + 1}\right) }{2} \] \section*{3. 二阶矩阵} \[ A = \left\lbrack \begin{array}{ll} 1 & 2 \\ 3 & 4 \end{array}\right\rbrack \] \section*{4. 分段函数} \[ \left| x\right| = \left\{ \begin{matrix} x, & x \geq 0 \\ - x, & x < 0 \end{matrix}\right. \] \section*{5. 多行等式} \[ \begin{aligned} f\left( x\right) & = {\left( x + 1\right) }^2 \\ & = {x}^2 + {2x} + 1 \end{aligned} \] \section*{6. 代码示例保持原样} \section*{下面一行用于展示源码,不应被渲染为公式:} \textbackslash frac\{x+1\}\{x-1\} 结束核对:DOC2X-LATEX-EDITOR-END。 \end{document}