{"id":48907124,"url":"https://github.com/superle3/snippet-leaf","last_synced_at":"2026-04-23T02:01:33.912Z","repository":{"id":305542051,"uuid":"1019032548","full_name":"superle3/snippet-leaf","owner":"superle3","description":"Overleaf port of obsidian-latex-suite. Make typesetting LaTeX as fast as handwriting through snippets, text expansion, and editor enhancements ","archived":false,"fork":false,"pushed_at":"2026-04-16T15:23:47.000Z","size":22931,"stargazers_count":13,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-16T21:35:26.770Z","etag":null,"topics":["latex","math","overleaf","overleaf-extension","snippets","text-expansion"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/superle3.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"artisticat","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2025-07-13T15:36:36.000Z","updated_at":"2026-04-16T19:30:19.000Z","dependencies_parsed_at":"2025-09-11T01:15:54.337Z","dependency_job_id":"b6998d14-b283-492d-865d-f16f50452ec1","html_url":"https://github.com/superle3/snippet-leaf","commit_stats":null,"previous_names":["superle3/snippet-leaf"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/superle3/snippet-leaf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superle3%2Fsnippet-leaf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superle3%2Fsnippet-leaf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superle3%2Fsnippet-leaf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superle3%2Fsnippet-leaf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superle3","download_url":"https://codeload.github.com/superle3/snippet-leaf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superle3%2Fsnippet-leaf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32162611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"online","status_checked_at":"2026-04-23T02:00:06.710Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["latex","math","overleaf","overleaf-extension","snippets","text-expansion"],"created_at":"2026-04-16T21:07:51.817Z","updated_at":"2026-04-23T02:01:33.902Z","avatar_url":"https://github.com/superle3.png","language":"TypeScript","funding_links":["https://ko-fi.com/artisticat","https://ko-fi.com/J3J6BBZAW'"],"categories":[],"sub_categories":[],"readme":"# Snippetleaf\n\nA port of [Obsidian Latex Suite](https://github.com/artisticat1/obsidian-latex-suite) to overleaf that aims to make typesetting LaTeX math as fast as handwriting.\n\nInspired by [Gilles Castel\u0026#39;s setup using UltiSnips](https://castel.dev/post/lecture-notes-1/).\n\n![demo](./gifs/demov2.gif)\n\nThe plugin's main feature is **snippets**, which help you write LaTeX quicker through shortcuts and text expansion! For example, type\n\n- \"sqx\" instead of \"\\sqrt{x}\"\n- \"a/b\" instead of \"\\frac{a}{b}\"\n- \"par x y \" instead of \"\\frac{\\partial x}{\\partial y}\"\n\nSee [Gilles Castel\u0026#39;s writeup](https://castel.dev/post/lecture-notes-1/) for more information.\n\nThe plugin comes with a [set of default snippets](https://github.com/superle3/snippet-leaf/blob/main/src/default_snippets.js), loosely based on [Gilles Castel\u0026#39;s](https://castel.dev/post/lecture-notes-1/#other-snippets). You can modify them, remove them, and write your own.\n\n## Usage\n\nTo get started, type \"dm\" to enter display math mode. Try typing the following:\n\n- \"xsr\" → \"x^{2}\".\n- \"x/y \u003ckbd\u003eTab\u003c/kbd\u003e\" → \"\\\\frac{x}{y}\".\n- \"sin @t\" → \"\\\\sin \\\\theta\".\n\n**Have a look at the [cheatsheet](#cheatsheet)** for a list of commonly used default snippets.\n\nOnce these feel familiar, you can check out the [**default snippets**](https://github.com/artisticat1/obsidian-latex-suite/blob/main/src/default_snippets.js) for more commands. e.g.\n\n- \"par \u003ckbd\u003eTab\u003c/kbd\u003e f \u003ckbd\u003eTab\u003c/kbd\u003e x \u003ckbd\u003eTab\u003c/kbd\u003e\" → \"\\\\frac{\\\\partial f}{\\\\partial x}\".\n- \"dint \u003ckbd\u003eTab\u003c/kbd\u003e 2pi \u003ckbd\u003eTab\u003c/kbd\u003e sin @t \u003ckbd\u003eTab\u003c/kbd\u003e @t \u003ckbd\u003eTab\u003c/kbd\u003e\" → \"\\\\int\\_{0}^{2\\pi} \\\\sin \\\\theta \\\\, d\\\\theta\".\n\nYou can also add your own snippets! [For more info on writing snippets, see **here**](#snippets). You can [view snippets written by others and share your own snippets here](https://github.com/artisticat1/obsidian-latex-suite/discussions/50).\n\nAside from snippets, the plugin also comes with several other features that aim to make writing LaTeX easier.\n\n## Installation\n\n### Firefox\n\n- Go the [latest release](https://github.com/superle3/snippet-leaf/releases/latest) and download the `.xpi` file in the firefox based browser you want to add the extension.\n- There should open a popup, click on `Continue to Installation` and when its done downloading, click `add`.\n- If for whatever reason this doesn't work or you can't download it on that browser, you first hide any sidebar on the left/right and drag-and-drop the `.xpi` file from your file-explorer in firefox. It should give you a popup where it asks you if the addons should be added. Click `add` to install the addon.\n\n### Chromium (Chrome, Edge, Brave, Opera, Vivaldi, etc)\n\n- Go to the [latest release](https://github.com/superle3/snippet-leaf/releases/latest) and download the `snippetleaf-\u003cversion-number\u003e.zip` file.\n- Extract the zip file into any folder, for example `snippetleaf`.\n- Inside the folder `snippetleaf`, there should be a file called `manifest.json`, if there is only a folder in `snippetleaf`, check if that folder has a file `manifest.json`.\n- Go to `chrome://extensions` or open your extensions settings. (the url `chrome://extensions` might get redirected to `\u003cinsert-browser-name\u003e://extensions` like `brave://extensions`).\n- turn on developer mode\n- Click on `Load unpacked`\n- Select the folder which contains the `manifest.json` file, in this example thus `snippetleaf`.\n\nTo check if the installation succeeded, reload your overleaf website and there should be little message in the corner saying `Snippetleaf settings updated!`.\n\n\u003e [!NOTE]\n\u003e For pictures of the installation on brave see https://github.com/superle3/snippet-leaf/discussions/23#discussioncomment-14723470.\n\u003e This addon relies on a very recent patch of overleaf which has not been brought into `overleaf-toolkit`. Thus if you self-host your overleaf instance and you can patch your instance, see https://github.com/superle3/snippet-leaf/discussions/23#discussioncomment-14732840 on how to patch your `overleaf-toolkit`.\n\n### Safari/other browsers\n\nNot supported, use a chromium/firefox browser. If anyone is willing to release this addon for safari you can open an issue and I'll redirect it to that version. As for other browsers, you can open up an issue asking for support if its not already supported.\n\n### Chrome extension store/ Edge extension store/ Mozilla addons store\n\nComing soon(ish), need to make an icon and then I'll try to release it on there.\n\n## Features\n\n### Auto-fraction\n\nLets you type \"1/x\" instead of \"\\frac{1}{x}\".\n\nFor example, it makes the following expansions:\n\n- `x/` → `\\frac{x}{}`\n- `(a + b(c + d))/` → `\\frac{a + b(c + d)}{}`\n\nand moves the cursor inside the brackets.\n\nOnce done typing the denominator, press \u003ckbd\u003eTab\u003c/kbd\u003e to exit the fraction.\n\n![auto-fraction](https://raw.githubusercontent.com/artisticat1/obsidian-latex-suite/main/gifs/auto-fraction.gif)\n\n### Matrix shortcuts\n\nWhile inside a matrix, array, align, or cases environment,\n\n- Pressing \u003ckbd\u003eTab\u003c/kbd\u003e will insert the \"\u0026\" symbol.\n- Pressing \u003ckbd\u003eEnter\u003c/kbd\u003e will insert \"\\\\\\\\\" and move to a new line.\n- Pressing \u003ckbd\u003eShift + Enter\u003c/kbd\u003e will move to the end of the next line (which you can use to exit the matrix).\n\n![matrix shortcuts](https://raw.githubusercontent.com/artisticat1/obsidian-latex-suite/main/gifs/matrix_shortcuts.gif)\n\n### Tabout\n\nTo make it easier to navigate and exit equations,\n\n- Pressing \u003ckbd\u003eTab\u003c/kbd\u003e while the cursor is at the end of an equation will move the cursor outside the `$` symbols.\n- Otherwise, pressing \u003ckbd\u003eTab\u003c/kbd\u003e will advance the cursor to the next closing bracket: `)`, `]`, `}`, `\u003e`, or `|`.\n\n### Visual snippets\n\nSometimes you want to annotate math, or cancel or cross out terms. Selecting some math with the cursor and typing\n\n- \"U\" will surround it with \"\\\\underbrace\".\n- \"O\" will surround it with \"\\\\overbrace\".\n- \"C\" will surround it with \"\\\\cancel\".\n- \"K\" will surround it with \"\\\\cancelto\".\n- \"B\" will surround it with \"\\\\underset\".\n\n![visual snippets](https://raw.githubusercontent.com/artisticat1/obsidian-latex-suite/main/gifs/visual_snippets.gif)\n\n### Auto-enlarge brackets\n\nWhen a snippet containing \"\\\\sum\", \"\\\\int\" or \"\\\\frac\" is triggered, any enclosing brackets will automatically be enlarged with \"\\\\left\" and \"\\\\right\".\n\n![auto-enlarge brackets](https://raw.githubusercontent.com/artisticat1/obsidian-latex-suite/main/gifs/auto-enlarge_brackets.gif)\n\n### Snippets\n\n_Snippets_ are shortcuts that allow you to insert certain text based on certain triggers. For example, the default snippet\n\n```typescript\n{trigger: \"@l\", replacement: \"\\\\lambda\", options: \"mA\"}\n```\n\nwill expand \"@l\" to \"\\lambda\".\n\nSnippets can be edited in the plugin settings. The structure of a snippet is as follows:\n\n```typescript\n{\n  trigger: string | RegExp,\n  replacement: string | (arg) =\u003e string | false,\n  options: string,\n  priority?: number,\n  description?: string,\n  flags?: string,\n  version?: 1 | 2,\n}\n```\n\n- `trigger` : The text that triggers this snippet.\n    - Triggers can also be regular expressions. [See here for more info.](./DOCS.md#regex-snippets)\n- `replacement` : The text to replace the `trigger` with.\n    - Replacements can also be JavaScript functions. [See here for more info.](./DOCS.md#function-snippets)\n- `options` : See below.\n- `priority` (optional): This snippet's priority. Snippets with higher priority are run first. Can be negative. Defaults to 0.\n- `description` (optional): A description for this snippet.\n- `flags` (optional): Flags for regex snippets.\n- `version` (optional): version number for snippet syntax. [See here for more info](./DOCS.md#versions)\n\n#### Options\n\n- `t` : Text mode. Only run this snippet outside math\n- `m` : Math mode. Only run this snippet inside math. Shorthand for both `M` and `n`\n- `M` : Block math mode. Only run this snippet inside a `$$ ... $$` or `\\[ ... \\]` block\n- `n` : Inline math mode. Only run this snippet inside a `$ ... $` or `\\( ... \\)` block\n- `A` : Auto. Expand this snippet as soon as the trigger is typed. If omitted, the \u003ckbd\u003eTab\u003c/kbd\u003e key must be pressed to expand the snippet\n- `r` : [Regex](./DOCS.md#regex-snippets). The `trigger` will be treated as a regular expression\n- `v` : [Visual](./DOCS.md#visual-snippets). Only run this snippet on a selection. The trigger should be a single character\n- `w` : Word boundary. Only run this snippet when the trigger is preceded (and followed by) a word delimiter, such as `.`, `,`, or `-`.\n\nInsert **tabstops** for the cursor to jump to by writing \"@0\", \"@1\", etc. in the `replacement`.\n\nFor examples and more details on writing snippets, including **regex** snippets and **function** snippets, [have a look at the **documentation**](DOCS.md).\n\nYou can [view snippets written by others and share your own snippets here](https://github.com/artisticat1/obsidian-latex-suite/discussions/50).\n\n\u003e [!WARNING]\n\u003e Snippet files are interpreted as JavaScript and can execute arbitrary code.\n\u003e Always be careful with snippets shared from others to avoid running malicious code.\n\n## Cheatsheet\n\n| Trigger           | Replacement    |\n| ----------------- | -------------- |\n| mk                | \\\\( \\\\)        |\n| dm                | \\\\[\u003cbr\u003e\u003cbr\u003e\\\\] |\n| sr                | ^{2}           |\n| cb                | ^{3}           |\n| rd                | ^{ }           |\n| \\_                | \\_{ }          |\n| sq                | \\\\sqrt{ }      |\n| x/y\u003ckbd\u003eTab\u003c/kbd\u003e | \\\\frac{x}{y}   |\n| //                | \\\\frac{ }{ }   |\n| \"                 | \\\\text{ }      |\n| text              | \\\\text{ }      |\n| x1                | x\\_{1}         |\n| x,.               | \\\\mathbf{x}    |\n| x.,               | \\\\mathbf{x}    |\n| xdot              | \\\\dot{x}       |\n| xhat              | \\\\hat{x}       |\n| xbar              | \\\\bar{x}       |\n| xvec              | \\\\vec{x}       |\n| xtilde            | \\\\tilde{x}     |\n| xund              | \\\\underline{x} |\n| ee                | e^{ }          |\n| invs              | ^{-1}          |\n\nWhen running a snippet that **moves the cursor inside brackets {}, press \u003ckbd\u003eTab\u003c/kbd\u003e to exit the brackets**.\n\n### Greek letters\n\n| Trigger | Replacement  | Trigger | Replacement |\n| ------- | ------------ | ------- | ----------- |\n| ;a      | \\\\alpha      | eta     | \\\\eta       |\n| ;b      | \\\\beta       | mu      | \\\\mu        |\n| ;g      | \\\\gamma      | nu      | \\\\nu        |\n| ;G      | \\\\Gamma      | xi      | \\\\xi        |\n| ;d      | \\\\delta      | Xi      | \\\\Xi        |\n| ;D      | \\\\Delta      | pi      | \\\\pi        |\n| ;e      | \\\\epsilon    | Pi      | \\\\Pi        |\n| :e      | \\\\varepsilon | rho     | \\\\rho       |\n| ;z      | \\\\zeta       | tau     | \\\\tau       |\n| ;t      | \\\\theta      | phi     | \\\\phi       |\n| ;T      | \\\\Theta      | Phi     | \\\\Phi       |\n| ;k      | \\\\kappa      | chi     | \\\\chi       |\n| ;l      | \\\\lambda     | psi     | \\\\psi       |\n| ;L      | \\\\Lambda     | Psi     | \\\\Psi       |\n| ;s      | \\\\sigma      |         |             |\n| ;S      | \\\\Sigma      |         |             |\n| ;o      | \\\\omega      |         |             |\n| ome     | \\\\omega      |         |             |\n\nFor Greek letters with short names (2-3 characters), just type their name,\ne.g. \"pi\" → \"\\\\pi\".\n\n## Acknowledgements\n\n- [@artisticat1](https://github.com/artisticat1)'s [Obsidian Latex Suite](https://github.com/artisticat1/obsidian-latex-suite) for the snippet engine.\n- [@TeXlyre](https://github.com/TeXlyre/codemirror-lang-latex) for the LaTeX language support.\n- [@tth05](https://github.com/tth05)'s [Obsidian Completr](https://github.com/tth05/obsidian-completr) for the basis of the tabstop code.\n- [Dynamic Highlights](https://github.com/nothingislost/obsidian-dynamic-highlights/blob/master/src/settings/ui.ts) for reference.\n- [Quick Latex for Obsidian](https://github.com/joeyuping/quick_latex_obsidian) for inspiration.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.\n\n## Coming from Obsidian latex suite\n\nSee the [DOCS](./DOCS.md#tranvsering%20obsidian%20settings)\n\n## Support\n\nIf you like this plugin and want to say thanks, you can buy the original author of obsidian latex suite coffee here.\n\n\u003ca href='https://ko-fi.com/J3J6BBZAW' target='_blank'\u003e\u003cimg height='42' style='border:0px;height:42px;' src='https://cdn.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy @artisticat1 a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperle3%2Fsnippet-leaf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperle3%2Fsnippet-leaf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperle3%2Fsnippet-leaf/lists"}