当前位置:网站首页>Getting started with latex
Getting started with latex
2022-07-28 06:17:00 【Ali forever】
LaTex A simple introduction to
Preface
The author is learning Latex Before , Searched a lot of learning Latex Methods , It is nothing more than two schools of systematics and non systematics , In fact, both sects have disadvantages , We should combine , Let's start with a basic concept , Then apply the template , Only in this way can we learn more efficiently
One 、LaTex What is it? ?
LaTeX It's based on ΤΕΧ The typesetting system of , Suitable for articles with strong structure . Mainly for Mathematics 、 Physics 、 Computer science , A system for academic publishing , The articles written are very uniform and symmetrical
Two 、LaTex And Word The main difference
- Latex With annotation function , It is a system that composes documents through code , It is easier for developers to understand what they write .Word It doesn't have this function , The displayed content is what you wrote .
- Latex Compared with the typesetting of Word More specification , And more tidy , When Word And Latex When there are corresponding templates , Want to destroy a Latex Templates are not simple , and Word The formwork is easy to be damaged , And convert it to PDF Sometimes there will be chaos .
- Latex Inserting code blocks is relatively simple , and Word You need to reformat after inserting the code block in , It is a troublesome operation
- Latex It is very friendly to insert formulas , The setting and writing of formulas are all realized by code ,Word It will be very laborious to write formulas in , besides , The number is not Word What I'm good at , You need to set the outline level manually , Is a more troublesome process
- Latex Unfriendly to tables and drawings , Other software is needed to assist , And if teammates want to modify Latex For documents, you also need to see the notes , This process will waste a lot of time .
3、 ... and 、Latex Simple introduction
Because there are many online Latex Tutorial for environment installation , This article will not elaborate on how to install Latex And configuration environment , Directly from the simple Latex Getting started
1. General overview
Latex It is mainly divided into introduction area and text area .
The introduction area first needs to introduce a class , For global settings , You can also define some commands , If you need to use some custom symbols .
The code is as follows ( Example ):
\documentclass[10pt]{
article}
% book,report,letter There is an optional parameter in square brackets to indicate the basic font size
\usepackage{
ctex}
% The introduction area also defines the command , If you want to use some custom symbols in the body area
\newcommand\degree{
^\circ}
\title{
\heiti My First Document}
\author{
\kaishu Ali Chen}
\date{
\today}
Example of introduction area :
The body area is the content area we need to edit , use begin And end Enter an environment , Inside is the name of the environment , There is one and only one document Environmental Science
The code is as follows ( Example ):
\begin{
document}
\maketitle %letter There is no maketitle
Hello World!
\end{
document}
Example of body area :
2. Font format
stay Latex in , There are five attributes of fonts , Respectively encode the font , Font family , HTTP: , Font shape , font size
- Font family ( roman type , Sans serif fonts , Typewriter font )
\textrm{
Roman Family} \textsf{
Sans Serif Family} \texttt{
Typewriter Family}
\rmfamily Roman Family {
\sffamily Sans Serif Family} {
\ttfamily Typewriter Family}

2. HTTP: ( The thickness and width of the font )
\textmd{
Medium Series} \textbf{
Boldface Series}
{
\mdseries Medium Series} {
\bfseries Boldface Series}

- Font shape ( Erect , Italics , Pseudo italics , Small caps )
\textup{
Upright Shape} \textit{
Italic Shape}
\textsl{
Slanted Shape} \textsc{
Small Caps Shape}
{
\upshape Uprigjt Shape}{
\itshape Italic Shape}{
\slshape Slanted Shape}{
\scshape Small Caps Shape}

- font size
Here are just a few common size control commands , It works with the basic font size set in the introduction area , Work together
{
\tiny Hello}\\
{
\small Hello}\\
{
\large Hello}\\
{
\huge Hello}\\

