diff options
author | Karl Berry <karl@freefriends.org> | 2024-02-18 21:05:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2024-02-18 21:05:58 +0000 |
commit | 45d62c355885e905db2a729761eb384ec447e931 (patch) | |
tree | a80c1c9bd45c98a38855f2ac39f1ac5233862747 /Master/texmf-dist/tex/latex/markdown | |
parent | c503d4c5c13af6a3749ec30bfee14cffda84240c (diff) |
markdown (18feb24)
git-svn-id: svn://tug.org/texlive/trunk@69962 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/markdown')
5 files changed, 1072 insertions, 1639 deletions
diff --git a/Master/texmf-dist/tex/latex/markdown/markdown.sty b/Master/texmf-dist/tex/latex/markdown/markdown.sty index 661ea377553..4f2bcd4bdba 100644 --- a/Master/texmf-dist/tex/latex/markdown/markdown.sty +++ b/Master/texmf-dist/tex/latex/markdown/markdown.sty @@ -6,7 +6,7 @@ %% %% markdown.dtx (with options: `latex') %% -%% Copyright (C) 2016-2023 Vít Novotný +%% Copyright (C) 2016-2024 Vít Starý Novotný %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -16,7 +16,7 @@ %% http://www.latex-project.org/lppl.txt %% %% This work has the LPPL maintenance status `maintained'. -%% The Current Maintainer of this work is Vít Novotný. +%% The Current Maintainer of this work is Vít Starý Novotný. %% %% Send bug reports, requests for additions and questions %% either to the GitHub issue tracker at @@ -43,649 +43,93 @@ %% The names of the source files used are shown above. %% \RequirePackage{expl3} -\newcommand\markdownInfo[1]{\PackageInfo{markdown}{#1}}% -\newcommand\markdownWarning[1]{\PackageWarning{markdown}{#1}}% -\newcommand\markdownError[2]{\PackageError{markdown}{#1}{#2.}}% -\input markdown/markdown -\newenvironment{markdown}\relax\relax -\newenvironment{markdown*}[1]\relax\relax \ExplSyntaxOn -\cs_new:Nn - \__markdown_setup:n - { - \keys_set:nn - { markdown/latex-options } - { #1 } - } -\let\markdownSetup=\__markdown_setup:n -\ExplSyntaxOff -\ExplSyntaxOn -\cs_new:Nn - \__markdown_latex_setup_snippet:nn - { - \markdownIfSnippetExists - { #1 } - { - \markdownWarning - {Redefined~snippet~\markdownLaTeXThemeName#1} - \csname markdownLaTeXSetupSnippet% - \markdownLaTeXThemeName#1\endcsname={#2} - } - { - \newtoks\next - \next={#2} - \expandafter\let\csname markdownLaTeXSetupSnippet% - \markdownLaTeXThemeName#1\endcsname=\next - } - } -\let\markdownSetupSnippet=\__markdown_latex_setup_snippet:nn -\ExplSyntaxOff -\newcommand\markdownIfSnippetExists[3]{% - \@ifundefined - {markdownLaTeXSetupSnippet\markdownLaTeXThemeName#1}% - {#3}{#2}}% -\ExplSyntaxOn -\seq_new:N \g__markdown_latex_options_seq -\prop_new:N \g__markdown_latex_option_types_prop -\prop_new:N \g__markdown_default_latex_options_prop \tl_const:Nn \c__markdown_option_layer_latex_tl { latex } -\seq_gput_right:NV \g__markdown_option_layers_seq \c__markdown_option_layer_latex_tl -\cs_new:Nn - \__markdown_add_latex_option:nnn - { - \__markdown_add_option:Vnnn - \c__markdown_option_layer_latex_tl - { #1 } - { #2 } - { #3 } - } -\__markdown_add_latex_option:nnn - { plain } - { boolean } - { false } -\ExplSyntaxOff -\newif\ifmarkdownLaTeXLoaded - \markdownLaTeXLoadedfalse -\AtEndOfPackage{\markdownLaTeXLoadedtrue} -\ExplSyntaxOn -\tl_new:N \markdownLaTeXThemePackageName -\cs_new:Nn - \__markdown_set_latex_theme:n - { - \str_if_in:nnF - { #1 } - { / } - { - \markdownError - { Won't~load~theme~with~unqualified~name~#1 } - { Theme~names~must~contain~at~least~one~forward~slash } - } - \str_if_in:nnT - { #1 } - { _ } - { - \markdownError - { Won't~load~theme~with~an~underscore~in~its~name~#1 } - { Theme~names~must~not~contain~underscores~in~their~names } - } - \tl_set:Nn \markdownLaTeXThemePackageName { #1 } - \str_replace_all:Nnn - \markdownLaTeXThemePackageName - { / } - { _ } - \edef\markdownLaTeXThemePackageName{ - markdowntheme\markdownLaTeXThemePackageName} - \expandafter\markdownLaTeXThemeLoad\expandafter{ - \markdownLaTeXThemePackageName}{#1/} - } -\keys_define:nn - { markdown/latex-options } - { - import .code:n = { - \tl_set:Nn - \l_tmpa_tl - { #1 } - \tl_replace_all:NnV - \l_tmpa_tl - { / } - \c_backslash_str - \keys_set:nV - { markdown/latex-options/import } - \l_tmpa_tl - }, - } -\cs_generate_variant:Nn - \tl_replace_all:Nnn - { NnV } -\keys_define:nn - { markdown/latex-options } - { - theme .code:n = { \__markdown_set_latex_theme:n { #1 } }, - } -\ExplSyntaxOff -\ExplSyntaxOn -\@onlypreamble - \__markdown_set_latex_theme:n -\ExplSyntaxOff -\ExplSyntaxOn -\keys_define:nn - { markdown/latex-options } - { - snippet .code:n = { - \markdownIfSnippetExists{#1} - { - \expandafter\markdownSetup\expandafter{ - \the\csname markdownLaTeXSetupSnippet - \markdownLaTeXThemeName#1\endcsname} - }{ - \markdownError - {Can't~invoke~setup~snippet~#1} - {The~setup~snippet~is~undefined} - } - } - } -\ExplSyntaxOff -\ExplSyntaxOn -\tl_new:N - \l__markdown_latex_import_current_theme_tl -\keys_define:nn - { markdown/latex-options/import } - { - unknown .default:n = {}, - unknown .code:n = { - \tl_set_eq:NN - \l__markdown_latex_import_current_theme_tl - \l_keys_key_str - \tl_replace_all:NVn - \l__markdown_latex_import_current_theme_tl - \c_backslash_str - { / } - \__markdown_set_latex_theme:V - \l__markdown_latex_import_current_theme_tl - \clist_map_inline:nn - { #1 } - { - \regex_extract_once:nnNTF - { ^(.*?)\s+as\s+(.*?)$ } - { ##1 } - \l_tmpa_seq - { - \seq_pop:NN - \l_tmpa_seq - \l_tmpa_tl - \seq_pop:NN - \l_tmpa_seq - \l_tmpa_tl - \seq_pop:NN - \l_tmpa_seq - \l_tmpb_tl - } - { - \tl_set:Nn - \l_tmpa_tl - { ##1 } - \tl_set:Nn - \l_tmpb_tl - { ##1 } - } - \tl_put_left:Nn - \l_tmpa_tl - { / } - \tl_put_left:NV - \l_tmpa_tl - \l__markdown_latex_import_current_theme_tl - \__markdown_latex_setup_snippet:Vx - \l_tmpb_tl - { snippet = { \l_tmpa_tl } } - } - }, - } -\cs_generate_variant:Nn - \tl_replace_all:Nnn - { NVn } -\cs_generate_variant:Nn - \__markdown_set_latex_theme:n - { V } -\cs_generate_variant:Nn - \__markdown_latex_setup_snippet:nn - { Vx } -\ExplSyntaxOff -\ExplSyntaxOn -\cs_new:Nn \__markdown_latex_define_option_commands_and_keyvals: - { - \seq_map_inline:Nn - \g__markdown_latex_options_seq - { - \__markdown_plain_tex_define_option_command:n - { ##1 } - } - \seq_map_inline:Nn - \g__markdown_option_layers_seq - { - \seq_map_inline:cn - { g__markdown_ ##1 _options_seq } - { - \__markdown_with_various_cases:nn - { ####1 } - { - \__markdown_latex_define_option_keyval:nnn - { ##1 } - { ####1 } - { ########1 } - } - } - } - } -\cs_new:Nn \__markdown_latex_define_option_keyval:nnn - { - \prop_get:cnN - { g__markdown_ #1 _option_types_prop } - { #2 } - \l_tmpa_tl - \keys_define:nn - { markdown/latex-options } - { - #3 .code:n = { - \__markdown_set_option_value:nn - { #2 } - { ##1 } - }, - } - \str_if_eq:VVT - \l_tmpa_tl - \c__markdown_option_type_boolean_tl - { - \keys_define:nn - { markdown/latex-options } - { - #3 .default:n = { true }, - } - } - \str_if_eq:VVT - \l_tmpa_tl - \c__markdown_option_type_clist_tl - { - \tl_set:Nn - \l_tmpa_tl - { #3 } - \tl_reverse:N - \l_tmpa_tl - \str_if_eq:enF - { - \tl_head:V - \l_tmpa_tl - } - { s } - { - \msg_error:nnn - { markdown } - { malformed-name-for-clist-option } - { #3 } - } - \tl_set:Nx - \l_tmpa_tl - { - \tl_tail:V - \l_tmpa_tl - } - \tl_reverse:N - \l_tmpa_tl - \tl_put_right:Nn - \l_tmpa_tl - { - .code:n = { - \__markdown_get_option_value:nN - { #2 } - \l_tmpa_tl - \clist_set:NV - \l_tmpa_clist - { \l_tmpa_tl, { ##1 } } - \__markdown_set_option_value:nV - { #2 } - \l_tmpa_clist - } - } - \keys_define:nV - { markdown/latex-options } - \l_tmpa_tl - } - } \cs_generate_variant:Nn - \clist_set:Nn + \tl_const:Nn { NV } -\cs_generate_variant:Nn - \keys_define:nn - { nV } -\cs_generate_variant:Nn - \__markdown_set_option_value:nn - { nV } -\prg_generate_conditional_variant:Nnn - \str_if_eq:nn - { en } - { F } -\msg_new:nnn - { markdown } - { malformed-name-for-clist-option } +\tl_if_exist:NF + \c__markdown_top_layer_tl { - Clist~option~name~#1~does~not~end~with~-s. + \tl_const:NV + \c__markdown_top_layer_tl + \c__markdown_option_layer_latex_tl } -\__markdown_latex_define_option_commands_and_keyvals: \ExplSyntaxOff +\input markdown/markdown +\newenvironment{markdown}\relax\relax +\newenvironment{markdown*}[1]\relax\relax \DeclareOption{finalizecache}{\markdownSetup{finalizeCache}} \DeclareOption{frozencache}{\markdownSetup{frozenCache}} \ExplSyntaxOn -\cs_new:Nn \__markdown_latex_define_renderers: +\str_if_eq:VVT + \c__markdown_top_layer_tl + \c__markdown_option_layer_latex_tl { - \seq_map_function:NN - \g__markdown_renderers_seq - \__markdown_latex_define_renderer:n + \__markdown_define_option_commands_and_keyvals: + \__markdown_define_renderers: + \__markdown_define_renderer_prototypes: } -\cs_new:Nn \__markdown_latex_define_renderer:n - { - \__markdown_renderer_tl_to_csname:nN - { #1 } - \l_tmpa_tl - \prop_get:NnN - \g__markdown_renderer_arities_prop - { #1 } - \l_tmpb_tl - \__markdown_latex_define_renderer:ncV - { #1 } - { \l_tmpa_tl } - \l_tmpb_tl +\ExplSyntaxOff +\newif\ifmarkdownLaTeXLoaded + \markdownLaTeXLoadedfalse +\AtEndOfPackage{ + \markdownLaTeXLoadedtrue + \markdownIfOption{noDefaults}{}{ + \markdownSetup{theme=witiko/markdown/defaults} } -\cs_new:Nn \__markdown_renderer_tl_to_csname:nN +} +\def\markdownVersionSpace{ }% +\ProvidesPackage{markdown}[\markdownLastModified\markdownVersionSpace v% + \markdownVersion\markdownVersionSpace markdown renderer]% +\let\markdownInputPlainTeX\markdownInput +\renewcommand\markdownInput[2][]{% + \begingroup + \markdownSetup{#1}% + \markdownInputPlainTeX{#2}% + \endgroup}% +\ExplSyntaxOn +\renewenvironment + { markdown } { - \tl_set:Nn - \l_tmpa_tl - { \str_uppercase:n { #1 } } - \tl_set:Nx - #2 + \group_begin: + \char_set_catcode_active:n { 13 } + \char_set_catcode_letter:n { 35 } + \peek_regex_replace_once:nnF + { \ *\[([^]]*)\][^\r]* } { - markdownRenderer - \tl_head:f { \l_tmpa_tl } - \tl_tail:n { #1 } + \c { group_end: } + \c { tl_set_rescan:Nnn } \c { l_tmpa_tl } { } { \1 } + \c { __markdown_setup:V } \c { l_tmpa_tl } + \c { markdownReadAndConvert@markdown } { } } - } -\cs_new:Nn \__markdown_latex_define_renderer:nNn - { - \__markdown_with_various_cases:nn - { #1 } { - \keys_define:nn - { markdown/latex-options/renderers } - { - ##1 .code:n = { - \cs_generate_from_arg_count:NNnn - #2 - \cs_set:Npn - { #3 } - { ####1 } - }, - } + \group_end: + \markdownReadAndConvert@markdown { } } } -\cs_generate_variant:Nn - \__markdown_latex_define_renderer:nNn - { ncV } -\ExplSyntaxOff -\ExplSyntaxOn -\tl_new:N - \l__markdown_renderer_definition_tl -\keys_define:nn - { markdown/latex-options/renderers } + { \markdownEnd } +\renewenvironment + { markdown* } + [ 1 ] { - unknown .code:n = { - \regex_match:nVTF - { \* } - \l_keys_key_str - { - \tl_set:Nn - \l__markdown_renderer_definition_tl - { #1 } - \tl_set:NV - \l_tmpa_tl - \l_keys_key_str - \regex_replace_all:nnN - { \* } - { .* } - \l_tmpa_tl - \regex_set:NV - \l_tmpa_regex - \l_tmpa_tl - \int_zero:N - \l_tmpa_int - \seq_map_inline:Nn - \g__markdown_renderers_seq - { - \__markdown_with_various_cases:nn - { ##1 } - { - \regex_match:NnT - \l_tmpa_regex - { ####1 } - { - \__markdown_renderer_tl_to_csname:nN - { ##1 } - \l_tmpa_tl - \prop_get:NnN - \g__markdown_renderer_arities_prop - { ##1 } - \l_tmpb_tl - \cs_generate_from_arg_count:cNVV - { \l_tmpa_tl } - \cs_set:Npn - \l_tmpb_tl - \l__markdown_renderer_definition_tl - \int_incr:N - \l_tmpa_int - \__markdown_with_various_cases_break: - } - } - } - \int_compare:nNnT - { \l_tmpa_int } = { 0 } - { - \msg_error:nnV - { markdown } - { nonmatched-renderer-wildcard } - \l_keys_key_str - } - } - { - \msg_error:nnV - { markdown } - { undefined-renderer } - \l_keys_key_str - } - }, - } -\msg_new:nnn - { markdown } - { undefined-renderer } - { - Renderer~#1~is~undefined. - } -\msg_new:nnn - { markdown } - { nonmatched-renderer-wildcard } - { - Wildcard~#1~matches~no~renderers. - } -\cs_generate_variant:Nn - \regex_set:Nn - { NV } -\cs_generate_variant:Nn - \cs_generate_from_arg_count:NNnn - { cNVV } -\cs_generate_variant:Nn - \msg_error:nnn - { nnV } -\prg_generate_conditional_variant:Nnn - \regex_match:nn - { nV } - { TF } -\ExplSyntaxOff -\ExplSyntaxOn -\cs_new:Nn \__markdown_latex_define_renderer_prototypes: - { - \seq_map_function:NN - \g__markdown_renderers_seq - \__markdown_latex_define_renderer_prototype:n - } -\cs_new:Nn \__markdown_latex_define_renderer_prototype:n - { - \__markdown_renderer_prototype_tl_to_csname:nN - { #1 } - \l_tmpa_tl - \prop_get:NnN - \g__markdown_renderer_arities_prop + \msg_warning:nnn + { markdown } + { latex-markdown-star-deprecated } { #1 } - \l_tmpb_tl - \__markdown_latex_define_renderer_prototype:ncV - { #1 } - { \l_tmpa_tl } - \l_tmpb_tl - } -\cs_new:Nn \__markdown_latex_define_renderer_prototype:nNn - { - \__markdown_with_various_cases:nn + \__markdown_setup:n { #1 } - { - \keys_define:nn - { markdown/latex-options/renderer-prototypes } - { - ##1 .code:n = { - \cs_generate_from_arg_count:NNnn - #2 - \cs_set:Npn - { #3 } - { ####1 } - }, - } - } - } -\cs_generate_variant:Nn - \__markdown_latex_define_renderer_prototype:nNn - { ncV } -\ExplSyntaxOff -\ExplSyntaxOn -\tl_new:N - \l__markdown_renderer_prototype_definition_tl -\keys_define:nn - { markdown/latex-options/renderer-prototypes } - { - unknown .code:n = { - \regex_match:nVTF - { \* } - \l_keys_key_str - { - \tl_set:Nn - \l__markdown_renderer_prototype_definition_tl - { #1 } - \tl_set:NV - \l_tmpa_tl - \l_keys_key_str - \regex_replace_all:nnN - { \* } - { .* } - \l_tmpa_tl - \regex_set:NV - \l_tmpa_regex - \l_tmpa_tl - \int_zero:N - \l_tmpa_int - \seq_map_inline:Nn - \g__markdown_renderers_seq - { - \__markdown_with_various_cases:nn - { ##1 } - { - \regex_match:NnT - \l_tmpa_regex - { ####1 } - { - \__markdown_renderer_prototype_tl_to_csname:nN - { ##1 } - \l_tmpa_tl - \prop_get:NnN - \g__markdown_renderer_arities_prop - { ##1 } - \l_tmpb_tl - \cs_generate_from_arg_count:cNVV - { \l_tmpa_tl } - \cs_set:Npn - \l_tmpb_tl - \l__markdown_renderer_prototype_definition_tl - \int_incr:N - \l_tmpa_int - \__markdown_with_various_cases_break: - } - } - } - \int_compare:nNnT - { \l_tmpa_int } = { 0 } - { - \msg_error:nnV - { markdown } - { nonmatched-renderer-prototype-wildcard } - \l_keys_key_str - } - } - { - \msg_error:nnV - { markdown } - { undefined-renderer-prototype } - \l_keys_key_str - } - }, + \markdownReadAndConvert@markdown * } + { \markdownEnd } \msg_new:nnn { markdown } - { undefined-renderer-prototype } + { latex-markdown-star-deprecated } { - Renderer~prototype~#1~is~undefined. + The~markdown*~LaTeX~environment~has~been~deprecated~and~will~ + be~removed~in~the~next~major~version~of~the~Markdown~package. } -\msg_new:nnn - { markdown } - { nonmatched-renderer-prototype-wildcard } - { - Wildcard~#1~matches~no~renderer~prototypes. - } -\cs_generate_variant:Nn - \regex_set:Nn - { NV } -\cs_generate_variant:Nn - \cs_generate_from_arg_count:NNnn - { cNVV } -\cs_generate_variant:Nn - \msg_error:nnn - { nnV } -\prg_generate_conditional_variant:Nnn - \regex_match:nn - { nV } - { TF } \ExplSyntaxOff -\def\markdownVersionSpace{ }% -\ProvidesPackage{markdown}[\markdownLastModified\markdownVersionSpace v% - \markdownVersion\markdownVersionSpace markdown renderer]% -\ExplSyntaxOn -\__markdown_latex_define_renderers: -\__markdown_latex_define_renderer_prototypes: -\ExplSyntaxOff -\let\markdownInputPlainTeX\markdownInput -\renewcommand\markdownInput[2][]{% - \begingroup - \markdownSetup{#1}% - \markdownInputPlainTeX{#2}% - \endgroup}% -\renewenvironment{markdown}{% - \markdownReadAndConvert@markdown{}}{% - \markdownEnd}% -\renewenvironment{markdown*}[1]{% - \markdownSetup{#1}% - \markdownReadAndConvert@markdown*}{% - \markdownEnd}% \begingroup \catcode`\|=0\catcode`\<=1\catcode`\>=2% \catcode`\\=12|catcode`|{=12|catcode`|}=12% @@ -693,991 +137,96 @@ |markdownReadAndConvert<\end{markdown#1}>% <|end<markdown#1>>>% |endgroup -\ExplSyntaxOn -\newcommand\markdownLaTeXThemeName{} -\seq_new:N \g__markdown_latex_themes_seq -\seq_gput_right:NV - \g__markdown_latex_themes_seq - \markdownLaTeXThemeName -\newcommand\markdownLaTeXThemeLoad[2]{ - \def\@tempa{% - \def\markdownLaTeXThemeName{#2} - \seq_gput_right:NV - \g__markdown_latex_themes_seq - \markdownLaTeXThemeName - \RequirePackage{#1} - \seq_pop_right:NN - \g__markdown_latex_themes_seq - \l_tmpa_tl - \seq_get_right:NN - \g__markdown_latex_themes_seq - \l_tmpa_tl - \exp_args:NNV - \def - \markdownLaTeXThemeName - \l_tmpa_tl} - \ifmarkdownLaTeXLoaded - \@tempa - \else - \exp_args:No - \AtEndOfPackage - { \@tempa } - \fi} -\ExplSyntaxOff \DeclareOption*{% \expandafter\markdownSetup\expandafter{\CurrentOption}}% \ProcessOptions\relax \ExplSyntaxOn -\keys_define:nn - { markdown/latex-options } - { - renderers .code:n = { - \keys_set:nn - { markdown/latex-options/renderers } - { #1 } - }, - } -\__markdown_with_various_cases:nn - { rendererPrototypes } - { - \keys_define:nn - { markdown/latex-options } - { - #1 .code:n = { - \keys_set:nn - { markdown/latex-options/renderer-prototypes } - { ##1 } - }, - } - } -\keys_define:nn - { markdown/latex-options } - { - code .code:n = { #1 }, - } -\__markdown_with_various_cases:nn - { jekyllDataRenderers } +\cs_gset:Nn + \__markdown_load_theme:nn { - \keys_define:nn - { markdown/latex-options } - { - #1 .code:n = { - \tl_set:Nn - \l_tmpa_tl - { ##1 } - \tl_replace_all:NnV - \l_tmpa_tl - { / } - \c_backslash_str - \keys_set:nV - { markdown/latex-options/jekyll-data-renderers } - \l_tmpa_tl - }, - } - } -\keys_define:nn - { markdown/latex-options/jekyll-data-renderers } - { - unknown .code:n = { - \tl_set_eq:NN - \l_tmpa_tl - \l_keys_key_str - \tl_replace_all:NVn - \l_tmpa_tl - \c_backslash_str - { / } - \tl_put_right:Nn - \l_tmpa_tl - { - .code:n = { #1 } - } - \keys_define:nV - { markdown/jekyllData } - \l_tmpa_tl - } - } -\cs_generate_variant:Nn - \keys_define:nn - { nV } -\ExplSyntaxOff -\markdownIfOption{plain}{\iffalse}{\iftrue} -\@ifclassloaded{beamer}{}{% - \markdownIfOption{tightLists}{\RequirePackage{paralist}}{}% - \markdownIfOption{fancyLists}{\RequirePackage{paralist}}{}% -} -\ExplSyntaxOn -\@ifpackageloaded{paralist}{ - \tl_new:N - \l__markdown_latex_fancy_list_item_label_number_style_tl - \tl_new:N - \l__markdown_latex_fancy_list_item_label_delimiter_style_tl - \cs_new:Nn - \__markdown_latex_fancy_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 - \__markdown_latex_fancy_list_item_label_delimiter:n - { - \str_case:nn - { #1 } - { - { Default } { . } - { OneParen } { ) } - { Period } { . } - } - } - \cs_new:Nn - \__markdown_latex_fancy_list_item_label:nnn - { - \__markdown_latex_fancy_list_item_label_number:nn - { #1 } - { #3 } - \__markdown_latex_fancy_list_item_label_delimiter:n - { #2 } - } - \cs_new:Nn - \__markdown_latex_paralist_style:nn - { - \str_case:nn - { #1 } - { - { Decimal } { 1 } - { LowerRoman } { i } - { UpperRoman } { I } - { LowerAlpha } { a } - { UpperAlpha } { A } - } - \__markdown_latex_fancy_list_item_label_delimiter:n - { #2 } - } - \markdownSetup{rendererPrototypes={ - ulBeginTight = {% - \group_begin: - \pltopsep=\topsep - \plpartopsep=\partopsep - \begin{compactitem} - }, - ulEndTight = { - \end{compactitem} - \group_end: - }, - fancyOlBegin = { - \group_begin: - \tl_set:Nn - \l__markdown_latex_fancy_list_item_label_number_style_tl - { #1 } - \tl_set:Nn - \l__markdown_latex_fancy_list_item_label_delimiter_style_tl - { #2 } - \tl_set:Nn - \l_tmpa_tl - { \begin{enumerate}[ } - \tl_put_right:Nx - \l_tmpa_tl - { \__markdown_latex_paralist_style:nn { #1 } { #2 } } - \tl_put_right:Nn - \l_tmpa_tl - { ] } - \l_tmpa_tl - }, - fancyOlEnd = { - \end{enumerate} - \group_end: - }, - olBeginTight = {% - \group_begin: - \plpartopsep=\partopsep - \pltopsep=\topsep - \begin{compactenum} - }, - olEndTight = { - \end{compactenum} - \group_end: - }, - fancyOlBeginTight = { - \group_begin: - \tl_set:Nn - \l__markdown_latex_fancy_list_item_label_number_style_tl - { #1 } - \tl_set:Nn - \l__markdown_latex_fancy_list_item_label_delimiter_style_tl - { #2 } - \tl_set:Nn - \l_tmpa_tl - { - \plpartopsep=\partopsep - \pltopsep=\topsep - \begin{compactenum}[ - } - \tl_put_right:Nx - \l_tmpa_tl - { \__markdown_latex_paralist_style:nn { #1 } { #2 } } - \tl_put_right:Nn - \l_tmpa_tl - { ] } - \l_tmpa_tl - }, - fancyOlEndTight = { - \end{compactenum} - \group_end: - }, - fancyOlItemWithNumber = { - \item - [ - \__markdown_latex_fancy_list_item_label:VVn - \l__markdown_latex_fancy_list_item_label_number_style_tl - \l__markdown_latex_fancy_list_item_label_delimiter_style_tl - { #1 } - ] - }, - dlBeginTight = { - \group_begin: - \plpartopsep=\partopsep - \pltopsep=\topsep - \begin{compactdesc} - }, - dlEndTight = { - \end{compactdesc} - \group_end: - }}} - \cs_generate_variant:Nn - \__markdown_latex_fancy_list_item_label:nnn - { VVn } -}{ - \markdownSetup{rendererPrototypes={ - ulBeginTight = {\markdownRendererUlBegin}, - ulEndTight = {\markdownRendererUlEnd}, - fancyOlBegin = {\markdownRendererOlBegin}, - fancyOlEnd = {\markdownRendererOlEnd}, - olBeginTight = {\markdownRendererOlBegin}, - olEndTight = {\markdownRendererOlEnd}, - fancyOlBeginTight = {\markdownRendererOlBegin}, - fancyOlEndTight = {\markdownRendererOlEnd}, - dlBeginTight = {\markdownRendererDlBegin}, - dlEndTight = {\markdownRendererDlEnd}}} -} -\ExplSyntaxOff -\RequirePackage{amsmath} -\@ifpackageloaded{unicode-math}{ - \markdownSetup{rendererPrototypes={ - untickedBox = {$\mdlgwhtsquare$}, - }} -}{ - \RequirePackage{amssymb} - \markdownSetup{rendererPrototypes={ - untickedBox = {$\square$}, - }} -} -\RequirePackage{csvsimple} -\RequirePackage{fancyvrb} -\RequirePackage{graphicx} -\markdownSetup{rendererPrototypes={ - hardLineBreak = {\\}, - leftBrace = {\textbraceleft}, - rightBrace = {\textbraceright}, - dollarSign = {\textdollar}, - underscore = {\textunderscore}, - circumflex = {\textasciicircum}, - backslash = {\textbackslash}, - tilde = {\textasciitilde}, - pipe = {\textbar}, - codeSpan = {% - \ifmmode - \text{#1}% - \else - \texttt{#1}% - \fi - }}} -\ExplSyntaxOn -\markdownSetup{ - rendererPrototypes = { - contentBlock = { - \str_case:nnF - { #1 } - { - { csv } - { - \begin{table} - \begin{center} - \csvautotabular{#3} - \end{center} - \tl_if_empty:nF - { #4 } - { \caption{#4} } - \end{table} - } - { tex } { \markdownEscape{#3} } - } - { \markdownInput{#3} } - }, - }, -} -\ExplSyntaxOff -\markdownSetup{rendererPrototypes={ - image = {% - \begin{figure}% - \begin{center}% - \includegraphics{#3}% - \end{center}% - \ifx\empty#4\empty\else - \caption{#4}% - \fi - \end{figure}}, - ulBegin = {\begin{itemize}}, - ulEnd = {\end{itemize}}, - olBegin = {\begin{enumerate}}, - olItem = {\item{}}, - olItemWithNumber = {\item[#1.]}, - olEnd = {\end{enumerate}}, - dlBegin = {\begin{description}}, - dlItem = {\item[#1]}, - dlEnd = {\end{description}}, - emphasis = {\emph{#1}}, - tickedBox = {$\boxtimes$}, - halfTickedBox = {$\boxdot$}, - headerAttributeContextBegin = {% - \markdownSetup{ - rendererPrototypes = { - attributeIdentifier = {% - \begingroup - \def\next####1{% - \def####1########1{% - \endgroup - ####1{########1}% - \label{##1}% - }% - }% - \next\markdownRendererHeadingOne - \next\markdownRendererHeadingTwo - \next\markdownRendererHeadingThree - \next\markdownRendererHeadingFour - \next\markdownRendererHeadingFive - \next\markdownRendererHeadingSix - }, - }, - }% - }, - headerAttributeContextEnd = {}, - superscript = {\textsuperscript{#1}}, - subscript = {\textsubscript{#1}}, - displayMath = {\begin{displaymath}#1\end{displaymath}}, - inlineMath = {\begin{math}#1\end{math}}, - blockQuoteBegin = {\begin{quotation}}, - blockQuoteEnd = {\end{quotation}}, - inputVerbatim = {\VerbatimInput{#1}}, - thematicBreak = {\noindent\rule[0.5ex]{\linewidth}{1pt}}, - note = {\footnote{#1}}}} -\RequirePackage{ltxcmds} -\ExplSyntaxOn -\cs_gset:Npn - \markdownRendererInputFencedCodePrototype#1#2 - { - \tl_if_empty:nTF - { #2 } - { \markdownRendererInputVerbatim{#1} } - { - \regex_extract_once:nnN - { \w* } - { #2 } - \l_tmpa_seq - \seq_pop_left:NN - \l_tmpa_seq - \l_tmpa_tl - \ltx@ifpackageloaded - { minted } + \ifmarkdownLaTeXLoaded + \ifx\@onlypreamble\@notprerr + \file_if_exist:nTF + { markdown theme #2.sty } { - \catcode`\#=6\relax - \exp_args:NV - \inputminted - \l_tmpa_tl + \msg_error:nnn + { markdown } + { latex-theme-after-preamble } { #1 } - \catcode`\#=12\relax } { - \ltx@ifpackageloaded - { listings } - { \lstinputlisting[language=\l_tmpa_tl]{#1} } - { \markdownRendererInputFencedCode{#1}{} } + \__markdown_plain_tex_load_theme:nn + { #1 } + { #2 } } - } - } -\ExplSyntaxOff -\ExplSyntaxOn -\def\markdownLATEXStrongEmphasis#1{% - \str_if_in:NnTF - \f@series - { b } - { \textnormal{#1} } - { \textbf{#1} } -} -\ExplSyntaxOff -\markdownSetup{rendererPrototypes={strongEmphasis={% - \protect\markdownLATEXStrongEmphasis{#1}}}} -\@ifundefined{chapter}{% - \markdownSetup{rendererPrototypes = { - headingOne = {\section{#1}}, - headingTwo = {\subsection{#1}}, - headingThree = {\subsubsection{#1}}, - headingFour = {\paragraph{#1}\leavevmode}, - headingFive = {\subparagraph{#1}\leavevmode}}} -}{% - \markdownSetup{rendererPrototypes = { - headingOne = {\chapter{#1}}, - headingTwo = {\section{#1}}, - headingThree = {\subsection{#1}}, - headingFour = {\subsubsection{#1}}, - headingFive = {\paragraph{#1}\leavevmode}, - headingSix = {\subparagraph{#1}\leavevmode}}} -}% -\markdownSetup{ - rendererPrototypes = { - ulItem = {% - \futurelet\markdownLaTeXCheckbox\markdownLaTeXUlItem - }, - }, -} -\def\markdownLaTeXUlItem{% - \ifx\markdownLaTeXCheckbox\markdownRendererTickedBox - \item[\markdownLaTeXCheckbox]% - \expandafter\@gobble - \else - \ifx\markdownLaTeXCheckbox\markdownRendererHalfTickedBox - \item[\markdownLaTeXCheckbox]% - \expandafter\expandafter\expandafter\@gobble - \else - \ifx\markdownLaTeXCheckbox\markdownRendererUntickedBox - \item[\markdownLaTeXCheckbox]% - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\@gobble \else - \item{}% - \fi - \fi - \fi -} -\@ifundefined{HCode}{}{ - \markdownSetup{ - rendererPrototypes = { - inlineHtmlTag = {% - \ifvmode - \IgnorePar - \EndP - \fi - \HCode{#1}% - }, - inputBlockHtmlElement = {% - \ifvmode - \IgnorePar - \fi - \EndP - \special{t4ht*<#1}% - \par - \ShowPar - }, - }, - } -} -\newcount\markdownLaTeXCitationsCounter - -\RequirePackage{gobble} -\def\markdownLaTeXBasicCitations#1#2#3#4#5#6{% - \advance\markdownLaTeXCitationsCounter by 1\relax - \ifx\relax#4\relax - \ifx\relax#5\relax - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \cite{#1#2#6}% Without prenotes and postnotes, just accumulate cites - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter - \@gobblethree - \fi - \else% Before a postnote (#5), dump the accumulator - \ifx\relax#1\relax\else - \cite{#1}% - \fi - \cite[#5]{#6}% - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \else - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter - \markdownLaTeXBasicCitations - \fi - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter}% - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter}% - \expandafter\expandafter\expandafter - \@gobblethree - \fi - \else% Before a prenote (#4), dump the accumulator - \ifx\relax#1\relax\else - \cite{#1}% - \fi - \ifnum\markdownLaTeXCitationsCounter>1\relax - \space % Insert a space before the prenote in later citations - \fi - #4~\expandafter\cite\ifx\relax#5\relax{#6}\else[#5]{#6}\fi - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \else - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter - \markdownLaTeXBasicCitations - \fi - \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter}% - \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter}% - \expandafter - \@gobblethree - \fi\markdownLaTeXBasicCitations{#1#2#6},} -\let\markdownLaTeXBasicTextCitations\markdownLaTeXBasicCitations - -\def\markdownLaTeXNatbibCitations#1#2#3#4#5{% - \advance\markdownLaTeXCitationsCounter by 1\relax - \ifx\relax#3\relax - \ifx\relax#4\relax - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \citep{#1,#5}% Without prenotes and postnotes, just accumulate cites - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter - \@gobbletwo - \fi - \else% Before a postnote (#4), dump the accumulator - \ifx\relax#1\relax\else - \citep{#1}% - \fi - \citep[][#4]{#5}% - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \else - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter - \markdownLaTeXNatbibCitations - \fi - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter}% - \expandafter\expandafter\expandafter - \@gobbletwo - \fi - \else% Before a prenote (#3), dump the accumulator - \ifx\relax#1\relax\relax\else - \citep{#1}% - \fi - \citep[#3][#4]{#5}% - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \else - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter - \markdownLaTeXNatbibCitations - \fi - \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter}% - \expandafter - \@gobbletwo - \fi\markdownLaTeXNatbibCitations{#1,#5}} -\def\markdownLaTeXNatbibTextCitations#1#2#3#4#5{% - \advance\markdownLaTeXCitationsCounter by 1\relax - \ifx\relax#3\relax - \ifx\relax#4\relax - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \citet{#1,#5}% Without prenotes and postnotes, just accumulate cites - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter - \@gobbletwo - \fi - \else% After a prenote or a postnote, dump the accumulator - \ifx\relax#1\relax\else - \citet{#1}% - \fi - , \citet[#3][#4]{#5}% - \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal\relax - , - \else - \ifnum\markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal\relax - , - \fi + \file_if_exist:nTF + { markdown theme #2.sty } + { + \msg_info:nnn + { markdown } + { loading-latex-theme } + { #1 } + \RequirePackage + { markdown theme #2 } + } + { + \__markdown_plain_tex_load_theme:nn + { #1 } + { #2 } + } \fi - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter - \markdownLaTeXNatbibTextCitations - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter\expandafter}% - \expandafter\expandafter\expandafter - \@gobbletwo - \fi - \else% After a prenote or a postnote, dump the accumulator - \ifx\relax#1\relax\relax\else - \citet{#1}% - \fi - , \citet[#3][#4]{#5}% - \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal\relax - , \else - \ifnum\markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal\relax - , - \fi - \fi - \expandafter\expandafter\expandafter - \markdownLaTeXNatbibTextCitations - \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter}% - \expandafter - \@gobbletwo - \fi\markdownLaTeXNatbibTextCitations{#1,#5}} - -\def\markdownLaTeXBibLaTeXCitations#1#2#3#4#5{% - \advance\markdownLaTeXCitationsCounter by 1\relax - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \autocites#1[#3][#4]{#5}% - \expandafter\@gobbletwo - \fi\markdownLaTeXBibLaTeXCitations{#1[#3][#4]{#5}}} -\def\markdownLaTeXBibLaTeXTextCitations#1#2#3#4#5{% - \advance\markdownLaTeXCitationsCounter by 1\relax - \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax - \textcites#1[#3][#4]{#5}% - \expandafter\@gobbletwo - \fi\markdownLaTeXBibLaTeXTextCitations{#1[#3][#4]{#5}}} - -\markdownSetup{rendererPrototypes = { - cite = {% - \markdownLaTeXCitationsCounter=1% - \def\markdownLaTeXCitationsTotal{#1}% - \@ifundefined{autocites}{% - \@ifundefined{citep}{% - \expandafter\expandafter\expandafter - \markdownLaTeXBasicCitations - \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter}% - \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter}% - }{% - \expandafter\expandafter\expandafter - \markdownLaTeXNatbibCitations - \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter}% - }% - }{% - \expandafter\expandafter\expandafter - \markdownLaTeXBibLaTeXCitations - \expandafter{\expandafter}% - }}, - textCite = {% - \markdownLaTeXCitationsCounter=1% - \def\markdownLaTeXCitationsTotal{#1}% - \@ifundefined{autocites}{% - \@ifundefined{citep}{% - \expandafter\expandafter\expandafter - \markdownLaTeXBasicTextCitations - \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter}% - \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter}% - }{% - \expandafter\expandafter\expandafter - \markdownLaTeXNatbibTextCitations - \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter}% - }% - }{% - \expandafter\expandafter\expandafter - \markdownLaTeXBibLaTeXTextCitations - \expandafter{\expandafter}% - }}}} -\RequirePackage{url} -\RequirePackage{expl3} -\ExplSyntaxOn -\def\markdownRendererLinkPrototype#1#2#3#4{ - \tl_set:Nn \l_tmpa_tl { #1 } - \tl_set:Nn \l_tmpb_tl { #2 } - \bool_set:Nn - \l_tmpa_bool - { - \tl_if_eq_p:NN - \l_tmpa_tl - \l_tmpb_tl - } - \tl_set:Nn \l_tmpa_tl { #4 } - \bool_set:Nn - \l_tmpb_bool - { - \tl_if_empty_p:N - \l_tmpa_tl - } - \bool_if:nTF - { - \l_tmpa_bool && \l_tmpb_bool - } - { - \markdownLaTeXRendererAutolink { #2 } { #3 } - }{ - \markdownLaTeXRendererDirectOrIndirectLink { #1 } { #2 } { #3 } { #4 } - } -} -\def\markdownLaTeXRendererAutolink#1#2{% - \tl_set:Nn - \l_tmpa_tl - { #2 } - \tl_trim_spaces:N - \l_tmpa_tl - \tl_set:Nx - \l_tmpb_tl - { - \tl_range:Nnn - \l_tmpa_tl - { 1 } - { 1 } - } - \str_if_eq:NNTF - \l_tmpb_tl - \c_hash_str - { - \tl_set:Nx - \l_tmpb_tl + \msg_info:nnn + { markdown } + { theme-loading-postponed } + { #1 } + \AtEndOfPackage { - \tl_range:Nnn - \l_tmpa_tl - { 2 } - { -1 } + \__markdown_load_theme:nn + { #1 } + { #2 } } - \exp_args:NV - \ref - \l_tmpb_tl - }{ - \url { #2 } - } -} -\ExplSyntaxOff -\def\markdownLaTeXRendererDirectOrIndirectLink#1#2#3#4{% - #1\footnote{\ifx\empty#4\empty\else#4: \fi\url{#3}}} -\newcount\markdownLaTeXRowCounter -\newcount\markdownLaTeXRowTotal -\newcount\markdownLaTeXColumnCounter -\newcount\markdownLaTeXColumnTotal -\newtoks\markdownLaTeXTable -\newtoks\markdownLaTeXTableAlignment -\newtoks\markdownLaTeXTableEnd -\AtBeginDocument{% - \@ifpackageloaded{booktabs}{% - \def\markdownLaTeXTopRule{\toprule}% - \def\markdownLaTeXMidRule{\midrule}% - \def\markdownLaTeXBottomRule{\bottomrule}% - }{% - \def\markdownLaTeXTopRule{\hline}% - \def\markdownLaTeXMidRule{\hline}% - \def\markdownLaTeXBottomRule{\hline}% - }% -} -\markdownSetup{rendererPrototypes={ - table = {% - \markdownLaTeXTable={}% - \markdownLaTeXTableAlignment={}% - \markdownLaTeXTableEnd={% - \markdownLaTeXBottomRule - \end{tabular}}% - \ifx\empty#1\empty\else - \addto@hook\markdownLaTeXTable{% - \begin{table} - \centering}% - \addto@hook\markdownLaTeXTableEnd{% - \caption{#1} - \end{table}}% \fi - \addto@hook\markdownLaTeXTable{\begin{tabular}}% - \markdownLaTeXRowCounter=0% - \markdownLaTeXRowTotal=#2% - \markdownLaTeXColumnTotal=#3% - \markdownLaTeXRenderTableRow - } -}} -\def\markdownLaTeXRenderTableRow#1{% - \markdownLaTeXColumnCounter=0% - \ifnum\markdownLaTeXRowCounter=0\relax - \markdownLaTeXReadAlignments#1% - \markdownLaTeXTable=\expandafter\expandafter\expandafter{% - \expandafter\the\expandafter\markdownLaTeXTable\expandafter{% - \the\markdownLaTeXTableAlignment}}% - \addto@hook\markdownLaTeXTable{\markdownLaTeXTopRule}% - \else - \markdownLaTeXRenderTableCell#1% - \fi - \ifnum\markdownLaTeXRowCounter=1\relax - \addto@hook\markdownLaTeXTable\markdownLaTeXMidRule - \fi - \advance\markdownLaTeXRowCounter by 1\relax - \ifnum\markdownLaTeXRowCounter>\markdownLaTeXRowTotal\relax - \the\markdownLaTeXTable - \the\markdownLaTeXTableEnd - \expandafter\@gobble - \fi\markdownLaTeXRenderTableRow} -\def\markdownLaTeXReadAlignments#1{% - \advance\markdownLaTeXColumnCounter by 1\relax - \if#1d% - \addto@hook\markdownLaTeXTableAlignment{l}% - \else - \addto@hook\markdownLaTeXTableAlignment{#1}% - \fi - \ifnum\markdownLaTeXColumnCounter<\markdownLaTeXColumnTotal\relax\else - \expandafter\@gobble - \fi\markdownLaTeXReadAlignments} -\def\markdownLaTeXRenderTableCell#1{% - \advance\markdownLaTeXColumnCounter by 1\relax - \ifnum\markdownLaTeXColumnCounter<\markdownLaTeXColumnTotal\relax - \addto@hook\markdownLaTeXTable{#1&}% - \else - \addto@hook\markdownLaTeXTable{#1\\}% - \expandafter\@gobble - \fi\markdownLaTeXRenderTableCell} - -\markdownIfOption{lineBlocks}{% - \RequirePackage{verse} - \markdownSetup{rendererPrototypes={ - lineBlockBegin = {% - \begingroup - \def\markdownRendererHardLineBreak{\\}% - \begin{verse}% - }, - lineBlockEnd = {% - \end{verse}% - \endgroup - }, - }} -}{} - -\ExplSyntaxOn -\keys_define:nn - { markdown/jekyllData } - { - author .code:n = { \author{#1} }, - date .code:n = { \date{#1} }, - title .code:n = { \title{#1} }, - } -\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} -\markdownSetup{ - rendererPrototypes = { - jekyllDataEnd = { - \IfFormatAtLeastTF - { 2020-10-01 } - { \AddToHook{begindocument/end}{\maketitle} } - { - \ifx\@onlypreamble\@notprerr - % We are in the document - \maketitle - \else - % We are in the preamble - \RequirePackage{etoolbox} - \AfterEndPreamble{\maketitle} - \fi - } - }, - }, -} -\ExplSyntaxOff -\markdownIfOption{strikeThrough}{% - \RequirePackage{soulutf8}% - \markdownSetup{ - rendererPrototypes = { - strikeThrough = {% - \st{#1}% - }, - } - } -}{} -\markdownIfOption{strikeThrough}{% - \RequirePackage{soulutf8}% - \markdownSetup{ - rendererPrototypes = { - strikeThrough = {% - \st{#1}% - }, - } - } -}{} -\ExplSyntaxOn -\__markdown_if_option:nT - { linkAttributes } - { - \RequirePackage{graphicx} - \markdownSetup{ - rendererPrototypes = { - imageAttributeContextBegin = { - \group_begin: - \markdownSetup{ - rendererPrototypes = { - attributeKeyValue = { - \setkeys - { Gin } - { { ##1 } = { ##2 } } - }, - }, - } - }, - imageAttributeContextEnd = { - \group_end: - }, - }, - } - } -\ExplSyntaxOff -\ExplSyntaxOn -\cs_gset:Npn - \markdownRendererInputRawInlinePrototype#1#2 - { - \str_case:nnF - { #2 } - { - { latex } - { - \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn - { #1 } - { tex } - } - } - { - \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn - { #1 } - { #2 } - } } -\cs_gset:Npn - \markdownRendererInputRawBlockPrototype#1#2 +\msg_new:nnn + { markdown } + { theme-loading-postponed } { - \str_case:nnF - { #2 } - { - { latex } - { - \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn - { #1 } - { tex } - } - } - { - \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn - { #1 } - { #2 } - } + Postponing~loading~Markdown~theme~#1~until~ + Markdown~package~has~finished~loading } +\msg_new:nnn + { markdown } + { loading-latex-theme } + { Loading~LaTeX~Markdown~theme~#1 } +\cs_generate_variant:Nn + \msg_new:nnnn + { nnVV } +\tl_set:Nn + \l_tmpa_tl + { Cannot~load~LaTeX~Markdown~theme~#1~after~ } +\tl_put_right:NV + \l_tmpa_tl + \c_backslash_str +\tl_put_right:Nn + \l_tmpa_tl + { begin{document} } +\tl_set:Nn + \l_tmpb_tl + { Load~Markdown~theme~#1~before~ } +\tl_put_right:NV + \l_tmpb_tl + \c_backslash_str +\tl_put_right:Nn + \l_tmpb_tl + { begin{document} } +\msg_new:nnVV + { markdown } + { latex-theme-after-preamble } + \l_tmpa_tl + \l_tmpb_tl \ExplSyntaxOff -\fi % Closes `\markdownIfOption{Plain}{\iffalse}{iftrue}` \newcommand\markdownMakeOther{% \count0=128\relax \loop diff --git a/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_dot.sty b/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_dot.sty index 54aa163371a..a6ebbd6f1d9 100644 --- a/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_dot.sty +++ b/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_dot.sty @@ -4,9 +4,9 @@ %% %% The original source files were: %% -%% markdown.dtx (with options: `latex-themes-witiko-dot') +%% markdown.dtx (with options: `themes-witiko-dot') %% -%% Copyright (C) 2016-2023 Vít Novotný +%% Copyright (C) 2016-2024 Vít Starý Novotný %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -16,7 +16,7 @@ %% http://www.latex-project.org/lppl.txt %% %% This work has the LPPL maintenance status `maintained'. -%% The Current Maintainer of this work is Vít Novotný. +%% The Current Maintainer of this work is Vít Starý Novotný. %% %% Send bug reports, requests for additions and questions %% either to the GitHub issue tracker at @@ -47,7 +47,7 @@ \RequirePackage{ifthen,grffile} \let\markdown@witiko@dot@oldRendererInputFencedCodePrototype \markdownRendererInputFencedCodePrototype -\renewcommand\markdownRendererInputFencedCodePrototype[2]{% +\renewcommand\markdownRendererInputFencedCodePrototype[3]{% \def\next##1 ##2\relax{% \ifthenelse{\equal{##1}{dot}}{% \markdownIfOption{frozenCache}{}{% @@ -59,7 +59,7 @@ fi}}% \markdownRendererImage{Graphviz image}{#1.pdf}{#1.pdf}{##2}% }{% - \markdown@witiko@dot@oldRendererInputFencedCodePrototype{#1}{#2}% + \markdown@witiko@dot@oldRendererInputFencedCodePrototype{#1}{#2}{#3}% }% }% \next#2 \relax}% diff --git a/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_graphicx_http.sty b/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_graphicx_http.sty index 57d27069ab0..a962d1d8cd0 100644 --- a/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_graphicx_http.sty +++ b/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_graphicx_http.sty @@ -4,9 +4,9 @@ %% %% The original source files were: %% -%% markdown.dtx (with options: `latex-themes-witiko-graphicx-http') +%% markdown.dtx (with options: `themes-witiko-graphicx-http') %% -%% Copyright (C) 2016-2023 Vít Novotný +%% Copyright (C) 2016-2024 Vít Starý Novotný %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -16,7 +16,7 @@ %% http://www.latex-project.org/lppl.txt %% %% This work has the LPPL maintenance status `maintained'. -%% The Current Maintainer of this work is Vít Novotný. +%% The Current Maintainer of this work is Vít Starý Novotný. %% %% Send bug reports, requests for additions and questions %% either to the GitHub issue tracker at diff --git a/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_markdown_defaults.sty b/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_markdown_defaults.sty new file mode 100644 index 00000000000..99de31845a7 --- /dev/null +++ b/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_markdown_defaults.sty @@ -0,0 +1,933 @@ +%% +%% This is file `markdownthemewitiko_markdown_defaults.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% markdown.dtx (with options: `themes-witiko-markdown-defaults-latex') +%% +%% Copyright (C) 2016-2024 Vít Starý Novotný +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% +%% http://www.latex-project.org/lppl.txt +%% +%% This work has the LPPL maintenance status `maintained'. +%% The Current Maintainer of this work is Vít Starý Novotný. +%% +%% Send bug reports, requests for additions and questions +%% either to the GitHub issue tracker at +%% +%% https://github.com/Witiko/markdown/issues +%% +%% or to the e-mail address <witiko@mail.muni.cz>. +%% +%% MODIFICATION ADVICE: +%% +%% If you want to customize this file, it is best to make a copy of +%% the source file(s) from which it was produced. Use a different +%% name for your copy(ies) and modify the copy(ies); this will ensure +%% that your modifications do not get overwritten when you install a +%% new release of the standard system. You should also ensure that +%% your modified source file does not generate any modified file with +%% the same name as a standard file. +%% +%% You will also need to produce your own, suitably named, .ins file to +%% control the generation of files from your source file; this file +%% should contain your own preambles for the files it generates, not +%% those in the standard .ins files. +%% +%% The names of the source files used are shown above. +%% +\ProvidesPackage{markdownthemewitiko_markdown_defaults}[2024/01/03]% +\markdownLoadPlainTeXTheme +\markdownIfOption{plain}{\iffalse}{\iftrue} +\@ifclassloaded{beamer}{}{% + \markdownIfOption{tightLists}{\RequirePackage{paralist}}{}% + \markdownIfOption{fancyLists}{\RequirePackage{paralist}}{}% +} +\ExplSyntaxOn +\@ifpackageloaded{paralist}{ + \tl_new:N + \l__markdown_latex_fancy_list_item_label_number_style_tl + \tl_new:N + \l__markdown_latex_fancy_list_item_label_delimiter_style_tl + \cs_new:Nn + \__markdown_latex_fancy_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 + \__markdown_latex_fancy_list_item_label_delimiter:n + { + \str_case:nn + { #1 } + { + { Default } { . } + { OneParen } { ) } + { Period } { . } + } + } + \cs_new:Nn + \__markdown_latex_fancy_list_item_label:nnn + { + \__markdown_latex_fancy_list_item_label_number:nn + { #1 } + { #3 } + \__markdown_latex_fancy_list_item_label_delimiter:n + { #2 } + } + \cs_new:Nn + \__markdown_latex_paralist_style:nn + { + \str_case:nn + { #1 } + { + { Decimal } { 1 } + { LowerRoman } { i } + { UpperRoman } { I } + { LowerAlpha } { a } + { UpperAlpha } { A } + } + \__markdown_latex_fancy_list_item_label_delimiter:n + { #2 } + } + \markdownSetup{rendererPrototypes={ + ulBeginTight = {% + \group_begin: + \pltopsep=\topsep + \plpartopsep=\partopsep + \begin{compactitem} + }, + ulEndTight = { + \end{compactitem} + \group_end: + }, + fancyOlBegin = { + \group_begin: + \tl_set:Nn + \l__markdown_latex_fancy_list_item_label_number_style_tl + { #1 } + \tl_set:Nn + \l__markdown_latex_fancy_list_item_label_delimiter_style_tl + { #2 } + \__markdown_if_option:nTF + { startNumber } + { + \tl_set:Nn + \l_tmpa_tl + { \begin{enumerate} } + } + { + \tl_set:Nn + \l_tmpa_tl + { \begin{enumerate}[ } + \tl_put_right:Nx + \l_tmpa_tl + { \__markdown_latex_paralist_style:nn { #1 } { #2 } } + \tl_put_right:Nn + \l_tmpa_tl + { ] } + } + \tl_use:N + \l_tmpa_tl + }, + fancyOlEnd = { + \end{enumerate} + \group_end: + }, + olBeginTight = {% + \group_begin: + \plpartopsep=\partopsep + \pltopsep=\topsep + \begin{compactenum} + }, + olEndTight = { + \end{compactenum} + \group_end: + }, + fancyOlBeginTight = { + \group_begin: + \tl_set:Nn + \l__markdown_latex_fancy_list_item_label_number_style_tl + { #1 } + \tl_set:Nn + \l__markdown_latex_fancy_list_item_label_delimiter_style_tl + { #2 } + \tl_set:Nn + \l_tmpa_tl + { + \plpartopsep=\partopsep + \pltopsep=\topsep + } + \__markdown_if_option:nTF + { startNumber } + { + \tl_put_right:Nn + \l_tmpa_tl + { \begin{compactenum} } + } + { + \tl_put_right:Nn + \l_tmpa_tl + { \begin{compactenum}[ } + \tl_put_right:Nx + \l_tmpa_tl + { \__markdown_latex_paralist_style:nn { #1 } { #2 } } + \tl_put_right:Nn + \l_tmpa_tl + { ] } + } + \tl_use:N + \l_tmpa_tl + }, + fancyOlEndTight = { + \end{compactenum} + \group_end: + }, + fancyOlItemWithNumber = { + \item + [ + \__markdown_latex_fancy_list_item_label:VVn + \l__markdown_latex_fancy_list_item_label_number_style_tl + \l__markdown_latex_fancy_list_item_label_delimiter_style_tl + { #1 } + ] + }, + dlBeginTight = { + \group_begin: + \plpartopsep=\partopsep + \pltopsep=\topsep + \begin{compactdesc} + }, + dlEndTight = { + \end{compactdesc} + \group_end: + }}} + \cs_generate_variant:Nn + \__markdown_latex_fancy_list_item_label:nnn + { VVn } +}{ + \markdownSetup{rendererPrototypes={ + ulBeginTight = {\markdownRendererUlBegin}, + ulEndTight = {\markdownRendererUlEnd}, + fancyOlBegin = {\markdownRendererOlBegin}, + fancyOlEnd = {\markdownRendererOlEnd}, + olBeginTight = {\markdownRendererOlBegin}, + olEndTight = {\markdownRendererOlEnd}, + fancyOlBeginTight = {\markdownRendererOlBegin}, + fancyOlEndTight = {\markdownRendererOlEnd}, + dlBeginTight = {\markdownRendererDlBegin}, + dlEndTight = {\markdownRendererDlEnd}}} +} +\ExplSyntaxOff +\RequirePackage{amsmath} +\@ifpackageloaded{unicode-math}{ + \markdownSetup{rendererPrototypes={ + untickedBox = {$\mdlgwhtsquare$}, + }} +}{ + \RequirePackage{amssymb} + \markdownSetup{rendererPrototypes={ + untickedBox = {$\square$}, + }} +} +\RequirePackage{csvsimple} +\RequirePackage{fancyvrb} +\RequirePackage{graphicx} +\markdownSetup{rendererPrototypes={ + hardLineBreak = {\\}, + leftBrace = {\textbraceleft}, + rightBrace = {\textbraceright}, + dollarSign = {\textdollar}, + underscore = {\textunderscore}, + circumflex = {\textasciicircum}, + backslash = {\textbackslash}, + tilde = {\textasciitilde}, + pipe = {\textbar}, + codeSpan = {% + \ifmmode + \text{#1}% + \else + \texttt{#1}% + \fi + }}} +\ExplSyntaxOn +\markdownSetup{ + rendererPrototypes = { + contentBlock = { + \str_case:nnF + { #1 } + { + { csv } + { + \begin{table} + \begin{center} + \csvautotabular{#3} + \end{center} + \tl_if_empty:nF + { #4 } + { \caption{#4} } + \end{table} + } + { tex } { \markdownEscape{#3} } + } + { \markdownInput{#3} } + }, + }, +} +\ExplSyntaxOff +\markdownSetup{rendererPrototypes={ + image = {% + \begin{figure}% + \begin{center}% + \includegraphics[alt={#1}]{#3}% + \end{center}% + \ifx\empty#4\empty\else + \caption{#4}% + \fi + \end{figure}}, + ulBegin = {\begin{itemize}}, + ulEnd = {\end{itemize}}, + olBegin = {\begin{enumerate}}, + olItem = {\item{}}, + olItemWithNumber = {\item[#1.]}, + olEnd = {\end{enumerate}}, + dlBegin = {\begin{description}}, + dlItem = {\item[#1]}, + dlEnd = {\end{description}}, + emphasis = {\emph{#1}}, + tickedBox = {$\boxtimes$}, + halfTickedBox = {$\boxdot$}}} +\ExplSyntaxOn +\seq_new:N \l__markdown_header_identifiers_seq +\markdownSetup{ + rendererPrototypes = { + headerAttributeContextBegin = { + \seq_clear:N \l__markdown_header_identifiers_seq + \markdownSetup + { + renderers = { + attributeIdentifier = { + \seq_put_right:Nn + \l__markdown_header_identifiers_seq + { ##1 } + }, + }, + } + }, + headerAttributeContextEnd = { + \seq_map_inline:Nn + \l__markdown_header_identifiers_seq + { \label { ##1 } } + }, + }, +} +\ExplSyntaxOff +\markdownSetup{rendererPrototypes={ + superscript = {\textsuperscript{#1}}, + subscript = {\textsubscript{#1}}, + blockQuoteBegin = {\begin{quotation}}, + blockQuoteEnd = {\end{quotation}}, + inputVerbatim = {\VerbatimInput{#1}}, + thematicBreak = {\noindent\rule[0.5ex]{\linewidth}{1pt}}, + note = {\footnote{#1}}}} +\RequirePackage{ltxcmds} +\ExplSyntaxOn +\cs_gset:Npn + \markdownRendererInputFencedCodePrototype#1#2#3 + { + \tl_if_empty:nTF + { #2 } + { \markdownRendererInputVerbatim{#1} } + { + \regex_extract_once:nnN + { \w* } + { #2 } + \l_tmpa_seq + \seq_pop_left:NN + \l_tmpa_seq + \l_tmpa_tl + \ltx@ifpackageloaded + { minted } + { + \catcode`\#=6\relax + \exp_args:NV + \inputminted + \l_tmpa_tl + { #1 } + \catcode`\#=12\relax + } + { + \ltx@ifpackageloaded + { listings } + { \lstinputlisting[language=\l_tmpa_tl]{#1} } + { \markdownRendererInputFencedCode{#1}{}{} } + } + } + } +\def\markdownLATEXStrongEmphasis#1{% + \str_if_in:NnTF + \f@series + { b } + { \textnormal{#1} } + { \textbf{#1} } +} +\ExplSyntaxOff +\markdownSetup{rendererPrototypes={strongEmphasis={% + \protect\markdownLATEXStrongEmphasis{#1}}}} +\@ifundefined{chapter}{% + \markdownSetup{rendererPrototypes = { + headingOne = {\section{#1}}, + headingTwo = {\subsection{#1}}, + headingThree = {\subsubsection{#1}}, + headingFour = {\paragraph{#1}}, + headingFive = {\subparagraph{#1}}}} +}{% + \markdownSetup{rendererPrototypes = { + headingOne = {\chapter{#1}}, + headingTwo = {\section{#1}}, + headingThree = {\subsection{#1}}, + headingFour = {\subsubsection{#1}}, + headingFive = {\paragraph{#1}}, + headingSix = {\subparagraph{#1}}}} +}% +\markdownSetup{ + rendererPrototypes = { + ulItem = {% + \futurelet\markdownLaTeXCheckbox\markdownLaTeXUlItem + }, + }, +} +\def\markdownLaTeXUlItem{% + \ifx\markdownLaTeXCheckbox\markdownRendererTickedBox + \item[\markdownLaTeXCheckbox]% + \expandafter\@gobble + \else + \ifx\markdownLaTeXCheckbox\markdownRendererHalfTickedBox + \item[\markdownLaTeXCheckbox]% + \expandafter\expandafter\expandafter\@gobble + \else + \ifx\markdownLaTeXCheckbox\markdownRendererUntickedBox + \item[\markdownLaTeXCheckbox]% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\@gobble + \else + \item{}% + \fi + \fi + \fi +} +\@ifundefined{HCode}{}{ + \markdownSetup{ + rendererPrototypes = { + inlineHtmlTag = {% + \ifvmode + \IgnorePar + \EndP + \fi + \HCode{#1}% + }, + inputBlockHtmlElement = {% + \ifvmode + \IgnorePar + \fi + \EndP + \special{t4ht*<#1}% + \par + \ShowPar + }, + }, + } +} +\newcount\markdownLaTeXCitationsCounter + +\RequirePackage{gobble} +\def\markdownLaTeXBasicCitations#1#2#3#4#5#6{% + \advance\markdownLaTeXCitationsCounter by 1\relax + \ifx\relax#4\relax + \ifx\relax#5\relax + \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax + \cite{#1#2#6}% Without prenotes and postnotes, just accumulate cites + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \@gobblethree + \fi + \else% Before a postnote (#5), dump the accumulator + \ifx\relax#1\relax\else + \cite{#1}% + \fi + \cite[#5]{#6}% + \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax + \else + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \markdownLaTeXBasicCitations + \fi + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter + \@gobblethree + \fi + \else% Before a prenote (#4), dump the accumulator + \ifx\relax#1\relax\else + \cite{#1}% + \fi + \ifnum\markdownLaTeXCitationsCounter>1\relax + \space % Insert a space before the prenote in later citations + \fi + #4~\expandafter\cite\ifx\relax#5\relax{#6}\else[#5]{#6}\fi + \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax + \else + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \markdownLaTeXBasicCitations + \fi + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter}% + \expandafter + \@gobblethree + \fi\markdownLaTeXBasicCitations{#1#2#6},} +\let\markdownLaTeXBasicTextCitations\markdownLaTeXBasicCitations + +\def\markdownLaTeXNatbibCitations#1#2#3#4#5{% + \advance\markdownLaTeXCitationsCounter by 1\relax + \ifx\relax#3\relax + \ifx\relax#4\relax + \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax + \citep{#1,#5}% Without prenotes and postnotes, just accumulate cites + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \@gobbletwo + \fi + \else% Before a postnote (#4), dump the accumulator + \ifx\relax#1\relax\else + \citep{#1}% + \fi + \citep[][#4]{#5}% + \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax + \else + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \markdownLaTeXNatbibCitations + \fi + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter + \@gobbletwo + \fi + \else% Before a prenote (#3), dump the accumulator + \ifx\relax#1\relax\relax\else + \citep{#1}% + \fi + \citep[#3][#4]{#5}% + \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax + \else + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \markdownLaTeXNatbibCitations + \fi + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter}% + \expandafter + \@gobbletwo + \fi\markdownLaTeXNatbibCitations{#1,#5}} +\def\markdownLaTeXNatbibTextCitations#1#2#3#4#5{% + \advance\markdownLaTeXCitationsCounter by 1\relax + \ifx\relax#3\relax + \ifx\relax#4\relax + \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax + \citet{#1,#5}% Without prenotes and postnotes, just accumulate cites + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \@gobbletwo + \fi + \else% After a prenote or a postnote, dump the accumulator + \ifx\relax#1\relax\else + \citet{#1}% + \fi + , \citet[#3][#4]{#5}% + \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal\relax + , + \else + \ifnum\markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal\relax + , + \fi + \fi + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter + \markdownLaTeXNatbibTextCitations + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter + \@gobbletwo + \fi + \else% After a prenote or a postnote, dump the accumulator + \ifx\relax#1\relax\relax\else + \citet{#1}% + \fi + , \citet[#3][#4]{#5}% + \ifnum\markdownLaTeXCitationsCounter<\markdownLaTeXCitationsTotal\relax + , + \else + \ifnum\markdownLaTeXCitationsCounter=\markdownLaTeXCitationsTotal\relax + , + \fi + \fi + \expandafter\expandafter\expandafter + \markdownLaTeXNatbibTextCitations + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter}% + \expandafter + \@gobbletwo + \fi\markdownLaTeXNatbibTextCitations{#1,#5}} + +\def\markdownLaTeXBibLaTeXCitations#1#2#3#4#5{% + \advance\markdownLaTeXCitationsCounter by 1\relax + \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax + \autocites#1[#3][#4]{#5}% + \expandafter\@gobbletwo + \fi\markdownLaTeXBibLaTeXCitations{#1[#3][#4]{#5}}} +\def\markdownLaTeXBibLaTeXTextCitations#1#2#3#4#5{% + \advance\markdownLaTeXCitationsCounter by 1\relax + \ifnum\markdownLaTeXCitationsCounter>\markdownLaTeXCitationsTotal\relax + \textcites#1[#3][#4]{#5}% + \expandafter\@gobbletwo + \fi\markdownLaTeXBibLaTeXTextCitations{#1[#3][#4]{#5}}} + +\markdownSetup{rendererPrototypes = { + cite = {% + \markdownLaTeXCitationsCounter=1% + \def\markdownLaTeXCitationsTotal{#1}% + \@ifundefined{autocites}{% + \@ifundefined{citep}{% + \expandafter\expandafter\expandafter + \markdownLaTeXBasicCitations + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter}% + }{% + \expandafter\expandafter\expandafter + \markdownLaTeXNatbibCitations + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter}% + }% + }{% + \expandafter\expandafter\expandafter + \markdownLaTeXBibLaTeXCitations + \expandafter{\expandafter}% + }}, + textCite = {% + \markdownLaTeXCitationsCounter=1% + \def\markdownLaTeXCitationsTotal{#1}% + \@ifundefined{autocites}{% + \@ifundefined{citep}{% + \expandafter\expandafter\expandafter + \markdownLaTeXBasicTextCitations + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter}% + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter}% + }{% + \expandafter\expandafter\expandafter + \markdownLaTeXNatbibTextCitations + \expandafter\expandafter\expandafter{% + \expandafter\expandafter\expandafter}% + }% + }{% + \expandafter\expandafter\expandafter + \markdownLaTeXBibLaTeXTextCitations + \expandafter{\expandafter}% + }}}} +\RequirePackage{url} +\RequirePackage{expl3} +\ExplSyntaxOn +\def\markdownRendererLinkPrototype#1#2#3#4{ + \tl_set:Nn \l_tmpa_tl { #1 } + \tl_set:Nn \l_tmpb_tl { #2 } + \bool_set:Nn + \l_tmpa_bool + { + \tl_if_eq_p:NN + \l_tmpa_tl + \l_tmpb_tl + } + \tl_set:Nn \l_tmpa_tl { #4 } + \bool_set:Nn + \l_tmpb_bool + { + \tl_if_empty_p:N + \l_tmpa_tl + } + \bool_if:nTF + { + \l_tmpa_bool && \l_tmpb_bool + } + { + \markdownLaTeXRendererAutolink { #2 } { #3 } + }{ + \markdownLaTeXRendererDirectOrIndirectLink { #1 } { #2 } { #3 } { #4 } + } +} +\def\markdownLaTeXRendererAutolink#1#2{% + \tl_set:Nn + \l_tmpa_tl + { #2 } + \tl_trim_spaces:N + \l_tmpa_tl + \tl_set:Nx + \l_tmpb_tl + { + \tl_range:Nnn + \l_tmpa_tl + { 1 } + { 1 } + } + \str_if_eq:NNTF + \l_tmpb_tl + \c_hash_str + { + \tl_set:Nx + \l_tmpb_tl + { + \tl_range:Nnn + \l_tmpa_tl + { 2 } + { -1 } + } + \exp_args:NV + \ref + \l_tmpb_tl + }{ + \url { #2 } + } +} +\ExplSyntaxOff +\def\markdownLaTeXRendererDirectOrIndirectLink#1#2#3#4{% + #1\footnote{\ifx\empty#4\empty\else#4: \fi\url{#3}}} +\newcount\markdownLaTeXRowCounter +\newcount\markdownLaTeXRowTotal +\newcount\markdownLaTeXColumnCounter +\newcount\markdownLaTeXColumnTotal +\newtoks\markdownLaTeXTable +\newtoks\markdownLaTeXTableAlignment +\newtoks\markdownLaTeXTableEnd +\AtBeginDocument{% + \@ifpackageloaded{booktabs}{% + \def\markdownLaTeXTopRule{\toprule}% + \def\markdownLaTeXMidRule{\midrule}% + \def\markdownLaTeXBottomRule{\bottomrule}% + }{% + \def\markdownLaTeXTopRule{\hline}% + \def\markdownLaTeXMidRule{\hline}% + \def\markdownLaTeXBottomRule{\hline}% + }% +} +\markdownSetup{rendererPrototypes={ + table = {% + \markdownLaTeXTable={}% + \markdownLaTeXTableAlignment={}% + \markdownLaTeXTableEnd={% + \markdownLaTeXBottomRule + \end{tabular}}% + \ifx\empty#1\empty\else + \addto@hook\markdownLaTeXTable{% + \begin{table} + \centering}% + \addto@hook\markdownLaTeXTableEnd{% + \caption{#1} + \end{table}}% + \fi + \addto@hook\markdownLaTeXTable{\begin{tabular}}% + \markdownLaTeXRowCounter=0% + \markdownLaTeXRowTotal=#2% + \markdownLaTeXColumnTotal=#3% + \markdownLaTeXRenderTableRow + } +}} +\def\markdownLaTeXRenderTableRow#1{% + \markdownLaTeXColumnCounter=0% + \ifnum\markdownLaTeXRowCounter=0\relax + \markdownLaTeXReadAlignments#1% + \markdownLaTeXTable=\expandafter\expandafter\expandafter{% + \expandafter\the\expandafter\markdownLaTeXTable\expandafter{% + \the\markdownLaTeXTableAlignment}}% + \addto@hook\markdownLaTeXTable{\markdownLaTeXTopRule}% + \else + \markdownLaTeXRenderTableCell#1% + \fi + \ifnum\markdownLaTeXRowCounter=1\relax + \addto@hook\markdownLaTeXTable\markdownLaTeXMidRule + \fi + \advance\markdownLaTeXRowCounter by 1\relax + \ifnum\markdownLaTeXRowCounter>\markdownLaTeXRowTotal\relax + \the\markdownLaTeXTable + \the\markdownLaTeXTableEnd + \expandafter\@gobble + \fi\markdownLaTeXRenderTableRow} +\def\markdownLaTeXReadAlignments#1{% + \advance\markdownLaTeXColumnCounter by 1\relax + \if#1d% + \addto@hook\markdownLaTeXTableAlignment{l}% + \else + \addto@hook\markdownLaTeXTableAlignment{#1}% + \fi + \ifnum\markdownLaTeXColumnCounter<\markdownLaTeXColumnTotal\relax\else + \expandafter\@gobble + \fi\markdownLaTeXReadAlignments} +\def\markdownLaTeXRenderTableCell#1{% + \advance\markdownLaTeXColumnCounter by 1\relax + \ifnum\markdownLaTeXColumnCounter<\markdownLaTeXColumnTotal\relax + \addto@hook\markdownLaTeXTable{#1&}% + \else + \addto@hook\markdownLaTeXTable{#1\\}% + \expandafter\@gobble + \fi\markdownLaTeXRenderTableCell} + +\markdownIfOption{lineBlocks}{% + \RequirePackage{verse} + \markdownSetup{rendererPrototypes={ + lineBlockBegin = {% + \begingroup + \def\markdownRendererHardLineBreak{\\}% + \begin{verse}% + }, + lineBlockEnd = {% + \end{verse}% + \endgroup + }, + }} +}{} + +\ExplSyntaxOn +\keys_define:nn + { markdown/jekyllData } + { + author .code:n = { \author{#1} }, + date .code:n = { \date{#1} }, + title .code:n = { \title{#1} }, + } +\markdownSetup{ + rendererPrototypes = { + jekyllDataEnd = { + \AddToHook{begindocument/end}{\maketitle} + }, + }, +} +\ExplSyntaxOff +\markdownIfOption{strikeThrough}{% + \RequirePackage{soulutf8}% + \markdownSetup{ + rendererPrototypes = { + strikeThrough = {% + \st{#1}% + }, + } + } +}{} +\markdownIfOption{mark}{% + \RequirePackage{soulutf8}% + \markdownSetup{ + rendererPrototypes = { + mark = {% + \hl{#1}% + }, + } + } +}{} +\ExplSyntaxOn +\__markdown_if_option:nT + { linkAttributes } + { + \RequirePackage{graphicx} + \markdownSetup{ + rendererPrototypes = { + imageAttributeContextBegin = { + \group_begin: + \markdownSetup{ + rendererPrototypes = { + attributeKeyValue = { + \setkeys + { Gin } + { { ##1 } = { ##2 } } + }, + }, + } + }, + imageAttributeContextEnd = { + \group_end: + }, + }, + } + } +\cs_gset:Npn + \markdownRendererInputRawInlinePrototype#1#2 + { + \str_case:nnF + { #2 } + { + { latex } + { + \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn + { #1 } + { tex } + } + } + { + \__markdown_plain_tex_default_input_raw_inline_renderer_prototype:nn + { #1 } + { #2 } + } + } +\cs_gset:Npn + \markdownRendererInputRawBlockPrototype#1#2 + { + \str_case:nnF + { #2 } + { + { latex } + { + \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn + { #1 } + { tex } + } + } + { + \__markdown_plain_tex_default_input_raw_block_renderer_prototype:nn + { #1 } + { #2 } + } + } +\ExplSyntaxOff +\fi % Closes `\markdownIfOption{plain}{\iffalse}{\iftrue}` +\endinput +%% +%% End of file `markdownthemewitiko_markdown_defaults.sty'. diff --git a/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_tilde.sty b/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_tilde.sty deleted file mode 100644 index 83dcd4015bf..00000000000 --- a/Master/texmf-dist/tex/latex/markdown/markdownthemewitiko_tilde.sty +++ /dev/null @@ -1,49 +0,0 @@ -%% -%% This is file `markdownthemewitiko_tilde.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% markdown.dtx (with options: `latex-themes-witiko-tilde') -%% -%% Copyright (C) 2016-2023 Vít Novotný -%% -%% This work may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.3c -%% of this license or (at your option) any later version. -%% The latest version of this license is in -%% -%% http://www.latex-project.org/lppl.txt -%% -%% This work has the LPPL maintenance status `maintained'. -%% The Current Maintainer of this work is Vít Novotný. -%% -%% Send bug reports, requests for additions and questions -%% either to the GitHub issue tracker at -%% -%% https://github.com/Witiko/markdown/issues -%% -%% or to the e-mail address <witiko@mail.muni.cz>. -%% -%% MODIFICATION ADVICE: -%% -%% If you want to customize this file, it is best to make a copy of -%% the source file(s) from which it was produced. Use a different -%% name for your copy(ies) and modify the copy(ies); this will ensure -%% that your modifications do not get overwritten when you install a -%% new release of the standard system. You should also ensure that -%% your modified source file does not generate any modified file with -%% the same name as a standard file. -%% -%% You will also need to produce your own, suitably named, .ins file to -%% control the generation of files from your source file; this file -%% should contain your own preambles for the files it generates, not -%% those in the standard .ins files. -%% -%% The names of the source files used are shown above. -%% -\ProvidesPackage{markdownthemewitiko_tilde}[2021/03/22]% -\renewcommand\markdownRendererTildePrototype{~}% -\endinput -%% -%% End of file `markdownthemewitiko_tilde.sty'. |