LaTeX命令速查手册
- 格式:docx
- 大小:74.35 KB
- 文档页数:72
05LaTeX学习系列之---TeX的命令⾏操作⽬录⽬录本系列是有关LaTeX的学习系列,共计19篇,本章节是第5篇。
前⼀篇:后⼀篇:总⽬录:前⾔我们在学习LaTeX的时,有必要来了解⼀下,它的实现机制。
(⼀)查看版本号在命令⾏输⼊:tex -v在命令⾏输⼊:latex -v在命令⾏输⼊:xelatex -v(⼆)更⾏版本在命令⾏输⼊:tlmgr update --all⾃⼰测试,不可⽤,可能⾃⼰电脑的原因(三)⽤命令⾏来编译.tex⽂件若想编译text.tex⽂件,则可在命令⾏输⼊:latex test.tex此时会⽣成⼏个中间⽂件,其中.dvi就是TeX以前的标准输出⽂件。
现在已经发展为.pdf⽂件。
在⽣成.dvi的基础上,再使⽤如下命令,便可转化为.pdf⽂件dvipdfmx test.dvi再命令⾏输⼊如下命令:xelatex test.tex(四)⽤批处理⽂件编译.tex⽂件::使⽤latex编译.tex⽂件latex test.tex::使⽤dvipdfmx⽣成pdf⽂件dvipdfmx test.dvi::删除中间⽂件del *.aux *.dvi *.log::暂停⼀下pause在.tex同⽬录下,保存为build.bat⽂件,双击便可⾃动编译::使⽤latex编译.tex⽂件xelatex test.tex::删除中间⽂件del *.aux *.log::暂停⼀下pause在.tex同⽬录下,保存为buildx.bat⽂件,双击便可⾃动编译本系列是有关LaTeX的学习系列,共计19篇,本章节是第5篇。
前⼀篇:后⼀篇:总⽬录:。
LaT ex辅谈:LaT eX命令速查手册51。
怎样在多栏环境中使用单栏图表?答:如果你在多栏环境中使用\begin{figure} ... \end{figure},图形是不会出现的。
如果你用另外的命令\begin{figure*} ... \end{figure*},图形就会超出右边或有页的上边。
解决的方法是把下面命令放在\begin{document}前面\makeatletter\newenvironment{tablehere}{\def\@captype{table}}{}\newenvironment{figurehere}{\def\@captype{figure}}{}\makeatother然后用figurehere 和tablehere 在你平常用figure[h....] 和table[h...]的地方。
2。
怎样得到度(degree)的符号?答:在\begin{document} 前面用\newcommand{\grad}{\ensuremath{^{\circ}}} ,然后你在文中就可用45\grad等等了。
3。
怎样得到一个欧元符号?答:用\usepackage{textcomp} 和\texteuro 或\usepackage{marvosym} 和\EUR都可以。
4。
当我应用fancyhdr时,我得到了太多'Overfull \vbox' 的信息?答:这是因为缺省的标题空间太小的原因(文本的一行),不能包括fancy标题(1 line of text + 1 rule)。
在导言里面加\addtolength{\headheight}{2.5pt}即可。
5。
当我用fancyhdr时,左边和右边的题有交叉重合?答:这是因为\section 等命令中的文本太长的原因,可用类似"\section[short version]{very long version indeed}"来解决问题。
latex使用手册LaTeX 使用手册一、LaTeX 简介与安装LaTeX 是一款强大的排版系统,基于TeX 编程语言开发。
它广泛应用于学术论文、书籍、报告等文档的撰写与排版。
安装LaTeX 系统后,用户可以利用各种编辑器(如TeXstudio、TeXworks 等)编写文档,并通过命令行或图形界面进行编译。
二、LaTeX 基本语法与结构1.文档结构:LaTeX 文档由一系列章节组成,每个章节具有独立的标题和内容。
2.标题:使用section、subsection、subsubsection 等命令创建不同级别的标题。
3.段落与换行:使用par 和ewline 命令创建段落和换行。
4.文本格式:使用textbf、textit、textsf 等命令设置文本格式。
三、文本格式与排版1.字体:使用fontfamily 命令选择字体。
2.字号:使用fontsize 命令设置字号。
3.行距:使用linespacing 命令设置行距。
4.间距:使用marginpar 命令设置页面四周的空白。
四、数学公式与符号1.数学公式:使用equation、align 等命令编写数学公式。
2.符号:使用symbol 命令插入特殊符号。
五、表格与图表1.创建表格:使用begin{tabular}、end{tabular} 命令创建表格。
2.修改表格:使用hline、multicolumn 等命令修改表格样式。
3.创建图表:使用begin{figure}、end{figure} 命令创建图表。
4.修改图表:使用caption、label 等命令修改图表属性。
六、目录与参考文献1.目录:使用tableofcontents 命令生成目录。
2.参考文献:使用bibliography 命令管理参考文献。
七、跨章节引用与链接1.交叉引用:使用label 和ef 命令实现章节间的引用。
2.内部链接:使用hyperlink 命令创建内部链接。
1:\begin{}与\end{}的用法2:\textcolor{red}{\fangsong\zihao{2}汉字:}3:\newpage 新的一页4:\heiti\zihao{4}\bf{}5:\qquad 与 \hfill 加空白矩阵中数字空用 :$\公式用\,加空格6:\newline 与 \\ 断行7:\bigskip \medskip \smallskip 增加段落间距8:\noindent \indent 段落的缩进9:\small\normalsize \large \LARGE \huge \Huge 字体大小设置10:\begin{quote} 文本 \end{quote} 文本两边缩进一定长度11:空行表示分段12:格式列表设置:\begin{itemize} \item列表文本 \end{itemize} 默认黑点标签可利用\item【1.1】改变样式\begin{enumerate}\item列表文本 \end{enumerate} 数字标签13:参考文献设置\begin{thebibliography}{99} \item{关键词} 或\bibitem{关键词}\end{ thebibliography }引用:\cite{关键词}或\upcite{关键词}例\begin{thebibliography}{99}\bibitem{DF2005_Auto1}Ding F, Chen T. Hierarchical gradient-based identification ofmultivariable discrete-time systems [J]. Automatica, 2005, 41(2):315-325\cite{ DF2005_Auto1} 或\upsite{DF2005_Auto1}………………\end{thebibliography}14:列表设置:\newcounter{fig}\begin{list}\item 文本………\end{list}15:注释 %开头若有多行每行都需以%开头16:脚注和边注\footnote{{\songti\zihao{-5}{\heiti收搞日期}: 2007-10-19 \\ {\heiti基金项目}: 国家自然科学基金项目(No. 60973043).\\ {\heiti作者简介}: XXX(1984-), 女, XXX人, 控制理论与控制工程硕士研究生. xxx@xxxx.xxx. \\ 丁锋(1963-), 男, 湖北广水人, 博士生导师. 研究方向为系统建模、系统辨识、过程控制、多率系统等. fding@}}17:\iffalse18:\mu_k(t)\leqslant2\left(\sum^{t}_{i=1}[\|\hat{\bfpsi}_k(t)\|^2+\|\bfvarphi(t)\|^2]\right)^{-1}. 表示方程为:19:\[公式\] :单行公式20:矩阵公式\vect{y_1(t)}{y_2(t)}-0.85\vect{y_1(t-1)}{y_2(t-1)}=\left[\begin{array}{rr}2.00&\1.00\\1.00&\2.00\end{array}\r ight]\vect{u_1(t-1)}{u_2(t-1)}\bftheta^{\T}=\bfQ_1=\mtwor{2.00}{1.00}{1.00}{2.00}表示:21:表的设置:\begin{table}[!hbt]\centering %\tabcolsep 3mm表\ref{hhq1_tab1}: \ 参数估计及其误差($L=1000$, $\sigma_1^2=\sigma_2^2=1.00^2$)\vspace{-3mm}\caption{The parameter estimates and errors ($L=1000$, $\sigma_1^2=\sigma_2^2=1.00^2$)}\label{hhq1_tab1}\vspace{-3mm}\tabcolsep 3mm\begin{tabular}{cccccccc}\\\hline:加横线c表示列的数目表的内容(可利用$ $对其表中内容)\end{tabular}\end{table}表示:22:图的设置:\begin{figure}[!hbt]\includegraphics[width=0.8\hsize]{CARMA-like-HG1_sigma100_L1000.eps}\\ 打开图标 %The original size: width=15cm, height=8cm\vspace{-2mm}\centering图\ref{hhq1_fig1} \ 估计误差$\delta$随$k$变化曲线($L=1000$, $\sigma_1^2=\sigma_2^2=1.00^2$)\vspace{-1mm}\caption{The parameter estimation errors $\delta$ versus $k$ ($L=1000$, $\sigma_1^2=\sigma_2^2=1.00^2$)}\label{hhq1_fig1}\end{figure}表的下标注表示:23:整体框架\begin{document}文本\end{document}24方框图表示:25:公式编辑1.\begin{equation} $单个公式 $ \end{equation} 或\begin{eqnarray} $多行公式 $ \end{eqnarray}2.\{ \} 表示大括号{ }3.\left{ \right } { }会根据公式大小调整尺寸4.$ $ 公式对齐符号5.公式不显示用 \non 或 \nonumber 标签公式式用 \label{关键词} 引用 \ref{关键词}6.数学公式黑体设置 $ \mathbf{ }$1.tex提供300多条基本排版命令2.由D.E.Knuth1978年开发3.plain tex:在tex基础上新定义600多条复合命令4.AMS-TEX:美国数学会开发(amsmath宏包)排版的数学公式TEX:mport(1985)编写,适合排版普通文章和书籍TEX2e:可加载amsmath宏包,目前最流行的TEX宏包7.版本:LATEX2.09-->LATEX2e-->LATEX3(开发中)8.中文排版:T:科学院张林波10.TY(天元):华师大肖刚、陈志杰教授开发11.CJK:德国W.Lemberg开发,处理中日韩三国文字。
The relsize package∗by Donald Arseneau†originally based on smaller.sty by Bernie Coselland combined with code by Matt SwiftSept21,2011It is frequently the case that something should be typeset somewhat larger or smaller than the surrounding text,whatever that size happens to be.Specifying such sizing commands explicitly makes it difficult to modify the font sizes of a document at a later time,and makes it hard to write macros that work at arbitrary sizes.Tofill this need, relsize.sty defines several commands for L A T E X to set font sizes relative to the current size. Command Function\relsize{i}Change font size by i steps.\larger[i]Increase size by(optional)i steps(default1).\smaller[i]Reduce font size by i steps(default1).\relscale{f}Change font size by scale factor f.\textlarger[i]{〈text〉}Text size enlarged by(optional)i steps.\textsmaller[i]{〈text〉}Text size reduced by(optional)i steps.\textscale{f}{〈text〉}Text size scaled by factor f.To refresh your memory,the font sizing commands in L A T E X are,in order:\tiny, \scriptsize,\footnotesize,\small,\normalsize,\large,\Large,\LARGE,\huge, \Huge(package moresize adds\ssmall and\HUGE).The main new command provided by relsize.sty is\relsize,which takes one(positive or negative)number as its argument; the number specifies how many“steps”by which to change the font size,where each step is a scaling factor of1.2,corresponding to the usual difference between the size commands.For example,if{\relsize{-2}smaller}appears in normal sized text,the word“smaller”is printed in script size type.If the same command appears in a\Large section title,then“smaller”is printed in normal size.∗This manual corresponds to relsize.sty v4.0,dated Sept21,2011.†asnd@triumf.ca,Vancouver,Canada1There are also the commands\larger and\smaller,which normally changethe font size by one step in the obvious direction;\larger is an abbreviation for\relsize{+1},and\smaller is an abbreviation for\relsize{-1}.For example, {\large...\larger{WOW!}}prints“WOW!”in\Large type.You can also specify bigger steps as an optional argument for\larger and\smaller:\larger[3]isequivalent to\relsize{3}and\smaller[2]is\relsize{-2}.(Both\larger and\smaller accept negative arguments,but please don’t make things so obscure!)If you want to change size by several steps it is much better to give an increment than to string several\larger commands together;i.e.,\relsize{3}or\larger[3],but not\larger\larger\larger.Half-steps are possible,as in\relsize{-0.5}to change from10pt\normalsize to9pt\small,but other numbers are rounded to the nearest half-integer.All of the\relsize,\larger,and\smaller commands are“switches”just like theregular sizing commands.That is,they change the size for all following text until thescope is ended by a closing brace(or tabular cell,or environment...).There are alternateversions called\textlarger and\textsmaller that take some text as an argument andapply the size change to only that text:\textlarger{big}.Using the number of“magnification steps”to indicate font size can be confusing tosome people,and limiting in certain uses.There are commands with syntax\text-scale{〈factor〉}{〈text〉}and\relscale{〈factor〉}to select the size based on a scale factor,like\relscale{0.75}.If the size requested is too small or too large,a warning is given,and the sizewill only change as far as appropriate,typically\tiny or\Huge.These limits arecontrolled by the commands\RSsmallest and\RSlargest,which get set automat-ically when relsize.sty is loaded,but you can redefine them to other length values:\renewcommand\RSlargest{50pt}(do not use\setlength).Fine point:The combination\relsize{n}\relsize{−n}is not guaranteed to restore the current font size!That is because the increment n may be enough to overflow the range of sizes, depending on\RSsmallest,\RSlargest,and\RSpercentTolerance(below).You should use grouping to undo relative size changes because it is unsafe to counteract one change with an “equal”change in the opposite direction.Or just use the commands that take the text as arguments,like\textsmaller{this}.Typically,the font-size commands do not select fonts at precise regular size ratios(andsome commands give half-intervals).\relsize and the others will select,and execute,the command for the size closest to the desired size.Then,if the relative differencefrom the target size is more than\RSpercentTolerance a further font-size selection ismade.By default,\RSpercentTolerance is an empty macro,which causes automaticselection:“30”(30%)when the current“fontshape”definition is composed of onlydiscrete sizes,and“5”when the fontshape definition covers ranges of sizes.The highersetting for discrete fonts ensures only the pre-defined sizes get used.(By default L A T E Xuses Computer Modern fonts at discrete sizes;you get full coverage of sizes by using2\usepackage{type1cm}or various other font package.)For special uses,or when the font shape definitions are not parsed properly,you can redefine the percent tolerance: \renewcommand\RSpercentTolerance{10}.Define it as“0”(zero)to ensure the scaling is exactly as specified,regardless of the document’s standard font sizes.−×××−All of the commands described above are text commands;they cannot be used in math mode.There are special\mathsmaller and\mathlarger commands provided,but these do not use the same sizes that the text versions use.Instead,they step between the usual math“styles”which you can explicitly set using the commands\displaystyle, \textstyle,\scriptstyle,and\scriptscriptstyle.However,the\mathlarger command will also increase the size beyond regular\displaystyle by selecting a larger regular font size(using\larger).(Yes,this is a kludge,and doesn’t work very well,but it can still be useful.)If you want to use this to create big integral signs,then you must also load the package exscale so that math symbols can change size.The sizes selected are:Current style\mathsmaller gives\mathlarger gives\displaystyle\textstyle(similar)\displaystyle in\larger font \textstyle\scriptstyle\displaystyle(similar)\scriptstyle\scriptscriptstyle\textstyle\scriptscriptstyle\scriptscriptstyle\scriptstyleFor example,try$\frac{\mathlarger{E}}{E}$=EE .Note that,for most symbols,\displaystyle and\textstyle give the same size,so$N,\mathlarger{N}$=NN, showing two identical N’s,but\sum and\int do get bigger in display style,and fractionsare treated differently too:$\int\frac{1}{2}dN-\mathlarger{\int\frac{1}{2}dN}$= 12dN−12dN.As you might have guessed,\mathlarger and\mathsmaller should only be used in math mode.These commands will attempt to attach any superscripts and subscripts directly to the symbol within the braces,rather than how they would attach to a math sub-formula. On the other hand,math accents and the math spacing do behave as if the symbol is enclosed in braces(which it is).Operators should be explicitly declared to use the right operator type(\mathrel,\mathbin,\mathop)to get the correct spacing,e.g., \mathrel{\mathsmaller{=}}.Due to their oddities,the math larger/smaller commands should not be trusted very far,and they will not be useful in every instance.3。
latex查询⼤全⽬录说明1、数学公式及符号:介绍数学公式的排版;附各类数学符号的指令表。
2、宏包⼤全详细介绍⽬前常⽤的各类宏包3、⾃定义字体及字号对字体和字号的设置举例说明4、绘图/表格/算法流程通过举例介绍图形、表格和算法流程的控制指令。
5、参考⽂献设置(两种⽅法)讲解两种添加参考⽂献的⽅法。
⼀是直接在TEX⽂件中添加。
⼆是通过.bib⽂件添加。
6、常见命令速查列出⼀些有⽤的细节处理⽅法。
它们可能经常使⽤,却⼜不易查询。
由于内容较多,可以通过关键词搜索。
1、数学公式及符号⾏中数学公式状态命令\begin{math}〈数学公式〉\end{math}\( 〈数学公式〉\)$ 〈数学公式〉$独⽴数学公式状态命令\begin{displaymath}〈数学公式〉\end{displaymath}\[〈数学公式〉\]$$〈数学公式〉$$独⽴编号的数学⽅程控制命令\begin{equation}〈数学公式〉\end{equation}注⽅程的排版⽅式(向左、向右对齐,编号排在⽅程左侧等)可在⽂件格式命令中选择如下版式注解参量:leqno 将⽅程编号置于⽅程左侧fleqn 所有⽅程式靠左侧拉齐排版,⽅程左边距可通过\mathindent = 〈左边距〉来控制。
数学公式状态字距命令表控制命令意义字距(em)\ ⾏⽂标准词间距0.33\; 数学式宽字距0.30\: 中等字距0.23\, 窄字距0.17\! 负窄字距-0.17注表中字距单位“em”是以字母“M”的宽度为基本单位。
对于标准的10点(pt)正⽂字体,宽度⼤约为3.5mm。
希腊字母控制命令表⼩写希腊字母字母控制命令字母控制命令字母控制命令α\alpha ι\iota \varrhoβ\beta κ\kappa σ\sigmaγ\gamma λ\lambda ?\varsigma δ\delta µ\mu τ\tauε\epsilon ν\nu υ\upsilonε\varepsilon ξ\xi φ\phiζ\zeta οo ?\varphiη\eta π\pi χ\chiθ\theta ?\varpi ψ\psi\vatheta ρ\rho ω\omega⼤写希腊字母字母控制命令字母控制命令字母控制命令Γ\Gamma Λ\Lambta Σ\Sigma\Delta Ξ\Xi Υ\UpsilonΘ\Theta Π\Pi Φ\PhiΨ\Psi ?\Omega动态配置界标动态开界标命令 \left 〈界标排版命令〉〈数学公式〉动态闭界标命令〈数学公式〉\right 〈界标排版命令〉多⾏数学⽅程式排版命令多⾏编号⽅程式排版命令\begin{eqnarray}〈⽅程式1左式〉& = &〈⽅程式1右式〉\\〈⽅程式2左式〉& = &〈⽅程式2右式〉\\…………〈⽅程式n左式〉& = &〈⽅程式n右式〉\end{eqnarray}注:如果某⾏不要编号,就在该⾏换⾏号“\\”之前插⼊⼀个⽆⽅程编号命令“\nonumber”。
1. 段首缩进中文习惯在段首缩进两格,在LaTeX中,\parindent表示段首缩进的长度,我们将它设置为当前字号的两个大写字母M的宽度,大约正好是两个汉字的宽度:\setlength{\parindent}{2em}LaTeX 默认每节的第一段的段首不缩进,这不符合中文排版习惯。
我们希望正文的每一段都要缩进,使用indentfirst宏包就可办到:\usepackage{indentfirst}2. 段距行距LaTeX 用\baselineskip表示当前的行距,其默认值大约是当前字号的1.2倍,如果当前字号是10pt,那么\baselineskip是12pt。
这对英文排版是合适的,对中文就显得太拥挤了,因为英文正文多为小写字母,字高与小写的x差不多(即1ex)。
如果字号为10pt,那么1ex =4.3pt。
我通常把行距设为字号的1.8倍:\setlength{\baselineskip}{1.8em}这个值随时可以改,对更改点以后的文字有效。
LaTeX 用\parskip表示段距,我一般把它设为1ex:\setlength{\parskip}{1ex}注意这些修改长度的命令最好都放在正文区(即\begin{document}之后)。
3. 页眉页脚我通常用fancyhdr宏包来设置页眉和页脚。
\documentclass[10pt, a4paper]{book}\usepackage{fancyhdr}我们在LaTeX中先把page style 设为fancy,再设置这个style 中的页眉和页脚。
但是它默认每章的第一页的page style是plain,需要单独处理。
% 设置plain style 的属性\fancypagestyle{plain}{%\fancyhf{} % 清空当前设置% 设置页眉(head)\fancyhead[RE]{\leftmark} % 在偶数页的右侧显示章名\fancyhead[LO]{\rightmark} % 在奇数页的左侧显示小节名\fancyhead[LE,RO]{~\thepage~} % 在偶数页的左侧,奇数页的右侧显示页码% 设置页脚:在每页的右下脚以斜体显示书名\fancyfoot[RO,RE]{\it Typesetting with \LaTeX}\renewcommand{\headrulewidth}{0.7pt} % 页眉与正文之间的水平线粗细\renewcommand{\footrulewidth}{0pt}}\pagestyle{fancy} % 选用fancy style% 其余同plain style\fancyhf{}\fancyhead[RE]{\leftmark}\fancyhead[LO]{\rightmark}\fancyhead[LE,RO]{~\thepage~}\fancyfoot[RO,RE]{\it Typesetting with \LaTeX}\renewcommand{\headrulewidth}{0.7pt}\renewcommand{\footrulewidth}{0pt}% 设置章名和节名的显示方式\renewcommand{\chaptermark}[1]{\markboth{~第~\thechapter~章~~~#1~}{}}\renewcommand{\sectionmark}[1]{\markright{~\these ction~~#1~}{}}4. 章节标题我通常用titlesec宏包来设置正文中出现的章节标题的格式:\usepackage{titlesec}设置章名为右对齐,字号为\Huge,字型为黑体,章号用粗体,并设置间距:\titleformat{\chapter}{\flushright\Huge\hei}{{\bf \thechapter}}{0pt}{}\titlespacing{\chapter}{0pt}{-20pt}{25pt}设置节名的字号为\Large,字型为黑体,节号用粗体,并设置间距:\titleformat{\section}{\Large \hei }{{\bf \thesection\space}}{0pt}{}\titlespacing*{\section}{0pt}{1ex plus .3ex minus .2ex}{-.2ex plus .2ex}其中\hei的定义为:\newcommand{\hei}{\CJKfamily{hei}}5. 纸张大小毕业论文要求用b5纸,单面打印,我用geometry宏包来设置纸张和版心大小:\documentclass[10pt, b5paper]{report}\usepackage[body={12.6cm, 20cm}, centering, dvipdfm]{geometry}% 以上将版心宽度设为12.6cm,高度20cm,版心居中,且自动设置PDF文件的纸张大小。
LaT ex辅谈:LaT eX命令速查手册51。
怎样在多栏环境中使用单栏图表?答:如果你在多栏环境中使用\begin{figure} ... \end{figure},图形是不会出现的。
如果你用另外的命令\begin{figure*} ... \end{figure*},图形就会超出右边或有页的上边。
解决的方法是把下面命令放在\begin{document}前面\makeatletter\newenvironment{tablehere}{\def\@captype{table}}{}\newenvironment{figurehere}{\def\@captype{figure}}{}\makeatother然后用figurehere 和tablehere 在你平常用figure[h....] 和table[h...]的地方。
2。
怎样得到度(degree)的符号?答:在\begin{document} 前面用\newcommand{\grad}{\ensuremath{^{\circ}}} ,然后你在文中就可用45\grad等等了。
3。
怎样得到一个欧元符号?答:用\usepackage{textcomp} 和\texteuro 或\usepackage{marvosym} 和\EUR都可以。
4。
当我应用fancyhdr时,我得到了太多'Overfull \vbox' 的信息?答:这是因为缺省的标题空间太小的原因(文本的一行),不能包括fancy标题(1 line of text + 1 rule)。
在导言里面加\addtolength{\headheight}{2.5pt}即可。
5。
当我用fancyhdr时,左边和右边的题有交叉重合?答:这是因为\section 等命令中的文本太长的原因,可用类似"\section[short version]{very long version indeed}"来解决问题。
Latex常用查询符号: LATEX 中有些字符(例如# $ % ^ & _ { } ~ \\ 等)被用作特殊的控制符,所以不能直接输入,多数需要在前面加个\\。
而\\ 本身则要用\extbackslash 命令来输入,希腊字母:α \\alpha ζ \heta β \\beta ? \\vartheta γ \\gamma η \\iota δ \\delta θ \\kappa 2 \\epsilon ι \\lambda ε \\varepsilon κ \\mu δ \\zeta λ \u ε \\eta μ \\xi Γ \\Gamma Λ \\Lambda Δ \\Delta Ξ \\Xi Θ \\Theta Π \\Pi 字样命令: \extrm{...} \extsf{...} \exttt{...} \\emph{...} \extsc{...} oo π \\pi $ \\varpi ρ \ho % \\varrho ζ \\sigma ? \\varsigma Σ \\Sigma Υ \\Upsilon Φ \\Phiη\au υ \\upsilon θ \\phi ?\\varphi χ \\chi ψ \\psi ω \\omega Ψ \\Psi Ω \\Omegaroman \extbf{...} bold face sans serif \extit{...} italic typewriter \extsl{...} slanted emphasized \\underline{...} underline Small Caps 运算符: \\[\\pm \imes\\div \\cdot \\cap \\cup \\geq \\leq \eq \\approx \\equiv\\] 三种列表环境:itemize(黑点)、enumerate(编号)、description(文字标题)箭头:标注:省略号:省略号用\\dots \\cdots \\vdots \\ddots 等命令表示,注意\\cdots 和 \\dots 的差别。
LaTex辅谈LaTeX命令速查手册3 +--+|一个英文文档的例子|+--+一个英文文档的例子,保存为:*.tex\documentstyle{article}%使用article格式\topmargin=0pt%以下页面设置\oddsidemargin=0pt\evensidemargin=0pt%\textwidth=14cm%\textheight=21cm%%\title{This is asample of\LaTeX}%文章题目\author{Bigeyes(\tt{**************})\%作者.多行用\Department of Mathematics\%USTC,Anhui,Hefei,230026%%\and%如有多作者,用\and A\_A%\thanks{Supported by.}%致谢,在author里\%BBS of USTC\%[202.38.64.3]}%\date{Mar.1,1999}%日期,如果没有此项,%则以当前日期代替,若%不要日期,则用空{}%\begin{document}%document开始.%以上定义标题各项内容,\maketitle%此句产生标题,不可缺少,%一般都是正文第一句\begin{abstract}%套用abstract格式This is mini-page defined for abstract,%自动形成小页you only write your abstract in it.If%you want to shows keywords,maybe you%should use:%{\bf Keywords:}\LaTeX,example%LaTeX没有keywords环境\end{abstract}%自己手工来做吧%\section{The very beginning}%一个节,节的使用后详This is the first section of your%article.You may find every first%一节的第一段缺省情况paragraph of your section,s section,%为段首不自动缩进chapter or.always has no%``parindent''at the beginning.%This is the second paragrph,you can%但是以后的段段首find this has parindent at the%自动缩进beginning.If you want to show%parindent at first paragraph too,%do as the first paragraph Ishowed%in the next section.%%\section{The 2nd step}%第二节,使用自动标号\hskip\parindent%横向空出\parindent This is the second section.In this%从这里大家看到first paragraph,I use`hskip'to%\parindent其实是get the first parindent.Maybe you%一个长度单位,长can get this effect by another way.%度单位后详%\s section{S-sect of 2}%小节this%%\s section*{\S 2.2 Another sof 2}%节,小节可以不使用this%自动标号,这时有关%的计数器不增加\section{Conclusion}%I think you have know\TeX well now.%又是一节I want to show you how to use%bibliography.In the article,you%参考文献的can use as``see\cite{texbook}''.%引用方法\cite{标识} %\begin{thebibliography}{0}%参考文献列在这里%{0}表示最长文献序号%为一位数%\bibitem{标识}%参考文献使用后详\bibitem{texbook}Donald~E.~Knouth,``The\TeX book'', Add ison-Wesley,1984\bibitem{lamport}L.\Lamport,``\LaTeX:A Document Preparation System'',Addison-Wesley,1994\bibitem{companion}M.~Goossens,F.~Millelbach,and A.~Samarin,``The\LaTeX\Companion'',Addison--Wesley,1994\end{thebibliography}\end{document}%document结束+---+|如何编辑、编译TeX文件|+---+我们已经讲过,TeX源文件是文本文件,就象一个C语言的源文件一样,那么我们也象编译C语言程序得到可执行程序一样,我们编译TeX源文件,以得到能在计算机上浏览或打印的格式文件, 那就是后缀为.DVI的文件(我们就称它为DVI文件).TeX源文件我们通常把其后缀取为.TEX.当然,如果你在中文TeX的环境中编排你的中文文章,那么你的源文件后缀可能就是那个中文TeX给你约定的了,我们现在常用的CCT EMTEX,所用的后缀是.CTX,系统的操作是将.CTX源文件中的中文经过预处理,产生标准的TeX文件, 然后再照平常的TeX文档一样操作,得到DVI文件.今后,我们均以DOS下的CCT EMTEX环境为例,来讲述TeX文章的编排.因为TeX的标准,所以在不同的TeX环境,其实文章编排的内容格式是一样的,只是可能它得到DVI的途径不同而已.而我们就以现在比较流行的LaTeX为准来讲述TeX的使用,其它如amstex, amslatex等,仅是文档的最外层框架以及少数扩展的命令不大一样之外,其它命令都是相同的.一个最最简单的TeX文档可能是:(比如我们用EDIT,当然也可以用写字板或UltraEdit等甚至是UNIX下的vi编辑器等编辑一个文本文件如下四行,取名为'1.tex')\documentstyle{article}\begin{document}my example content\end{document}现在流行的TeX格式似乎已经不是documentstyle而是documentclass 了,但是它们除了一开始的写法不大一样之外,正文的命令排版等等都没有任何区别.以CCT EMTEX环境为例,我们用'latex 1.tex'来编译TeX文件来得到DVI文件,然后用'view 1.dvi'来浏览,用'dvi24p 1.dvi'(24针打)或'dviljp 1.dvi'(激打)来打印文章.(以上三条命令的后缀均可以省去,仅用'latex 1','view 1'和'dviljp 1'等.)如果你的TeX文件不符合TeX语法,那编译将可能出错,这时可以让系统忽略错误产生DVI文件(这时可能就不能达到你所期望的排版效果了),或者你应该修改源文件中的错误,重新编译,直到全部通过.在LaTeX编译出错时,会在屏幕上显示出错信息,并显示"?"以接受用户进一步的指示.在"?"后,输入:1.回车:LaTeX尽量忽略此错误,继续运行;2.s:LaTeX继续运行,并之后还有错误,也不停止运行;3.r:类似s,比上者更强硬,甚至连打不开文件这样的严重错误也不停止;4.q:同r,但错误及提示均不在屏幕显示,直接写入.LOG文件;5.I:之后跟一个字符串,用来插入替代出错的字符串.比如在正文需要纵向空出1cm空白,用"\vskip 1cm",但是输入错误成为"\vship 1cm",则编译出错:!Undefined control seq nce.l.102\vship 1cm表示在第102行,\vship是未定义的命令,这时在?后输入"I\vskip",则用\vskip替代出错的\vship,继续执行.这里需要注意的是,这条指令只是编译中临时修改错误,并没有真正地修改源文件;6.小于10的数:表示删出从当前位置开始的那么多个字符;7.?:显示提示8.h:显示帮助,对当前错误提出进一步动作的建议;9.x:中断编译,将已编译的结果写入.DVI中,出错及提示写入.LOG中.+--+|制作幻灯片|+--+xcolor宏包\usepackage[选项]{xcolor}选项:彩色驱动程序名:dvips,dvipdfm,pdftex彩色模式:natural,rgb,cmyk,.预定义色彩集合:dvipsnames,dvipsnames*,.red,green,bl,yellow,cyan,magenta,black,white,orange,violet,purple ,brown,pink,.使用彩色\color{色彩名}--声明\textcolor{色彩名}{文本}--命令\pagecolor{色彩名}--声明,指定背景色(ps,pdf有效) 色彩名必须是已经有定义的可以使用不同色彩的混合,如\color{green!40!yellow}--40%的绿色与60%的黄色混合\color{-green!40!yellow}上述颜色的补色色彩混合公式:C0!P1!C1!P2!.!PN!CN=?另一种方法\color[色彩模式]{数据}\textcolor{色彩名}{数据}{文本}\pagecolor{色彩名}{数据}例:\textcolor[rgb]{0.3,0.8,0.1}\textcolor[cmyk]{0.0,0.5,0.1,0.5}\definecolor{色彩名}{色彩模式}{数据}\providecolor{色彩名}{色彩模式}{数据}色彩模式:rgb,cmyk,gray等逗号分隔的十进制小数,表示每个分量的力度如:\definecolor{red}{rgb}{1,0,0}\definecolor{yellow}{cmyk}{0,0,1,0}如色彩名已有定义,\providecolor不起作用,\definecolor覆盖原来的定义彩色盒子\colorbox{色彩名}{文本}\fcolorbox{色彩一}{色彩二}{文本}\colorbox{色彩模式}{数据}{文本}\fcolorbox{色彩模式}{数据一}{数据二}{文本}\normalcolor:恢复正常色使用pdfTeX dvipdfm--div转pdf dvipdfmx--dvipdfm的扩展pdfTeX处理Plain TeX and AMS-TeX文件pdfLaTeX处理LaTeX文件直接生成pdf文件,可以增加一些LaTeX中没有的pdf功能支持图片格式:pdf,png,jpg,tif,但不支持eps建立书签:hyperref宏包\usepackage[选项]{hyperref}\usepackage[选项]{hyperref}hypersetup{.}例子:\usepackage[dvipdfmx,CJKbookmarks]{hyperref}\usepackage[dvipdfmx]{hyperref}hypersetup{CJKbookmarks=tr}hyperref宏包常用选项驱动选项:dvipdfmx,dvips,pdftex,.pdf属性:pdftitle,pdfauthor,pdfs iect,.pdf打开方式:pdfstartview,pdfpagemode,.书签:bookmarks,CJKbookmarks,bookmarksnumbered,bookmarksopen,. 链接属性:colorlinks,l inkcolor,citecolor,.slides文档类:制作透明胶片\documentclass[选项]{slides}字体较大,\normalsize--20pt缺省字体为sffamily三种环境:slide,overlay,note pdfscreen宏包\usepackage[选项]{pdfscreen}常用选项screen:产生适合屏幕输出的pdf文件print:输出打印版panelleft,panelright,nopanel:设置导航面板paneltoc:将目录放在导航面板上sectionbreak:每节分页导航面板配色方案:bl,gray,orange,.pdfscreen宏包自动输入graphicx和color宏包pdfscreen定制幻灯片命令(导言区)\screensize{高度}{宽度}:屏幕大小(必须)\margins{左}{右}{上}{下}:定义页边空白,(放在\screensize前) \overlay{pdf图形文件}:幻灯片背景\paneloverlay{pdf图形文件}导航面板背景\urlid{CRL地址}:设置主页链接地址\emblema{图形文件}:在导航面板加入图片导航按钮:\bottombuttons,\nobottombuttons\topbuttons\notopbuttons按钮中文化\panelhomepagename:主页\paneltitlepagename:标题页\panelabstractname:摘要页\panelcontentsname:目录页\panelgobackname:返回\panelfullscreename:全屏显示\panelclosename:关闭\panelquitname:退出\panelpagename,\panelofname,\panelofnamep slide环境\begin{slide}.\end{slide}一个slide环境生成一张幻灯片页面过渡命令(需使用宏包texpower)\usepackage[display]{texpower}\pageTransitionBlindsH\pageTransitionBlindsV\pageTransitionSplitVI\pageTransitionDissolv e\pageTransitionSplitVO\pageTransitionSplitHI\pageTransitionSplitHO\pageTransitionGlitter{270}+--+|beamer宏包(最佳)|+--+是latex制作slide的一个文档类用pdflatex编译,不需要其它后处理程序同票latex结合度高直观而方便的创建遮挡(overlays)及其它各种漂亮的演示效果利用theme实现内容和风格的独立,可以轻松的改变风格在latex中使用beamer的一般步骤将latex的文档类型从article改为beamer用section和s section组织latex的文档结构用frame环境制作独立的帧执行pdflatex编译tex文件beamer文档类\documentclass[11pt,CJK,compress]{beamer}\usetheme{Warsaw}\usecolortheme{lily}.幻灯片主体结构\section{.}%用于书签和导航条\s section{.}%用于书签和导航条\begin{brame}[选项]\frametitle{.}--帧的标题\s frametitle{.}--%帧的副标题\end{brame}一个帧中可以包含覆盖,逐段显示内容一个有用的选项:plain标题页\begin{brame}[选项]\titlepage--生成标题页\end{brame}标题,副标题,报告人,。
目录说明1、数学公式及符号:介绍数学公式的排版;附各类数学符号的指令表。
2、宏包大全详细介绍目前常用的各类宏包3、自定义字体及字号对字体和字号的设置举例说明4、绘图/表格/算法流程通过举例介绍图形、表格和算法流程的控制指令。
5、参考文献设置(两种方法)讲解两种添加参考文献的方法。
一是直接在TEX文件中添加。
二是通过.bib文件添加。
6、常见命令速查列出一些有用的细节处理方法。
它们可能经常使用,却又不易查询。
由于内容较多,可以通过关键词搜索。
1、数学公式及符号行中数学公式状态命令•\begin{math}〈数学公式〉\end{math}•\( 〈数学公式〉\)•$ 〈数学公式〉$独立数学公式状态命令•\begin{displaymath}〈数学公式〉\end{displaymath}•\[〈数学公式〉\]•$$〈数学公式〉$$独立编号的数学方程控制命令\begin{equation}〈数学公式〉\end{equation}注方程的排版方式(向左、向右对齐,编号排在方程左侧等)可在文件格式命令中选择如下版式注解参量:•leqno 将方程编号置于方程左侧•fleqn 所有方程式靠左侧拉齐排版,方程左边距可通过\mathindent = 〈左边距〉来控制。
数学公式状态字距命令表控制命令意义字距(em)\ 行文标准词间距0.33\; 数学式宽字距0.30\: 中等字距0.23\, 窄字距0.17\! 负窄字距-0.17注表中字距单位“em”是以字母“M”的宽度为基本单位。
对于标准的10点(pt)正文字体,宽度大约为3.5mm。
希腊字母控制命令表小写希腊字母字母控制命令字母控制命令字母控制命令α\alpha ι\iota \varrhoβ\beta κ\kappa σ\sigmaγ\gamma λ\lambda ς\varsigma δ\delta µ\mu τ\tauε\epsilon ν\nu υ\upsilonε\varepsilon ξ\xi φ\phiζ\zeta οo ϕ\varphiη\eta π\pi χ\chiθ\theta ϖ\varpi ψ\psiϑ\vatheta ρ\rho ω\omega大写希腊字母字母控制命令字母控制命令字母控制命令Γ\Gamma Λ\Lambta Σ\Sigma∆\Delta Ξ\Xi Υ\UpsilonΘ\Theta Π\Pi Φ\PhiΨ\Psi Ω\Omega动态配置界标动态开界标命令 \left 〈界标排版命令〉〈数学公式〉动态闭界标命令〈数学公式〉\right 〈界标排版命令〉多行数学方程式排版命令•多行编号方程式排版命令\begin{eqnarray}〈方程式1左式〉& = &〈方程式1右式〉\\〈方程式2左式〉& = &〈方程式2右式〉\\…………〈方程式n左式〉& = &〈方程式n右式〉\end{eqnarray}注:如果某行不要编号,就在该行换行号“\\”之前插入一个无方程编号命令“\nonumber”。
LaTeX公式语法速查一、引言L a Te X是一种功能强大、广泛应用于学术界的排版系统,尤其在数学和科学领域中,其强大的公式排版功能备受推崇。
本文将为您介绍L a Te X中常用的公式语法,旨在帮助您快速掌握公式的编写方法。
二、基本格式L a Te X中的公式由特定的命令和语法构成,常用的公式格式如下:-行内公式:使用一对美元符号`$`将公式内容包裹起来,例如`$E=mc^2$`表示质能方程。
-行间公式:使用一对双美元符号`$$`将公式内容包裹起来,例如`$$\su m_{i=1}^{n}x_i$$`表示求和公式。
三、常用符号3.1上下标使用下划线`_`表示下标,使用脚注符号`^`表示上标。
例如:$x_1$表示下标,$a^{n}$表示上标。
3.2求和与积分使用`\su m`表示求和,使用`\in t`表示积分。
例如:求和公式:$\s um_{i=1}^{n}x_i$。
积分公式:$\i nt_{0}^{\i nf ty}f(x)dx$。
3.3分数与根号使用`\fr ac`表示分数,使用`\sq rt`表示开根号。
例如:分数公式:$\f ra c{a}{b}$。
根号公式:$\s qr t{x}$。
3.4矢量与矩阵使用`\ve c`表示矢量,使用`\ma th bf`表示加粗的矢量或矩阵。
例如:矢量公式:$\v ec{a}$。
矩阵公式:$\m at hbf{A}$。
四、常用公式4.1三角函数-正弦函数:$\si n(x)$-余弦函数:$\co s(x)$-正切函数:$\ta n(x)$4.2指数与对数-指数函数:$e^x$-自然对数:$\ln(x)$-对数函数:$\lo g(x)$4.3微积分-极限:$\li m_{x\t o\i nf ty}f(x)$-导数:$\fr ac{d f}{dx}$-积分:$\in t_{a}^{b}f(x)dx$4.4线性代数-矢量点乘:$\ma thb f{a}\cd ot\m at hbf{b}$-矢量叉乘:$\ma thb f{a}\ti me s\ma thb f{b}$-矩阵乘法:$\ma thb f{A}\ma th bf{B}$五、总结本文介绍了L aT eX中常用的公式语法,包括基本格式、常用符号以及常用公式的编写方法。
latex常用的数学命令-回复LaTeX 是一种常用的排版系统,特别适用于数学、科学和技术领域。
在数学领域中,LaTeX 提供了丰富且强大的数学命令,使得编写数学公式和符号变得更加简便和美观。
本文将一步一步地介绍一些常用的数学命令及其用法。
1. 表达式和公式LaTeX 提供了一系列命令用于编写数学表达式和公式。
其中,最基本的命令是`\(...\)` 或`\(...\)` 用于插入行内公式,例如`\(x^2 + y^2 = r^2\)`。
如果需要居中显示的公式,可以使用`\[...\]` 命令,例如:\[ \lim_{x \to \infty} f(x) = L \]2. 算符和运算符LaTeX 提供了丰富的算符和运算符命令。
例如,使用`\frac{a}{b}` 可以插入分数形式的算符,效果为\(\frac{a}{b}\)。
使用`\sqrt{n}` 可以插入平方根符号,例如\(\sqrt{n}\)。
此外,常用的运算符还包括求和、积分、极限等,如`\sum_{i=1}^{n} i` 可以插入求和符号,例如\(\sum_{i=1}^{n} i\)。
3. 上下标和分式LaTeX 提供了命令用于插入上下标和分式。
使用`_` 和`^` 可以插入下标和上标。
例如,`H_2O` 可以显示为\(H_2O\),`x^2` 可以显示为\(x^2\)。
对于较复杂的上下标,可以使用`{}` 包围。
而对于有多个上下标的情况,可以使用`\substack{}` 来处理。
分式可以使用`\frac{a}{b}` 命令插入,例如\(\frac{a}{b}\)。
4. 矩阵LaTeX 支持矩阵的排版。
使用`pmatrix`, `bmatrix`, `Bmatrix`, `vmatrix` 和`Vmatrix` 等命令可以插入各种类型的矩阵。
例如,`\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}` 可以插入如下形式的矩阵:\[ \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \]5. 方程组LaTeX 还支持方程组的排版。
Texmaker:用户手册1。
配置Texmaker1。
1配置编辑器1。
2配置Latex相关的命令1。
3配置拼写检查2.编辑TeX的文档2.1常用命令2.2设置一个TeX的文件的前序部分一个文件,2。
3结构2.4浏览你的文档2.5格式化文本2.6的间距2.7插入列表2。
8插入表格2。
9插入一个“跳格”的环境2。
10插入图片2。
11交叉引用和注释2。
12插入数学公式2.13使用“•”占位3。
编译的文件3。
1编译3。
2日志文件3。
3同步源PDF与Synctex4。
其他功能4。
1折叠/展开部分文档4。
2关于在几个文件中分离出来的文件4。
3参考书目4。
4交友标签ANS工具4。
5 Pstricks / Metapost / Tikz /渐近线支持4.6更改界面语言和外观4。
7“恢复以前的会话"命令4.8“正向/反向搜索”与Texmaker4.9剧情简介texmaker命令4.10键盘快捷键4。
11“源代码浏览器”面板4。
12“使用'构建'子目录。
..”选项(PDF)Latex命令正则表达式4.13替换文本4.14使用Texmaker作为一个渐近线编辑器Texmaker:用户手册1.配置Texmaker使用Texmaker之前,您必须配置通过“配置Texmaker”命令,在“选项”菜单中的编辑器和Latex的相关命令(“首选项"下的MacOSX)。
1。
1配置编辑器在编译你的第一个文件,你必须设置所用的编辑器的编码(“配置Texmaker” —>“编辑” —〉“编辑字体编码”)。
然后,你应该使用相同的编码在你的TeX 文件(例如:\ usepackage [拉丁]{} inputenc,如果使用“ISO—8859—1”编码编辑器)的序言注意:当打开一个文件,你警告说,如果该文件不能被正确使用的默认编码解码,该方案可以让您选择其他编码(没有修改默认的编码)。
1.2配置Latex相关的命令Texmaker不能编译你的文件,如果路径中的LaTeX相关的命令是错误的。
LaTeX各种命令,符号函数、符号及特殊字符声调语法效果语法效果语法效果\bar{x}\acute{\eta}\check{\alpha}\grave{\eta}\breve{a}\ddot{y}\dot{x}\hat{\alpha}\tilde{\iota}函数语法效果语法效果语法效果\sin\theta\cos\theta\tan\theta\arcsin\frac{L}{r}\arccos\frac{T}{r}\arctan\frac{L}{T}\sinh g\cosh h\tanh i\operatorname{sh}j\operatorname{argsh}k\operatorname{ch}h\operatorname{argch}l\operatorname{th}i\operatorname{argth}mk'(x)=\lim_{\Delta x\to0}\frac{k(x)-k(x-\Delta x)}\limsup S\liminf I{\Deltax}\max H\min L\inf s\sup t\exp\!t\ln X\lg X\log X\log_\alpha X\ker x\deg x\gcd(T,U,V,W,X)\Pr x\det x\hom x\arg x\dim x\lim_{t\to n}T同余语法效果语法效果\pmod{m} a \bmod b微分语法效果语法效果语法效果\nabla\partial x\mathrm{d}x\dot x\ddot y集合语法效果语法效果语法效果语法效果语法效果\forall\exists\empty\emptyset\varnothing\in\ni\not\in\notin\subset\subseteq\supset\supseteq\cap\bigcap\cup\bigcup\biguplus\sqsubset\sqsubseteq\sqsupset\sqsupseteq\sqcap\sqcup\bigsqcup逻辑语法效果语法效果语法效果语法效果p\land\wedge\bigwedge\bar{q} \to p\lor\vee\bigvee\lnot\neg q\setminus\smallsetminus根号语法效果语法效果\sqrt{3}\sqrt[n]{3}关系符号语法效果\Delta ABC\sim\Delta XYZ\sqrt{3}\approx1.732050808\ldots\simeq\cong\dot=\ggg\gg>\ge\geqq=\leq\leqq<\ll\lll(x-y)^2\equiv(-x+y)^2\equiv x^2-2xy+y^2\begin{align}\because\begin{cases}\acute{a}x^2+bx^2+c\gtrless0\gtrless\grave{a}x^2+bx^2+c\\\acute{a}>0>\grave{a}\end{cases}\\\therefore\frac{-b\pm\sqrt{b^2-4\acute{a}c}}{2\acute{a}}{}_\lessgtr^\gtrlessx_\lessgtr^\gtrless\frac{-b\pm\sqrt{b^2-4\grave{a}c}}{2\grave{a}}\end{align}x\not\equiv N x\ne A x\neq C t\propto v \pm \mp⼏何符号特征语法效果菱形\Diamond 正⽅形\Box 三⾓形Delta \Delta 图型\triangle⾓名\angle\Alpha\Beta\Gamma\sin\!\frac{\pi}{3}=\sin60^\operatorname{\omicron}=\frac{\sqrt{3}}{2}\perp箭头符号语法效果语法效果语法效果\leftarrow \gets \rightarrow \to\leftrightarrow \longleftarrow \longrightarrow \mapsto \longmapsto \hookrightarrow \hookleftarrow \nearrow \searrow \swarrow \nwarrow \uparrow\downarrow\updownarrow 语法效果语法效果语法效果语法效果\rightharpoonup \rightharpoondown \leftharpoonup \leftharpoondown \upharpoonleft\upharpoonright \downharpoonleft \downharpoonright语法效果语法效果语法效果\Leftarrow \Rightarrow \Leftrightarrow\Longleftarrow \Longrightarrow \Longleftrightarrow (or \iff)\Uparrow\Downarrow\Updownarrow特殊符号语法效果语法效果语法效果语法效果语法效果语法效果\eth \S \P \%\dagger \ddagger \star *\ldots \smile \frown \wr语法效果语法效果语法效果\oplus \bigoplus \otimes \bigotimes \times \cdot \div \circ \bullet \bigodot \boxtimes\boxplus 语法效果语法效果语法效果语法效果\triangleleft \triangleright \infty \bot \top \vdash \vDash \Vdash \models \lVert\rVert语法效果语法效果语法效果\imath \hbar \ell \mho \Finv \Re\Im\wp\complement语法效果语法效果语法效果语法效果\diamondsuit \heartsuit \clubsuit \spadesuit \Game\flat\natural\sharp上标、下标及等功能语法效果上标a^2下标a_2组合a^{2+2}a_{i,j}结合上下标x_2^3前置上下标{}_1^2\!X_3^4(HTML )x'导数(PNG )x^\prime 导数(错误)x\prime导数点\dot{x}\ddot{y}\vec{c}\overleftarrow{a b}\overrightarrow{c d}\widehat{e f g}上弧(注: 正确应该⽤ \overarc, 但在这⾥⾏不通。
LaTeX 是一个高质量的排版系统,被广泛用于编写科学、数学和技术文档。
以下是LaTeX 使用手册的一些基本指南和要点:1. **文档结构**:* 一个基本的LaTeX 文档由`\documentclass`,`\begin{document}`, 和`\end{document}` 组成。
* 使用`\documentclass` 命令来选择文档类型,例如`\documentclass{article}`。
2. **基本元素**:* 文本的加粗、斜体和下划线分别使用`\textbf{}`, `\textit{}` 和`\underline{}`。
* 插入章节和段落使用`\section{}`, `\subsection{}`,`\subsubsection{}` 和`\paragraph{}`。
3. **数学模式**:* 数学模式中的公式使用`$...$` 或`\[...\]` 包围。
* 特殊的数学符号和环境,如矩阵、分数、根等,使用相应的LaTeX 命令。
4. **插入图片**:* 使用`\includegraphics` 命令插入图片,例如:`\includegraphics[width=0.5\textwidth]{filename}`。
5. **表格**:* 使用`\begin{table} ... \end{table}` 插入表格,或使用`tabular` 环境。
* 使用`\hline` 和`\cline{col1-col2}` 来添加表格线。
6. **引用和参考文献**:* 使用`\cite{}` 插入文献引用。
* 使用BibTeX 或其他参考文献管理软件来管理参考文献。
7. **定理和证明**:* 使用`\begin{theorem} ... \end{theorem}` 来定义定理,或使用其他现有的环境,如`proof`。
8. **列表**:* 使用`\begin{itemize} ... \end{itemize}` 或`\begin{enumerate} ... \end{enumerate}` 来创建列表。
latex常用语法在使用 LaTeX 进行排版时,常见的语法规则介绍如下:1.文本类命令\emph{text}:将文本设置为斜体,用于强调文字。
2.格式设置命令\centering:将当前段落居中显示。
\setlength{length}{value}:设置长度类型的参数,用于调整文本、行距、表格等的宽度。
3.环境命令\begin{environment} … \end{environment}:启用指定环境,例如文本对齐、表格等。
\begin{itemize} … \end{itemize}:创建无序列表,列表项以符号或数字为序号。
4.数学公式命令$…$:用于行内数学公式或者短公式。
\[…\]:用于单独成行的公式或换行的长公式。
\begin{equation} … \end{equation}:用于数学公式,自带编号。
\mathrm{text}:用于显示无需延伸的字母。
6.参考文献命令\bibliography{路径/文件名.bib}:设置参考文献文件路径及文件名。
\cite{ref}:插入参考文献引用,ref 为参考文献中的引用标识符。
7.图表命令\includegraphics[options]{path}:插入一张图片,其中 options 为可选项,path 为图片文件路径。
\begin{figure} … \end{figure}:创建一个浮动的图形环境,用于插入图片、表格等。
\caption{text}:为浮动环境设置标题,text 为标题文本。
\hline:用于添加表格水平线。
\cline{i-j}:用于添加表格跨多行的水平线,i-j 为要跨越的行数。
LaTeX命令速查手册来源:/atomic.php?act=article&board=Linux&id=9524发表回复上篇下篇主题上篇主题下篇楼主溯源回版面原文发信人: yyz (騎馬倚斜橋/滿樓紅袖招), 信区: Linux标题: LaTeX命令速查手册1发信站: 同舟共济站 (Thu Dec 24 14:14:35 2009), 转信+---------------------------------+|TeX各版本概述及基本约定,特殊字符|+---------------------------------+tex提供300多条基本排版命令由D.E.Knuth1978年开发plain tex:在tex基础上新定义600多条复合命令AMS-TEX:美国数学会开发(amsmath宏包)排版的数学公式LATEX:mport(1985)编写,适合排版普通文章和书籍LATEX2e:可加载amsmath宏包,目前最流行的TEX宏包版本:LATEX2.09-->LATEX2e-->LATEX3(开发中)中文排版:CCT:科学院张林波TY(天元):华师大肖刚、陈志杰教授开发CJK:德国W.Lemberg开发,处理中日韩三国文字。
发行版CTEX:集成了CCT,TY,CJK的MikTEX系统。
ChinaTEX:内容涵盖MiKTeX系统及中文支持、常用外围软件、TeX\LaTeX文档和模板选萃等TeX中的长度mm毫米cm厘米in英寸=2.54cm=72.27ptpt点em大写字母M的宽度ex小写字母x的高度弹性长度:根据需要自动伸缩正常值plus伸展值minus收缩值实际长度可超过正常值和伸展值之和,但不能小于正常值和收缩值之差\documentclass[11pt]{article}%11pt字体,普通文章%导言区,全局命令\usepackage{CJK}%使用CJK宏包\begin{document}%主环境\begin{CJK}{GBK}{song}%汉字必须放入CJK环境%其它字体:song,kai,fs,hei,li,you%CJK的两种环境CJK和CJK*%GBK是采用的字符集:GB,GBK,Bg5,GbtHi,This is my first \LaTeX file祝贺你,MikTex和CJK安装成功了\end{CJK}\ent{document}CJK和CJK*环境之间的切换\CJKspace和\CJKnospace\CJKtilde 重新定义~的长度基本约定分组{......}注释符:%西文标点后要加空格各种环境的开始和结束命令最好独占一行换行:连续两个回车,一个仅为空格输入特殊字符前加\的有:#$%{}~_^&\=\textbackslash|,<,>=$|$,$<$,$>$,$*$(中间星)*=*上面星特殊符号\s \p \dag \ddag \copyrigh版权号,\pounds 磅\TeX \LaTeX \LaTeXe \AmS-\LaTeX(最后这个要amsmath宏包)单引号:`'(1键前面的)双引号:``"+------------------------------+|段落、行距、水平间距、缩进命令|+------------------------------+强制分行:\\或\\*[和下行间距离]、\newline建议分行:\linebreak[0-4,数越大建议力度越大]\linebreak增加字间距,强制换行\nolinebreak[n]建议不分行\mbox{内容}内容保持在同一行分段:\par,或两个回车分页:自动分页强制分页:\newpage建议分页:\pagebreak[n],\nopagebreak[n]增加当前页高度有时可以避免难看的分页\enlargethispage{尺寸}可增加的最大高度\enlargethispage*{尺寸}指定增加高度水平间距:\quad 插入空白相当于当前字体大小\qquad=\quad×2\ ,=\quad×3/18~=好象比\ 小\hspace{宽度大小},\hspace*{宽度大小}\hfill弹性长度:hspace{\hfill}插入空白,撑满整行\hphantom{文本内容},占据文本内容的宽度\vphantom[文本内容},\phantom{文本内容}导引线:\dotfill,\hrulefill垂直间距:\vspace{高度}和\vspace*{高度}\vfill:相当于\vspace{\fill}\smallskip:-->\vspace{\smallskipamount}\medskip:-->\vspace{\medskipamount}\bigskip:-->\vspace{\bigskipamount}段落首行缩进:\setlength{\parindent}{2em},2个M\setlength{\parindent}{0pt},首行不缩进\CJKindent:两个汉字\indent与\noindent每节的第一段首行不会自动缩进\hspane{\parindent}在导言区加入:\usepackage{indentfirst}段落间距:\lineskip+\parskip可用\setlength修改以上值行距:\baselineskip:相邻两行基线间距离\baselinestretch:伸展因子修改改变行距:\renewcommand{\baselinestretch}[1.2] 放在\begin{document}之后,字体尺寸改变时才生效+----------------------------------+|西文字体属性、及中文字体属性、命令|+----------------------------------+字体有5种属性族:\rmfamily:罗马字体\sffamily:无衬线字体\ttfamily:打字机字体形状:(shape)直立斜\upshape:直立\itshape:意大利斜体\slshape:斜体\scshape:小体大写系列:(series)宽度黑度\mdseries:中等权重(黑)\bfseries:粗体\normalfont:默认字体,中等权重直立罗马字体西文尺寸:10pt,11pt,12pt\em强调,一般为斜体以上命令称为声明(无参数)每一声明对应字体命令命令只对其参数中的文本起作用族:\testrm{},\testsf{},\testtt{}形状\textup{},\textit{},\textsl{},\textsc{}系列\textmd{},\textbf{}默认值:\textnormal{}强调:\emph{}定义了基本尺寸后,可使用下面的声明来改变字体\tiny 5pt\scriptsize 7pt\footnotesize 8pt\small 9pt\normalsize 10pt\large 12pt\Large 14.4pt\LARGE 17.28pt\huge 20.74pt\Huge 24.88pt以上尺寸是基本尺寸为10pt时的大小所有西文字体命令对中文同样起作用italic和slanted斜体对中文一样中文书籍基本字号为5号约等于11pt使用GBK编码时,可同时输入简繁体。
自定义字体大小\fontsize{字体尺寸}{行距}后面须加上\selectfont才生效可得到任意大小汉字,西文最大不能超\Huge行距通常为字体大小的1.2-1.5倍例:\fontsize{12pt}{\baselineskip}\selectfont\usepackage{type1cm}任意大小西文行距:\linespread{1.3}产生1.5倍行距,1.6产生双倍行距,效果夸张,不适合出版用下面方法:\setlength{\baselineskip}{1.5\baselineskip}{......}正文中更换字体:\CJKfamily{字体族}为方便,作以下自定义\newcommand*{\SONG}{\CJKfamily{song}}\newcommand*{\HEI}{\CJKfamily{hei}}\newcommand*{\KAI}{\CJKfamily{kai}}\newcommand*{\FS}{\CJKfamily{fs}}\newcommand*{\LI}{\CJKfamily{li}}\newcommand*{\YOU}{\CJKfamily{YOU}}引用更改为宋体:\SONG 正文文本居中文本默认为左对齐单行文本居中命令\centerline{....}多行使用\begin{center}环境居中声明:\centering(不建议使用)+------------+|参考文献环境|+------------+\begin{thebibliography}{编号样本}\bibitem[记号]{引用标志} 文献条目...\bibitem[记号]{引用标志} 文献条目\end{thebibliography}\bibitem[省略为方括号数字]{不可省由字母,数字和,号外符号组成,各个文献互不相同} 文献条目编号样本,指定记号的宽度,一般为数字引用文献时用\cite{引用标志1,引用标志2}调节各文献间距离\setlength{\itemsep}{高度}标题缺省为左对齐Reference(\Large\bfseries)由\refname值确定书籍参考文献标题由\bibname值确定文献条目包含:作者,标题,出版社,年代,版本,页码一行放不下,后面自动缩进,距离为“编号样本”宽度+----------+| 脚注 |+----------+\footnote{脚注内容}article文档,整篇同一编号book和report文档,每章统一编号+----------------+| 文档类别、章节 |+----------------+\documentclass[可选项]{article,book,report,letter,只能选一种}article 短篇文章report 长篇报告,可分章book (书)可含chapter,奇偶页采用不同处理可选项对整篇文档起作用,使用多个选项互不排斥,用逗号分隔基本字体:10pt,11pt,12pt纸张大小:letterpaper,a4paper,a5paper...排版方向:portrait(竖向),landscape(横向)标题页:titlepage,notitlepagefinal和draft指定纸张大小(只有latex2e中使用)letterpaper(11*8.5in)legalpaper(14*8.5in)executivepaper(10.5*7.25in)a4paper(29.7*21cm)a5paper(21*14.8cm)b5paper(25*17.6cm)默认值是letterpaper,美国信纸尺寸,纵向landscape 横向章节命令:\part,\chapter,\section,\subsection,\subsubsection,\paragraph,\subpar agraph\命令[短标题]{标题},用于显示在目录和页眉\命令*{标题}层次号:book中\part为-1(article中为0),\chapter为0,....book类\part,\chapter独立编号,只出现在奇数页,\part独占一页\section,\subsection 关联编号article类\part,\section独立编号\subsection,\subsubsection 关联编号星号章节不参加自动编号\part和\chapter标题占两行标题中文化\renewcommand{\partname}{}\renewcommand{\thepart}{第\,\Roman{part}}\,篇}修改编号最深层次\setcounter{secnumberdepth}{数}secnumberdepth,book类-2~5,缺省为2,-2时取消编号article类-1~5,缺省为3自动编号章节对应计数器part,chapter,section,bsection,subsubsection,paragraph,subparagraph 修改计数器值:\setcounter{计数器名}{数}TeX的版式首先是文件版式, 也就是我们接触的第一个最最最简单的TeX文档中的第一句:\documentstyle[选项1,选项2,...]{格式}其中的[]及选项是可选的, 而{格式}是必需的. LaTeX有以下几种格式: article(文章), report(报告), book(书), letter(信件).CCT对前面三种进行了汉化, 分别是carticle, creport和cbook.常用的选项有10pt/11pt/12pt: 定义基准字号, 缺省10pt.twoside: 两面印刷格式, 因奇偶页装订位置不同而异, 缺省为单页.twocolumn: 双栏排版, 缺省为单栏.titlepage: 仅在article格式使用, 它是\maketile产生一个单独的文章题目页, 同时abstract也产生单独页leqno: 使公式标号出现在左边, 缺省在右fleqn: 公式左对齐, 缺省中间对齐thesis: 专用于毕业论文排版IEEE: 专向IEEE类杂志投稿的格式IFTHEN: 排版计算机程序\columnsep 指定两栏间距\columnseprule 两栏间竖线宽度,默认为0。