1. 程式人生 > >Aurora編輯LaTex公式基本用法教程

Aurora編輯LaTex公式基本用法教程

LaTeX basics

Math mode

LaTeX has two primary modes of operation—text and math modes. Both are equally important when using LaTeX as a typesetting system; however, since the main purpose of Aurora is editing equations, the math mode is the one you will probably use most often. Thus, when you see Aurora initializing equations it creates to “$ $

” or “\[ \]” and placing the caret in between, it does so to enter the math mode.

Spaces and line breaks are typically ignored by LaTeX and doubly so in math mode, because it can generally infer proper placement from the mathematical expression alone.

Inline versus display equations

LaTeX distinguishes formulas that are a part of a sentence, such as the following gratuitous display of Greek symbols 

, from formulas that stand by themselves, such as the Schrödinger equation below:

The former are called inline equations, whereas the latter are display equations.

For Aurora, the most important differences between the two lie in the sizes of certain operators (fractions, sum, integrals, and so on) and the placement of limits in expressions. Simply put, LaTeX tries to fit inline equations into a single line of text, but lets display equations claim as much space as they need:

$ $” (inline) $\lim_{\to 0} \frac{\sin x}{x} = 1$
“\[ \]” (display) \[\lim_{\to 0} \frac{\sin x}{x} = 1\]

When creating a new equation using the “Insert equation” button on the Aurora toolbar or the “Insert Object…” command, Aurora initializes the formula in inline mode. To change the mode, simply change the dollar signs to \[ and\] or the other way around.

Commands

All the LaTeX commands—and that includes special symbols as well—begin with the backslash symbol \. For example, to insert the  sign into a formula, you might enter \pm. Many commands accept arguments, which go right after the command’s name. For example, an argument to the command that places a line over an expression (\overline) would be the expression to place that line over: \overline{A} gives .

Note that the curly braces in the example above are not strictly necessary, because the argument is only one character long. However, to make editing less error-prone, it is common to write braces even when they could be omitted.

Occasionally, a command may accept optional arguments—\sqrt, for example. These are given in square brackets right after the command name: \sqrt[3]{xy} produces .

Common expressions

What follows in this and next sections is but a very concise collection of most common and useful symbols available in LaTeX (and hence Aurora). It is primarily based on the material of:

If you cannot find some symbol here or in the documents above, The Comprehensive LaTeX Symbol List thereference to over 3300 symbols that can be used in LaTeX (and thus, again, Aurora)—will most definitely have whatever it is you need.

Aurora’s default preamble includes both amsmath and amssymb; therefore, the examples below use symbols and commands from these packages indiscriminately. All these examples should be used in math mode unless noted otherwise.

Operations

square root

\sqrt{x+\sqrt{y}}

higher order roots

\sqrt[mn]{x+y} \quad \sqrt[3]{2}

root sign

\surd[x+y]

fractions

\frac{a+b}{x+\log\frac{Y}{Z}}

force large (display) fraction

\frac{a+b}{x+\log\dfrac{Y}{Z}}

continued fraction

1+\cfrac{2}{

  3+\cfrac{4}{

    5+\cfrac{6}{7+\dotsb}}} =

\frac{1}{\sqrt e - 1}

binomial

\binom{n+1}{k}

prime

y'' + y' + y = u

“mod”

\begin{array}{l}

  a\bmod n=b \\

  a\equiv b\pmod n \\

  a\equiv b\mod n \\

  a\equiv b\pod n

\end{array}

Subscripts and superscripts

subscripts

x_1, x_2 \quad a_{ij}

superscripts

x^\quad e^{2j\pi t} \quad

a_{ij}^2

multilevel subscripts

\sum_{\substack{

      1 \le m \le N, \\

      m\text{ odd}}} P(m)

nested sub/superscripts

a_{b_j} \quad e^{x^2}

sub- and superscripts before the symbol

{}_n C_k

subscripts and superscripts for large symbols

