LaTex-day01

目录

源文件的基本结构

创建文件

配置参数

分类

导言区

正文区

LaTex中文处理步骤

技巧

打开Ctex的说明文档

打开LaTex的说明文档


源文件的基本结构

创建文件

文件-->新建

配置参数

写中文内容将编译器修改为:xLaTex

写英文内容将编译器修改为:PDFlaTex

分类

导言区

\documentclass{article}

其中artice可以换成letter、book、report类等

导言区主要用于全局设置,例如设置个人信息、文章信息和日期:

\title{My first paper}
\author{Ph.D Chang}
\date{\today}

注意在正文区需要加上\maketitle才能显示个人信息、文章信息和日期。

\begin{document}

\maketitle

\end{document}

正文区

\begin{document}

\end{document}

举例:

\begin{document}
    Hello World!
\end{document}

(1)添加数学公式 (使用单$)

\begin{document}
\maketitle
Hello World!
Let $f(x)$ be defined by $f(x)=3x^2$
\end{document}

运行结果:

(2)添加数学公式 (使用双$)

\begin{document}
\maketitle
Hello World!
Let $f(x)$ be defined by $$ f(x)=3x^2 $$
\end{document}

运行结果:

(3)另起一行

\begin{document}
\maketitle
Hello World!

Let $f(x)$ be defined by $$ f(x)=3x^2+x-1 $$
\end{document}

 运行结果:

 (4)带编号的公式:

\begin{document}
    \begin{equation}
        f(x)=3x^2+2x+3
    \end{equation}
\end{document}

运行结果:

LaTex中文处理步骤

(1)在选项-设置TeXStudio中设定

默认编辑器:XeLaTex

默认字体编码:UTF-8

(2)在导言区加入

\usepackage{ctex}

 引入ctex宏包。

或者将\documentclass{article}修改为documentclass{ctexart}即可,无需添加\usepackage{ctex}。

若是book、report类型的,则为ctexbook,ctexreport。

(3)输入中文即可显示。

注:在输入中文的时候可以加入字体

\title\heiti 我的第一篇论文}
\author{\kaishu 常博士}

技巧

打开Ctex的说明文档

  1. win+R
  2. 输入cmd
  3. 输入texdoc ctex,从而打开ctex宏集手册,从而查看CTEX宏包的使用方法

打开LaTex的说明文档

  1. win+R
  2. 输入cmd
  3. 输入texdoc lshort,打开英文的说明手册,texdoc lshort-zh打开中文的说明手册

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值