在Microsoft Word或Latex中的文档中使用了这些方程式。在Latex中,您可以使用命令轻松编写方程式。您可以使用简单文本快速插入这样的命令,以在文档之间或文档中的任何位置编写方程式。您无需在菜单栏上搜索方程式或符号。
下面给出了用于实现数学命令和方程式的环境:
\begin{equation} ........... \end{equation}
下面给出了用于实现数学命令和方程的软件包:
\usepackage{amsmath}
或者
\usepackage{mathtools}
mathtools 软件包还加载了 amsmath 软件包。因此,从以上两个程序包中,可以使用任何一个。
让我们用方程式 x + y = 4 的简单示例来理解。
下面给出了该示例的代码:
\documentclass[12pt]{article} \usepackage{mathtools} %引入包 \begin{document} \title{How to learn latex mathematical equations} \author{ Welcome learnfk.com } \date{\today} \maketitle \begin{equation} x + y = 4 % 两行中的任何一行之间不应有间隙 \end{equation} \end{document}
输出:
您还可以编写任何顺序的方程式。
下面给出了写二阶方程的代码:
\documentclass[12pt]{article} \usepackage{mathtools} %引入包 \begin{document} \title{How to learn latex mathematical equations} \author{ Welcome learnfk.com } \date{\today} \maketitle \begin{equation} x^2 +2x+ 6 = 0 \end{equation} \end{document}
输出:
让我们考虑另一个写方程式的例子。代码如下:
\documentclass[12pt]{article} \usepackage{mathtools} %引入包 \begin{document} \title{How to learn latex mathematical equations} \author{ Welcome learnfk.com } \date{\today} \maketitle \begin{equation} x^3 - y^2 = 23 \end{equation} \end{document}
输出:
如果要以无穷或有限级数格式写数字等,则可以使用以下代码中给出的命令:
\documentclass[12pt]{article} \usepackage{mathtools} %引入包 \begin{document} \title{How to learn latex mathematical equations} \author{ Welcome learnfk.com } \date{\today} \maketitle \begin{equation} 1, 2, 3, 4, 5, 6........... \infty \end{equation} \end{document}
输出:
您也可以用不同的格式编写一个简单的方程式。下面给出了该示例的代码:
\documentclass[12pt]{article} \usepackage{mathtools} %引入包 \begin{document} \title{How to learn latex mathematical equations} \author{ Welcome learnfk.com } \date{\today} \maketitle \begin{equation} 10 \text{oranges} \times 2 \text{dozens of oranges} = 120 \text{oranges} \end{equation} \end{document}
输出:
您还可以根据需要在文档中编写几个方程式。公式编号将根据公式自动调整。但是,您需要为每个方程式使用单独的环境。
此类示例的代码如下:
\documentclass[12pt]{article} \usepackage{mathtools} %引入包 \begin{document} \title{How to learn latex mathematical equations} \author{ Welcome learnfk.com } \date{\today} \maketitle \begin{equation} x^3 + y^3 = 9 \end{equation} \begin{equation} x^2 + 2x + 4 = 0 \end{equation} \begin{equation} y^2 + 4y = 5 \end{equation} \end{document}
输出:
您还可以使用到目前为止讨论的命令在文档中的任何位置执行派生。
让我们通过一个简单的例子来理解推导的概念。
这个例子是牛顿运动方程。
此类示例的代码如下:
\documentclass[12pt]{article}
\usepackage{mathtools} %引入包
\begin{document}
\title{How to learn latex mathematical equations}
\author{ Welcome learnfk.com }
\date{\today}
\maketitle
\begin{center}
The three equations of motion are: \\
\end{center}
\begin{equation} % 要在方程之间插入额外的空间,您可以在方程环境之间留出空间。但是你不应该在任何环境中留下空间。
v = u + at
\end{equation}
\begin{equation}
v^2 = u^2 + 2as
\end{equation}
\begin{equation}
s = ut + 1/2at^2
\end{equation} \\
where,\\
s = displacement; \\
u = initial velocity; \\
v = final velocity; \\
a = acceleration; \\
t = time of motion
\end{document}
输出:
运算符定义为一种函数,以对数函数,三角函数,指数函数和极限的形式编写。
让我们考虑以上三个函数的示例。
Latex引入了一种简单的方法来使用三角函数,指数函数和对数函数,并以等式形式显示。
1)让我们考虑两个三角函数示例。
下面是第一个示例的代码:
\documentclass[12pt]{article} \usepackage{mathtools} \begin{document} \begin{equation} \cos^2 \theta + \sin^2 \theta = 1 \end{equation} \end{document}
输出:
下面给出第二个示例的代码:
\documentclass[12pt]{article} \usepackage{mathtools} \begin{document} \begin{equation} cos2 \theta = 1 - 2sin^2\theta % you can specify any equation according to the requirements. \end{equation} \end{document}
输出:
2)让我们考虑两个对数函数的示例。
下面是第一个示例的代码:
\documentclass[12pt]{article} \usepackage{mathtools} \begin{document} \begin{equation} \log a = \log b \end{equation} \end{document}
输出:
下面给出第二个示例的代码:
\documentclass[12pt]{article} \usepackage{mathtools} \begin{document} \begin{equation} \log a + \log b = \log c + \log d \end{equation} \centering which can also be written as\\ \begin{equation} \log ab = \log cd \end{equation} \end{document}
输出:
3)让我们考虑两个指数函数和限制的示例。
下面是第一个示例的代码:
\documentclass[12pt]{article} \usepackage{mathtools} \begin{document} \begin{equation} \lim\limits_{x \to n-1} \exp(x) = 0 \end{equation} \end{document}
输出:
下面给出第二个示例的代码:
\documentclass[12pt]{article} \usepackage{mathtools} \begin{document} \begin{equation} \lim\limits_{x \to \infty} \Sigma f(x) = 0 \end{equation} \centering where, \begin{equation} f(x) = 3x^3 + 2x^2 - 4ax +2 = 0 \end{equation} \end{document}
在这里,您还可以根据需要组合不同形式和类型的数学方程式。
链接:https://www.learnfk.comhttps://www.learnfk.com/latex/latex-mathematical-equations.html
来源:LearnFk无涯教程网
输出:
功效和索引被认为类似于标准文本中的上标和下标。
大括号 {} 用于包含超过一位的幂。下划线符号在Latex中使用下划线符号( _ )提及。
您也可以使用 | 符号将竖线插入方程式中。
下面是第一个示例的代码:
\documentclass[12pt]{article} \usepackage{mathtools} \begin{document} \begin{equation} k_n = k_{n-1} + k_{n-2} \end{equation} \end{document}
输出:
下面给出第二个示例的代码:
\documentclass[12pt]{article} \usepackage{mathtools} \begin{document} \begin{center} \begin{equation} a^{12} \times a^{22} = a^{34} \end{equation} where,\\ 12 + 22 = 34 \\ equation 1 signifies that the powers are added when multiplied. \begin{equation} b^9 \div b^4 = b^5 \end{equation} where,\\ 9 - 4 = 5 \\ equation 2 signifies that the powers are subtracted when divided. \end{center} \end{document}
输出:
下面给出了第三个示例的代码:
\documentclass[12pt]{article} \usepackage{mathtools} \begin{document} \begin{center} \begin{equation} f(x) = x^3 + 2x^2 + 4x + 2 |_{x = -2} \end{equation} \end{center} \end{document}
输出:
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)