\sideset{^a_b}{'_c}\sum

Sums, integrals, and products

sum

\sum_{i=1}^{+\infty}

product

\prod_{\alpha \in U}

integral

\int_{x_0}^{x_1}

contour integral

\oint_C

double and triple integrals

\iint_\quad \iiint_S

even more integrals

\iiiint_\quad \idotsint_S

integrals with alternative limit placement

\int\limits_\alpha^\beta \quad

\iint\limits_S

unions and intersections

\bigcup_{\alpha\in S} \quad

\bigcap_{V\in\mathfrak{V}}

direct sums, co-products, and so on

\bigodot \quad \bigoplus

\bigotimes \quad \bigsqcup

\biguplus \quad \coprod

\bigvee \quad \bigwedge

Brackets

pairing brackets

\; ), [ \; ], \{ \\}

\lvert\;\rvert\lVert\;\rVert

\lceil\;\rceil\lfloor\;\rfloor

\langle\;\rangle

Aurora also defines the following two commands in its default preamble:

absolute value

\abs{u(t)}

norm

\norm{\hat{G}}_\infty

To make the brackets scale to the size of the enclosed expression, use \left and \right commands:

\left
\right

\left(

  \sum_{i=1}^{n} e^{2\pi j i^2}

\right)

plain

\sum_{i=1}^{n} e^{2\pi j i^2} )

Alternatively, the bracket size can be specified explicitly using the following commands:

\Biggl(  \biggl(  \Bigl(  \bigl\quad

\Biggr\} \biggr\} \Bigr\} \bigr\}

This may be necessary when \left and \right commands create delimiters that are visually too large:

\left
\right

\left[ \sum_j

      \left|\sum_i x_{ij}\right|^2

\right]^{1/2}

manually-sized

\biggl\sum_j

      \Bigl|\sum_i x_{ij}\Bigr|^2

\biggr]^{1/2}

or when \left and \right create brackets of the same size in nested expressions:

\left
\right

O\left(\left(

    m^2+n^2\right)\log n\right)

manually-sized

O\bigl((m^2+n^2)\log n\bigr)

Multiline formulas and piecewise functions

piecewise functions/cases

a_k = \begin{cases}

  k & \text{for $\le n/2$} \\

  n & \text{for $k=n/2$} \\

  k-1 & \text{otherwise}

\end{cases}

multiline equations (aligned at &)

\begin{split}\tan^2 x

  &\sin^2 x/\cos^2 x \\

  &1/\cos^2 x - 1

\end{split}

systems of equations

