CTex基础笔记
1 什么是CTex?
电子排版系统
2 CTex使用前涉及的文件
- .bib文件:相当于一个参考文献的数据库。
- .cls文件:为LaTeX2e的格式文件,决定了LaTeX2e源文件的排版布局。
- .tex文件:基于宏的流行的文本格式,后期论文的编辑就是在.tex文件。
3 文档的基本结构
- \documentclass{*} ,表示文章的排版模式,*中的内容可以是book、report、letter、article。
- \usepackage{*},表示使用相关的宏包, 宏包就相当于c语言中所说的头文件。
- 文章的正文部分以 \begin{document} 开始,以 \end{document} 结束。其中, \begin{document}之前的部分被称为导言区。
- 在CTex的正文部分,段与段之前要空一行,即段与段之前以空行为分段标志。
- 在CTex中输出特殊符号 % $ {} \的方式
- %: /%
- $: /$
- {}: /{/}
- \: $\backslash$
- \eject 表示另起一页。
- 使用book模式的实践例子
\documentclass{book}
\usepackage{amsmath}
\begin{document}
\title{This is my book}
\author{Li}
\date{}
\maketitle
\tableofcontents
\mainmatter
\part{elementary}
\chapter{introduction}
\section{first section}
\subsection{I like book}
\chapter{balabala}
\chapter{summary}
The quick brown fox jumps over the lazy dog.
\part{advanced}
\chapter{intro}
\chapter{conclusion}
The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.The quick brown fox jumps over the lazy dog.
\end{document}
- \title{*} 表示该book的标题,\author{*} 为作者。
- 在book模式下会自动在标题页生成该book的编写日期,如果想要 取消自动生成的日期 ,只需在作者下面一行加上 \date{} 即可。
- **\maketitle **表示标题页结束。
- \tableofcontents 表示自动生成book目录。
- \mainmatter 是book的正文部分开始的标志。
4 LaTex替换
- \newcommand{}{} 该命令相当于c中的宏替换,个人创建的命令不能与latex下的命令有冲突。
例:\newcommand{\fc}{\frac}即将所有的\fc当作\frac。
5 LaTex列表与表格环境
5.1 列表环境
5.1.1 itemize环境
\begin{itemize}
\item this is itme1.
\begin{itemize}%嵌套item
\item this is sub-item1.
\item this is sub-item2.
\end{itemize}
\item this is itme2.
\item this is itme3.
\end{itemize}
效果:
5.1.2 enumerate环境
\begin{enumerate}
\item this is itme1.
\begin{enumerate}%嵌套item
\item this is sub-item1.
\item this is sub-item2.
\end{enumerate}
\item this is itme2.
\item this is itme3.
\end{enumerate}
效果:
- 如何修改enumerate列表的序号编号方式?<