QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 4063|回复: 0
打印 上一主题 下一主题

【美赛加分项】 latex教程,大家看过来~~

[复制链接]

2802

主题

160

听众

8904

积分

自我介绍
即使不开心也不要皱眉,因为你永远不知道有谁会爱上你的微笑!

社区QQ达人 发帖功臣 新人进步奖 最具活力勋章

群组数学中国试看培训视频

群组2017美赛两天强训

群组2015司守奎matlab培训

群组2016国赛优秀论文解析

群组国赛护航思路养成班

跳转到指定楼层
1#
发表于 2016-12-27 16:52 |只看该作者 |倒序浏览

比赛期间,越来越多的同学意识到在写论文时latex的强大,在之前发的帖子(latex安装包)的下载量可以看出,大家对latex的青睐,最后祝大家美赛取得好成绩!!




latex相对于word的优势:


1.最大的优势就是排出的公式非常漂亮。另外行内公式不会出现word那样超大行距,怎么也对不齐的情况。公式可以自动排号。
2.大家插入表格或者图片的时候是否有过表格乱飞的苦恼呢?在latex里你根本不用担心你的表格或者图该放在哪里,因为latex会自动帮你排好。
3.关于文献的引用,word可以和Endnotes无缝连接,而latex可以与Jabref无缝连接。但是后者的好处就是完全免费。


1.LaTeX软件的安装和使用  

方法A(自助):在MikTeX的官网下载免费的MikTeX编译包(150Mb)并安装。下载WinEdt(9.5Mb)(收费)或TexMaker(32Mb)(免费)等编辑界面软件并安装。  
方法B(打包):在ctex.org下载ctex套装(203Mb或1.3Gb)(含MikTeX及WinEdt)
新人不必纠结软件问题,随便什么软件随便什么版本只要下载下来能编译出pdf来就可以,先下载了装上来试试再说。在真正开始跑步之前没有必要纠结该买NIKE跑鞋还是ADI跑鞋,跑起来再说。不要瞻前顾后,just try it.

2.第一个文档  
打开WinEdt,建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8。  

\documentclass{article}  
\begin{document}    hello, world  \end{document}\begin{document}    hello, world  \end{document}

  

然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeLaTeX,并点击编译。 (这里请注意一下我之前一直笔误写的XeTeX,给大家带来困扰深感歉意)  
如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。

3.标题、作者和注释
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。  

\documentclass{article}    \author{My Name}    \title{The Title}  
\begin{document}    \maketitle   
  hello, world % This is comment  \end{document}\begin{document}    \maketitle     hello, world % This is comment  \end{document}


%为本行右边所有内容被注释掉,在生成的pdf中不会显示。
块注释也有专门的语句,不过更方便的方式是选中一块区域点鼠标右键,点comment  

4.章节和段落
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。  

\documentclass{article}    \title{Hello World}  \begin{document}    \maketitle  
  本帖隐藏的内容\section{Hello China} China is in East Asia.  <br />    \subsection{Hello Beijing} Beijing is the capital of China.        \subsubsection{Hello Dongcheng District}  <br />        \paragraph{Tian'anmen Square}is in the center of Beijing  <br />          \subparagraph{Chairman Mao} is in the center of Tian'anmen Square  <br />      \subsection{Hello Guangzhou}  <br />        \paragraph{Sun Yat-sen University} is the best university in Guangzhou.  <br />\end{document}

【回帖可见】

退格只是我个人偏好,看起来层次清晰美观。实际操作上未必要如此,每一行之前的空格不影响编译生成PDF的排版结果。  

5.加入目录  
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为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}  <br />        \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}



6.换行  
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为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}\begin{document}    Beijing is    the capital    of China.      New York is      the capital      of America.      Amsterdam is \\ the capital \\    of Netherlands.  \end{document}


空一行为另起一段,\\为段内强制换行。  

7.数学公式  
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为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=maF=ma

  

  The Newton's second law is   
F=maF=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)   
[a1d444b22e555555c333f6][a1b22c333d444e555555f6]

  

Equations(here \& is the symbol for aligning different rows)  
a+bd=c=e+f+ga+b=cd=e+f+g

  

{a+b=cd=e+f+g{a+b=cd=e+f+g

  

\end{document}


具体细节可以自行搜索LaTeX的数学符号表或别人给的例子。

$...$是开启行内数学模式,用于和文本合在一起使用。
......

......

是另起一行居中开启数学模式


有一些网站可以通过画图的方式来生成公式,有的编辑器集成了各种数学功能按钮。这对于公式需求少的人来说很方便,具体信息可以自己去搜索。但是如果你的文章中要出现大段的证明过程,就会发觉还是老老实实地google一篇latex数学符号表,然后不懂的去查代码,自己用手指敲来得干脆利索。再进阶一点,可以去搜一下有关LaTeX的自定义command的内容去看一下,在敲公式时能省很多力气。

8.插入图片  
将待插入的图片姑且先命名为figure1.jpg  
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,放在和图片文件同一个文件夹里,编译并观察现象。  

\documentclass{article}    \usepackage{graphicx}  
\begin{document}   
  \includegraphics[width=4.00in,height=3.00in]{figure1.jpg}  \end{document}\begin{document}     \includegraphics[width=4.00in,height=3.00in]{figure1.jpg}  \end{document}



在老版本的LaTeX中是只支持eps图片格式的,现在的LaTeX对jpg、bmp、png等等常见图片都可以支持。

9.简单表格  
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察对比现象。  

\documentclass{article}  \begin{document}  
本帖隐藏的内容
\begin{tabular}{|c|c|} <br />aaa & b \\      c & ddddd\\    \end{tabular}\begin{tabular}{|c|c|} <br />aaa & b \\      c & ddddd\\    \end{tabular}

  <br /><br />  
\begin{tabular}{|l|r|}      \hline  <br />    aaaa & b \\      \hline  <br />    c & ddddd\\      \hline  <br />  \end{tabular}\begin{tabular}{|l|r|}      \hline  <br />    aaaa & b \\      \hline  <br />    c & ddddd\\      \hline  <br />  \end{tabular}

  <br /><br />  
\begin{center}  <br />    \begin{tabular}{|c|c|}        \hline  <br />      a & b \\ \hline        c & d\\        \hline  <br />    \end{tabular}    \end{center}\begin{center}  <br />    \begin{tabular}{|c|c|}        \hline  <br />      a & b \\ \hline        c & d\\        \hline  <br />    \end{tabular}    \end{center}

  \end{document}


注意观察有无\hline和有无\begin{center}的区别。注意观察\begin{tabular}后的lcr的区别,分别是left对齐,center对齐和right对齐。  

10.结尾  
到目前为止,你已经可以用LaTeX自带的article模板来书写一篇基本的论文框架了,至少你已经能够借助搜索然后复制粘贴这些命令例子来开始用LaTeX编辑了。  
在论文从框架到完整的过程中,必然还存在许多的细节问题,比如字体字号,比如图片拼合,比如复杂的表格等等。  
通常来说,作为初学者会提出的问题,早就已经有许多的先辈们在网络上提过同样的问题了,看看别人的回答就可以。


转播转播0 分享淘帖0 分享分享0 收藏收藏1 支持支持0 反对反对0 微信微信
qq
收缩
  • 电话咨询

  • 04714969085

关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

手机版|Archiver| |繁體中文 手机客户端  

蒙公网安备 15010502000194号

Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

GMT+8, 2025-7-25 11:55 , Processed in 0.383395 second(s), 42 queries .

回顶部