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

LaTex基础

时间:2014-09-10 22:23:22      阅读:431      评论:0      收藏:0      [点我收藏+]

标签:des   io   os   ar   for   art   div   cti   sp   

网上搜到的名为《LaTex新人教程,30分钟从完全陌生到基本入门》,实践了一下。

安装CTEX后,打开WinEdt进行编辑,保存时选UTF-8,编译时选XeLaTex。

1,基本

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

bubuko.com,布布扣

2,标题、作者和注释

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

bubuko.com,布布扣

3,章节和段落

\documentclass{article}
  \title{Hello World}
\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{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}
bubuko.com,布布扣

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‘anmen Square}is in the center of Beijing
          \subparagraph{Hello Chairman Mao} is in the center of Tian‘anmen Square
\end{document}

bubuko.com,布布扣

5,换行

\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}
bubuko.com,布布扣

6,数学公式

\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}
bubuko.com,布布扣

7,插入图片

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

8,简单表格

\documentclass{article}
\begin{document}
  \begin{tabular}{|c|c|}
    aaa & b \\
    c & ddddd\\
  \end{tabular}

  \begin{tabular}{|l|r|}
    \hline
    aaaa & b \\
    \hline
    c & ddddd\\
    \hline
  \end{tabular}

  \begin{center}
    \begin{tabular}{|c|c|}
      \hline
      a & b \\ \hline
      c & d\\
      \hline
    \end{tabular}
  \end{center}
\end{document}
bubuko.com,布布扣

9,中文支持

\documentclass[UTF8]{ctexart}
\begin{document}
你好,世界
\end{document}
bubuko.com,布布扣

LaTex基础

标签:des   io   os   ar   for   art   div   cti   sp   

原文地址:http://www.cnblogs.com/liulenju/p/3965171.html

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