LaTeX学习1

使用WinEdt作为编辑latex文本的工具
1.LaTeX的基本语句

\documentclass{book}
\usepackage{amsmath} %使用宏包
\begin{document}
\title{this is my book}
\author{zhenjiang-xzy}
\date{} %用于日期的显示
\maketitle %标题输出结束
\end{document}

2.生成目录、标题等

\documentclass{book}
\usepackage{amsmath}
\begin{document}
\title{this is my book}
\author{xiao zeyu}
\date{}
\maketitle

\tableofcontents
%%生成目录
\mainmatter
%%将正文变为第一页
\part{now}
\chapter{introduction}
    \section{first section}
        \subsection{i love latex}
\chapter{conclusion}
\chapter{summary}

\part{advance}
\chapter{introduction}
\chapter{conclusion}
\chapter{summary}

\end{document}

生成如下图的PDF文件
这里写图片描述
这里写图片描述

3.表格图片等插入操作
3.1 list item的操作

\documentclass{article}

%\usepackage{enumerate}
%\usepackage{lengtable}
\begin{document}

\begin{itemize}
  \item this is item1
  \begin{itemize}
    \item this is subtitle1
    \item this is subtitle2
    \begin{itemize}
      \item this is subsubtitle1
      \item this is subsubtitle2
      \item this is subsubtitle3
      \begin{itemize}
        \item 11
        \item 22
        \item 33
      \end{itemize}
    \end{itemize}
  \end{itemize}
  \item this is item2
  \item this is item3
\end{itemize}


\end{document}

这里写图片描述
3.2enumerate的使用

\begin{enumerate}[*\bfseries* A.]%%前导符是大写ABC...+粗体显示
    \item this is subtitle1
    \begin{enumerate}[a.]%小写abc...
      \item this is subsubtitle1
      \item this is subsubtitle2
    \end{enumerate}
    \item this is subtitle2
    \item this is subtitle3
\end{enumerate}

使用setcounter将序列号任意改变

\begin{enumerate}[\bfseries A]%%前导符是大写ABC...+
 \setcounter{enumi}{4}
    \item this is subtitle1
    \begin{enumerate}[\sffamily a.]
      \item this is subsubtitle1
      \item this is subsubtitle2
    \end{enumerate}
    \item this is subtitle2
    \item this is subtitle3
\end{enumerate}

这里写图片描述
3.3表格环境使用
用tabular做出表格(其中:c表示居中对齐,l为左对齐,r为右对齐)

\begin{tabular}{clr}
        221555555555555 & 11112555555 & 44443555555555\\
        34343 & 6666 &09099
\end{tabular}

效果图如下显示:
这里写图片描述

在对齐方式之间加上竖线“|”可以做出竖线边框,加入\hline可以获得横线边框。
代码如下:

\begin{tabular}{c|l|r}
\hline
221555555555555 & 11112555555 & 44443555555555\\
\hline
34343 & 6666 & 09099\\  %%注意反斜杠
\hline
\end{tabular}

这里写图片描述
用\eject使得文字另起一页
用table给表格自动标号
一般用三线表


\begin{table}
  \centering
    \begin{tabular}{ccccccccc}
\hline
area& date& start& max& min& deal& close& money& amount\\
\hline
beijing & 2013/11/28 & 51.25 & 51.25 & 51.25 & 51.25 & 51.25 & 41000 & 800\\
beijing & 2013/11/29 & 51.25 & 51.25 & 51.25 & 51.25 & 51.25 & 0 & 0\\
beijing & 2013/11/30 & 51.25 & 51.25 & 51.25 & 51.25 & 51.25 & 0 & 0\\
beijing & 2013/12/1 & 51.25 & 51.25 & 51.25 & 51.25 & 51.25 & 0 & 0\\
\hline
\end{tabular}
  \caption{this is my first table}
\end{table}

这里写图片描述

使用multicolumn将单元格中的元素合并(比如我将第一行的beijing 和 date进行合并)
multicolumn有三个参数:
a.需要合并的单元格数量
b.合并单元格的对齐方式
c.合并单元格具体的内容

\eject
\begin{table}
  \centering
    \begin{tabular}{ccccccccc}
\hline
area& date& start& max& min& deal& close& money& amount\\
\hline
\multicolumn{2}{c}{beijing 2013/11/28} & 51.25 & 51.25 & 51.25 & 51.25 & 51.25 & 41000 & 800\\%注意multicolumn的写法
beijing & 2013/11/29 & 51.25 & 51.25 & 51.25 & 51.25 & 51.25 & 0 & 0\\
beijing & 2013/11/30 & 51.25 & 51.25 & 51.25 & 51.25 & 51.25 & 0 & 0\\
beijing & 2013/12/1 & 51.25 & 51.25 & 51.25 & 51.25 & 51.25 & 0 & 0\\
\hline
\end{tabular}
  \caption{this is my first table}
\end{table}

这里写图片描述
在某些单元格下方加上横线,使用\cline{3-4} 【表示在第三第四个单元格下面加入下划线】

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值