[Continuously updated] tutorial-Linux-Markdown-etc (Linux, command, Markdown, md, Tex, LaTex)

1. Linux commands

1.1 Commonly used

  1. Check the number of files in a folder:ls -l | wc -l
  2. 7zip:
    1. Extract:7z x compressed_file.7z -o/path/to/destination # Note that -o and the target path are connected without spaces
    2. compression:7z a compressed_file.zip destination_path
  3. conda
    1. Check the environment owned by conda:conda env list
    2. Create conda environment:conda create -n 环境名 python=3.8
    3. Clone the conda environment:conda create -n 环境名 --clone 要克隆哪个环境
    4. Delete the conda environment:conda remove -n 环境名 --all

1.2 General

  1. Update package list:sudo apt update
  2. Open the document with Notepad in WSL:notepad.exe 文件路径
  3. screen:
    1. Create session:screen -R session_name
    2. Enter session:screen -r session_name
  4. Copy files from other server to another server:
    1. First enter [the server where the file is located]
    2. sudo scp -p -r 端口号 要复制的文件夹 目标服务器名称@IP地址:目标文件夹

1.3 Rare

  1. Change sudo password:sudo passwd

2. Markdown

2.1 Markdown basic syntax

Effect grammar illustrate
# title
italics _斜体_or*斜体* -Both and * are OK
Bold **粗体**
Bold italic ***粗斜体*** bold + italic
--- Dividing line
strikethrough ~~删除线~~
Underline ~~下划线~~
Footnote1 Additional footnote→ 脚注[^脚注的名字]
Photograph footnote→ [^脚注的名字]: 脚注的内容
Remember to write the specific content of the footnote
1. Ordered list 1. 有序列表
+ unordered list + 无序列表 * - +It will be all right
- [ ] Hello - [ ] 你好 To-do list
- [x] Hello - [x] 你好 Things that have been done
> 区块内容 block
代码 ``
代码块 ` ```code block````
代码块 ` ```code block```` Pay attention to the writing language
link address [要显示的内容](具体网址)

