Skip to content

johngolden/TeXDown.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TeXDown.jl

TeXDown converts Markdown files into nicely formatted PDFs via LaTeX. It solves two problems:

  1. Human-readable LaTeX output. Unlike Pandoc, TeXDown produces LaTeX that looks like something you'd write yourself—easy to edit or share.
  2. Direct Markdown-to-PDF. Go from a todo list in Markdown to a printable PDF without touching LaTeX.

TeXDown is a lightweight wrapper around CommonMark.jl that cleans up LaTeX artifacts and adds preamble templates for common use cases: research notes, todo lists, and recipes.

See the examples folder for sample output.

Installation

1. Install Julia

Download from julialang.org.

2. Install TeXDown

using Pkg
Pkg.add(url="https://github.com/johngolden/TeXDown.jl")

3. Install LaTeX

Via Homebrew:

brew install --cask mactex-no-gui

4. Add CLI to PATH (optional)

ln -s /path/to/TeXDown.jl/bin/texdown /usr/local/bin/texdown

Usage

Command Line

texdown "My Todo.md"                    # PDF with todo_list template (default)
texdown pdf "Notes.md" research_note    # PDF with specific template
texdown tex "Notes.md"                  # LaTeX only

Templates: todo_list (default), research_note, recipe

In todo lists, any bullet marker (*, -, +) renders as an empty checkbox, and GitHub-style task syntax is supported: - [x] renders as a checked box. Links, images, tables, and code blocks compile out of the box.

Apple Shortcuts

Right-click a Markdown file → Quick Actions → select a TeXDown shortcut. First-time use requires granting permissions.

Tip: Assign a keyboard shortcut (e.g., Option-Shift-P) via Shortcuts app → open shortcut → click "ℹ︎" → set "Run with:".

Markdown to PDF: Todo list · Research note · Recipe

Markdown to LaTeX: Todo list · Research note · Recipe · No Preamble

Recipe utilities: Combine recipe PDFs — combines 8.5"×5.5" recipe PDFs for printing on letter paper.

VSCode

Add to .vscode/tasks.json:

{
  "version": "2.0.0",
  "tasks": [{
    "label": "TeXDown: Generate PDF",
    "type": "shell",
    "command": "texdown",
    "args": ["pdf", "${file}"],
    "group": "build",
    "problemMatcher": []
  }]
}

Add keybinding in ~/Library/Application Support/Code/User/keybindings.json:

{
  "key": "cmd+shift+t",
  "command": "workbench.action.tasks.runTask",
  "args": "TeXDown: Generate PDF",
  "when": "editorLangId == markdown"
}

Obsidian

Install Shell commands plugin, then add:

texdown pdf "{{file_path:absolute}}"

Assign a hotkey in plugin settings.

Julia API

make_tex(md_content)              # Markdown string or file → LaTeX (no preamble)
make_tex(md_content, template)    # With preamble template
make_pdf(md_file, template)       # Compile to PDF, clean up aux files, open

About

Convert Markdown to nicely formatted LaTeX, and compile it with a few templates.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors