Skip to content

mirkosprojects/latex-callouts

Repository files navigation

Latex Callouts

This pandoc lua-filter uses the mdframed package to create custom callouts looking similar to obsidian callouts or github alerts.

Github Alerts Obsidian Callouts
Github Alert Tip Obsidian Callout Tip

Installation

Clone the project.

git clone https://github.com/mirkosprojects/latex-callouts.git

Global Installation (Recommended)

Place the callouts.lua in your pandoc filters folder.

  • Unix/MacOS: /Users/USERNAME/.local/share/pandoc/filters/ or /Users/USERNAME/.pandoc/filters/
  • Windows: C:\Users\USERNAME\AppData\Roaming\pandoc\filters\

Note

If the folders don't exist, you have to create them manually

Local Installation

Move the callouts.lua to your project folder.

Usage

Build the examples

Run the build commands.

pandoc github-alerts.md --lua-filter=callouts.lua -o github-alerts.pdf
pandoc obsidian-callouts.md --lua-filter=callouts.lua -o obsidian-callouts.pdf

Usage in your own project

Copy the header-includes YAML metadata from github-alerts.md or obsidian-callouts.md into your own markdown file.

Write your callouts in the format:

> [!NOTE] Callout Title
> Callout Content

See the github-alerts.md and obsidian-callouts.md for details.

Add the filter --lua-filter=callouts.lua to your pandoc command.

Customize Callouts

You can add custom callout styles by adding them to the header-includes:

- \definecolor{calloutColor<NAME>}{HTML}{<COLOR>}
- \newcommand{\calloutIcon<NAME>}{<ICON>}
  • Replace <NAME> with the name of your custom callout
  • Replace <COLOR> with a hex color value
  • Replace <ICON> with any fontawesome5 icon

Use the callout as follows:

> [!<NAME>] Custom callout
> Callout Content

About

A Pandoc Lua Filter for creating Callouts styled like Obsidian Callouts or GitHub Alerts

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published