A newcommand Command to set the basic font , Avoid too many commands in the body , It doesn't fit Latex The original meaning of , So we can set it like this in the introduction area
\newcommand{
\myfont}{
\textbf{
\textsf{
Fancy Text}}}
We only need to call in the body area myfont that will do .
3. Subtitles and common characters
We often set subtitles in the body , This will make our article more clear , Then we will combine common characters to set subtitles and show
- Subheading
We can use section And subsection Wait to set the outline level and complete the marking of the title
{
\section{
Blank symbols }}
May adopt quad Generate spaces , One quad produce 1em Width
One qquad produce 2em Width
One enspace produce 0.5em Width
One hfill The command is used to achieve elastic length , Fill the whole line
The first paragraph
\subsection{
Paragraph character }
\par This command generates a new paragraph
{
\section{
\ LaTex Controller }}

2. character
Here are some common characters , There is no need to memorize , Just know how to use and see
{
\section{
\ LaTex Controller }}
The backslash is \textbackslash
{
\section{
Typesetting symbols }}
\S \P \dag \ddag \copyright \pounds
{
\section{
\ Tex Standard symbol }}
\LaTeXe{
}
{
\section{
quotes }}
`` Left single quote '' Right single quotation mark
{
\section{
A hyphen }}
- -- ---
{
\section{
Non English characters }}
\oe \OE \ae \AE \aa \AA
{
\section{
stress mark }}
\r{
o} \t{
o} \b{
o} \c{
o} \d{
o}

- Contents and chapters
{
\tableofcontents} % Used to generate directories
{
\chapter{
The introduction }}% Used to generate chapter outline
4. Illustrations and tables
- Introduction area preparation
Want to quote illustrations , In the introduction area, you need to import these macros
\usepackage{
graphicx} % Introduce illustrations
% grammar \includegraphics[< Options >]{
file name }
% Format :EPS,PDF,PNG,JPEG,BMP
\graphicspath{
{
figures/},{
pics/}} % Pictures in the current directory figures Catalog ,pics Catalog
- illustrations
There are other labels in the text area that need to be used to assist illustrations and tables
Setting in the floating body will automatically label pictures or tables
\begin{
figure} % Floating body environment
\centering % Center layout
\includegraphics[scale=0.3,height=2cm,width=2cm,angle=-45]{
pic01}\\
\caption{
Aliforever} %caption Command to set the title of the picture
\end{
figure}

3. form
Here is the exam form \ref{
fig-profile}
\begin{
table}[htbp] %table Floating body environment
\centering % Center layout
\caption{
The test }\label{
fig-profile}% This is used for echo , As in the previous ref echo
\begin{
tabular}{
l||c |c |c |rp{
1.5cm}|}% It can be used | Generate single vertical line or double vertical line ,p You can specify the width
\hline % This command generates table horizontal lines
full name & Chinese language and literature & mathematics & Foreign Languages & remarks \\
\hline \hline
Zhang San & 87 & 100 & 93 & good \\
\hline
Li Si & 88 & 75 & 87 & commonly \\
\hline
Zhong Ting & 58 & 65 & 47 & a make-up exam \\
\hline
\end{
tabular}
\end{
table}

5. Mathematical formulas and symbols
Similar to the front , Want to introduce mathematical formulas and symbols , It is necessary to introduce these macros
\usepackage{
amsmath}
\usepackage{
amssymb}
- The mathematical formula
In line formulas can be used in three ways : Use dollar sign respectively $, parentheses , also math Environmental Science
\section{
In line formula }
\subsection{
Dollar symbol }
change:$3+2=5$,and $2+3=5$
\subsection{
parentheses }
change:\(3+2=5\),and \(2+3=5\)
\subsection{
Mathematical environment }
change:\begin{
math}
3+2=5
\end{
math},and
\begin{
math}
2+3=5
\end{
math}

- The subscript
\section{
The subscript }
\subsection{
Superscript }
$3x^{
20}+5x+8=0$
\subsection{
Subscript }
$a_0,a_1,a_2$

3. The Greek letter
\section{
The Greek letter }
$\alpha$
$\beta$
$\gamma$
$\epsilon$
$\pi$
$\omega$
$\Gamma$
$\Delta$
$\Theta$
$\Pi$
$\Omega$

4. Mathematical functions
\section{
Mathematical functions }
$\log$
$\sin$
$\cos$
$\arcsin$
$\ln$\\
$$\log5+\sin^230=\arctan55$$
$\sqrt[4]{
x}$

5. Fraction
\section{
Fraction }
$3/4$
$\frac{
55}{
66}$

