Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly load LaTeX themes when theme or import is used in \usepackage[...]{markdown} #498

Merged
merged 6 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}