---
title: "@tecosaur #스니펫 #이맥스: 수식 레이텍 §laas"
url: "https://notes.junghanacs.com/notes/20241111T144638"
author: "Junghan Kim"
date: "2024-11-11T14:46:00+09:00"
lastmod: "2025-02-26T00:00:00+09:00"
tags: ["bib","latex","snippet","symbol","packages"]
description: "LaTeX 자동 활성 스니펫을 이맥스 수식 입력 흐름에 붙이는 방법을 살피는 노트이다."
---

> [!abstract] 이 노트에 대하여
> 
> tecosaur의 LaTeX auto-activating snippets를 중심으로 수식 입력을 얼마나 편하게 만들 수 있는지 검토한다. 스니펫과 기호 입력을 실제 수학 작업 흐름에 연결하려는 관심이 강하다.

## BIBLIOGRAPHY

- “Glossary of Mathematical Symbols.” 2024. [https://en.wikipedia.org/w/index.php?title=Glossary_of_mathematical_symbols&#38;oldid=1253365653](https://en.wikipedia.org/w/index.php?title=Glossary_of_mathematical_symbols&oldid=1253365653).
- “Tecosaur/Latex-Auto-Activating-Snippets.” 2024. <https://github.com/tecosaur/LaTeX-auto-activating-snippets>.

## 관련메타

-   [#스니펫](https://notes.junghanacs.com/meta/20241007T134132)

## 관련노트

-   [@karthink 이맥스 구루 지피텔 레이텍 아티스트](https://notes.junghanacs.com/bib/20250110T104339)
-   [#스니펫 #이맥스 #패키지 §tempel §yasnippet §auto-yasnippet §doom-snippets](https://notes.junghanacs.com/notes/20231018T171100)
-   [@티모시 tecosaur 조직모드 마술사](https://notes.junghanacs.com/bib/20250128T152148)

엄청 편리한 방법이다.

## tecosaur/LaTeX-auto-activating-snippets

-   ([“Tecosaur/Latex-Auto-Activating-Snippets” 2024](https://notes.junghanacs.com/notes/20241111T144638#citeproc_bib_item_2))
-   ([“Glossary of Mathematical Symbols” 2024](https://notes.junghanacs.com/notes/20241111T144638#citeproc_bib_item_1))
-   [X] 수식 테스트

뭔가 구리다. 이거 기본으로 가서 해보라 고전역학 수식 쳐넣는 방법 좀 연구해줘

Mirror of <https://git.tecosaur.net/tec/LaTeX-auto-activating-snippets>

A chunky set of LaTeX snippets for the [auto-activating-snippets engine](https://github.com/ymarco/auto-activating-snippets).

### Sample Configuration

```emacs-lisp
(use-package laas
  :hook (LaTeX-mode . laas-mode)
  :config ; do whatever here
  (aas-set-snippets 'laas-mode
                    ;; set condition!
                    :cond #'texmathp ; expand only while in math
                    "supp" "\\supp"
                    "On" "O(n)"
                    "O1" "O(1)"
                    "Olog" "O(\\log n)"
                    "Olon" "O(n \\log n)"
                    ;; bind to functions!
                    "Sum" (lambda () (interactive)
                            (yas-expand-snippet "\\sum_{$1}^{$2} $0"))
                    "Span" (lambda () (interactive)
                             (yas-expand-snippet "\\Span($1)$0"))
                    ;; add accent snippets
                    :cond #'laas-object-on-left-condition
                    "qq" (lambda () (interactive) (laas-wrap-previous-object "sqrt"))))
```

### Credits

[cdlatex](https://github.com/cdominik/cdlatex) and this [very nice blog post](https://castel.dev/post/lecture-notes-1/).

### Snippets

_Note:_ The rendering on GitHub is a little wonkey. It should be understandable enough, but in any case you can also view this file from emacs:

```sh
(browse-url-emacs "https://raw.githubusercontent.com/tecosaur/LaTeX-auto-activating-snippets/master/README.org")
```

#### Basic set

```emacs-lisp
(aas--format-doc-to-org 'laas-basic-snippets)
```

```text
Basic snippets. Expand only inside maths.
```

```emacs-lisp
(aas--format-snippet-array laas-basic-snippets)
```

| `!=`     | &ne;                |
|----------|---------------------|
| `!>`     | \mapsto             |
| `**`     | &sdot;              |
| `+-`     | &plusmn;            |
| `-+`     | \mp                 |
| `->`     | &rarr;              |
| `...`    | &hellip;            |
| `<<`     | &Lt;                |
| `<=`     | &le;                |
| `<>`     | &diamond;           |
| `=<`     | \impliedby          |
| `==`     | &amp;=              |
| `=>`     | \implies            |
| `>=`     | &ge;                |
| `>>`     | &Gt;                |
| `AA`     | &forall;            |
| `EE`     | &exist;             |
| `cb`     | ^3                  |
| `iff`    | \iff                |
| `inn`    | &isin;              |
| `notin`  | &not;&isin;         |
| `sr`     | ^2                  |
| `xx`     | &times;             |
| `❘->`    | \mapsto             |
| `❘=`     | \models             |
| `❘❘`     | \mid                |
| `∽=`     | &asymp;             |
| `∽∽`     | &sim;               |
| `arccos` | arccos              |
| `arccot` | \arccot             |
| `arccot` | \arccot             |
| `arccsc` | \arccsc             |
| `arcsec` | \arcsec             |
| `arcsin` | arcsin              |
| `arctan` | arctan              |
| `cos`    | cos                 |
| `cot`    | cot                 |
| `csc`    | csc                 |
| `exp`    | exp                 |
| `ln`     | ln                  |
| `log`    | log                 |
| `perp`   | &perp;              |
| `sin`    | sin                 |
| `star`   | *                   |
| `gcd`    | gcd                 |
| `min`    | min                 |
| `max`    | max                 |
| `eqv`    | &equiv;             |
| `CC`     | \CC                 |
| `FF`     | \FF                 |
| `HH`     | \HH                 |
| `NN`     | \NN                 |
| `PP`     | \PP                 |
| `QQ`     | \QQ                 |
| `RR`     | \RR                 |
| `ZZ`     | \ZZ                 |
| `;a`     | &alpha;             |
| `;A`     | &forall;            |
| `;;A`    | &aleph;             |
| `;b`     | &beta;              |
| `;;;c`   | cos                 |
| `;;;C`   | arccos              |
| `;d`     | &delta;             |
| `;;d`    | &part;              |
| `;D`     | &Delta;             |
| `;;D`    | &nabla;             |
| `;e`     | &epsilon;           |
| `;;e`    | &epsilon;           |
| `;;;e`   | exp                 |
| `;E`     | &exist;             |
| `;;;E`   | ln                  |
| `;f`     | &phi;               |
| `;;f`    | &varphi;            |
| `;F`     | &Phi;               |
| `;g`     | &gamma;             |
| `;;;g`   | lg                  |
| `;G`     | &Gamma;             |
| `;;;G`   | 10<sup>?</sup>      |
| `;h`     | &eta;               |
| `;;h`    | &hbar;              |
| `;i`     | &isin;              |
| `;;i`    | &imath;             |
| `;I`     | &iota;              |
| `;;I`    | \Im                 |
| `;;j`    | &jmath;             |
| `;k`     | &kappa;             |
| `;l`     | &lambda;            |
| `;;l`    | &ell;               |
| `;;;l`   | log                 |
| `;L`     | &Lambda;            |
| `;m`     | &mu;                |
| `;n`     | &nu;                |
| `;;;n`   | ln                  |
| `;N`     | &nabla;             |
| `;;;N`   | exp                 |
| `;o`     | &omega;             |
| `;O`     | &Omega;             |
| `;;O`    | &mho;               |
| `;p`     | &pi;                |
| `;;p`    | &piv;               |
| `;P`     | &Pi;                |
| `;q`     | &theta;             |
| `;;q`    | &thetasym;          |
| `;Q`     | &Theta;             |
| `;r`     | &rho;               |
| `;;r`    | \varrho             |
| `;;R`    | \Re                 |
| `;s`     | &sigma;             |
| `;;s`    | &sigmaf;            |
| `;;;s`   | sin                 |
| `;S`     | &Sigma;             |
| `;;;S`   | arcsin              |
| `;t`     | &tau;               |
| `;;;t`   | tan                 |
| `;;;T`   | arctan              |
| `;u`     | &upsilon;           |
| `;U`     | &Upsilon;           |
| `;v`     | &or;                |
| `;V`     | &Phi;               |
| `;w`     | &xi;                |
| `;W`     | &Xi;                |
| `;x`     | &chi;               |
| `;y`     | &psi;               |
| `;Y`     | &Psi;               |
| `;z`     | &zeta;              |
| `;0`     | &empty;             |
| `;8`     | &infin;             |
| `;!`     | &not;               |
| `;^`     | &uarr;              |
| `;&`     | &and;               |
| `;∽`     | &asymp;             |
| `;;∽`    | &cong;              |
| `;_`     | &darr;              |
| `;+`     | &cup;               |
| `;-`     | &harr;              |
| `;;+`    | &oplus;             |
| `;;-`    | \longleftrightarrow |
| `;*`     | &times;             |
| `;/`     | &not;               |
| `;❘`     | \mapsto             |
| `;;❘`    | \longmapsto         |
| `;\`     | &setminus;          |
| `;=`     | &hArr;              |
| `;;=`    | \Longleftrightarrow |
| `;(`     | &lang;              |
| `;)`     | &rang;              |
| `;[`     | &lArr;              |
| `;;[`    | \Longleftarrow      |
| `;]`     | &rArr;              |
| `;;]`    | \Longrightarrow     |
| `;{`     | &sub;               |
| `;}`     | &sup;               |
| `;<`     | &larr;              |
| `;;<`    | \longleftarrow      |
| `;;;<`   | min                 |
| `;>`     | &rarr;              |
| `;;>`    | \longrightarrow     |
| `;;;>`   | max                 |
| `;'`     | &prime;             |
| `;.`     | &sdot;              |

#### Annoying Subscripts

```emacs-lisp
(aas--format-doc-to-org 'laas-subscript-snippets)
```

```text
Automatic subscripts! Expand In math and after a single letter.
```

```emacs-lisp
(aas--format-snippet-array laas-subscript-snippets)
```

| `ii`  | X_i, or X<sub>Yi</sub> if a subscript was typed already |
|-------|---------------------------------------------------------|
| `ip1` | \_{i+1}                                                 |
| `jj`  | X_j, or X<sub>Yj</sub> if a subscript was typed already |
| `jp1` | \_{j+1}                                                 |
| `nn`  | X_n, or X<sub>Yn</sub> if a subscript was typed already |
| `np1` | \_{n+1}                                                 |
| `kk`  | X_k, or X<sub>Yk</sub> if a subscript was typed already |
| `kp1` | \_{k+1}                                                 |
| `0`   | X_0, or X<sub>Y0</sub> if a subscript was typed already |
| `1`   | X_1, or X<sub>Y1</sub> if a subscript was typed already |
| `2`   | X_2, or X<sub>Y2</sub> if a subscript was typed already |
| `3`   | X_3, or X<sub>Y3</sub> if a subscript was typed already |
| `4`   | X_4, or X<sub>Y4</sub> if a subscript was typed already |
| `5`   | X_5, or X<sub>Y5</sub> if a subscript was typed already |
| `6`   | X_6, or X<sub>Y6</sub> if a subscript was typed already |
| `7`   | X_7, or X<sub>Y7</sub> if a subscript was typed already |
| `8`   | X_8, or X<sub>Y8</sub> if a subscript was typed already |
| `9`   | X_9, or X<sub>Y9</sub> if a subscript was typed already |

#### The infamous fraction

```emacs-lisp
(aas--format-doc-to-org 'laas-frac-snippet)
```

```text
Frac snippet.
Expand to a template frac after //, or wrap the object before point if it isn~t /.

ab/ => \frac{ab}{}
// => \frac{}{}
```

```emacs-lisp
(aas--format-snippet-array laas-frac-snippet)
```

|     |                                      |
|-----|--------------------------------------|
| `/` | See the docs of \`laas-frac-snippet' |

#### Simpler Accents

```emacs-lisp
(aas--format-doc-to-org 'laas-accent-snippets)
```

```text
A simpler way to apply accents. Expand If LaTeX symbol immidiately before point.
```

```emacs-lisp
(aas--format-snippet-array laas-accent-snippets)
```

| `'r`  | Wrap in \mathrm{} or \textrm{}     |
|-------|------------------------------------|
| `'i`  | Wrap in \mathit{} or \textit{}     |
| `'b`  | Wrap in \mathbf{} or \textbf{}     |
| `'e`  | Wrap in \mathemph{} or \textemph{} |
| `'y`  | Wrap in \mathtt{} or \texttt{}     |
| `'f`  | Wrap in \mathsf{} or \textsf{}     |
| `'l`  | Wrap in \textsl                    |
| `'.`  | Wrap in \dot{}                     |
| `':`  | Wrap in \ddot{}                    |
| `'∽`  | Wrap in ~                          |
| `'N`  | Wrap in \widetilde{}               |
| `'^`  | Wrap in \hat{}                     |
| `'H`  | Wrap in \widehat{}                 |
| `'-`  | Wrap in \bar{}                     |
| `'T`  | Wrap in \overline{}                |
| `'_`  | Wrap in \underline{}               |
| `'{`  | Wrap in \overbrace{}               |
| `'}`  | Wrap in \underbrace{}              |
| `'>`  | Wrap in \vec{}                     |
| `'/`  | Wrap in \grave{}                   |
| `'"`  | Wrap in &acute;                    |
| `'v`  | Wrap in &checkmark;                |
| `'u`  | Wrap in \breve{}                   |
| `'m`  | Wrap in \mbox{}                    |
| `'c`  | Wrap in \mathcal{}                 |
| `'0`  | Wrap in {\textstyle }              |
| `'1`  | Wrap in {\displaystyle }           |
| `'2`  | Wrap in {\scriptstyle }            |
| `'3`  | Wrap in {\scriptscriptstyle }      |
| `'q`  | Wrap in \sqrt{}                    |
| `..␣` | Wrap in \dot{}                     |
| `,.`  | Wrap in \vec{}                     |
| `.,`  | Wrap in \vec{}                     |
| `∽␣`  | Wrap in ~                          |
| `hat` | Wrap in \hat{}                     |
| `bar` | Wrap in \overline{}                |

### 테스트

[2024-11-06 Wed 21:58]

\\(\frac{1}{2}\\)입니다. 대박.
