个性化阅读
专注于IT技术分析

Latex数学表达式

点击下载

本文概述

分数定义为以分子和分母的形式表示的数值。

使用以下命令创建分数:

\frac{numerator}{denominator}

调整环境

align环境还用于实现分数, 如下所示:

\begin{align*}
.......
\end{align*}

声明align环境以对齐方程式。在单个环境中不可能写两个方程。为了克服这个问题, 星号(*)与align命令一起使用。带align的*符号表示未编号在此环境中输入的方程式。

下面给出了使用align环境的代码:

\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}

\begin{align*}
a + b = c \\
5 - 4 = 1 \\
x ^2 + y^2 = z^2
\end{align*}

\end{document}

输出将在单独的行中显示上述代码中列出的三个方程式, 这在方程式环境中是不可能的。你需要为每个方程式使用单独的方程式环境。

你会注意到以下输出:

Latex数学表达式

对齐环境类别中通常有两个环境。

下面列出了两种对齐环境:

1)falign环境用于对齐页边距两侧的文本。

下面给出了该示例的代码:

\documentclass[8pt]{article}
\usepackage{mathtools}
\begin{document}

\begin{flalign}
a & = b &   % for the elements of the first column, two ampersand symbols are inserted.
12 & = 21 \\
ABC & = DEF &
c & = e + d
\end{flalign}

\end{document}

输出:

Latex数学表达式1

multialign环境用于在不同的行中对齐长文本。否则, 文本将无法正确对齐。

让我们考虑一个例子。

  • 与multialign的使用

此类示例的代码如下:

\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}

\begin{multline}
1 + 2 + 3 + 4 + 5 + 6 \\
+ 7 + 8 + 9 + 10 + 11 + 12 \\
+ 13 + 14 + 15 + 16 + 17 + 18
\end{multline}

\end{document}

输出:

Latex数学表达式2
  • 不使用multialign

此类示例的代码如下:

\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}

1 + 2 + 3 + 4 + 5 + 6 \\
+ 7 + 8 + 9 + 10 + 11 + 12 \\
+ 13 + 14 + 15 + 16 + 17 + 18

\end{document}

输出:

Latex数学表达式3

分数类型

让我们通过几个例子来理解分数。

示例1:下面是第一个示例的代码:

\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}

\begin{align*}
\frac{a}{b} = \frac{c}{d}
\end{align*}

\end{document}

输出:

Latex数学表达式4

示例2:下面给出第二个示例的代码:

\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}

\begin{align*}
r(x) = \frac{1}{x^2 + y^2 + z^2} = 1 \\ \\ % you can insert any type of fraction according to the requirements.
g(x) = \frac{\frac{1}{a}+\frac{1}{b}}{a - b} \\ \\
f(x) = \frac{a - b}{\frac{1}{a} - \frac{1}{b}} \\
\end{align*}

\end{document}

输出:

Latex数学表达式5

斜分数

小数通常在分子和分母之间具有一条直线。但是要在分子和分母之间创建斜线, 可以使用\ sfrac命令。

\ sfrac命令用于创建斜线, 而\ frac命令用于创建分子和分母之间的直线。

要实现\ sfrac, 我们需要使用xfrac包。程序包写为\ usepackage {xfrac}。

数学环境用于实现此类命令。该环境写为:

\begin{math}
..................
\end{math}

让我们用几个例子来理解。

示例1:下面是第一个示例的代码:

\documentclass[8pt]{article}
\usepackage{mathtools}
\usepackage{xfrac}
\begin{document}

\begin{math}
 $\sfrac{a}{b}$  \\
% the slanted fraction is first declared inside the math mode first
Fraction = \sfrac{a}{b} 
 % after the declaration, you can use the above command anywhere in your document  
\end{math}

\end{document}

输出:

Latex数学表达式6

示例2:下面给出第二个示例的代码:

