关于Latex的安装
2022版本的LaTex可以在 TeX Live 2022 来了 - LaTeX 工作室 问答社区 进行下载安装,具体安装步骤也特别简单,就是安装时间比骄长。
LaTex的基本操作
LaTex的编程框架主要分为两大板块,也就是导言区和正文区,
![](https://img-blog.csdnimg.cn/cee8451be0fb44ce8c8221ab5bf120c1.png)
其中,导言区主要进行宏包配置,所为宏包,有一定编程基础的大佬应该都可以理解,宏包里面定义了各种函数,我们只需要进行调用,就可以实现相关功能。
LaTex数学公式的编写
这里主要介绍三种类型。
行内数学公式
行内数学公式主要有两种方法,这里介绍最常用的,利用美元$符号
%基本结构
%导言区
\documentclass{article}%book,report,letter,article
\usepackage{ctex} %中文处理包
%正文区
\begin{document}
Let $f(x)$ be defined by the formula $f(x)=3x^2+10x-1$.%单$$表示数学公式
\end{document}
在你所要输入的数学公式两端分别加入一个 $,比如 $f(x)=3x^2+10x-1$。
行间数学公式
相比于行内公式,行间公式的输出方法是在数学公式的两端分别输入两个$。
%基本结构
%导言区
\documentclass{article}%book,report,letter,article
\usepackage{ctex} %中文处理包
%正文区
\begin{document}
Let $f(x)$ be defined by the formula $f(x)=3x^2+10x-1$.%单$$表示数学公式
Let $f(x)$ be defined by the formula $$f(x)=3x^2+10x-1$$ which is polynomial of degree 2.%双$$ $$表示数学公式单独占一行
\end{document}
输出对比图:
另外一种方法是在equation环境下输入公式
\begin{equation} %equation用于产生带编号的行间公式
AB^2=BC^2+AC^2 \\
AB^2=BC^2+AC^2\\
\end{equation}
\begin{equation} %equation用于产生带编号的行间公式
AB^2=BC^2+AC^2 \\
AB^2=BC^2+AC^2\\
\end{equation}
\begin{equation*} %equation*用于产生不带编号的行间公式
AB^2=BC^2+AC^2 \\
AB^2=BC^2+AC^2\\
\end{equation*}
输出图为
多行数学公式
多行数学公式可以在gather环境下编写
带标号
gather环境表示带标号
gather*表示不带编号
在gather环境下,可利用\notag阻止编号
\begin{gather}
a+b=c\\
c+d=e\\
3 \times 5 = 5 \times 3
\end{gather}
\begin{gather*}
a+b=c\\
c+d=e\\
3 \times 5 = 5 \times 3
\end{gather*}
\begin{gather}
a+b=c \notag \\
c+d=e\\
3 \times 5 = 5 \times 3
\end{gather}
输出为:
对齐
在equation环境下使用split环境,并在需要对齐的位置加入&符号,可使公式对齐
\begin{equation*}
\begin{split}
\neg p\land (p \vee q)\longrightarrow q &=(\neg p\land p)\vee (\neg p \land q)
\longrightarrow q\\&=(\neg p \land q)\longrightarrow q\\
&=\neg(\neg p \land q) \vee q\\
&=(p \vee \neg q)\vee q\\
&=p\vee (\neg q \vee q)\\
&=p\vee T\\
&=T
\end{split}
\end{equation*}
\begin{equation*}
\begin{split}
(p\land q)\longrightarrow r\Longleftrightarrow p\longrightarrow (q\longrightarrow r) &=\neg(p\land q)\vee r \Longleftrightarrow p\longrightarrow(\neg q \vee r)\\
&=(\neg p \vee \neg q) \vee r \Longleftrightarrow \neg p \vee(\neg q \vee r)\\
&=T
\end{split}
\end{equation*}
输出为:
第一次分享,不足之处还请各位大佬指正!!!