跳转至

LaTeX learning

Happy LaTeXing!

LateX 本地配置参考文章:

Windows: sublime + sumatraPDF快捷键:

Shortkey Function
Ctrl+L, then J forward search
double click backward search
Ctrl+L, then Backspace clear tmp files
Ctrl+K, then Ctrl+B open/close sidebar

Roadmap

\(\LaTeX{}\)的学习从阅读overleaf的完整教程开始

YouTuber creation: LaTeX Cheat Sheet

LaTeX syntax tips

math code

内置功能:\( ... \), $ ... $, \begin{math} ... \end{math}

内置功能: \[ ... \], $$ ... $$, \begin{displaymath} ... \end{displaymath}

amsmath package提供:

  • \begin{equation*} ... \end{equation*}, \begin{equation} ... \end{equation}(编号)
  • \begin{align*} ... \end{align*}, \begin{align} ... \end{align}(编号)

✨ equation仅支持单行公式;align支持多行公式,可以通过&指定对齐位置,但是每行都有编号。

✨ pairs of dollar sign is no longer recommended: Why use \[...\] in place of $$...$$?

实现多行公式,但只有一个编号:

\begin{equation}
  \begin{aligned}
    a &= b + c \\
    &= d + e + f \\
  \end{aligned}
\end{equation}

fonts

  • 自动应用的字体
    • 主字体(mainfont) - 正文默认
    • 无衬线字体(sansfont) - 标题/强调
    • 等宽字体(monofont) - 代码
  • 可调用的字体族(familyfont)
    • zhsong
    • zhhei
    • zhkai
    • zhfs
% 设置字体路径
\defaultfontfeatures{Path=fonts/}

% 设置中文字体
\setCJKmainfont[
  AutoFakeBold = 3,
  ItalicFont   = simkai.ttf
]{simsun.ttc}
\setCJKsansfont[AutoFakeBold=3]{simhei.ttf}
\setCJKmonofont{simfang.ttf}
\setCJKfamilyfont{zhsong}{simsun.ttc}[
  AutoFakeBold = 3,
  ItalicFont   = simkai.ttf
]
\setCJKfamilyfont{zhhei}{simhei.ttf}[AutoFakeBold=3]
\setCJKfamilyfont{zhkai}{simkai.ttf}
\setCJKfamilyfont{zhfs}{simfang.ttf}

\newcommand*{\songti}{\CJKfamily{zhsong}}
\newcommand*{\heiti}{\CJKfamily{zhhei}}
\newcommand*{\kaishu}{\CJKfamily{zhkai}}
\newcommand*{\fangsong}{\CJKfamily{zhfs}}

Document Class Templates

note📒

参考UC Berkeley的CS61A课程的discussion模板

Teemu's TU Delft LaTeX Template

beamer🅱️

Template Link or Reference
color and theme configuration beamer matix
SJTU theme SJTUBeamer
UBC(University of British Columbia) blue theme
Northwestern University theme wildcat: A modern, highly customizable beamer theme. -- Aaron Wolf

book📘

Template Link or Reference
Beautybook

Mathmatical symbols fonts

\mathcal: calligraphic. 通常用来表示集合、函数空间等. \(\LaTeX{}\)默认支持,无需external package.

\[ \mathcal{A}, \mathcal{B}, \mathcal{C}, \mathcal{D}, \mathcal{E}, \mathcal{F}, \mathcal{G}, \mathcal{H}, \mathcal{I}, \mathcal{J}, \mathcal{K}, \mathcal{L}, \mathcal{M}, \mathcal{N}, \mathcal{O}, \mathcal{P}, \mathcal{Q}, \mathcal{R}, \mathcal{S}, \mathcal{T}, \mathcal{U}, \mathcal{V}, \mathcal{W}, \mathcal{X}, \mathcal{Y}, \mathcal{Z} \]
\mathcal{A}, \mathcal{B}, \mathcal{C}...

\mathbb: blackboard bold. 通常用于表示常见的数学集合,例如实数集\(\mathbb{R}\)、整数集\(\mathbb{Z}\)、自然数集\(\mathbb{N}\)等. 在preamble中需要加载 amsfonts 或 amssymb 包来支持.

\[ \mathbb{A}, \mathbb{B}, \mathbb{C}, \mathbb{D}, \mathbb{E}, \mathbb{F}, \mathbb{G}, \mathbb{H}, \mathbb{I}, \mathbb{J}, \mathbb{K}, \mathbb{L}, \mathbb{M}, \mathbb{N}, \mathbb{O}, \mathbb{P}, \mathbb{Q}, \mathbb{R}, \mathbb{S}, \mathbb{T}, \mathbb{U}, \mathbb{V}, \mathbb{W}, \mathbb{X}, \mathbb{Y}, \mathbb{Z} \]
\mathbb{A}, \mathbb{B}, \mathbb{C}...

Package management

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\graphicspath{{figures/}}
\usepackage{float}
\usepackage{geometry}
\geometry{margin=1in}
\usepackage{hyperref}