[LaTex and markdown] Grammar explanation


markdown

bold

**加粗样式**
  • Format: add two on both sides*

The effect is as follows: bold style

italics

*斜体样式*
  • Format: Add one on both sides*

The effect is as follows: italic style

set heading level

# 标题
  • Format: There is only one first-level heading #, two second-level headings #, and up to six level headings.

Effect like title

Set directory

@[TOC](这里写目录标题)
  • Format:@[TOC](这里写目录标题)

The effect is like this catalog

strikethrough

~~删除线格式~~ 
  • Format: add two on both sides~

The effect is as follows: strikethrough format

unordered list

- 内容1
- 内容2
  • Format: add before content-

The effect is as follows:

  • content 1
  • Content 2

ordered list

1. 内容1
2. 内容2
  • Format: add or in front of the 1. content2.

The effect is as follows:

  1. content 1
  2. Content 2

Dividing line

---
  • Format: three-

The effect is as follows:


Agent

 - [ ] List item
  • Format: Add before the matter- [ ]

The effect is as follows:

  • List item

Quote

> 这里是引用
  • Format: add before content>

The effect is as follows:

Here is the quote

highlight

==标记文本==
  • Format: add two on both sides=

The effect is as follows:Highlight text

mark

`标记文本`
  • Format: add a ` on both sides

The effect is as follows:标记文本

code block

  • Format: add three ` in the upper and lower lines of the code

Effect:

// An highlighted block
var foo = 'bar';

picture

![在这里插入图片描述](https://i2.hdslb.com/bfs/archive/844677b75e011c66a99e7c70e387a97af03d8739.jpg@672w_378h_1c_!web-home-common-cover.webp)
  • Format:![图片描述](图片路径)

The effect is as follows:
Insert image description here

Link

链接: [link](https://www.csdn.net/)
  • Format:[链接描述](链接路径)

The effect is as follows: link

sheet

| Column 1 | Column 2 |Column 3 |
|:--:| ---:| :--|
| 文本居中 | 文本居右 | 文本居左  |
  • Format: The header in the first line, the colon in the second line determines whether the text is centered, left, or right. The default is centered.

The effect is as follows:

Column 1 Column 2 Column 3
Center text text right Text left

in-line formula

$y_{max}=\max\left \{     y_{1},y_{2},...,y_{n}        \right \}$
  • Format: Add one on both sides of the expression$

效果如下: y m a x = max ⁡ { y 1 , y 2 , . . . , y n } y_{max}=\max\left \{ y_{1},y_{2},...,y_{n} \right \} ymax=max{ y1,y2,...,yn}

Alone formula

$$
y_{max}=\max\left \{     y_{1},y_{2},...,y_{n}        \right \}
$$
  • Format: Expression plus two lines above and below$

效果如下:
y m a x = max ⁡ { y 1 , y 2 , . . . , y n } y_{max}=\max\left \{ y_{1},y_{2},...,y_{n} \right \} ymax=max{ y1,y2,...,yn}

formula expression

The formula expression method in markdown is completely consistent with LaTex. Here I provide a website that can generate formulas online , which covers most of the formula expression methods, so I won't go into details in this article.

LaTex preliminary

Article backbone

%所撰写文本的类型
\documentclass{article}

%要使用的一些包
\usepackage{graphicx} % Required for inserting images
\usepackage{xeCJK}

%标题,作者,日期
\title{标题}
\author{Your name}
\date{today}

%文本开始
\begin{document}

%表示标题独占一页
\begin{titlepage}
\maketitle
\end{titlepage}

%摘要部分
\begin{abstract}
    
\end{abstract}

%正文部分
%设置标题级别
\section{一级标题}

\subsection{二级标题}

\subsubsection{三级标题}

%引用文献
\bibliographystyle{}
\bibliography{}

%文本结束
\end{document}

Line feed and page feed

\section{换行教学}
第一行

第二行

\section{换页教学}
第一页

\newpage 

第二页
  • Line breaks require a blank line
  • For page change\newpage

figure (basically a picture)

\begin{figure}[htbp]
    \centering
    \includegraphics[width=0.5\textwidth,height=0.61\textwidth]{you_image.jpg}
    \caption{填入的图题}
    \label{fig:enter-label}
\end{figure}

\begin{figure}[htbp]
    \centering
    \includegraphics[width=5cm,height=5cm]{you_image.jpg}
    \caption{填入的图题}
    \label{fig:enter-label}
\end{figure}
  • \centeringmeans centered
  • \includegraphicsSpecify image style and path
  • \captionIndicates the title of the figure
  • \labelIndicates the name you gave it, which will be used in future references

sheet

\begin{table}[]
    \centering
    \begin{tabular}{c|c}
         &  \\
         & 
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}

Forms can be generated online using some websites, so there is no need to memorize them by rote.

official

\begin{equation}
    
\end{equation}

The formula can be generated online by using some websites, so there is no need to memorize it by rote.

Center left and right

%居中
\begin{center}
    
\end{center}

%居左
\begin{flushleft}
    
\end{flushleft}

%居右
\begin{flushright}
    
\end{flushright}

figure reference

In the definition of figure, we have given figure a name, \labelnamed with. Next, to cite in the text, just do the following:

\ref{figure_name}
  • figure_nameIt's the name you gave the figure

Literature Citation

First of all, in the backbone, there will be the following two lines to indicate the reference

%引用文献
\bibliographystyle{}
\bibliography{}
  • \bibliographystyleIndicates the format of the bib file
  • \bibliographyIndicates the path of the bib file

When citing in text, just do the following:

\cite{paper_name}
  • paper_nameis the name of the document cited in the bib file

Guess you like

Origin blog.csdn.net/qq_50791664/article/details/131293525