目录
- 源文件结构
- 例子
- 代码
- 运行结果
- Latex中文处理办法
- 在vscode中进行latex中文环境的编写设置步骤如下:
- 在texstudio中进行中文编写步骤
- 例子
- 代码
- 知识点
- 带有序号的数学表达式
- 用newcommand创建新的命令
- 运行结果
- 查看相关帮助文档
- ctex宏包
- 中文版latex快速入门手册
源文件结构
# 源文件结构
## 导言区
## 正文区(文稿区)

例子
代码
% 导言区
\documentclass{book} % book、report、letter
\title{My First Document}
\author{Alan Turing}
\date{\today}
% 正文区(文稿区)
\begin{document}
\maketitle %显示文章的标题作者和日期
hello,\LaTeX! % 正文部分内容
This is my first equation :$f(x)$ %行内数学表达式
$$f(x) = 5x^2 + 3x + 1$$ % 行间数学表达式
\end{document}
运行结果


Latex中文处理办法
主要是靠xelatex结合ctex宏包来进行处理中文的
在vscode中进行latex中文环境的编写设置步骤如下:
在vscode中使用latex支持中文编译
在texstudio中进行中文编写步骤
-
设置UTF-8编码格式
-
构建选择xelatex进行构建
- 菜单栏点击选项,选择设置texstudio
- 点击构建,选择默认编译器为xelatex
- 菜单栏点击选项,选择设置texstudio
-
引入ctex宏包
\usepackage{ctex}
例子
代码
\documentclass{book} % book、report、letter
\usepackage{ctex}
% 创建新的命令
\newcommand\degree{^\circ}
\title{我的第一个 \LaTeX 文件}
\author{\kaishu 张三}
\date{\today}
% 正文区(文稿区)
\begin{document}
\maketitle %显示文章的标题作者和日期
hello,\LaTeX! % 正文部分内容
This is my first equation :$f(x)$ %行内数学表达式
$$f(x) = 5x^2 + 3x + 1$$ % 行间数学表达式
设直角三角形ABC,其中$\angle C = 90\degree$
\begin{equation}
A^2 + B^2 = C^2 % 带有序号的数学表达式
\end{equation}
\end{document}
知识点
带有序号的数学表达式
\begin{equation}
......
\end{equation}
用newcommand创建新的命令
在导言区定义新的命令,以便可以在正文区进行重复使用
\newcommand .....(自定义命令和具体定义)
%比如:角度
\newcommand\degree{^\circ}
运行结果

查看相关帮助文档
ctex宏包
在cmd命令窗口里输入:texdoc ctex 即可查询相关文档


中文版latex快速入门手册
在cmd命令窗口里输入:texdoc lshort-zh 即可查询相关文档

