You can use the following lua filter (say, alert.lua) when you produce a beamer presentation.
if FORMAT:match 'beamer' then
function Span(el)
if el.classes[1] == "alert" then
table.insert(el.content, 1, pandoc.RawInline("latex", "\\alert{"))
table.insert(el.content, pandoc.RawInline("latex", "}"))
end
return el
end
return { { Span = Span } }
end
In an md file, [what you want to highlight]{.alert} is the command to produce a text with an alert. Note that you need to enclose the text with square bracket [...], not (...).
## frame header
- This is important
- This is also important
- This is [the most important]{.alert} line
Then, your md is converted into a beamer presentation pdf with alerts.
pandoc --lua-filter=alert.lua -t beamer presentation.md -o presentation.pdfThis gist is originnaly posted as a reply to the issue here.