[go: nahoru, domu]

Skip to content

Commit

Permalink
Merge pull request #498 from Witiko/fix/import
Browse files Browse the repository at this point in the history
Properly load LaTeX themes when `theme` or `import` is used in `\usepackage[...]{markdown}`
  • Loading branch information
Witiko authored Sep 9, 2024
2 parents 0ceded6 + b602f0a commit c4ef2e4
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 22 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## 3.7.1

Fixes:

- Properly load LaTeX themes when `theme` or `import` is used in
`\usepackage[...]{markdown}`. (#471, #498)

## 3.7.0 (2024-08-30)

Development:
Expand Down
33 changes: 20 additions & 13 deletions markdown.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -35880,17 +35880,6 @@ end
% \par
% \begin{markdown}
%
%### Options
% The supplied package options are processed using the \mref{markdownSetup} macro.
%
% \end{markdown}
% \begin{macrocode}
\DeclareOption*{%
\expandafter\markdownSetup\expandafter{\CurrentOption}}%
\ProcessOptions\relax
% \end{macrocode}
% \begin{markdown}
%
%### Themes {#latex-themes-implementation}
%
% This section overrides the plain \TeX{} implementation of the theme-loading
Expand Down Expand Up @@ -35978,9 +35967,8 @@ end
{ #1 }
\AtEndOfPackage
{
\@@_load_theme:nn
\@@_set_theme:n
{ #1 }
{ #2 }
}
\fi
}
Expand Down Expand Up @@ -36254,6 +36242,25 @@ end
% See Section <#sec:latex-token-renderer-prototypes> for the actual
% definitions.
%
%### Options
% The supplied package options are processed using the \mref{markdownSetup} macro.
%
% \end{markdown}
% \iffalse
%</themes-witiko-markdown-defaults-latex>
%<*latex>
% \fi
% \begin{macrocode}
\DeclareOption*{%
\expandafter\markdownSetup\expandafter{\CurrentOption}}%
\ProcessOptions\relax
% \end{macrocode}
% \iffalse
%</latex>
%<*themes-witiko-markdown-defaults-latex>
% \fi
% \begin{markdown}
%
%### Token Renderer Prototypes {#latex-token-renderer-prototypes}
%
% The following configuration should be considered placeholder. If the option
Expand Down
2 changes: 1 addition & 1 deletion tests/support/markdownthemewitiko_markdown_test.sty
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage
{markdownthemewitiko_markdown_test}%
[2023/12/29 A LaTeX theme for the Markdown package that writes used renderers to the log for testing]
[2024/09/09 A LaTeX theme for the Markdown package that writes used renderers to the log for testing]
\markdownLoadPlainTeXTheme
9 changes: 9 additions & 0 deletions tests/support/markdownthemewitiko_markdown_test_latex.sty
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage
{markdownthemewitiko_markdown_test_latex}%
[2024/09/09 A LaTeX theme for the Markdown package that writes used renderers to the log for testing]
\markdownSetup {
import = {
witiko/markdown/test = snippet
}
}
8 changes: 4 additions & 4 deletions tests/templates/latex/input/head.tex.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
\csname UseRawInputEncoding\endcsname

% Load the package.
\usepackage[plain]{markdown}
\usepackage[plain, import=witiko/markdown/test/latex]{markdown}
\markdownSetupSnippet{testSnippet}{
snippet = witiko/markdown/test/latex/snippet,
}

% Load the support files.
\markdownSetup {
eagerCache = false,
outputDir = OUTPUT_DIRECTORY,
import = {
witiko/markdown/test = snippet as testSnippet,
}
}

\begin{document}
8 changes: 4 additions & 4 deletions tests/templates/latex/verbatim/head.tex.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
\csname UseRawInputEncoding\endcsname

% Load the package.
\usepackage[plain]{markdown}
\usepackage[plain, theme=witiko/markdown/test/latex]{markdown}
\markdownSetupSnippet{testSnippet}{
snippet = witiko/markdown/test/latex/snippet,
}

% Load the support files.
\markdownSetup {
eagerCache = false,
outputDir = OUTPUT_DIRECTORY,
import = {
witiko/markdown/test = snippet as testSnippet,
}
}

\begin{document}

0 comments on commit c4ef2e4

Please sign in to comment.