Topic 5
Snippets
Snippets are useful when they remove repetition without hiding the structure of the document.
Start with high-frequency patterns
Create snippets only for patterns you type constantly:
- theorem environments
- aligned equation blocks
- common figure or table shells
- repeated document scaffolding
If a snippet is used once a month, it probably does not belong in the core set.
Start from the Command Palette and open the user snippet flow instead of creating random JSON files by hand.
Then search for the LaTeX snippet target so the snippet file is attached to the language you actually use for manuscript work.
If a LaTeX snippet file already exists, open that existing file instead of scattering duplicate snippet files across the system.
Example snippet
If you need to inspect the files directly, the Windows example below shows the %APPDATA%\\Code\\User\\snippets folder where user snippets are stored.
Inside that folder, confirm that the LaTeX snippet file exists and is the file you plan to keep editing.
Once the file is open, keep the snippet set short and readable so future edits stay easy.
{
"align environment": {
"prefix": "ali",
"body": [
"\\begin{align}",
" $1",
"\\end{align}"
]
}
}
Keep prefixes short but memorable.
Avoid oversized libraries
Large snippet files become their own maintenance burden. Start with a small set that you trust, then add entries only when repeated typing is clearly wasting time.
Before proceeding
Confirm that your snippets speed up common LaTeX patterns and that you still understand the structure they expand into.