CTex和Texmaker的下载方法就不必细谈了,在官方网站上有。主要是CTex建议选择完全版。由于CTex自带的WinEdit是收费软件,不符合自由软件之精神,另外的Texworks又过于简陋,因此采取CTex+Texmaker的方案。
CTex和Texmaker的安装都很傻瓜,注意,CTex在安装的时候不要勾选WinEdit。
CTex安装会自动配置好路径,无需用户自己设置。因此,关键在于Texmaker的设置。打开Texmaker,执行:选项->配置Texmaker,更改相应路径如下:(我的CTex安装到了D盘的Program Files里的CTEX文件夹下,具体安装路径需根据情况自行更改)
其中的pdf一栏需要填写自己的pdf浏览器的位置。
可以用下面的简单代码试一下效果(使用xelatex编译)
\documentclass[UTF8]{ctexart} \begin{document} \section{文字} 测试部分! \section{数学} \[ a ^2+ b^2=c^2 \] 这是数学公式! \end{document}
打开WinEdt,建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8。
\documentclass{article} \begin{document} hello, world \end{document}
然后在texmaker的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeTeX,并点击编译。
如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。
\documentclass{article} \author{My Name} \{The } \begin{document} \make hello, world % This is comment \end{document}
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。
\documentclass{article} \{Hello World} \begin{document} \make \section{Hello China} China is in East Asia. \subsection{Hello Beijing} Beijing is the capital of China. \subsubsection{Hello Dongcheng District} \paragraph{Tian'anmen Square}is in the center of Beijing \subparagraph{Chairman Mao} is in the center of Tian'anmen Square \subsection{Hello Guangzhou} \paragraph{Sun Yat-sen University} is the best university in Guangzhou. \end{document}
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。
\documentclass{article} \begin{document} \tableofcontents \section{Hello China} China is in East Asia. \subsection{Hello Beijing} Beijing is the capital of China. \subsubsection{Hello Dongcheng District} \paragraph{Hello Tian'anmen Square}is in the center of Beijing \subparagraph{Hello Chairman Mao} is in the center of Tian'anmen Square \end{document}
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。
\documentclass{article} \begin{document} Beijing is the capital of China. New York is the capital of America. Amsterdam is \\ the capital \\ of Netherlands. \end{document}
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。
\documentclass{article} \usepackage{amsmath} \usepackage{amssymb} \begin{document} The Newton's second law is F=ma. The Newton's second law is $F=ma$. The Newton's second law is $$F=ma$$ The Newton's second law is \[F=ma\] Greek Letters $\eta$ and $\mu$ Fraction $\frac{a}{b}$ Power $a^b$ Subscript $a_b$ Derivate $\frac{\partial y}{\partial t} $ Vector $\vec{n}$ Bold $\mathbf{n}$ To time differential $\dot{F}$ Matrix (lcr here means left, center or right for each column) \[ \left[ \begin{array}{lcr} a1 & b22 & c333 \\ d444 & e555555 & f6 \end{array} \right] \] Equations(here \& is the symbol for aligning different rows) \begin{align} a+b&=c\\ d&=e+f+g \end{align} \[ \left\{ \begin{aligned} &a+b=c\\ &d=e+f+g \end{aligned} \right. \] \end{document}
具体细节可以自行搜索LaTeX的数学符号表或别人给的例子。
先搜索到一个将图片转成eps文件的软件,很容易找的,然后将图片保存为一个名字如figure1.eps。
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,放在和图片文件同一个文件夹里,编译并观察现象。
\documentclass{article} \usepackage{graphicx} \begin{document} \includegraphics[width=4.00in,height=3.00in]{figure1.eps} \end{document}
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。
\documentclass{article} \begin{document} \begin{tabular}{|c|c|} a & b \\ c & d\\ \end{tabular} \begin{tabular}{|c|c|} \hline a & b \\ \hline c & d\\ \hline \end{tabular} \begin{center} \begin{tabular}{|c|c|} \hline a & b \\ \hline c & d\\ \hline \end{tabular} \end{center} \end{document}
有关我认为不是新手急需,但是的确比较有用的信息
曾经的LaTeX的中文支持是比较麻烦的一件事,但是现在使用MikTeX+WinEdt的中文支持非常容易。
只需要把开头的\documentclass{article}换成\documentclass{ctexart}就可以了。
如果是第一次使用ctexart的话,会自动下载和安装宏包和模板,之后就不会再下载了。
例子参考如下:
打开WinEdt,建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8。
\documentclass{ctexart} \begin{document} 你好,世界 \end{document}
\package{}就是在调用宏包,对计算机实在外行的同学姑且可以理解为工具箱。
每一个宏包里都定义了一些专门的命令,通过这些命令可以实现对于一类对象(如数学公式等)的统一排版(如字号字形),或用来实现一些功能(如插入图片或制作复杂表格)。
通常在\documentclass之后,在\begin{document}之前,将文章所需要涉及的宏包都罗列上。
对于新人而言比较常用的宏包有
差不多了,对于新人来说,这五个宏包已经基本够用了。如果有其他的特殊需求,就通过google去寻找吧。
补充说明一下,现在ctexart模板里集成了中文支持,所以CJK宏包并不是必需品。
模板就是在\documentclass{}后面的大括号里的内容。
在这一份教程中,我们使用的是LaTeX默认自带的模板article,以及中文模板ctexart。
模板就是实现我之前所介绍的LaTeX的经验总结的第二点的实现方式。
一篇文章,我们定义了section,定义了paragraph,就是没有定义字体字号,因为字体字号这一部分通常来说是在模板中实现的。
一个模板可以规定,section这个层级都用什么字体什么字号怎么对齐,subsection这个层级用什么字体什么字号怎么对齐,paragraph又用什么字体什么字号怎么对齐。
当然模板里还可以包含一些自定义的口令,以及页眉页脚页边距一类的页面设置。
由于模板的使用,在我的使用经验里来看,绝对不可能算是基本入门级的内容,所以在正文里当然不会提及。
如果有人实在想学,如果LaTeX已经接触到这个程度上了,那么再去翻其他厚一些的教材,也不亏了。
做参考文献的时候,文章也已经快写到尾声了,而幻灯片更不是进阶一些的需求。对这两个功能有需求的LaTeX user,使用LaTeX也已经相当熟练了,自己去google一下或查阅其他厚教程是很理所当然的,一点也不冤枉。
在此我就只提供两个搜索关键词,参考文献可以搜bibtex,制作幻灯片可以搜beamer。