This pandoc lua-filter uses the mdframed package to create custom callouts looking similar to obsidian callouts or github alerts.
Github Alerts | Obsidian Callouts |
---|---|
![]() |
![]() |
Clone the project.
git clone https://github.com/mirkosprojects/latex-callouts.git
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
Move the callouts.lua
to your project folder.
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
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.
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