{"id":31578348,"url":"https://github.com/nukopy/latex-in-markdown-for-pandoc","last_synced_at":"2026-05-18T19:06:14.041Z","repository":{"id":318029355,"uuid":"1068413463","full_name":"nukopy/latex-in-markdown-for-pandoc","owner":"nukopy","description":"LaTeX in Markdown for Pandoc","archived":false,"fork":false,"pushed_at":"2025-10-04T15:30:49.000Z","size":2719,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-04T17:26:25.774Z","etag":null,"topics":["latex","markdown","pandoc","pandoc-markdown","tex"],"latest_commit_sha":null,"homepage":"https://marketplace.visualstudio.com/items?itemName=nukopy.latex-in-markdown-for-pandoc","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nukopy.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-10-02T10:51:02.000Z","updated_at":"2025-10-04T17:21:50.000Z","dependencies_parsed_at":"2025-10-04T17:26:57.225Z","dependency_job_id":"ddb1dafc-f544-4249-b4e1-2b695ad41bb2","html_url":"https://github.com/nukopy/latex-in-markdown-for-pandoc","commit_stats":null,"previous_names":["nukopy/latex-in-markdown-for-pandoc"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/nukopy/latex-in-markdown-for-pandoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukopy%2Flatex-in-markdown-for-pandoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukopy%2Flatex-in-markdown-for-pandoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukopy%2Flatex-in-markdown-for-pandoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukopy%2Flatex-in-markdown-for-pandoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nukopy","download_url":"https://codeload.github.com/nukopy/latex-in-markdown-for-pandoc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nukopy%2Flatex-in-markdown-for-pandoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278510917,"owners_count":25998997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"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","markdown","pandoc","pandoc-markdown","tex"],"created_at":"2025-10-05T19:57:00.496Z","updated_at":"2026-05-18T19:06:14.018Z","avatar_url":"https://github.com/nukopy.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LaTeX in Markdown for Pandoc\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://latex-in-markdown-for-pandoc.s3.ap-northeast-1.amazonaws.com/assets/icon.png\" alt=\"LaTeX in Markdown for Pandoc\" width=\"256\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://marketplace.visualstudio.com/items?itemName=nukopy.latex-in-markdown-for-pandoc\"\u003e\u003cimg src=\"https://img.shields.io/visual-studio-marketplace/v/nukopy.latex-in-markdown-for-pandoc\" alt=\"Version badge\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://marketplace.visualstudio.com/items?itemName=nukopy.latex-in-markdown-for-pandoc\"\u003e\u003cimg src=\"https://img.shields.io/visual-studio-marketplace/d/nukopy.latex-in-markdown-for-pandoc\" alt=\"Downloads badge\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://marketplace.visualstudio.com/items?itemName=nukopy.latex-in-markdown-for-pandoc\"\u003e\u003cimg src=\"https://img.shields.io/visual-studio-marketplace/i/nukopy.latex-in-markdown-for-pandoc\" alt=\"Installs badge\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/nukopy/latex-in-markdown-for-pandoc/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" alt=\"MIT license badge\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e\n  |\n  \u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\n  |\n  \u003ca href=\"#quickstart\"\u003eQuickstart\u003c/a\u003e\n  |\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\n  |\n  \u003ca href=\"#showcase\"\u003eShowcase\u003c/a\u003e\n\u003c/p\u003e\n\nVisual Studio Code extension that brings LaTeX syntax highlighting to Markdown documents processed with [Pandoc](https://pandoc.org/index.html).\n\n## Features\n\n\u003c!-- v0.2.0 draft: LaTeX code in both the Markdown frontmatter and body is highlighted with this extension. **You can keep using your favorite theme.** --\u003e\n\nLaTeX code in the Pandoc-flavoured Markdown frontmatter is highlighted with this extension. **You can keep using your favorite theme.**\n\nFeatures are as follows:\n\n- **Highlight LaTeX code in Pandoc-flavoured Markdown**\n  - [x] LaTeX code in Markdown frontmatter written in YAML\n  - [ ] [WIP] LaTeX code in Markdown body\n\n### Frontmatter highlight\n\nFrontmatter highlight in dark theme ([Atom One Dark](https://vscodethemes.com/e/akamud.vscode-theme-onedark/atom-one-dark)):\n\n![Frontmatter highlight in dark theme](https://latex-in-markdown-for-pandoc.s3.ap-northeast-1.amazonaws.com/assets/features-highlight-frontmatter-dark.png)\n\nFrontmatter highlight in light theme ([Bold Light (rainglow)](https://vscodethemes.com/e/daylerees.rainglow/bold-light-rainglow)):\n\n![Frontmatter highlight in light theme](https://latex-in-markdown-for-pandoc.s3.ap-northeast-1.amazonaws.com/assets/features-highlight-frontmatter-light.png)\n\n\u003c!-- ### [WIP] Body highlight --\u003e\n\n\u003c!-- \u003e [!NOTE]\n\u003e This feature is WIP.\n\u003e Next version will support this feature. --\u003e\n\n\u003c!-- Body highlight in dark theme:\n\n![Body highlight in dark theme](https://latex-in-markdown-for-pandoc.s3.ap-northeast-1.amazonaws.com/assets/features-highlight-body-dark.png)\n\nBody highlight in light theme:\n\n![Body highlight in light theme](https://latex-in-markdown-for-pandoc.s3.ap-northeast-1.amazonaws.com/assets/features-highlight-body-light.png)\n--\u003e\n\n## Installation\n\nThis extension is available for free in the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=nukopy.latex-in-markdown-for-pandoc).\n\nIf you're a Cursor user, you cannot install this extension from the marketplace now (planned to be supported in the future). However, you can install it from a `.vsix` file. See the section [Install locally](#install-locally) for details.\n\n## Quickstart\n\n1. Install this extension from the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=nukopy.latex-in-markdown-for-pandoc).\n2. Create a new Markdown file.\n3. Copy the contents of [quickstart example](./examples/showcase/quickstart/main.md) into your Markdown file.\n4. LaTeX code in the Markdown frontmatter will be highlighted.\n\n\u003c!-- v0.2.0 draft: 4. LaTeX code in the frontmatter and body of your Markdown file will be highlighted. --\u003e\n\n## Usage\n\n\u003c!-- ### [WIP] Body highlight --\u003e\n\n\u003c!-- \u003e [!NOTE]\n\u003e This feature is not implemented yet.\n\u003e Next version will support this feature. --\u003e\n\n\u003c!-- v0.2.0 draft:Once the installation is complete, LaTeX code written in the Markdown body will be highlighted with **no configuration** like [example](#body-highlight). --\u003e\n\n### Frontmatter highlight\n\nTo highlight LaTeX code in the frontmatter, e.g. [Frontmatter highlight](#frontmatter-highlight), you need to add two YAML comments shown below to the frontmatter:\n\n- `# ----- pandoc-latex-begin -----`\n- `# ----- pandoc-latex-end -----`\n\nAfter adding them, the range between them in frontmatter is highlighted as LaTeX code. **This is a necessary step to enable LaTeX syntax highlight in the frontmatter**. We provide [utility snippets](#utility-snippets) to easily add these comments.\n\nIf correctly set up, LaTeX code like `\\usepackage{graphicx}` is highlighted. For example, your Markdown's frontmatter should look like:\n\n```yaml\n---\n# ----- pandoc-latex-begin -----\n\n# The code below is treated as normal YAML\ndocumentclass: extarticle\npapersize: a4\npagestyle: empty\ngeometry:\n  - top=17.5mm\n  - bottom=20mm\n  - left=20mm\n  - right=20mm\n\n# The code below is highlighted as LaTeX code in your editor!\nheader-includes:\n  - \\usepackage{xcolor}\n  - \\usepackage{graphicx}\n  - \\usepackage{titlesec}\n  - \\usepackage{setspace}\n\n# ----- pandoc-latex-end -----\n--- # \u003c- punctuation to end frontmatter\n```\n\n### Utility snippets\n\nUse the following snippets to insert comments mentioned above quickly.\n\n#### for new empty Markdown file\n\nYou can add frontmatter template by typing `pandoc template` like below:\n\n![snippets: pandoc template](https://latex-in-markdown-for-pandoc.s3.ap-northeast-1.amazonaws.com/assets/snippets-pandoc-template.gif)\n\n#### for existing frontmatter\n\nYou can add frontmatter comments that trigger the highlighting by typing `pandoc begin` and `pandoc end`. **You must type these inside the frontmatter block.**\n\n![snippets: pandoc begin, end](https://latex-in-markdown-for-pandoc.s3.ap-northeast-1.amazonaws.com/assets/snippets-pandoc-begin-end.gif)\n\n\u003e [!WARNING]\n\u003e You might think LaTeX code will still be highlighted even if you skip adding the end comment `# ----- pandoc-latex-end -----` to the frontmatter.\n\u003e\n\u003e However, this extension depends on those comments to delimit the scope it highlights, so omitting them can lead to unexpected errors. Make sure you add the `# ----- pandoc-latex-end -----` comment to the end of the frontmatter correctly.\n\n## Showcase\n\nIn this section, we show some examples of LaTeX in Markdown for Pandoc. As an appendix, we also show how to build PDF and LaTeX files from Markdown files with Pandoc.\n\n### Overview\n\nEach example contains a list of files as follows:\n\n- `main.md`: The main Markdown file\n- `main.tex`: The output LaTeX file (intermediate file)\n- `main.pdf`: The output PDF file (final output)\n\n### Examples\n\n- [Resume with single column layout](./examples/showcase/resume_single_column)\n  - This example shows how to write a resume with a single column layout\n- [Statistics - basics of the normal distribution](./examples/showcase/statistics_normal_distribution_basic)\n  - This example shows how to write a statistics topic in Japanese\n\n### Appendix: How to build examples in showcase\n\nThis appendix shows how to build PDF and LaTeX files from a Markdown file with Pandoc for the example \"Resume with single column layout\".\n\n\u003e [!NOTE]\n\u003e This section is specifically for macOS users.\n\u003e\n\u003e While it may be possible to build on other platforms, please be aware of potential differences.\n\n#### Environment\n\n- macOS Sonoma 14.7\n- Pandoc 3.8\n- [MacTeX](https://www.tug.org/mactex/) 2025.0308\n  - XeLaTeX 3.141592653-2.6-0.999997 (TeX Live 2025)\n\n#### Install dependencies\n\nInstall pandoc and MacTeX:\n\n```sh\n# Install pandoc\nbrew install pandoc\n\n# Install MacTeX (this takes 10-20 minutes on slow internet)\nbrew install --cask mactex\n```\n\nCheck versions:\n\n```sh\npandoc --version\n# pandoc 3.8\nxelatex --version\n# XeTeX 3.141592653-2.6-0.999997 (TeX Live 2025)\n```\n\nIn this example, `xelatex` is used as PDF engine.\n\n#### Clone repository\n\n```sh\ngit clone git@github.com:nukopy/latex-in-markdown-for-pandoc.git\n```\n\n#### Build PDF and LaTeX files from Pandoc-flavoured Markdown\n\n```sh\ncd latex-in-markdown-for-pandoc/examples/showcase/resume_single_column\n\n# build PDF file\npandoc main.md --pdf-engine=xelatex -o main.pdf\nfile main.pdf\n\n# build LaTeX file\npandoc main.md -s -t latex -o main.tex\nfile main.tex\n```\n\nOpen `main.pdf` in a viewer and `main.tex` in your editor to see the result.\n\n## Roadmap\n\n- [x] Highlight LaTeX code in Pandoc-flavoured Markdown\n  - [x] LaTeX in Markdown frontmatter written in YAML\n  - [ ] LaTeX in Markdown body\n- [ ] Extend LSP support to LaTeX code in Markdown (hover documentation and go-to-definition) or LaTeX Workshop integration.\n  - [ ] LaTeX in Markdown frontmatter written in YAML\n  - [ ] LaTeX in Markdown body\n\n## Motivation\n\nI built this extension while writing my resume with Pandoc.\n\nI needed proper LaTeX syntax highlighting inside Markdown, both in YAML frontmatter and the body.\n\n## Development\n\n### Requirements\n\n- Node.js v22.16.x\n- Visual Studio Code v1.99.x or later\n- (optional) Cursor 1.7.x or later\n\n### Setup\n\n```sh\ngit clone git@github.com:nukopy/latex-in-markdown-for-pandoc.git\ncd latex-in-markdown-for-pandoc\npnpm i\n```\n\nNow, you can start developing the extension.\n\n### Build\n\n```sh\npnpm run vsce:build\n```\n\nIf successful, the extension package `dist/latex-in-markdown-for-pandoc-\u003cversion\u003e.vsix` is created.\n\n### Install locally\n\nExecute command `Extensions: Install from VSIX...` in VS Code (or Cursor) and select the file `dist/latex-in-markdown-for-pandoc-\u003cversion\u003e.vsix`.\n\n### Prepare for publishing\n\n1. Create [Azure DevOps organization](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/create-organization?view=azure-devops)\n2. Create [Personal Access Token](https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops\u0026tabs=Windows)\n   - Copy the Personal Access Token for next step\n3. Create a [publisher](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#create-a-publisher)\n\nref: [Publishing Extensions | Visual Studio Code](https://code.visualstudio.com/api/working-with-extensions/publishing-extension)\n\n### Publish to VS Code Marketplace\n\n- Login to VS Code Marketplace\n\n```sh\npnpm run vsce:login -- \u003cpublisher ID\u003e\n# input Personal Access Token\n```\n\n- Edit version in `package.json`\n\n```diff json\n{\n-  \"version\": \"0.1.0\"\n+  \"version\": \"0.1.1\"\n}\n```\n\n- Release\n\n```sh\npnpm run vsce:publish\n```\n\n- Unpublish\n\n```sh\npnpm run vsce:unpublish\n```\n\n## References\n\nThanks to the following references for inspiration:\n\n- [Pandoc User's Guide — YAML metadata blocks and `header-includes`](https://pandoc.org/MANUAL.html#metadata-blocks)\n- [Pandoc User's Guide — Variables](https://pandoc.org/MANUAL.html#variables)\n- [Pandoc User's Guide — raw attribute extension (`{=latex}`)](https://pandoc.org/MANUAL.html#extension-raw_attribute)\n- [Visual Studio Code Extension API — Syntax Highlight Guide (Injection Grammars)](https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide#injection-grammars)\n- [vscode-latex-basics/markdown-latex-combined.tmLanguage.json](https://github.com/jlelong/vscode-latex-basics/blob/main/syntaxes/markdown-latex-combined.tmLanguage.json)\n\n## License\n\nLaTeX in Markdown for Pandoc is under the MIT License: See [LICENSE](./LICENSE) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnukopy%2Flatex-in-markdown-for-pandoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnukopy%2Flatex-in-markdown-for-pandoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnukopy%2Flatex-in-markdown-for-pandoc/lists"}