\left\{\begin{array}{l}

  ax+by=r_1 \\

  cx+dy=r_2

\end{array}\right.

Arrows

implication

x^2=4 \implies x=\pm 2

“if and only if”

x^2=4 \iff x=\pm 2

“tends to”

x\to+\infty

“gets”

A\gets B+C

sizable single horizontal arrows

A\xleftarrow{\rm today}B

B\xrightarrow{\rm tomorrow}C

\xrightarrow

    [\text{(except Fridays)}]

    {\text{every day}} D

sizable single vertical arrows

\left\uparrow\sum \right\downarrow \;

\Big\updownarrow

sizable double vertical arrows

\left\Uparrow\sum \right\Downarrow \;

\Big\Updownarrow

A large collection of arrows can be found in the symbols section.

Over- and underbraces and other embellishments

overline

\overline{A+B}

underline

\underline{A+B}

hat

\widehat{A+B}

tilde

\widetilde{A+B}

vector markers

\overrightarrow{AB} \text{ and }

\overleftarrow{BA}

overbrace

\overbrace{x_1+x_2+\cdots+x_k}^

      {\text{ in total}}

underbrace

m^n=\underbrace{m\cdot m\cdots m}_{n}

affixing arbitrary symbols

x\overset{?}{\ge}y

Function names

To get correct font and spacing around the names of mathematical functions, prefix the function name with \. For example, writing cos 2\pi\alpha gives  (incorrect), whereas \cos 2\pi\alpha gives  (correct). Full list of function names defined in LaTeX is given below:

\arccos

\exp

\log

\arcsin

\gcd

\max

\arctan

\hom

\min

\arg

\inf

\Pr

\cos

\injlim

\projlim

\cosh

\varinjlim

\varprojlim

\cot

\ker

\sec

\coth

\lg

\sin

\csc

\lim

\sinh

\deg

\liminf

\sup

\det

\varliminf

\tan

\dim

\limsup

\tanh

\ln

\varlimsup

To declare additional function names that behave like the ones above, use the \DeclareMathOperator command in the preamble: \DeclareMathOperator{\rank}{rank}, after which \rank A will produce . Alternatively, using \operatorname{rank} A inline will also produce .

Matrices

matrix (square-bracketed)

\begin{bmatrix}

      \lambda \\

      1 & \lambda \\

      & \ddots & \ddots \\

      & & 1 & \lambda

\end{bmatrix}_{n\times n}

alternative delimiters

\begin{pmatrix}a\\b\\c\end{pmatrix},

\begin{Bmatrix}a\\b\\c\end{Bmatrix},

\begin{vmatrix}a\\b\\c\end{vmatrix},

\begin{Vmatrix}a\\b\\c\end{Vmatrix},

\begin{matrix}a\\b\\c\end{matrix}

inline matrices

(\begin{smallmatrix}1 && 2 \\

3 && 4\end{smallmatrix})

Punctuation

dots between commas

x_1, x_2\dotsc, x_n

dots between binary operations

x_1 + x_2 + \dotsb + x_n

dots between integrals

\int\dotsi\int

dots between multiplication signs

x(x+1)\dotsm(x+n)

colon (meaning “such that” or when defining domains)

f\colon \mathbb{N}\to\mathbb{R}

vertical and diagonal

\vdots \quad \ddots

Fonts

Normally, everything typed in math mode is considered to be a part of the formula and is typeset as such—spaces are ignored, most symbols come out in medium-weight italics, and so on. If you want to use a different mathematical font or to enter a few words of regular text in math mode like in the piecewise example above, the following commands can help:

normal text

x+\frac{1}{x} \ge 2

\text{ for all $x>0$}

(note that this is one of the rare cases when spaces matter in LaTeX; also note that you can switch back to math mode in \text)

bold text, upright

\textbf{I am Jack's bold text.}

bold math, upright

AB\mathbf{CD}EF

bold math, italic

AB\boldsymbol{C}\boldsymbol{D}EF

“poor man’s bold”

相關推薦

Aurora編輯LaTex公式基本用法教程

LaTeX basics Math mode LaTeX has two primary modes of operation—text and math modes. Both are equally important when using LaTeX as a

Latex基本用法、表格、公式、演算法(持續更新)

在檢視的時候可以直接使用目錄快捷索引直接定位 基本用法 1、中文例項 \documentclass{cctart} \begin{document} \kaishu 這是中文楷體字 \end

Vi文字編輯器的基本用法

i: 插入,從目前游標所在之處插入所輸入的文字。 a: 增加,目前游標所在的下一個字開始輸入文字。 o: 插入新的一行,從行首開始輸入文字。 :w filename (輸入“w filename”,將文章存入指定的檔名filename) :wq (輸入“wq”,因為進入之時已經指定檔名testf

linux中行編輯器sed的基本用法

sed的基本用法linux中行編輯器sed的基本用法sed的處理方法默認逐行讀取文件到內存中---->把符合模式的行讀取到屬於sed的內存中(sed的模式空間)進行編輯---->將處理後模式空間的內容顯示到屏幕上sed:行編輯器,默認不編輯源文件,僅對模式空間中的數據進行處理顯示使用方法sed [

latex 基本用法

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow 也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!        

Latex編輯數學公式

在寫部落格的過程中發現寫數學公式是一件非常不友好的事情,不僅繁瑣而且常出現相容問題。 這裡介紹一個非常強大的工具Latex,通過簡單的語法可以輕鬆寫 出美觀優雅的公式。本博文總結了一些Latex的基礎語法,讓你5分鐘即可輕鬆上手。 1. 排版方式 行級元素(inline),行級元素使用$...$,在正文

LaTex公式編輯方法

公式排版 行內公式 ∑i=0ni2\sum_{i=0}^{n}i^2∑i=0n​i2 $\sum_{i=0}^{n}i^2$ 獨立公式 E=mc2E=mc^2E=mc2 $$E=mc^2$$ 注:# $ % ^ & ~ \ { } 這些字元有

如何在支援 MathJax 的編輯器中使用 LaTeX 編輯數學公式

MathJax是什麼? MathJax是一個開源JavaScript庫。它支援LaTeX、MathML、AsciiMath符號,可以運行於所有流行瀏覽器上。 LaTeX是什麼? LaTeX(LATEX,音譯“拉泰赫”)是一種基於ΤΕΧ的排版系統。 如何使用LaTeX公式?(這裡列出的是本人常用的,更多

Jupyter notebook教程系列(二)Jupyter notebook的基本用法

Jupyter notebook的基本使用   一. 主頁面 如圖1-1 我們先介紹一下主頁面上的內容: 1.Files頁面是用於管理建立檔案相關類目的。 2.Running頁面主要展示的是當前正在運行當中的終端和“ipynb”格式的notebook

mac os 利用ssh 搭建git server伺服器詳細教程,以及git基本用法(上)

上半部分轉載至 http://www.cnblogs.com/whj198579/archive/2013/04/09/3009350.html SSH開啟 在osx中開啟ssh訪問非常簡單,只需要開啟“系統偏好設定”並且點選“共享”圖示即可。 選中下圖中的ch

CODECOGS線上LaTeX公式編輯器收費陷阱!

CSDN部落格並沒有公式編輯器,需要用公式編輯器編寫之後再一圖片的形式上傳。因為這樣很不方便,就在網上搜線上LaTeX編輯器:http://www.codecogs.com/latex/eqneditor.php。線上編輯公式之後,直接點選右鍵,複製圖片連結即可

latex 基本用法(二)—— 矩陣(增廣矩陣、長虛線)

modm :\mod (modn):\pmod 1. 增廣矩陣 比如雞兔同籠問題的線性方程組: x+y=152x+4y=40 首先是有無解的判斷,也即是否 R(A|b)=R(Am×

latex公式編輯

$$ \begin{eqnarray*} \vec{x}\stackrel{\mathrm{def}}{=}{x_1, \dots, x_n}\\ {n+1 \choose k}={n \choose k} + {n \choose k-1}\\ \sum_{k_0,k_1,\ldots>0 \atop

【iTools】使用 LaTex 編輯數學公式

1. Basic 基礎 CSDN 的 LATEXLATEX 公式編輯器也是使用的 MathJax,所以看到任何一個公式,右鍵點選,選擇 Show Math As > TeX Commands,就會彈窗顯示語法命令。但是 $不會顯示,copy-pas

shape的基本用法

enc schema 顏色 顏色漸變 mas utf pad 半徑 start <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/

Pinyin4j的基本用法

nts 人的 此外 中文 put stat -s http any     轉自:http://www.cnblogs.com/bluestorm/archive/2012/07/23/2605412.html 1. 簡單介紹 有時候,需要將漢字編程對應的拼音,以

11.python並發入門(part9 多線程模塊multiprocessing基本用法

python 多進程 multiprocessing 一、回顧多繼承的概念。由於GIL(全局解釋器鎖)的存在,在python中無法實現真正的多線程(一個進程裏的多個線程無法在cpu上並行執行),如果想充分的利用cpu的資源,在python中需要使用進程。二、multiprocessing模塊的簡介

Android屬性動畫完全解析(上),初識屬性動畫的基本用法

fcm 操作 fad 擴展性 改變 內部使用 如果 轉載 @override 轉載請註明出處:http://blog.csdn.net/guolin_blog/article/details/43536355 在手機上去實現一些動畫效果算是件比較炫酷的事情,因此Andr

JQuery的基本用法

技術 -1 nbsp jquer 技術分享 9.png log query com JQuery的基本用法

Jquery-zTree的基本用法

etc ssim 希望 取數據 attribute name checked down 個性 【簡介】 zTree 是利用 JQuery 的核心代碼,實現一套能完成大部分常用功能的 Tree 插件 兼容 IE、FireFox、Chrome 等瀏覽器 在一個頁面內可同時