{"id":13479681,"url":"https://github.com/abeleinin/papyrus","last_synced_at":"2025-03-27T10:30:36.844Z","repository":{"id":66555246,"uuid":"602308344","full_name":"abeleinin/papyrus","owner":"abeleinin","description":"📜 Papyrus: Pandoc integration for automatic file conversion in Vim!","archived":false,"fork":false,"pushed_at":"2023-07-07T06:26:22.000Z","size":4965,"stargazers_count":65,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-30T13:38:06.138Z","etag":null,"topics":["latex","markdown","markdown-to-pdf","neovim","neovim-plugin","pandoc","vim","vim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","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/abeleinin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2023-02-15T23:44:15.000Z","updated_at":"2024-10-19T12:31:40.000Z","dependencies_parsed_at":"2024-01-16T06:26:56.483Z","dependency_job_id":"f83b6172-40a5-4f1e-9521-484664504ee8","html_url":"https://github.com/abeleinin/papyrus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeleinin%2Fpapyrus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeleinin%2Fpapyrus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeleinin%2Fpapyrus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abeleinin%2Fpapyrus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abeleinin","download_url":"https://codeload.github.com/abeleinin/papyrus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245826681,"owners_count":20678841,"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","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","markdown-to-pdf","neovim","neovim-plugin","pandoc","vim","vim-plugin"],"created_at":"2024-07-31T16:02:21.298Z","updated_at":"2025-03-27T10:30:36.252Z","avatar_url":"https://github.com/abeleinin.png","language":"Vim Script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"# Papyrus\n\nAutomatically compile Markdown notes into beautiful Latex PDFs or other supported pandoc formats!\n\n![Screenshot example of Papyrus](https://github.com/abeleinin/papyrus/blob/main/examples/example.png?raw=true)\n\nTheme: [material default-community](https://github.com/kaicataldo/material.vim)\n\nPapyrus is an asynchronous Markdown conversion plugin that allows users to have a latex-like editing experience while writing Markdown. By utilizing the [Pandoc](https://pandoc.org/) universal document converter you can write Markdown and Latex syntax in the same file and convert it into a PDF or other Pandoc supported document types.\n\n**Features**\n\n- Asynchronous compilation\n- Ability to set custom Pandoc command-line arguments\n- Optional templates\n\n## Table of contents\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Errors Messages](#error-messages)\n- [Commands](#commands)\n- [Documentation](#documentation)\n  - [Images](#images)\n  - [Fonts](#fonts)\n  - [Templates](#templates)\n- [Demo](#demo)\n\n## Requirements\n\n- [Pandoc](https://pandoc.org/installing.html)\n- [Latex Engine](https://pandoc.org/MANUAL.html#option--pdf-engine)\n\nSupported Engines: pdflatex, lualatex, xelatex, latexmk, tectonic, wkhtmltopdf, weasyprint, pagedjs-cli, prince, context, and pdfroff.\n\n## Installation\n\n### Vim Plugin\n\nAdd the following to your `.vimrc` or `init.vim` file to install the plugin using a plugin manager of your choice. Here are some examples:\n\n```vim\n\" vim-plug\nPlug 'abeleinin/papyrus'\n\n\" packer.nvim\nuse 'abeleinin/papyrus'\n\n\" vundle\nPlugin 'abeleinin/papyrus'\n```\n\nI *strongly* recommend also installing the [vim-pandoc-syntax](https://github.com/vim-pandoc/vim-pandoc-syntax) plugin to visualize Latex special characters.\n\n### Pandoc Templates\n\n**Templates are optional** \n\nMove the Latex template files from wherever your plugin is installed (`~/papyrus/templates/latex/*`) to the pandoc templates folder. The pandoc template folder depends on the OS you're using:\n\n- Unix, Linux, macOS: `$HOME/.local/share/pandoc/templates` or `$HOME/.pandoc/templates`\n- Windows: `C:\\$HOME\\AppData\\Roaming\\pandoc\\templates`\n\nIf the `templates` or `pandoc` folder doesn't exist then you need to create them and put the template files into the new directory. You can also find the default *User data directory* by checking `pandoc --version`.\n\n## Configuration\n\nAfter installation, copy the following configurations into your `.vimrc` or `init.vim` file to configure Papyrus to your specification.\n\n```vim\n\" Specify a Latex Engine from the supported list above\nlet g:papyrus_latex_engine = 'xelatex'\n\n\" Specify any built-in pdf viewing option. It's recommended to use \n\" a pdf viewer with automatic updates on save.\nlet g:papyrus_viewer = 'zathura'\n\n\" Recommended keybinding for compiling and viewing documents\n\" Adding optional formattings is also possible by \nmap \u003cleader\u003epc :PapyrusCompile\u003cCR\u003e\nmap \u003cleader\u003epa :PapyrusAutoCompile\u003cCR\u003e\nmap \u003cleader\u003epv :PapyrusView\u003cCR\u003e\nmap \u003cleader\u003eps :PapyrusStart\u003cCR\u003e\n```\n\n### Optional\n\n`g:papyrus_pandoc_args`: Add custom [pandoc compilation](https://pandoc.org/MANUAL.html#general-writer-options) arguments.\n\n`g:papyrus_autocompile`: Default set to `BufWrite` alternative [autocmd events](https://neovim.io/doc/user/autocmd.html#autocmd-events) can be used to trigger auto-compilation.\n\n`g:papyrus_output_path`: Set a custom output folder path in the format `/path/to/folder/`. Do not include `$HOME` or `~`.\n\n`g:papyrus_output_format`: Default output format is set to `pdf` which can be changed to any supported pandoc output format which is listed when running `pandoc --list-output-formats`.\n\n`g:papyrus_template`: Set a template from supported options. \n\n### Customization \n\nIf a command has an [optional argument](#commands) you can add custom mappings for different compilation formats. For example:\n\n```vim\n\" Compile current file to pdf\nmap \u003cleader\u003epcp :PapyrusCompile pdf\u003cCR\u003e\n\n\" Compile current file to html\nmap \u003cleader\u003epch :PapyrusCompile html\u003cCR\u003e\n```\n\n\n## Error Messages\n\nAfter every compilation either the message `Papyrus: Compilation Succeeded!` will appear at the bottom of the window or `Papyrus: Compilation Failed with exit status X`. After a failed compilation the **pandoc compilation errors are displayed in a quickfix list** which can be viewed using `:copen`.\n\n\n## Commands\n\n**Optional arguments** allow you to change the current file output format. Possible output formats are listed when running `pandoc --list-output-formats`.\n\n### :PapyrusCompile \\\u003coptional\\\u003e\n\nExecutes a `pandoc` command using `jobstart` to compile the current open `md` file into a `pdf` with the same name using either the `g:papyrus_pandoc_args` or `g:papyrus_template`. \n\n### :PapyrusAutoCompile \\\u003coptional\\\u003e\n\nExecutes an `autocmd` when the `g:papyrus_autocompile` event is triggered which runs `:PapyrusCompile`.\n\n### :PapyrusView \n\nOpens the current file in the specified pdf viewer from the `g:papyrus_viewer` variable.\n\n### :PapyrusStart \\\u003coptional\\\u003e\n\nRuns `:PapyrusView` and `:PapyrusAutoCompile` to automatically start an editing environment.\n\n### :PapyrusHeader\n\nCopies the specified template file into the current file from `/templates/md/g:papyrus_template`.\n\n### :PapyrusNew \n\nRuns `:PapyrusHeader` and `:PapyrusStart` to create a new editing environment for the specified template. \n\n## Documentation \n\n### Images\n\n```md\n# Insert image from current directory \n\n![](image.jpeg)\n\n# Add figure caption\n\n![\"Figure caption here\"](image.jpeg)\n\n# Insert images from different directory \n\n![](/path/to/image.jpeg)\n\n# Append {width=\"50%\"} to adjust dimensions\n\n![](/path/to/image.jpeg){width=\"50%\"}\n```\n\n### Fonts\n\nTo add custom fonts you first need to verify that the font is downloaded to your systems. For example, on Mac, you can use the Font Book application to add any font from the internet. There are two ways to specify a font using Papyrus. First, you can use the mainfont variable in the YAML heading at the top of your markdown document:\n\n```yaml\n---\ntitle: Custom Font\nauthor: Author\ndate: xx-xx-xxxx\nmainfont: Droid Sans Fallback\n---\n```\n\nThe second way is to use the `g:papyrus_pandoc_args` variable in your `init.vim` or `.vimrc` file:\n\n```vim\nlet g:papyrus_pandoc_args = '-V mainfont=\"Droid Sans Fallback\"'\n```\n\n### Templates\n\nPapyrus supports two templates which you can view in the [pdf directory](https://github.com/abeleinin/papyrus/tree/main/templates/pdf). Custom template files can be created using [pandoc-latex-templates](https://github.com/Wandmalfarbe/pandoc-latex-template). If you create a cool template feel free to submit a pull request!\n\n```vim\n\" Specify the current template by its file name \nlet g:papyrus_template = 'default'\n```\n \n### Default\n\n![Screenshot of default template](https://github.com/abeleinin/papyrus/blob/main/examples/default.png?raw=true)\n\n### Lecture \n\n![Screenshot of lecture template](https://github.com/abeleinin/papyrus/blob/main/examples/lecture.png?raw=true)\n\n## Demo\n\nThis is a demo from my notes on the [Book of Proof](https://www.people.vcu.edu/~rhammack/BookOfProof/Main.pdf). I'm using the [Vim Pandoc Syntax](https://github.com/vim-pandoc/vim-pandoc-syntax) plugin to automatically insert special characters and clean up the document. Also, in the demo, you can see that pandoc supports the ability to insert Latex syntax inside the Markdown document.\n\nhttps://user-images.githubusercontent.com/95333017/220041898-7326b76d-348e-4bf4-95dd-b4a879527ed5.mov\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabeleinin%2Fpapyrus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabeleinin%2Fpapyrus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabeleinin%2Fpapyrus/lists"}