文章目录
  • markdown
  • 加粗
  • 斜体
  • 设置标题级别
  • 设置目录
  • 删除线
  • 无序列表
  • 有序列表
  • 分割线
  • 代办
  • 引用
  • 高亮
  • 标记
  • 字体颜色
  • 代码块
  • 图片
  • 链接
  • 表格
  • 公式表达
  • 行中公式
  • 独行公式
  • LaTex初步
  • 文章骨干
  • 换行与换页
  • figure(基本是图片)
  • 表格
  • 公式
  • 公式字体颜色
  • 左右居中
  • figure引用
  • 文献引用



markdown

加粗

**加粗样式**
  • 1.
  • 格式:两边加两个*

效果如下:加粗样式

斜体

*斜体样式*
  • 1.
  • 格式:两边加一个*

效果如下:斜体样式

设置标题级别

# 标题
  • 1.
  • 格式:一级标题就一个#,二级标题就两个#,最多六级标题

效果如标题

设置目录

@[TOC](这里写目录标题)
  • 1.
  • 格式:@[TOC](这里写目录标题)

效果如本文目录

删除线

~~删除线格式~~
  • 1.
  • 格式:两边加两个~

效果如下:删除线格式

无序列表

- 内容1
- 内容2
  • 1.
  • 2.
  • 格式:内容前面加-

效果如下:

  • 内容1
  • 内容2

有序列表

1. 内容1
2. 内容2
  • 1.
  • 2.
  • 格式:内容前面加1. 或者2. 即可

效果如下:

  1. 内容1
  2. 内容2

分割线

---
  • 1.
  • 格式:三个-

效果如下:


代办

- [ ] List item
  • 1.
  • 格式:事项前面加- [ ]

效果如下:


引用

> 这里是引用
  • 1.
  • 格式:内容前面加>

效果如下:

这里是引用

高亮

==标记文本==
  • 1.
  • 格式:两边加两个=

效果如下:高亮文本

标记

`标记文本`
  • 1.
  • 格式:两边加一个 `

效果如下:标记文本

字体颜色

<font color=red>红色</font>
  • 1.
<font color=red>
红色
</font>
  • 1.
  • 2.
  • 3.
  • 格式:使用HTML语法

效果如下:红色

以下是一些常用颜色:

语法示例

颜色效果

<font color=red>红色</font>

红色

<font color=orange>橙色</font>

橙色

<font color=green>绿色</font>

绿色

<font color=cyan>青色</font>

青色

<font color=blue>蓝色</font>

蓝色

<font color=violet>紫罗兰色</font>

紫罗兰色

代码块

\```javascript
var foo = 'bar';
\```
  • 1.
  • 2.
  • 3.
  • 格式:在代码的上下两行添加三个`,后面可以加语言类型,如cpp, javascript。

效果:

var foo = 'bar';
  • 1.

图片

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

效果如下:

【LaTex、markdown】常用语法写出漂亮的blog_前端

链接

链接: [link]()
  • 1.
  • 格式:[链接描述](链接路径)

效果如下:link

表格

| Column 1 | Column 2 |Column 3 |
|:--:| ---:| :--|
| 文本居中 | 文本居右 | 文本居左  |
  • 1.
  • 2.
  • 3.
  • 格式:第一行表头,第二行的冒号决定文本居中、居左、居右,默认居中

效果如下:

Column 1

Column 2

Column 3

文本居中

文本居右

文本居左

公式表达

markdown中的公式表达方法与LaTex是完全一致的。这里我提供一个可以在线生成公式的 网站,其中涵盖了大多数的公式表达方法,本文不再赘述。

行中公式

$y_{max}=\max\left \{     y_{1},y_{2},...,y_{n}        \right \}$
  • 1.
  • 格式:表达式两边加一个$

效果如下:【LaTex、markdown】常用语法写出漂亮的blog_删除线_02

独行公式

$$
y_{max}=\max\left \{     y_{1},y_{2},...,y_{n}        \right \}
$$
  • 1.
  • 2.
  • 3.
  • 格式:表达式上下两行加两个$

效果如下:
【LaTex、markdown】常用语法写出漂亮的blog_字体颜色_03

LaTex初步

文章骨干

%所撰写文本的类型
\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}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.

换行与换页

\section{换行教学}
第一行

第二行

\section{换页教学}
第一页

\newpage 

第二页
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 换行需要空一行
  • 换页用\newpage

figure(基本是图片)

\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}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • \centering表示居中
  • \includegraphics指定图片样式和路径
  • \caption表示图题
  • \label表示你给它取的名字,以后引用时会用到

表格

\begin{table}[]
    \centering
    \begin{tabular}{c|c}
         &  \\
         & 
    \end{tabular}
    \caption{Caption}
    \label{tab:my_label}
\end{table}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.

表格可以利用一些网站在线生成,不用死记。

公式

\begin{equation}
    
\end{equation}
  • 1.
  • 2.
  • 3.

公式可以利用一些网站在线生成,不用死记。

公式字体颜色

\textcolor{red}{ y_{max} } =\max \left \{    y_{\textcolor{blue}{ 1}},y_{2},...,y_{n}      \right \}
  • 1.
  • 格式:使用\textcolor关键字

效果如下:
【LaTex、markdown】常用语法写出漂亮的blog_前端_04

以下是一些常用颜色:

语法示例

颜色效果

\textcolor{red}{红色}

【LaTex、markdown】常用语法写出漂亮的blog_前端_05

\textcolor{orange}{橙色}

【LaTex、markdown】常用语法写出漂亮的blog_前端_06

\textcolor{green}{绿色}

【LaTex、markdown】常用语法写出漂亮的blog_前端_07

\textcolor{cyan}{青色}

【LaTex、markdown】常用语法写出漂亮的blog_删除线_08

\textcolor{blue}{蓝色}

【LaTex、markdown】常用语法写出漂亮的blog_删除线_09

\textcolor{violet}{紫色}

【LaTex、markdown】常用语法写出漂亮的blog_字体颜色_10

左右居中

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

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

%居右
\begin{flushright}
    
\end{flushright}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.

figure引用

在figure的定义中,我们已经给figure取了一个名字,用\label取名。接下来,在正文部分进行引用,只需要如下做:

\ref{figure_name}
  • 1.
  • figure_name是你给figure起的名字

文献引用

首先,在骨干中,会有如下两行表示引用

%引用文献
\bibliographystyle{}
\bibliography{}
  • 1.
  • 2.
  • 3.
  • \bibliographystyle表示bib文件的格式
  • \bibliography表示bib文件的路径

在正文部分进行引用时,只需要如下做:

\cite{paper_name}
  • 1.
  • paper_name是在bib文件中所引文献的名字