Skip to content

Commit

Permalink
Add default fancy list renderer prototypes for LaTeX
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed Aug 18, 2022
1 parent f79103d commit b2de944
Showing 1 changed file with 68 additions and 1 deletion.
69 changes: 68 additions & 1 deletion markdown.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -24339,22 +24339,89 @@ end
%
% \end{markdown}
% \begin{macrocode}
\ExplSyntaxOn
\@ifpackageloaded{paralist}{
\cs_new:Nn
\@@_latex_translate_list_item_label_number:nn
{
\str_case:nn
{ #1 }
{
{ Decimal } { #2 }
{ LowerRoman } { \int_to_roman:n { #2 } }
{ UpperRoman } { \int_to_Roman:n { #2 } }
{ LowerAlpha } { \int_to_alph:n { #2 } }
{ UpperAlpha } { \int_to_alph:n { #2 } }
}
}
\cs_new:Nn
\@@_latex_translate_list_item_label_delimiter:n
{
\str_case:nn
{ #1 }
{
{ Default } { . }
{ OneParen } { ) }
{ Period } { - }
}
}
\cs_new:Nn
\@@_latex_translate_list_item_label:nnn
{
\@@_latex_translate_list_item_delimiter:n
{ #2 }
\@@_latex_translate_list_item_label_number:nn
{ #1 }
{ #3 }
}
\cs_new:Nn
\@@_latex_paralist_style:nn
{
\str_case:nn
{ #1 }
{
{ Decimal } { 1 }
{ LowerRoman } { i }
{ UpperRoman } { I }
{ LowerAlpha } { a }
{ UpperAlpha } { A }
}
\@@_latex_translate_list_item_delimiter:n
{ #2 }
}
\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}},
fancyOlItemWithNumber = {
\markdownRendererOlItemWithNumber
{ \@@_latex_translate_list_item_label:nnn { #1 } { #2 } { #3 } }
},
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
Expand Down

0 comments on commit b2de944

Please sign in to comment.