当前位置:网站首页>Latex快速入门
Latex快速入门
2022-04-23 05:43:00 【林仔520】
文章目录
1. 文章类型
- 文章:article
- 报告:report
- 书:book
- 写论文的话就用“文章” article
- 中文的文章: ctexart
- 中文字体:UTF8
代码:
\documentclass[UTF8]{
ctexart}
2. 引入宏包
论文中,可能包含公式、表格、图片等,需要在开头说明一下。说明的方式就是用宏包
,加了宏包才能写公式,做表格,放图片。
代码:
\usepackage{
宏包1,宏包2,...}
比较常用的是由mathtools,amsmath,graphicx,array之类的,写出来就是:
\usepackage{
mathtools,amsmath,graphicx,array}
3. 开始写文档
先建立一个“文档环境”,这个环境里面只来放文档内容,什么宏包和文档类型都在这个外面
- 环境的建立
\begin{
环境名字}
整篇论文的内容!!!
\end{
环境名字}
- 比如说文档环境就是
\begin{
document}
数学建模
\end{
document}
关于“\”:
- \begin{环境名字} \end{环境名字}是“环境”。他们全部用“\”来开头,区分单纯的一个单词,是用来控制排版的。
- \document和\usepackage都是“命令”
document环境中的写作
- 首先,编辑器段与段之间需要空一行,这样才能输出文本的分段,否则输出文本是一段(两个回车是换段)。
- 关于字体的几个命令/环境
加粗:\textbf{内容}
字号:\normalsize\large\Large\LARGE\huge\Huge
字号大小在一个环境内或者{}之间生效
居中:\begin{center} 内容 \end{center}
常用的关键字:
\title{
标题名}
\author{
作者名}
\date{
日期}
\maketitle
一级章节:\section{
一级章节名}
二级章节:\subsection{
二级章节名}
三级章节:\subsubsection{
三级章节名}
\tableofcontents
\begin{
abstract}
摘要内容
\end{
abstract}
\begin{
itemize}
\item 第一个东西
\item 第二个东西
\end{
itemize}
\begin{
equation}
公式
\end{
equation}
% 这个环境内公式不可以换行
\begin{
align*}
& y=a+b \\
& y=b+c
\end{
align*}
不自动编号的公式环境,可以在环境名称后加*
或者加\nonumber
,如
\begin{
equation*}
公式1
\end{
equation*}
% 或者
\begin{
equation}\nonumber
公式1
\end{
equation}
这个环境还有几种简写形式:
$$公式1$$
% 或者
\[ 公式 \]
以上为“行间公式”,也就是两行间插入公式,大概是这样子的。行内公式$公式$
例如:
例如:
我们可以知道牛顿得出了力与物体质量和加速度的关系为$F=ma$
行间公式可以为:
我们可以知道牛顿得出了力与物体质量和加速度的关系为:
\begin{
equation}
F=ma
\end{
equation}
输出结果:
公式命令
表格的插入
latex 中表格的输入相对复杂一点,我们暂时也不需要太复杂的,这里说一点简单的。
普通表格环境tabular:
\begin{
tabular}{
|l|c|r|}
\hline
指标1 & 指标2 & 指标3 \\
\hline
居左 & 居中 & 居右
\hline
\end{
tabular}
三线表的制作(需要用到booktabs宏包)
\begin{
table}
\centering
\caption{
题目}
\begin{
tabular}{
cccc}
\toprule
&指标1 &指标2 &指标3 \\
\midrule
方案1 & 1 & 0.5 & 100 \\
方案2 & 2 & 0.6 & 110 \\
\bottomrule
\end{
tabular}
\end{
table}
图片插入
\section{
图片的插入}
用figure环境
\begin{
figure}[H]
\centering
\includegraphics[width=8cm,height=3cm]{
a.png}
\caption{
图片}
\end{
figure}[H]
符号&与\:
- 符号
&
的意思通常是“对齐”之类的意思,通常是用在存在多行数据,需要在某一个位置对齐的情况下。 - 符号
\\
是换行,通常多行数据需要换行的时候用这个。矩阵环境、多行公式会经常用到,表格也会经常遇到这两个符号。 - 如果只是单纯的在文本想打出来
&
的话,就用\&
,就会输出&
。如果想要输出\
,那就用\verb|\|
,还有其他的特殊符号,想要输出大部分都是“\符号”
命令label
label
是标签命令
label{#1:#2}
,其中#1代表第一个参数,说明这个东西是什么类型的,有三种类型:eq
公式、tab
表格、fig
图片;
#2 就是名字了。
比如给它命名“niudun”:
\section{
命令label}
\begin{
equation}
F=ma \label{
eq:niudun}
\end{
equation}
如果要引用,就用\ref{eq:niudun}
,这个命令的地方就会被替换成被引入那个公式的编号
由公式(\ref{
eq:niudun}),我们可以得到...
同理,表格和图片也可以这样引用,完全没有任何问题。
版权声明
本文为[林仔520]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_37955704/article/details/119407635
边栏推荐
- Software architecture design - software architecture style
- Mysql 查询使用\G,列转行
- PHP处理json_decode()解析JSON.stringify
- Flutter nouvelle génération de rendu graphique Impeller
- Strategy for improving the conversion rate of independent stations | recovering abandoned users
- Add days to date
- 【华为机试】考试得分总数(如何处理答错的情况?回溯一次,代表答错一题)
- freemark中插入图片
- AcWing 1096. Detailed notes of Dungeon Master (3D BFS) code
- 软件架构设计——软件架构风格
猜你喜欢
Software architecture design - software architecture style
一文读懂当前常用的加密技术体系(对称、非对称、信息摘要、数字签名、数字证书、公钥体系)
mysql sql优化之Explain
Pilotage growth · ingenuity empowerment -- yonmaster developer training and pilotage plan is fully launched
2-軟件設計原則
jdbc入门\获取数据库连接\使用PreparedStatement
Radar equipment (greedy)
Duplicate key update in MySQL
SQL注入
The 8th Blue Bridge Cup 2017 - frog jumping cup
随机推荐
delete和truncate
2.devops-sonar安装
软件架构设计——软件架构风格
实操—Nacos安装与配置
Excel obtains the difference data of two columns of data
C3P0数据库连接池使用
No.1.#_ 6 Navicat shortcuts
多线程与高并发(2)——synchronized用法详解
Relative reference and absolute reference of Excel
Pytorch deep learning practice_ 11 convolutional neural network
jdbc入门\获取数据库连接\使用PreparedStatement
TypeScript interface & type 粗略理解
JDBC工具类封装
MySQL lock mechanism
Shell instruction learning 1
[machine learning] scikit learn introduction
Sea Level Anomaly 和 Sea Surface Height Anomaly 的区别
C language - Spoof shutdown applet
尚硅谷 p290 多态性练习
2 - software design principles