意义用途
用于出版物的排版,样式控制,使得编排标准美观。
整体框架
一个最简环境
documentclass{article} egin{document} content... end{document}
特殊符号
特殊符号的表示需要使用转义方式,但是\表示的是换行而不是。需要则使用$ackslash$表示。
documentclass{article}
egin{document}
# $ \% ^{} & \_ { } ~ \
$ackslash$
end{document}
省略号
省略号使用特殊的表示,区别于传统的直接使用多个点,间距不同的。
documentclass{article} egin{document} ldots when Einstein introduced his formula\ ... end{document}
公式表示
使用另外的子环境设置
documentclass{article} egin{document} egin{equation} e = m cdot c^2 end{equation} which is at the same time the most widely known and the least well understood physical formula. end{document}
一些求和,下标表示示例
documentclass{article} egin{document} egin{equation} sum_{k=1}^{n} I_k = 0 end{equation} Kirchhoff’s voltage law can be derive ldots end{document}
日期表示
如下
documentclass{article} egin{document} oday end{document}
引号表示
使用两个’表示,或者左边使用`,右边使用’表示。
documentclass{article} egin{document} ‘‘Please press the ‘x’ key.’’ \ \ ``asdf''' end{document}
破折号或横线
使用多个-表示
documentclass{article} egin{document} -------------------------- LaTeX end{document}
上波浪线和中波浪线
如下,分别为上波浪线和中波浪线
documentclass{article} egin{document} http://www.rich.edu/~{}bush \ http://www.clever.edu/$sim$demo\ end{document}
另一些特殊符号
,如℃
documentclass{article} egin{document} It’s $-30\,^{circ}mathrm{C}$.
smo rrebro d, !‘Se~norita!,\ end{document}
导入包并使用欧元符号
观察不同即可
documentclass{article} usepackage{textcomp} egin{document} exteuro end{document}
字符ff等自动连接的拆分
如下示例
documentclass{article} egin{document} Not shelfful\ but shelfmbox{}ful\ end{document}
分节表示
如下简例
documentclass{article} egin{document} section{Some Interesting Words} end{document}
页脚注释方案
documentclass{article} egin{document} Footnotesfootnote{This is a footnote.} end{document}
强调方式
一般使用斜体,但是整体是斜体则用正体,总之是不同的样式,表示强调
documentclass{article} egin{document} extit{You can also emph{emphasize} text if it is set in italics,}\ emph{emphasize} end{document}
分条方式
如下示例
documentclass{article} egin{document} egin{enumerate} item You can mix the list environments to your taste: egin{itemize} item But it might start to look silly. item[-] With a dash. end{itemize} item Therefore remember: egin{description} item[Stupid] things will not become smart because they are in a list. item[Smart] things, though, can be presented beautifully in a list. end{description} end{enumerate} end{document}
对齐方式
示例右对齐、居中
documentclass{article} egin{document} egin{flushright} This text is right-\aligned. LaTeX{} is not trying to make each line the same length. end{flushright}
egin{center} At the centre\of the earth end{center} end{document}
摘要方式
摘要部分:
documentclass{article} egin{document} egin{abstract} The abstract abstract. end{abstract} end{document}
原始方式显示
示例:
documentclass{article} egin{document} egin{verbatim} 10 PRINT "HELLO WORLD "; 20 GOTO 10 end{verbatim} end{document}
文字加框
与上下横线,如下示例:宽度固定4.7cm
documentclass{article} egin{document} egin{tabular}{|p{4.7cm}|} hline Welcome to Boxy’s paragraph. We sincerely hope you’ll all enjoy the show.\ hline end{tabular}\ \\ \ egin{tabular}{l} hline leading space left and right\ hline end{tabular} end{document}
指数上标
示例:
documentclass{article} egin{document} 1\ [122pt] 100~m$^{3}$ of water\ end{document}
两个数学符号
示例:tal 和 属于
documentclass{article} egin{document} ( au epsilon )\ end{document}
其它数学表示
如下和效果:
documentclass{article} egin{document} egin{displaymath} lim_{n o infty} sum_{k=1}^n frac{1}{k^2} = frac{pi^2}{6} end{displaymath} egin{equation} x^{2} geq 0qquad extrm{for all }xinmathbf{R} end{equation} egin{equation} a^x+y eq a^{x+y} end{equation} [lim_{x ightarrow 0} frac{sin x}{x}=1] egin{displaymath} mathbf{X} = left( egin{array}{ccc} x_{11} & x_{12} & ldots \ x_{21} & x_{22} & ldots \ vdots & vdots & ddots end{array} ight) end{displaymath} end{document}