forked from jgm/lunamark
-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
feature requestluaRelated to the Lua interface and implementationRelated to the Lua interface and implementation
Milestone
Description
Acronyms, initialisms, and other all-caps sequences often benefit from being typeset differently from ordinary text, but marking them up manually quickly becomes tedious. Our parser could accept a comma-separated list of words to be treated specially. When these words appear in regular text, the parser would emit dedicated renderers that would apply appropriate typographic treatment such as small caps and letter-spacing.
Here is a demonstration of the proposed interface and the expected output:
\documentclass{article}
\usepackage{markdown}
\markdownSetup {
% Format the following words as acronyms.
acronyms = {HTML, YAML}, % We can also easily fill this list from e.g. YAML and other external sources.
renderers = {
% Format acronyms as small caps.
acronym = \textsc{\MakeLowercase{#1}},
% Don't format acronyms in headings.
heading* ^= \begingroup \markdownSetup { renderers = { acronym = ##1 } },
heading* += \endgroup,
},
}
\begin{document}
\begin{markdown}
HTML and YAML are two staples of modern tooling that often get mentioned
in the same breath, even though they live in very different layers of the stack.
\end{markdown}
\end{document}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestluaRelated to the Lua interface and implementationRelated to the Lua interface and implementation