LaTex入门(一)

来源:互联网 发布:淘宝联盟个人可以买吗 编辑:程序博客网 时间:2024/05/22 23:59

LaTex入门参考书为《ltxprimer-1.0》。这本书为英文著作。我根据里面的内容把自己认为的一些入门需要的只是提取出来。一是为了以后可以让自己在需要的时候翻看;二是可以提供一些入门的资料。
第一节的主要内容介绍LaTex的基本字体和排版等等内容。所有的内容都以LaTex代码的形式来展示,并且每个语法介绍都给出了相应的例子来运行。有兴趣的可以复制代码自己编译看看效果。

\documentclass{article}\usepackage{xeCJK}\begin{document}  %\noindent取消每行缩进  %\emph将{}内的文字以意大利斜体展示  %\LaTeX展示特有的latex符号  %\today 显示当前年月日  \noindent This is my \emph{first} document prepared in \LaTeX. I typed it \today  %单词必须以空格来间隔,无论多少个空格都一样,且可以接受任意一行以内换行  We have seen that to typeset something in \LaTeX, we type in the text to be typeset together with some \LaTeX commands. Words must be separated by spaces(does not matter how many) and lines maybe broken arbitrary.  %新段以和上一段间隔一个空行来达成  The end of a paragraph is specified by a \emph{blank line} in the input. In other words, whenever you want to start a new paragraph, just leave a blank line and proceed.  Carrots are good for your eyes, since they contain Vitamin A. Have you ever seen a rabbit wearing glasses?  Carrots are good for your eyes, since they contain Vitamin A\@. Have you ever seen a rabbit wearing glasses?  %取消.符号后面的空格可以在.后面加一个\  The number 1, 2, 3, etc.\ are called natural numbers. According to Kronecker, they were made by God; all else being the works of Man.  The number 1, 2, 3, etc. are called natural numbers. According to Kronecker, they were made by God; all else being the works of Man.  %、符号代表左引号,'符号代表右引号, 双引号则double引号  Note the difference in right and left quotes in `single quotes' and ``double quotes''.  %单横线代表连接符,双横线代表数值范围, 三横线代表破折号(用来附注)  X-rays are discussed in pages 221--225 of Volume 3---the volume on electromagnetic waves.  %\符号用\textbackslash  it needs to use \begin{verbatim} \textbackslash \end{verbatim} to express \textbackslash.  %文本位置的排版, \\可以实现换行  %center: 文本居中  %flushright: 右对齐  %flushleft: 左对齐  \begin{center}    the \TeX nical Institute\\[.75cm]    Certificate  \end{center}  \noindent This is to certify that Mr. N. O. Vice has undergone a course at this institute and is qualified to be a \TeX nician.  \begin{flushright}    the Director\\    The \TeX nical Institue  \end{flushright}  %字体用法: style{family, series, shape}  %默认字体: roman family, medium series, upright shape。下列语法属于Command语法  %Family:  % \textrm{...}: roman  % \textsf{...}: sans serif  % \texttt{...}: typewriter  %Series:  % \textmd{...}: medium  % \textbf{...}: boldface  %Shape:  % \textup{...}: upright  % \textit{...}: italic  % \textsl{...}: slanted  % \textsc{...}: small cap  %可以选择先声明 family, 再声明 series 或者 shape  \textsf{\textbf{sans serif family, boldface series, upright shape}}  \textrm{\textsl{roman family, medium series, slanted shape}}  %\emph{}: 在正常一般的字体显示的时候emph显示出来的效果就是意大利斜体, 但是在\textit{}当中使用的时候就会使字体恢复成正常的直立字体  \textit{A polygon of three sides is called a \emph{triangle} and a polygon of four sides is called a \emph{quadrilateral}}  %如果想要用Declaration语法改变局部的字体,则需要使用来用花括号把需要改变的文字包括起来了。否则就会到接下来所有的文字的字体都变成局部文字的字体。所以本人觉得最好还是用COMMAND语法。  %Family:  % {\rmfamily ...}: roman family  % {\sffamily ...}: sans serif family  % {\ttfamily ...}: typewriter family  %Series:  % {\mdseries ...}: medium  % {\bfseries ...}: boldface  %Shape:  % {\upshape ...}: upright  % {\itshape ...}: italic  % {\slshape ...}: slanted  % {\scshape ...}: small cap  By a {\bfseries triangle}, we mean a polygon of three sides.  %Type Size: 采用Declaration语法,需要花括号圈起来。下列的字体大小从小到大进行排列。同时可以和其他属性进行搭配。  %{\tiny ...}  %{\scriptsize ...}  %{\footnotesize ...}  %{\small ...}  %{\normalsize ...}  %{\large ...}  %{\Large ...}  %{\LARGE ...}  %{\huge ...}  %{\Huge ...}  \begin{center}    {\bfseries\huge The \TeX nical Institue}\\[1cm]    {\scshape\LARGE CERTIFICATE}  \end{center}  \noindent This is no certify that Mr. N. O. Vice has undergone a course at this institute and is qualified to be a \TeX nical Expert.  \begin{flushright}    {\sffamily The Director\\    The \TeX nical Institute}  \end{flushright}\end{document} 
原创粉丝点击