码迷,mamicode.com
首页 > 其他好文 > 详细

LATEX教程(一)

时间:2018-01-20 00:24:16      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:pac   ack   author   建立   different   一个   nts   符号   向量   

第一个文档

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

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

标题、作者和注释

\documentclass{article}

\usepackage{Ctex}

\author{yif}

\title{我是标题}

\begin{document}

\maketitle

我是yif % This is comment

\end{document}

章节和段落

\documentclass{article}
\usepackage{Ctex} 
      \title{我是标题}
    \author{yif} 
\begin{document} 
  \maketitle 
  \section{Hello China} 
    China is in East Asia.
    \subsection{Hello Beijing} 
    Beijing is the capital of China.
      \subsubsection{Hello Dongcheng District} 
        \paragraph{Tiananmen Square}is in the center of Beijing %段落
          \subparagraph{Chairman Mao} is in the center of Tiananmen Square 
      \subsection{Hello Guangzhou} 
        \paragraph{Sun Yat-sen University} is the best university in Guangzhou. 
\end{document}

加入目录

\documentclass{article} 
\usepackage{Ctex}
\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 Tiananmen Square}is in the center of Beijing 
           \subparagraph{Hello Chairman Mao} is in the center of Tiananmen Square 
\end{document}

换行




\documentclass{article} 
\usepackage{Ctex}
\title{我的标题}
\author{yif}
    \begin{document} 
\maketitle 
   Beijing is 
   the capital 
   of China. 

  Washington is 

   the capital 

   of America. 

   Amsterdam is \\ the capital \\ 
   of the Netherlands. 
    \end{document}

换一行不会显示换行,进行换两行在显示时才显示换一行。

双斜杠换行

数学公式

\documentclass{article} 
       \usepackage{amsmath} 
       \usepackage{amssymb}
    \usepackage{Ctex}
    \title{我的标题}
    \author{yif} 
\begin{document} 
\maketitle
   The Newtons second law is F=ma. 

   The Newtons second law is $F=ma$. %用美元修饰数学公式

   The Newtons second law is 
  
F=ma


   The Newtons second law is 
  
F=ma


   Greek Letters $\eta$ and $\mu$ %用数学符号

   Fraction $\frac{a}{b}$ %表示分数

   Power $a^b$ %表示指数

   Subscript $a_b$ %b是a的下标

   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教程(一)

标签:pac   ack   author   建立   different   一个   nts   符号   向量   

原文地址:https://www.cnblogs.com/yifdu25/p/8319319.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!