1.displaymath 单行数学环境,不带编号。

\begin{displaymath}
This\ is\ displaymath\ envirment.\ I\ don
't\ have\ a\ tag
\end{displaymath}

  2.equation 单行数学环境,全文按序编号。

\begin{equation}
This\ is\ equation\ envirment.\ I\ have\ a\ tag
\end{equation}

  3.itemize 条目环境,按小圆点排列。

\begin{itemize}
\item This is
\item itemize environment
\end{itemize}

  4.enmerate 枚举环境,按数字序号排列。

\begin{enumerate}
\item This is
\item enumerate enviroment
\end{enumerate}

  5.quotation 引用环境,将输入看作纯文本,有大缩进。

\begin{quotation}
This is quotation environment. I have big indent, and output plaintext.
\end{quotation}

  6.verbatim 复读环境,字体特殊,将输入看作纯文本。

\begin{verbatim}
This is verbatim enviroment.I also output plaintext.
\end{verbatim}

  7.tabular 表格环境。

\begin{tabular}{l|c|c}
Aloha&This is tabular environment & I can have many rows\\
\hline
I am BJ&Hello World &I love you\\
&I can make multiple lines & I can even enter $\int$
\end{tabular}

  其中{}框住的三个字母lcc表示表格有三列,l:本列左对齐,c:本列居中,r:本列右对齐。&符号分割表项,\\换行,\hline添加水平线。

  8.description 描述环境,将输入看作纯文本。

\begin{description}
\item[This is describe environment.]
\item[It seems cool.]
\end{description}

  9.matrix 矩阵环境,使用时要加载amsmath包,并用美元括住。编译器会将matrix看作数学符号处理。

$$
\begin{matrix}
I& am& a\\
Matrix& I& am\\
seen& as& a\ symbol
\end{matrix}
$$

  10.table 浮动表格环境,浮动体位置更灵活。

\begin{table}[hbt]
\begin{tabular}{l|cc}
& I& just\\
\hline
& like & tabular\\
& environment&but more complete
\end{tabular}
\caption{This is a floating table.}
\end{table}

  11.preamble 引言环境。

\title{This is a preamble}
\author{Chester}
\date{\today}
\maketitle

  12.figure 图片环境。

