zoukankan      html  css  js  c++  java
  • LATEX使用总结

    LATEX使用总结

    1 文档基本结构

    \document{article}%book, report, letter 主要表明文档的性质,采用哪种模板

    \usepackage{} %引用宏包amsmath

    导言部分

    \begin{document} %中间开始正文部分

     

    \title{} %文章的标题

    \author{} %作者

    \date{} %删除自动创建的日期

    \maketitle %生成封面

     

    \tableofcontents %生成目录

     

    %篇章结构

    \part{} %part I

    \charpter{} %1 xxx

    \section{} %1.1 xxx

    \subsection{} %1.1.1 xxx

     

     

    \end{document}

     

    1.1 常用命令

    \mainmatter 控制页码的起始页

    正文以一个空行进行分段

    2 列表和表格

    2.1 表格

    2.1.1 tabular环境

    \begin{tabular}{|c|l|r|}%对齐方式 "|"表格的竖线

    \hline %表格的横线

    11&11&11\\

    \hline

    11&11&11\\

    \hline

    \end{tabular}

    问题,没有表头等附加信息

    2.1.2 table环境

    \begin{table} %表格

    \centering %居中操作

    \begin{tabular}{|c|l|r|}%对齐方式

    \hline

    11&11&11\\

    \hline

    11&11&11\\

    \hline

    \end{tabular}

    \caption{this is my first table}

    \end{table}

    2.1.3 table中的操作

    \multicolum{个数}{对齐}{内容} %合并行

    \multirow %合并列

    \cline{单元格区间}%部分元素加下划线

    2.1.3 longtable环境

    长表格环境

    2.2 列表

    2.2.1 itemsize环境

    点型列表

    •  
    •  

    \begin{itemize}

    \item this is 1

    \begin{itemize}

    \item sub 1%嵌套

    \item sub 2

    \end{itemize}

    \item this is 2

    \item this is 3

    \end{itemize}

    2.2.2 enumerate环境

    数字列表

    1.  
    2.  

    \begin{enumerate}[\bfseries A.] %以粗体大写字母为序号,需要导入enumerate宏包

    \setcounter{enumi}{4} %符号开头, 计数器

    \item item 1

    \begin{enumerate}[\sffamily a.] %选择小写字母

    \item sub 1

    \item sub 2

    \item sub 3

    \end{enumerate}

    \item item 2

    \item item 3

    \end{enumerate}

    3 插入公式

    3.1 基本方式

    \[ \]行间公式

    $ $行内公式

    缺点:无法自动标号

    3.2 equation环境

    可以对行间公式进行自动编号。

    通过在导言去使用命令

    \numberwithin{equation}{section}来细分标号的层次

    3.2.1 常用公式

    \sum^5{i=1}i^2     

    \prod                                    

    {\rm abcd}^a_b                            

    \mathop{\rm abcd}^a_b                        

    \lim_{n\to\infty}\left(1+\frac{1}{n}\right)^n=e    

    \left.\frac{\partial{y}}{\partial{x}}\right|^{y_1=4}_{y_2=4}    

    3.3 矩阵

    3.3.1 array环境

    \left[\begin{array}{ccc} %\left和\right保证括号,对齐方式

    11&11&11\\

    11&11&11\\

    11&11&11

    \end{array}\right]

    类似的环境:

    \bmatrix \Bmatrix

    \pmatrix

    \vmatrix \Vmatrix

    3.3.2 虚线

    使用arydshln宏包

    \hdashline[]横的虚线

     

  • 相关阅读:
    0593. Valid Square (M)
    0832. Flipping an Image (E)
    1026. Maximum Difference Between Node and Ancestor (M)
    0563. Binary Tree Tilt (E)
    0445. Add Two Numbers II (M)
    1283. Find the Smallest Divisor Given a Threshold (M)
    C Primer Plus note9
    C Primer Plus note8
    C Primer Plus note7
    C Primer Plus note6
  • 原文地址:https://www.cnblogs.com/zjgtan/p/2893013.html
Copyright © 2011-2022 走看看