LaTeX新人教程,30分钟从完全陌生到基本入门

参考文章:LaTeX新人教程,30分钟从完全陌生到基本入门

0. 宏包

  • 编辑数学公式的宏包:\usepackage{amsmath}和 \usepackage{amssymb}
  • 编辑数学定理和证明过程的宏包:\usepackage{amsthm}
  • 插入图片的宏包:\usepackage{graphicx}
  • 复杂表格的宏包:\usepackage{multirow}

1. 第一个文档

打开 WinEdt(Windows 用户,Linux 用户:texmaker),建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8。

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

然后在WinEdt的工具栏中找到编译按钮(在垃圾桶和字母B中间),在下拉菜单中选择XeTeX,并点击编译。 如果顺利的话,我们就可以顺利生成出第一个pdf文件,点击工具栏中的放大镜按钮就可以快速打开生成的pdf文件。

2. 标题、作者和注释

建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。

\documentclass{article}
\author{zhang}
\title{The title}
\begin{document}
\maketitle
hello world! % this is comment
\end{document}

3. 章节和段落

建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。

\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 of Guangzhou.
\end{document}

4. 加入目录

\tableofcontents
\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} 

5. 插入图片

先搜索到一个将图片转成eps文件的软件,很容易找的,然后将图片保存为一个名字如figure1.eps。
建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,放在和图片文件同一个文件夹里,编译并观察现象。

\documentclass{article} 
  \usepackage{graphicx} 
\begin{document} 
  \includegraphics[width=4.00in,height=3.00in]{figure1.eps} 
\end{document} 

6. 简单表格

建立一个新文档,将以下内容复制进入文档中,保存,保存类型选择为UTF-8,编译并观察现象。


\documentclass{article} 
\begin{document} 
  \begin{tabular}{|c|c|} 
    a & b \\ 
    c & d\\ 
  \end{tabular} 

  \begin{tabular}{|c|c|} 
    \hline 
    a & b \\ 
    \hline 
    c & d\\ 
    \hline 
  \end{tabular} 

  \begin{center} 
    \begin{tabular}{|c|c|} 
      \hline 
      a & b \\ \hline 
      c & d\\ 
      \hline 
    \end{tabular} 
  \end{center} 
\end{document} 

7. 中文的问题

\documentclass[nofonts]{ctexart}
\setCJKmainfont[ItalicFont={AR PL UKai CN}]{AR PL UMing CN} %设置中文默认字体
\setCJKsansfont{WenQuanYi Zen Hei} %设置文泉驿正黑字体作为中文无衬线字体
\setCJKmonofont{WenQuanYi Zen Hei Mono} %设置文泉驿等宽正黑字体作为中文打字机字体
\begin{document}
您好,\LaTeX!
\end{document}
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值