\begin{figure}[hbt]
\centering
\includegraphics{lenna.png}
\caption{lenna}
\end{figure

  13.一个更灵活的图片环境,并且可以居中与缩放图片,需要graphicx包

{\centering\includegraphics[scale=0.85]{test.png}

}\\ 注意这里必须要空一行,这和tex的对齐方式有关,留待日后

  14.一个表格的实例,比较细节,含有合并单元格的操作,需要algorithm和algorithmic包

\begin{tabular}{|l|c|c|c}
\multicolumn{2}{}&&\multicolumn{2}{|c}{Predicted Classes}\\ \cline{3-4}
\multicolumn{2}{}&&\multicolumn{1}{|c|}{zero }& nonzero\\
\hline
Real&zero&975&5\\ \cline{2-4}
Class&nonzero&53&927\\ \hline
\end{tabular}\\

  15.一个伪代码的实例(Naive Bayes)

\begin{algorithm}
\caption{Training Naive Bayes Classifier}
\label{alg:train_bayes}
\textbf{Input:} The training set with the labels $\mathcal{D}=\{(\mathbf{x}_i,y_i)\}.$
\begin{algorithmic}[1]
\STATE $\mathcal{V}\leftarrow$ the set of distinct words and other tokens found in $\mathcal{D}$\\
\FOR{each target value $c$ in the labels set $\mathcal{C}$}
\STATE $\mathcal{D}_c\leftarrow$ the training samples whose labels are $c$\\
\STATE $P(c)\leftarrow\frac{|\mathcal{D}_c|}{|\mathcal{D}|}$\\
\STATE $T_c\leftarrow$ a single document by concatenating all training samples in $\mathcal{D}_c$\\
\STATE $n_c\leftarrow |T_c|$
\FOR{each word $w_k$ in the vocabulary $\mathcal{V}$}
\STATE $n_{c,k}\leftarrow$ the number of times the word $w_k$ occurs in $T_c$\\
\STATE $P(w_k|c)=\frac{n_{c,k}+1}{n_c+|\mathcal{V}|}$
\ENDFOR
\ENDFOR
\end{algorithmic}
\end{algorithm}

LaTeX中常用代码段snippets(持续更新)的更多相关文章

  1. Android开发中常用的库总结(持续更新)

    这篇文章用来收集Android开发中常用的库,都是实际使用过的.持续更新... 1.消息提示的小红点 微信,微博消息提示的小红点. 开源库地址:https://github.com/stefanjau ...

  2. Android中常用开发工具类—持续更新...

    一.自定义ActionBar public class ActionBarTool { public static void setActionBarLayout(Activity act,Conte ...

  3. swiper 轮播中常用的效果,持续更新

    swiper一款非常好用的轮播插件,支持移动端和PC端,用过很多次了,这次简单的总结一下.方便以后查找使用,说明一下,下面的例子是基于swiper 4.0+版本的,如果你是其他的版本,请自行前往官网查 ...

  4. js实用代码段(持续更新)

    1.得到一个数,在一个有序数组中应该排在的位置序号: function orderInArr(num,arr) { if(num > arr[0]){ return 1 + arguments. ...

  5. PyTorch常用代码段整理合集

    PyTorch常用代码段整理合集 转自:知乎 作者:张皓 众所周知,程序猿在写代码时通常会在网上搜索大量资料,其中大部分是代码段.然而,这项工作常常令人心累身疲,耗费大量时间.所以,今天小编转载了知乎 ...

  6. iOS:开发常用GitHub开源项目(持续更新)

    IOS开发常用GitHub开源项目(持续更新) 数据类 开源库 作者 简介 AFNetworking Mattt 网络请求库 ASIHTTPRequest pokeb 网络请求库 Alamofire ...

  7. 用Handler的post()方法来传递线程中的代码段到主线程中执行

    自定义的线程中是不能更新UI的,但是如果遇到更新UI的事情,我们可以用handler的post()方法来将更新UI的方法体,直接传送到主线程中,这样就能直接更新UI了.Handler的post()方法 ...

  8. C++入职学习篇--代码规范(持续更新)

    C++入职学习篇--代码规范(持续更新) 一.头文件规范 在头文件中大家一般会定义宏.引入库函数.声明.定义全局变量等,在设计时最后进行分类,代码示范(自己瞎琢磨的,请多多指点): #ifndef T ...

  9. LaTeX中Python代码的语法高亮

    LaTeX中Python代码的语法高亮 本文中,"{}"中的字母为LaTeX或Python的包名,只有"Pygments"是Python的包,其他都是LaTeX ...

随机推荐

  1. vue2.0+mint-ui资讯类顶导航和内容页联动实例(不是很完美)

    <template> <div> <div class="navbox"> <div class="nav"> ...

  2. Write a merge sort program

    Merge Sort- Recursion Write a merge sort program in JavaScript. Sample array : [34, 7, 23, 32, 5, 62 ...

  3. vue中 transition组件使用总结

    博客园比较啃爹啊,随笔只能手写,之前写在有道云笔记里面的内容也复制不了,忧伤..... 长话短说,看官方的transition 的讲解,可能是内容太多了,或者就是本人太辣鸡了,看的有点懵逼,但是项目中 ...

  4. eatwhatApp开发实战(三)

    在实战二中我们在eatwhatApp上增加了“添加店铺的功能”.接下来,我们来将添加的店铺显示出来,这里我们用到控件--ListView. 先上演示图: 首先,我们先设置布局: <Relativ ...

  5. sql 索引常见失效的几种情况

    1. 对于联合索引,没有遵循左前缀原则 2. 索引的字段区分度不大,可能引起索引近乎全表扫描 3. 对于join操作,索引字段的编码不一致,导致使用索引失效 4.对于hash索引,范围查询失效,has ...

  6. cordova开发插件,并在android studio中开发、调试

    之前用过cordova Lib包装H5页面,自己写插件,但做法是野路子,不符合cordova插件的开发思路,这次项目又需要包装H5页面,同时需要自定义插件.所以又折腾了一次cordova自定义插件. ...

  7. Spring boot Sample 009之spring-boot-web-thymeleaf

    一.环境 1.1.Idea 2020.1 1.2.JDK 1.8 二.目的 spring boot 整合thymeleaf模板开发web项目 三.步骤 3.1.点击File -> New Pro ...

  8. 看不见远程新建git分支

    再网页上新建了一个git分支.然后在本地跑git branch -r(查看远程分支)/ git branch -a(查看所有分支)两个命令,都没有看到新建的那个分支.这是为啥呢??? 原因是因为:gi ...

  9. Java实现 LeetCode 449 序列化和反序列化二叉搜索树

    449. 序列化和反序列化二叉搜索树 序列化是将数据结构或对象转换为一系列位的过程,以便它可以存储在文件或内存缓冲区中,或通过网络连接链路传输,以便稍后在同一个或另一个计算机环境中重建. 设计一个算法 ...

  10. Java实现 蓝桥杯VIP 算法训练 一元三次方程

    问题描述 有形如:ax3+bx2+cx+d=0 这样的一个一元三次方程.给出该方程中各项的系数(a,b,c,d 均为实数),并约定该方程存在三个不同实根(根的范围在-100至100之间),且根与根之差 ...