From 2e198d6f516b86a0a1d4b440c3b50ac7680e2678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Novotn=C3=BD?= Date: Thu, 18 Aug 2022 22:36:31 +0200 Subject: [PATCH] Add default fancy list renderer prototypes for LaTeX --- markdown.dtx | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/markdown.dtx b/markdown.dtx index 4b95ef09a..4c808257c 100644 --- a/markdown.dtx +++ b/markdown.dtx @@ -24204,22 +24204,53 @@ end % % \end{markdown} % \begin{macrocode} +\ExplSyntaxOn \@ifpackageloaded{paralist}{ + \cs_new:Nn + \@@_latex_paralist_style:nn + { + \str_case:nn + { #1 } + { + { Decimal } { 1 } + { LowerRoman } { i } + { UpperRoman } { I } + { LowerAlpha } { a } + { UpperAlpha } { A } + } + \str_case:nn + { #2 } + { + { Default } { . } + { OneParen } { ) } + { Period } { - } + } + } \markdownSetup{rendererPrototypes={ ulBeginTight = {\begin{compactitem}}, ulEndTight = {\end{compactitem}}, + fancyOlBegin = {\begin{enumerate}[ \@@_latex_paralist_style:nn { #1 } { #2 } ]}, + fancyOlEnd = {\end{enumerate}}, olBeginTight = {\begin{compactenum}}, olEndTight = {\end{compactenum}}, + fancyOlBeginTight = {\begin{compactenum}[ \@@_latex_paralist_style:nn { #1 } { #2 } ]}, + fancyOlEndTight = {\end{compactenum}}, dlBeginTight = {\begin{compactdesc}}, dlEndTight = {\end{compactdesc}}}} }{ \markdownSetup{rendererPrototypes={ ulBeginTight = {\markdownRendererUlBegin}, ulEndTight = {\markdownRendererUlEnd}, + fancyOlBegin = {\markdownRendererOlBegin}, + fancyOlEnd = {\markdownRendererOlEnd}, olBeginTight = {\markdownRendererOlBegin}, olEndTight = {\markdownRendererOlEnd}, + fancyOlBeginTight = {\markdownRendererOlBegin}, + fancyOlEndTight = {\markdownRendererOlEnd}, dlBeginTight = {\markdownRendererDlBegin}, - dlEndTight = {\markdownRendererDlEnd}}}} + dlEndTight = {\markdownRendererDlEnd}}} +} +\ExplSyntaxOff \RequirePackage{amsmath,ifthen} % \end{macrocode} % \par