6. The formula between lines
\section{
The formula between lines }
\subsection{
Dollar symbol }
$$8+8=16$$
\subsection{
brackets }
\[8+8=16\]
\subsection{
displaymath Environmental Science }
\begin{
displaymath}
8+8=16
\end{
displaymath}
\subsection{
Automatic numbering formula equation}
Commutative law formula \ref{
eq:commutaive}
\begin{
equation}
a+b=c \\
a*d=e \label{
eq:commutaive}
\end{
equation}
\subsection{
Do not automatically number formulas equation*}

- matrix
Because the matrix is too complex , Here we only introduce the relatively simple matrix , It can be used
\section{
matrix }
\subsection{
Ordinary matrix }
\[\begin{
bmatrix}
a_{
11}^2&a_{
12}^2\\
0&a_{
22}^3\\
\end{
bmatrix}\]
\subsection{
Omit the symbol }
%\dots \vdots $\ddots$
\[
A = \begin{
bmatrix}
a_{
11}&\dots &a_{
1n}\\
&\ddots &\vdots \\
0&&a_{
nn}
\end{
bmatrix}_{
n\times n}
\]


8. Multiline formula
\section{
Multiline formula } % With numbers gather* Without number
\begin{
gather}
a+b = b+a \\
ab ba \notag \\ %notag You can block numbers
ca ac
\end{
gather}
\begin{
align}
x&=t+\cos t +1\\
y&=2\sin t +1
\end{
align}
\begin{
equation}
\begin{
split}
\cos 2x&=\cos 2x+\sin x +5\\
&=2\cos x + 5
\end{
split}
\end{
equation}
\begin{
equation}
D(x)=\begin{
cases} % Implement piecewise functions
1,&\text{
If } x \in \mathbb{
Q};\\
0,&\text{
If } x \in \mathbb{
R}\setminus\mathbb{
Q};\\
\end{
cases}
\end{
equation}

summary
This paper introduces Latex To get started with , But if you want to use it well, you must rely on Latex Modify and correct the template , At the same time, consult relevant typesetting ideas to improve your typesetting ability . And finally attached is the mind map of this article , I hope it can help you get familiar with it quickly Latex The law of operation .
边栏推荐
- Deep learning (self supervision: simple Siam) -- Exploring simple Siamese representation learning
- Deep learning (II) into machine learning and deep learning programming
- 物联网互操作系统:分类、标准与未来发展方向综述
- 神经网络优化
- ESXi 7.0 Update 1c中加入的systemMediaSize启动选项
- Reinforcement learning - dqn in value learning
- USB Network Native Driver for ESXi更新到支持ESXi7.0 Update 2
- vscode uniapp
- Neural network learning
- Common CTF encryption methods JS
猜你喜欢

5、 Video processing and GStreamer

A comparative study of backdoor attack and counter sample attack

File upload vulnerability summary

How much does small program development cost? Analysis of two development methods!

Common CTF encryption methods JS

Which enterprises are suitable for small program production and small program development?

基于tensorflow搭建神经网络

Applet development

强化学习——Proximal Policy Optimization Algorithms

Reinforcement learning -- SARS in value learning
随机推荐
USB Network Native Driver for ESXi更新到支持ESXi7.0 Update 2
EIGamal cryptosystem description
基于tensorflow搭建神经网络
Reinforcement learning - incomplete observation problem, MCTs
tf.keras搭建神经网络功能扩展
TensorFlow2.1基本概念与常见函数
ESXi on ARM v1.2 (2020年11月更新)
The difference and connection between cookies, sessions and tokens
强化学习——价值学习中的SARSA
Convolutional neural network
Cyclic neural network
Internet of things interoperability system: classification, standards and future development
Differences between processes and threads
Basic usage of word2vec and Bert
Tf.keras build neural network function expansion
详解爬电距离和电气间隙
Byte Android post 4 rounds of interviews, received 50k*18 offers, and successfully broke the situation under the layoff
ESXi 7.0 Update 1c中加入的systemMediaSize启动选项
Boosting unconstrained face recognition with auxiliary unlabeled data to enhance unconstrained face recognition
后门攻击与对抗样本攻击的比较研究