2.2 Markdown advanced syntax

  1. Line break:<br> 内容 </br>
  2. Centering symbol:<center> 内容 </center>
  3. Bold character:<b> 内容 </b>
  4. Key effect:<kbd> 内容 </kbd> —— 内容
  5. Visual color: <font color='red'></font>
  6. Adjust font size:<font size=12 color='red'> 内容 </font>
  7. Image center
    <div>
       <img src=图片链接
       width=100%>
    </div>
    
  8. Pictures displayed side by side
    <center class="half">
       <img src="img1.jpg" width="270"/>
       <img src="img2.jpg" width="270"/>
    </center>
    
  9. folded block
    <details>
    
       <summary>展开/折叠</summary>
    
       具体内容...
    
    </details>
    
  10. mermaid drawing
    1. graph TB;
    2. graph LR;
      ```mermaid
      graph TB;
         A-->B;
         A-->C;
         B-->D;
    
  11. Insert video
<video id="video" controls="" preload="none"> 
   <source id="mp4" src="本地视频路径.mp4"
   type="video/mp4"> 
</video>
  1. sheet
    1. -:Set content or title bar right alignment
    2. :-Set content or title bar left alignment
    3. :-:Set content or title bar center alignment

2.3 LaTex Official

2.3.1 Syntax

Here is a mathematically typeset table with LaTeX code and notation descriptions:

Mathematics Symbol LaTeX code Symbol Description
A   B A \ B A B $A \ B$ space
A B A \quad B AB $A \quad B$ four spaces
A B A \\ B AB $A \\ B$ newline
{ a , b } \{a, b \} { a,b} \\{a, b \\} escape character\
x ^ \hat{x} x^ $\\hat{x}$ hat
x ˉ \bar{x} xˉ $\\bar{x}$ dash
x y z ‾ \overline{xyz} xyz $\\overline{xyz}$ long horizontal line
x y z ‾ \underline{xyz} xyz $\\underline{xyz}$ long underline
x ˙ \dot{x} x˙ $\\dot{x}$ one point
x ¨ \ddot{x}x¨ $\\ddot{x}$ two points
x ⃗ \vec{x}x $\\vec{x}$ Vector
x → \overrightarrow{x} x $\\overrightarrow{x}$ long vector
( a b c ) \left( abc \right) (abc) $\\left( abc \\right)$ long brackets and small brackets
[ a b c ] \left[ abc \right] [abc] $\\left[ abc \\right]$ long brackets
B A \underset{A}{B} AB $\underset{A}{B}$ write below
B A \overset{A}{B}BA $\overset{A}{B}$ write above

2.3.2 Font

Mathematics Symbol LaTeX code Symbol Description
H e l l o \rm{Hello} Hello $\rm{Hello}$ non-italic roman font
H e l l o \mathit{Hello}Hello $\mathit{Hello}$ italic font
H e l l o \mathsf{Hello} Hello $\mathsf{Hello}$ Sans serif font
H e l l o \mathtt{Hello} Hello $\mathtt{Hello}$ Typewriter font
H e l l o \mathcal{Hello}Hello $\mathcal{Hello}$ Calligraphic font
H e l l o \mathbb{Hello} Hello $\mathbb{Hello}$ Blackboard bold font
H e l l o \boldsymbol{Hello} Hello $\boldsymbol{Hello}$ Boldsymbol bold font

2.3.3 Matrix, alignment, piecewise function

  1. 【矩阵】 [ a b c d ] \left[\begin{matrix}a & b \cr c & d\end{matrix}\right] [acbd]

    \left[\begin{matrix}
       a & b \cr 
       c & d
    \end{matrix}\right]
    
  2. 【矩阵】 ⟮ a b c d ⟯ \left\lgroup\begin{matrix}a & b \cr c & d\end{matrix}\right\rgroup acbd

    \left\lgroup\begin{matrix}
       a & b \cr
        c & d
    \end{matrix}\right\rgroup
    
  3. 【对齐】
    a 1 = b 1 + c 1 a 2 = b 2 + c 2 + d 2 a 3 = b 3 + c 3 \begin{aligned} a_1 &= b_1 + c_1 \\ a_2 &= b_2 + c_2 + d_2 \\ a_3 &= b_3 + c_3 \end{aligned} a1a2a3=b1+c1=b2+c2+d2=b3+c3

    \begin{aligned}
    a_1 &= b_1 + c_1 \\
    a_2 &= b_2 + c_2 + d_2 \\
    a_3 &= b_3 + c_3
    \end{aligned}
    
  4. \\ in s i g n ( x ) = { 1 , x > 0 0 , x = 0 − 1 , x < 0 sign(x) = \begin{cases} 1, & x > 0 \\ 0, & x = 0 \cr -1, & x < 0 \end{cases} \cr, indicating a new line. [piecewise function] syntax is equivalent to
    sign(x)= 1,0,1,x>0x=0x<0

    sign(x) = 
    \begin{cases}
       1, & x > 0 \\ 
       0, & x = 0 \cr 
       -1, & x < 0
    \end{cases}
    

2.3.4 Greek letters

Mathematics Symbol LaTeX code Corresponds to uppercase letters LaTeX code
a \alphaa $\alpha$ Γ \GammaC $\Gamma$
β \betab $\beta$ D \DeltaD $\Delta$
γ \gammac $\gamma$ Θ \Theta Th $\Theta$
d \deltad $\delta$ D \DeltaD $\Delta$
ϵ \epsilonϵ $\epsilon$
ε \varepsilone $\varepsilon$
ζ \zetag $\zeta$
the \etathe $\eta$
θ \theta i $\theta$ Θ \ThetaTh $\Theta$
ϑ \vartheta ϑ $\vartheta$ Θ \varTheta Th $\varTheta$
i \iotai $\iota$
κ \kappa κ $\kappa$
λ \lambda λ $\lambda$ Λ \Lambda Λ $\Lambda$
μ \mu μ $\mu$
ν \nu ν $\nu$
ξ \xi ξ $\xi$ Ξ \Xi Ξ $\Xi$
π \pi π $\pi$ Π \Pi Π $\Pi$
ϖ \varpi ϖ $\varpi$ Π \varPi Π $\varPi$
ρ \rho ρ $\rho$
ϱ \varrho ϱ $\varrho$
σ \sigma σ $\sigma$ Σ \Sigma Σ $\Sigma$
ς \varsigma ς $\varsigma$ Σ \varSigma Σ $\varSigma$
τ \tau τ $\tau$
υ \upsilon υ $\upsilon$ Υ \Upsilon Υ $\Upsilon$
ϕ \phi ϕ $\phi$ Φ \Phi Φ $\Phi$
φ \varphi φ $\varphi$ Φ \varPhi Φ $\varPhi$
χ \chi χ $\chi$
ψ \psi ψ $\psi$ Ψ \Psi Ψ $\Psi$
ω \omega ω $\omega$ Ω \Omega Ω $\Omega$

2.3.5 运算符

数学符号 LaTeX 代码 说明
≪ \ll $\ll$ 远小于
≫ \gg $\gg$ 远大于
≈ \approx $\approx$ 约等于
∼ \sim $\sim$ 相似
≠ \ne = $\ne$ 不等于
∈ \in $\in$ 属于
∪ \cup $\cup$
∩ \cap $\cap$
± \pm ± $\pm$ 加减 (plusminus)
÷ \div ÷ $\div$ 除法
⋅ \cdot $\cdot$ 点乘
⊙ \odot $\odot$ 圈点乘
⊕ \oplus $\oplus$ 圈加
⊗ \otimes $\otimes$ 圈乘
∏ \prod $\prod$ 连乘
∫ \int $\int$ 积分
∂ \partial $\partial$ 偏导

2.3.6 其他符号

数学符号 LaTeX 代码 说明
… \dots $\dots$ 省略号
⋯ \cdots $\cdots$ 居中省略号
ℜ \Re $\Re$ 实部
∇ \nabla $\nabla$ 梯度符号
△ \triangle $\triangle$ 三角形
∠ \angle $\angle$ 角度符号
∞ \infty $\infty$ 无穷大
† \dag $\dag$ 剪影标记
‡ \ddag $\ddag$ 双剪影标记
§ \S § $\S$ 资料标记
∵ \because $\because$ 因为
∴ \therefore $\therefore$ 所以
↔ \leftrightarrow $\leftrightarrow$ 左右箭头
⇔ \Leftrightarrow $\Leftrightarrow$ 左右双箭头
↮ \nleftrightarrow $\nleftrightarrow$ 非左右箭头
⇎ \nLeftrightarrow $\nLeftrightarrow$ 非左右双箭头
∅ \varnothing $\varnothing$ 空集符号

3. Linux 安装 Anaconda 以及 设置环境变量

  1. 下载安装包
    wget https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
    
  2. 安装
    sh Anaconda3-2023.09-0-Linux-x86_64.sh
    
  3. 设置环境变量和设置快捷键
    gedit(notepad.exe) ~/.bashrc
    
    添加一行:
    # 添加 Anaconda 环境变量
    export PATH="/home/用户名/anaconda3/bin:$PATH"
    
    # 设置快捷键(可选)
    alias act='conda activate'
    alias deact='conda deactivate'
    

4. 配置 Jupyter Notebook

4.1 将 conda 的环境添加到 notebook 中

conda activate 虚拟环境名
conda install ipykernel
python -m ipykernel install --user --name 虚拟环境名 --display-name "自定义名字"
jupyter kernelspec list   #查看当前notebook中所具有的kernel

在该虚拟环境中还需要重新安装jupyter notebook

pip install jupyter notebook

4.2 代码自动填充 Auto-fill

pip install jupyter_contrib_nbextensions

jupyter contrib nbextension install --user

pip install --user jupyter_nbextensions_configurator 

jupyter nbextensions_configurator enable --user

jupyter nbextension enable

5. KMS 主机地址

kms.loli.beer
kms.loli.best
kms.03k.org
kms.cary.tech
kms.mc06.net

参考

  1. 如何使用jupyter编写数学公式(译)

  1. 这是一个演示的脚注(脚注的内容) ↩︎

Guess you like

Origin blog.csdn.net/weixin_44878336/article/details/133934093