Skip to content

A simple Markdown to Pdf converter inside Neovim.

License

Notifications You must be signed in to change notification settings

alexxGmZ/Md2Pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Md2Pdf

A simple Markdown to Pdf converter inside Neovim.

Preview.mp4

Dependencies

  • pandoc
  • Optional (if you want to use other pdf engine other than pdflatex):
    • texlive-luatex (for lualatex)
    • texlive-xetex (for xelatex)

Run :checkhealth Md2Pdf after installing to check if dependencies are installed.

Recommended Pdf Viewers:

  • zathura
  • Or any pdf viewers that updates whenever changes are applied.

To Do:

  • Support multiple buffer/file conversion in one NeoVim session.
  • Support YAML metadata template file.
  • Improve config handling.

Installation

Lazy:

{
   "alexxGmZ/Md2Pdf",
   cmd = "Md2Pdf"
}

Configuration

require("Md2Pdf").setup({
   pdf_engine = "pdflatex" -- pdflatex, lualatex, or xelatex
   yaml_template_path = nil
})

Usage

Start converting Markdown (*.md) file to Pdf after saving or writing the file. The Pdf is located in the same directory as the Markdown file.

:Md2Pdf
:Md2Pdf start

Stop the auto-converting after saving or writing the file.

:Md2Pdf stop

Convert manually.

:Md2Pdf convert

Variable specification (-V flag)

Note

Read the pandoc documentation or Google it to know more about variables.

Add Variables in the Markdown file by adding YAML metadata blocks at the top.

---
header-includes:
- \usepackage{fontspec}

geometry:
- margin=1cm

fontsize: 12pt
monofont: "FiraCode Nerd Font"
...

# Markdown Title

Or create a YAML template file and place the template path in the config's yaml_template_path.

require("Md2Pdf").setup({
   pdf_engine = "pdflatex" -- pdflatex, lualatex, or xelatex
   yaml_template_path = "/home/user/template.yml"
})

About

A simple Markdown to Pdf converter inside Neovim.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages