latex中使用定理、证明、缩进
1、定理和证明
1 \documentclass[a4paper,UTF8]{article} 2 \usepackage{ctex} 3 \usepackage{amsthm,amsmath,amsfonts,amssymb} 4 5 \newtheorem{theorem}{定理}%一定不能忘,否则会报错 6 \begin{document} 7 \begin{theorem} 8 设$a,b$是两个实数,则$2ab\leq a^2+b^2$. 9 \end{theorem} 10 \begin{proof} 11 因为$(a-b)^{2}\geq 0$ 12 \end{proof} 13 \end{document}
![](https://img2018.cnblogs.com/blog/1516317/201904/1516317-20190422194712748-1863430574.png)
2、缩进问题
1 在{document}里面加入 2 \setlength{\parindent}{2em}
在需要缩进的段落前加入\indent
1 \documentclass[a4paper,UTF8]{article} 2 \usepackage{ctex} 3 \usepackage{amsthm,amsmath,amsfonts,amssymb} 4 5 \newtheorem{theorem}{定理} 6 \begin{document} 7 \setlength{\parindent}{2em} 8 \begin{theorem} 9 设$a,b$是两个实数,则$2ab\leq a^2+b^2$. 10 \end{theorem} 11 \begin{proof} 12 因为$(a-b)^{2}\geq 0$\\ 13 \indent 所以可得到$a^{2}+b^{2}-2ab\geq 0$,从而得到$2ab\leq a^2+b^2$。 14 \end{proof} 15 \end{document}
结果:
![](https://img2018.cnblogs.com/blog/1516317/201904/1516317-20190422195512588-466905460.png)
1 \documentclass[a4paper,UTF8]{article} 2 \usepackage{ctex} 3 \usepackage{amsthm,amsmath,amsfonts,amssymb} 4 5 \newtheorem{theorem}{定理} 6 \begin{document} 7 \setlength{\parindent}{2em} 8 \begin{theorem} 9 设$a,b$是两个实数,则$2ab\leq a^2+b^2$. 10 \end{theorem} 11 \begin{proof} 12 因为$(a-b)^{2}\geq 0$\\ 13 所以可得到$a^{2}+b^{2}-2ab\geq 0$,从而得到$2ab\leq a^2+b^2$。 14 \end{proof} 15 \end{document}
结果:
![](https://img2018.cnblogs.com/blog/1516317/201904/1516317-20190422195810290-942520572.png)