首页 > 其他 > 详细

LaTeX学习笔记

时间:2017-02-10 23:19:21      阅读:305      评论:0      收藏:0      [点我收藏+]

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

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

然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeTeX,并点击编译。如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。

 

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

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

 

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

    \author{Dou zi}               

    \title{Welcome to LaTex World !}

\begin{document}

    \maketitle

    \section{Hello China} China is in East Asia.             %%大标题{} + 段落

        \subsection{Hello Beijing} Beijing is center 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}
4.加入目录
建立一个新文档,将以下内容复制进入文档中,保存

\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‘sanmen Square}is in the center of Beijing

                    \subparagraph{Hello Chairman Mao} is in the center of Tian‘sanmen Square

\end{document}

 

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

 

6.数学公式
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。

\documentclass{article}

    \usepackage{amsmath}

    \usepackage{amssymb}

\begin{document}

    The Netton‘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$

   

    Subscipt $a_b$

   

    Derivate $\frac{\partial y}{\partial t} $

   

    Vector $\vec{n}$

   

    Blod $\mathbf{n}$

   

    To time differential $\dot{F}$

   

\end{document}

 

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学习笔记

原文:http://www.cnblogs.com/douzujun/p/6388033.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!