\documentclass[8pt]{article}
\usepackage{mathtools}
\usepackage{xfrac}
\begin{document}

\begin{math}
 Pour \: 5 \times $\sfrac{1}{2}$ \: water, \\ \\
 = 2{}^1/_2 \: Liter  
 % we have used \: to maintain space between the words. You can use anywhere in your document, where you required to add more space between the words in a sentence.
\end{math}

\end{document}

输出:

Latex数学表达式7

二项式

二项式模式通常在阶乘中使用。 \ binom命令用于以二项式形式表示变量。

让我们看一个例子。

代码如下:

\documentclass[8pt]{article}
\usepackage{mathtools}
\usepackage{xfrac}
\begin{document}

\begin{align*}
The \: formula \: for \: the \:Combination \:in \:Permutation \: and \: Combination \: is: \\
\frac{n!}{r!(n-r)!} = \binom{n}{r} 
% there is no spacing between the words by default. To maintain spacing, \: is used after every word in Latex.
\end{align*}

\end{document}

输出:

Latex数学表达式8

根源

根在数学中被广泛使用。 \ sqrt {expression}命令用于创建根。它被称为平方根。大括号内的表达式是词根下的术语。如果要更改根的大小, 则需要使用\ sqrt [magnitude] {expression}命令。

让我们用几个例子来理解。

下面是第一个示例的代码:

\documentclass[8pt]{article}
\usepackage{mathtools}
\usepackage{xfrac}
\begin{document}

\begin{align*}
\sqrt{9} \\ \\
\sqrt{1 + x^2 + 2xy} \\ \\
\sqrt{\frac{a + b}{c - d}}
\end{align*}

\end{document}

输出:

Latex数学表达式9

下面给出第二个示例的代码:

\documentclass[8pt]{article}
\usepackage{mathtools}
\usepackage{xfrac}
\begin{document}

\begin{align*}
\sqrt[a]{d} \\ \\
\sqrt[4]{16} = 2 \\ \\
\sqrt[3]{27} = 3
% the above examples are the roots of the changing magnitude. You can set the value of magnitude according to the requirements.
\end{align*}

\end{document}

输出:

Latex数学表达式10

续分数

连续分数以梯形或连续形式表示。这些分数通常用于各种主题或主题的阶梯结构中。

\ cfrac命令用于实现连续分数。

我们可以使用方程式环境来创建连续分数。

让我们看一个例子。下面是代码:

\documentclass[8pt]{article}
\usepackage{mathtools}
\usepackage{xfrac}
\begin{document}

The continue fraction is written as: \\
\begin{equation}
x = b_0 + \cfrac{1}{b_1 + \cfrac{1}{b_2 + \cfrac{1}{b_3 + \cfrac{1}{b_4 + \cfrac{1}{ b_5 + \cfrac{1}{b_6} } } } } } 
\end{equation}
% you can add any numbers of fractions depending on the requirements.
% above is just an example for your better understanding.
\end{document}

输出:

Latex数学表达式11

sum命令用于插入求和符号。我们可以指定求和符号的范围和限制。

sum命令写为:

\sum{value at bottom of symbol}^{value at top of the symbol} text

让我们用两个例子来理解。

下面给出第一个示例的代码:

\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}

\begin{math}
\sum_{i=0}^{N - 1} a_i % you can modify the values according to the requirements
\end{math}

\end{document}

输出:

Latex数学表达式12

下面给出第二个示例的代码:

\documentclass[10pt]{article} % we can also modify the point size 
\usepackage{mathtools}
\begin{document}

\begin{math}
\sum_{\substack{  % the \substack command is used to display the limits in multiple lines.
   0<i<k \\
   k<j<n
  }} 
 R(k, n) % you can modify the values according to the requirements
\end{math}

\end{document}

输出:

乳胶馏分13

赞(0)
未经允许不得转载:srcmini » Latex数学表达式

相关推荐

评论 抢沙发

评论前必须登录!