Latex for Beginners学习笔记

最近开始使用latex,学习《Latex for Beginners》,记了一些笔记,在此分享一下。

第一章 介绍

第二章 文档结构

\documentclass[]{}  % 所有.tex以此开头,[]内为参数,{}内为类别
% ... 在此定义全局参数,引入包,如下:
\usepackage{color}
\title{My Title}
\author{My Name}
\data{\today}
\pagenumbering{roman}	%设置页码格式

\begin{document}  % 文档开始
\maketitle		% 显示title
\tableofcontents	% 显示目录

\section{}		% 章节
\subsection{}
\label{sec}		% 设备标签
\subsubsection{}
\paragraph{}
\section{}
refer to Section \ref{sec} on Page \pageref{sec} 	% 引用便签

\end{document} 结束文档,之后的内容被忽略

class

classusage
article适用于较短的文档,eg:journal articles and short reports
report使用于较长的文档,包含chapter
procconference proceedings
book暂不清楚
slides暂不清楚

第三章 排版文本

字体

\textit{words in italics} 
\textsl{words slanted} 
\textsc{words in smallcaps}
\textbf{words in bold} 
\texttt{words in teletype} 
\textsf{sans serif words} 
\textrm{roman words} 
\underline{underlined words} 

颜色

\usepackage{color} % 此命令应在\begin{document}之前
\color{color_name}text %color_name 可以是red、green、blue、cyan、yellow、magenta、white

字体大小

{\tiny tiny words}
{\scriptsize scriptsize words} 
{\footnotesize footnotesize words} 
{\small small words} 
{\normalsize normalsize words} 
{\large large words} 
{\Large Large words} 
{\LARGE LARGE words} 
{\huge huge words} 

列表list

有两种,有序和无序。

有序enumerate

\begin{enumerate}
\item One
\item Two
\end{enumerate}

无序itemize

\begin{itemize}
\item[] item	%[]中填符号,默认为黑点
\item[] item
\end{itemize}

字符

字符表示方式
#\#
$\$
%\%
^\^{} 注意要加{},否则默认为紧跟的字符
&\&
_\_
{\{
}\}
~\~{} 注意要加{},否则默认为紧跟的字符
\\textbackslash,注意不是\\

注:

  • 多个空格或换行,视为一个空格或换行
  • \\ 表示换行
  • 空行表示下一段

第四章 表格

\begin{tabular}{|l|r|c|}	% |代表竖线,l代表左对齐,r代表右对齐,c代表居中
name & age & gender \\ 		% &代表分列,\\代表换行
\hline						% 水平线
Francis & 10 & male \\
\cline{1-2}					% 水平线,从第一列到第二列
Alice & 11 & female \\
\end{tabular}

第五章 图

\usepackage{graphicx}	% 此命令应在\begin{document}之前
\begin{figure}[]		%[]内填h(此处)、t(页顶)、b(页底)、p(独立一页),加!表示强制
\centering				% 居中,默认左对齐
\includegraphics[width=1\textwidth]{my_figure}	% 宽度为1倍文本宽度,1可以改为其他参数,my_figure为图名,包含路径和后缀
\caption{My Title}	%图片标题
\label{My Label}
\end{figure}

第六章 公式

格式

$1+1=2$			% 行内公式
$$1+1=2$$		% 行间公式 
\begin{equation} 1+1=2 \end{equation}	% 带序号的行间公式
\begin{eqnarray}	% 带序号多行公式
a & = & b+c\\
  & = & d+e
\end{eqnarray}

若equation、eqnarray写为equation*、eqnarray*,则不带序号

分数

\frac{分子}{分母}

希腊字母

第七章 参考文献

暂不涉及。

更多高级用法,请参照http://en.wikibooks.org/wiki/LaTeX/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值