现在的位置: 首页 > 综合 > 正文

LATEX学习

2013年04月27日 ⁄ 综合 ⁄ 共 2212字 ⁄ 字号 评论关闭

LATEX 真的是比较强大,排版也比较好看,KNUTH大神NB。


插入图片时(使用\begin{figure},\end{figure}块)出现一个问题

提示undefined control sequence \includegraphics

然后只需在\documentclass{article}后加一句\usepackage{graphicx} ,有点像java使用jar包或者

C++包含一个库头文件似的。


The following paragraph cites from Indian TEX Users Group's<<LATEX Tutorials A PRIMER>>.It is copyrighted to the  original authors.

The \includegraphics command
\includegraphics[options]{filename}
The following options are available in \includegraphics command:


width The width of the graphics (in any of the accepted TEX units).
height The height of the graphics (in any of the accepted TEX units).
totalheight The totalheight of the graphics (in any of the accepted TEX units).
scale Scale factor for the graphic. Specifying scale = 2 makes the graphic twice
as large as its natural size.
angle Specifies the angle of rotation, in degrees, with a counter-clockwise (anticlockwise)
rotation being positive.



LATEX dot product symbol(点乘符号)

\cdot{}

BIBLIOGRAPHY参考文献

\bibitem用来分开参考文献中的条目


关于数学公式可以参见此页面

http://zh.wikipedia.org/wiki/Help:%E6%95%B0%E5%AD%A6%E5%85%AC%E5%BC%8F#.E7.BD.97.E9.A9.AC.E4.BD.93

公式对齐

\begin{align*}

\end{align*}

别忘了加上\usepackage{amsmath}

另外这个是右对齐的,若使用左对齐,在每一行前面加上&


latex默认开头一般会有空格,使用\noindent可以去掉开头的空格


latex手写体

\mathcal指令



latex插入图片


若需要多图在同一行并列排放,共享一个标题


比如一行放置两张图,共有两行总计四张图

可以用如下方式实现

\begin{figure}[h]
\centering
\centerline{
\includegraphics[scale=0.2]{1.png}
\includegraphics[scale=0.2]{2.png}}
\centerline{
\includegraphics[scale=0.2]{3.png}
\includegraphics[scale=0.2]{4.png}}
\caption{caption text}
\end{figure}


当数学公式太长时,需要把该公式分成几行

可以用\begin{aligned},\end{aligned}块或者\begin{split},\end{split}

具体如下,此方案引用自

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

方案(1)

\begin{equation}
\begin{aligned}
c^{j-1}_n=\sum_{l=0}^{D-1}g_lc_{l+2n}^j \\
d^{j-1}_n=\sum_{l=0}^{D-1}h_lc_{l+2n}^j
\end{aligned}
\end{equation}


方案2
\begin{equation}
\begin{split}
(a+b)^2 &=a^2+b^2+2ab\\
(a+b+c)^2 &=a^2+b^2+c^2+2ab+2ac+2bc
\end{split}
\end{equation}


但这样可能可能会碰到一个问题,当用\left(时,可能\right)预想的所在行(生成文件中括号所在行)与\left(不在同一行,无法通过编译,会提示 extra} ,or forgotten \right

google了一下说是\left and \right must be balanced in the same line

具体参见

http://tex.stackexchange.com/questions/65851/multi-line-equations


latex打印导数符号('一撇符号),不能直接用键盘上的',可以使用\prime,''自然就是\prime\prime


使用winedit时遇到的问题

本来插入的时候,在任意行点击鼠标,光标都是出现在每行开头的

然后插入图片段的时候,发现复制粘贴的代码会把\end{document}框进来

可以查看winedit窗口最下面的一行,可能不小心点到了,显示block的上面点击一下

便改为了line




抱歉!评论已关闭.