LaTeX学习摘记(三):数学公式

来源:互联网 发布:同花顺软件手机版 编辑:程序博客网 时间:2024/06/06 01:53

LATEX学习摘记(一):数学公式

 

1、数学公式的前后要加上 $ 或\( 和 \),比如:$f(x) = 3x + 7$\(f(x) = 3x+ 7\) 效果是一样的;
如果用 \[ 和 \],或者使用 $$ 和 $$,则改公式独占一行;

如果用 \begin{equation}\end{equation},则公式除了独占一行还会自动被添加序号,如何公式不想编号则使用\begin{equation*}\end{equation*}.

 

本文部分内容来自如下网页:

http://blog.sina.com.cn/s/blog_5e16f1770100fs38.html

http://zh.wikibooks.org/zh/LaTeX/%E6%95%B0%E5%AD%A6%E5%85%AC%E5%BC%8F

 

公式断行:

在括号内断行

\left. \right. 与\left(或\right(配对

直接输出\{, [, (,\big]

多页显示

允许多行公式在某处断页,在换行命令\\前加\allowdisplaybreak[n],n的值0~4,0表示可以但是应避免,4为默认值,表示必须

导言中加入\allowdisplaybreak[n]则全文公式都如此,n值1~4,使用该命令后,可在行末加\\*阻止换页

注意以下块结构断页无效,split,aligned,gathered,alignedat

定理

http://en.wikibooks.org/wiki/LaTeX/Theorems

http://latex.yo2.cn/articles/latex-thesis.html

另一种方法:通过新建环境

\newcounter{obsno}

\newenvironment{observation}

{\addvspace{3mm plus 1ptminus 1pt}

\noindent

\textit{Observation \stepcounter{obsno}\arabic{obsno}\quad}}

{\par\addvspace{3mm plus 1ptminus 1pt}}

 

艾斯维尔模板中定理环境的计数器为在定理名称前加the,例如新建了一个observation环境,其计数器为theobservation

Springer模板的证明后加方块

在springer下了一个模板,导言区有这样一条语句:

\smartqed % flush right qed marks, e.g. at end of proof

 

怎样用才能在证明结束后出现结束的符号啊?

我是这样弄的,但没有啊

\begin{proof}

asdgasgdasdg. \smartqed

\end{proof}

      

2#

发表于 2008-5-2822:22 | 只看该作者

\qed 就有了

 

\smartqed 定义了 \qed。所以不能直接用。
空心的就好看, 不用折腾了吧。如果不甘心,就去 cls 文件里找到\smartqed 的定义, 修改里头那个产生的空心 box 为amsmath 的 \Box

 

间距调整

水平距离

\mspace{多少mu}

垂直距离

\abovedisplayshortskip = 12pt plus 3pt minus 9pt

\abovedisplayshortskip = 12pt plus 3pt minus 9pt

\abovedisplayskip = 12pt plus 3pt minus 9pt

\abovedisplayskip = 12pt plus 3pt minus 9pt

*short为短公式,也即上一行的长度和公式加起来不足一行

*等号后面的为默认值

上面能加文字的长等号

来源:http://blog.sina.com.cn/s/blog_5e16f1770100l6cv.html

有网友提出问题,如何输入长等号,而且可以依据等号上下的文字宽度来自动伸缩长度,同样我们也会用到箭头的输入。

在chinatex论坛我们也有简单探讨,参见:

http://bbs.chinatex.org/forum.php?mod=viewthread&tid=3597&extra=page=1

这里我们提供如下方案使用\usepackage{extarrows}:

$$ A \xlongequal{\quad\quad}B $$

$$ A\xlongequal[sub-script]{super-script}B$$

输出为:

LaTeX技巧334:如何输入长等号,且上下可添加文字?

另外还有

\xLongleftarrow:

\xLongrightarrow:

\xLongleftrightarrow:

\xLeftrightarrow:

\xlongleftrightarrow:

\xlongrightarrow:

\xleftrightarrow:

\xlongleftarrow:

(amsmath) \xleftarrow:

(amsmath) \xrightarrow:

\xlongleftarrow:

\xlongrightarrow:

(amsmath) \xleftarrow:

(amsmath) \xrightarrow:

 

公式左对齐

来自(未验证):http://latex.yo2.cn/articles/latex_fleqn.html

LaTeX中公式默认是居中对齐的, 但有时我们希望它能左对齐, 使用的方法如下:

 

1. \documentclass[a4paper,fleqn]{article} 这个对整篇文章有效.

 

如果只需要对一行公式进行左对齐的话, 可使用

 

\begin{flalign}

your equation (1)

\end{flalign}

 

 2. 对某一个公式:

some text here\\

\[

your equation here

\]\\

and more text here.

3. 如果你说的是某一个公式有两三行, 你想把这几行做左对齐.

 

 

\begin{flalign}

\begin{split}

your equation (1)

your equation (2)

\end{split}&

\end{flalign}还有其它方法,

 

例如使用

 

左对齐、居中对齐、右对齐的环境分别为flushleft、center和flushright。也可以使用命令\raggedright、\centering和\raggedleft使以后的文本按指定方式对齐.

 

或者 (LaTeX 学习博客 (http://latex.yo2.cn) , 白色印记.)

 

加载amsmath宏包后,使用选项fleqn(就是声明加载宏包时使用\usepackage[fleqn]{amsmath})可以使本该居中对齐的行间公式改为左对齐.

 

除法

\frac 正常的横线分数

单分数\dfrac\tfrac分别为\displaystyle\frac和\textstyle\frac的简写,连分数\cfrac,这三个符号需要amsmath

斜分数(未验证):行内\nicefrac,行间\faktor,需要nicefrac包

 

 

 

分类环境

\begin{cases}

\end{cases}

自定义符号

新算符定义:包amsopn

\DeclareMathOperator{算符命令}{算符}

\DeclareMathOperator*{算符命令}{算符}:行间公式上下标会自动变为顶部和底部

\operatorname{算符}:直接使用,括号中字母会变成正体

四角标定义:amsmath

\sideset{左侧上下标}{右侧上下标}:例如\sideset{^a_b}{^c_d}\prod^{n}_{k=1}

任意指定运算符:\mathop

其他:

\begin{equation}

\stackrel{\wedge}{=}\quad

\overset{\infty}{A}\quad

\underset{k=1}{A}

\end{equation}

特殊数学字体所在的包

\mathds ß dsfont 

\mathbb \mathfrak  ß  amssymb 例如:ABCDabcd

\varmathbb ß txfonts 可能会改变其他字体

\mathcal ABCD

公式间水平间距调整命令

\thinspace \,(简化命令)  \negthinspace(缩小)

\medspace  \:  \negmedspace

\thickspace  \;  \negthickspace

\enskip

\quad

\qquad

 


原创粉丝点击