mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
LaTeX: refactor support macros for CSS-like sphinxsetup options
Use batch definitions to handle in a unified way options for code-blocks, topics and admonitions.
This commit is contained in:
parent
c105ea0ad4
commit
ad3235421f
@ -6,7 +6,7 @@
|
|||||||
%
|
%
|
||||||
|
|
||||||
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
||||||
\ProvidesPackage{sphinx}[2023/01/08 v6.2.0 LaTeX package (Sphinx markup)]
|
\ProvidesPackage{sphinx}[2023/03/06 v6.2.0 LaTeX package (Sphinx markup)]
|
||||||
|
|
||||||
% provides \ltx@ifundefined
|
% provides \ltx@ifundefined
|
||||||
% (many packages load ltxcmds: graphicx does for pdftex and lualatex but
|
% (many packages load ltxcmds: graphicx does for pdftex and lualatex but
|
||||||
@ -270,7 +270,7 @@ will be set to white}%
|
|||||||
\sphinxDeclareSphinxColorOption{errorBgColor}{{rgb}{1,1,1}}
|
\sphinxDeclareSphinxColorOption{errorBgColor}{{rgb}{1,1,1}}
|
||||||
%%%%%%%%
|
%%%%%%%%
|
||||||
%
|
%
|
||||||
% Additions at 5.1.0
|
% Additions of CSS-like keys (in particular for rounded boxes) at 5.1.0
|
||||||
%
|
%
|
||||||
% In future, an alternative user interface will perhaps be provided via
|
% In future, an alternative user interface will perhaps be provided via
|
||||||
% CSS-like input in a configuration variable latex_css, and Sphinx
|
% CSS-like input in a configuration variable latex_css, and Sphinx
|
||||||
@ -282,229 +282,211 @@ will be set to white}%
|
|||||||
%
|
%
|
||||||
\def\spxstring@none{none}
|
\def\spxstring@none{none}
|
||||||
\def\spxstring@clone{clone}
|
\def\spxstring@clone{clone}
|
||||||
% Future: should below all the macros holding dimensions be defined via some
|
|
||||||
% \edef and \dimexpr rather?
|
%%%%%%%%
|
||||||
%
|
%
|
||||||
% Deliberately the code avoids creating (except by \let) new \dimen variables
|
% Refactoring at 6.2.0
|
||||||
% besides the legacy ones already defined.
|
|
||||||
%
|
%
|
||||||
% code-blocks
|
% - No more\dimen registers \sphinxverbatimborder, \sphinxverbatimsep,
|
||||||
% 6.2.0 removes \sphinxverbatimborder and \sphinxverbatimsep
|
% \sphinxshadowsep, \sphinxshadowsize, and \sphinxshadowrule.
|
||||||
\newdimen\spxdimen@pre@border
|
% - No \dimen registers for pre@border and topic@border
|
||||||
\spxdimen@pre@border=\fboxrule
|
% (formerly \spxdimen@pre@border and \spxdimen@topic@border)
|
||||||
\define@key{sphinx}{pre_border-top-width}{\def\spx@pre@border@top{#1}}
|
% the dimensions are stored in macros. Dimen registers are used only
|
||||||
\define@key{sphinx}{pre_border-right-width}{\def\spx@pre@border@right{#1}}
|
% by the sphinxpackageboxes.sty "setup" hooks.
|
||||||
\define@key{sphinx}{pre_border-bottom-width}{\def\spx@pre@border@bottom{#1}}
|
% - Some internals macros containing box@shadow now only contain @shadow
|
||||||
\define@key{sphinx}{pre_border-left-width}{\def\spx@pre@border@left{#1}}
|
% (the use of box@shadow was not done in a coherent way across all such
|
||||||
% currently accepts only one dimension specification
|
% support macros)
|
||||||
\define@key{sphinx}{pre_border-width}{%
|
%
|
||||||
\spxdimen@pre@border\dimexpr #1\relax
|
% 6.2.0 batch defines in one go all auxiliaries for code blocks, topics,
|
||||||
\def\spx@pre@border@top {\spxdimen@pre@border}%
|
% and warning-type admonitions. Some needed add-ons due to maintaining
|
||||||
\let\spx@pre@border@right \spx@pre@border@top
|
% legacy options and specific defaults are handled in a second step.
|
||||||
\let\spx@pre@border@bottom\spx@pre@border@top
|
%
|
||||||
\let\spx@pre@border@left \spx@pre@border@top
|
% This unification allows to propose a \sphinxbox construct with
|
||||||
|
% a key=value interface for inline boxes usable for customization
|
||||||
|
% of mark-up elements such as \sphinxguilabel. (done in sphinxpackageboxes.sty)
|
||||||
|
%
|
||||||
|
% A sphinxbox environment for display-style boxes may be added later.
|
||||||
|
%
|
||||||
|
% MEMO: this refactoring induces a change that the default \fboxrule used by
|
||||||
|
% verbatimborder and shadowrule is not expanded to its value immediately in
|
||||||
|
% preamble as no assignment to a \dimen register is done. In practice this
|
||||||
|
% will change nothing to existing projects.
|
||||||
|
%
|
||||||
|
% Border keys
|
||||||
|
%
|
||||||
|
% #1 #2 #3 #4 #5
|
||||||
|
% macro prefix special prefix option prefix legacy option init
|
||||||
|
% The "special prefix" is for matters of keeping same naming conventions
|
||||||
|
% for all types of notices, both warning type and note type, for sphinxnotice
|
||||||
|
\def\spx@tempa#1#2{%
|
||||||
|
\expandafter\spx@tempb
|
||||||
|
\csname #2border\expandafter\endcsname
|
||||||
|
\csname #1border@top\expandafter\endcsname
|
||||||
|
\csname #1border@right\expandafter\endcsname
|
||||||
|
\csname #1border@bottom\expandafter\endcsname
|
||||||
|
\csname #1border@left\expandafter\endcsname
|
||||||
|
\csname if#1border@open\expandafter\endcsname
|
||||||
|
\csname #1border@opentrue\expandafter\endcsname
|
||||||
|
\csname #1border@openfalse\endcsname
|
||||||
|
}%
|
||||||
|
\def\spx@tempb #1#2#3#4#5#6#7#8#9{% #9 = option prefix
|
||||||
|
\define@key{sphinx}{#9border-top-width}{\def#2{##1}}%
|
||||||
|
\define@key{sphinx}{#9border-right-width}{\def#3{##1}}%
|
||||||
|
\define@key{sphinx}{#9border-bottom-width}{\def#4{##1}}%
|
||||||
|
\define@key{sphinx}{#9border-left-width}{\def#5{##1}}%
|
||||||
|
\define@key{sphinx}{#9border-width}{%
|
||||||
|
\def#1{##1}% MEMO: not immediately expanded, should this be changed?
|
||||||
|
\def#2{#1}\let#3#2\let#4#2\let#5#2%
|
||||||
|
}%
|
||||||
|
\newif#6%
|
||||||
|
\define@key{sphinx}{#9box-decoration-break}%
|
||||||
|
{\begingroup\edef\spx@tempa{##1}\expandafter\endgroup
|
||||||
|
\ifx\spx@tempa\spxstring@clone#8\else#7\fi}%
|
||||||
|
\spx@tempc{#9}% option prefix
|
||||||
}
|
}
|
||||||
\def\spx@pre@border@top {\spxdimen@pre@border}%
|
\def\spx@tempc #1#2{% #1 = option prefix, #2 = legacy option name
|
||||||
\let\spx@pre@border@right \spx@pre@border@top
|
% keep backward legacy option as alias to new-named option
|
||||||
\let\spx@pre@border@bottom\spx@pre@border@top
|
\expandafter\let\csname KV@sphinx@#2\expandafter\endcsname
|
||||||
\let\spx@pre@border@left \spx@pre@border@top
|
\csname KV@sphinx@#1border-width\endcsname
|
||||||
% define legacy verbatimborder key as alias to pre_border-width
|
% init border-width (fetches next argument)
|
||||||
\expandafter\let\expandafter\KV@sphinx@verbatimborder
|
\csname KV@sphinx@#1border-width\endcsname
|
||||||
\csname KV@sphinx@pre_border-width\endcsname
|
|
||||||
\newif\ifspx@pre@border@open
|
|
||||||
\spx@pre@border@opentrue % 6.0.0 (i.e. "slice")
|
|
||||||
\define@key{sphinx}{pre_box-decoration-break}%
|
|
||||||
{\begingroup\edef\spx@tempa{#1}\expandafter\endgroup
|
|
||||||
\ifx\spx@tempa\spxstring@clone
|
|
||||||
\spx@pre@border@openfalse
|
|
||||||
\else\spx@pre@border@opentrue\fi}
|
|
||||||
%
|
|
||||||
% no \dimen but only macros used for the padding user interface
|
|
||||||
% (\dimen's are defined and used by sphinxpackageboxes.sty)
|
|
||||||
\define@key{sphinx}{pre_padding-top}{\def\spx@pre@padding@top{#1}}
|
|
||||||
\define@key{sphinx}{pre_padding-right}{\def\spx@pre@padding@right{#1}}
|
|
||||||
\define@key{sphinx}{pre_padding-bottom}{\def\spx@pre@padding@bottom{#1}}
|
|
||||||
\define@key{sphinx}{pre_padding-left}{\def\spx@pre@padding@left{#1}}
|
|
||||||
\define@key{sphinx}{pre_padding}{%
|
|
||||||
\def\spx@pre@padding@top {#1}% (use here some \dimexpr wrapper?)
|
|
||||||
\let\spx@pre@padding@right \spx@pre@padding@top
|
|
||||||
\let\spx@pre@padding@bottom\spx@pre@padding@top
|
|
||||||
\let\spx@pre@padding@left \spx@pre@padding@top
|
|
||||||
}
|
}
|
||||||
\edef\spx@pre@padding@top {\number\fboxsep sp}
|
% macro prefix special prefix option prefix legacy option init
|
||||||
\let\spx@pre@padding@right \spx@pre@padding@top
|
\spx@tempa{spx@pre@} {spx@pre@} {pre_} {verbatimborder} \fboxrule
|
||||||
\let\spx@pre@padding@bottom\spx@pre@padding@top
|
\spx@tempa{spx@topic@} {spx@topic@} {div.topic_} {shadowrule} \fboxrule
|
||||||
\let\spx@pre@padding@left \spx@pre@padding@top
|
\spx@tempa{spx@warning@} {spx@opt@warning} {div.warning_} {warningborder} {1pt}
|
||||||
|
\spx@tempa{spx@caution@} {spx@opt@caution} {div.caution_} {cautionborder} {1pt}
|
||||||
|
\spx@tempa{spx@attention@}{spx@opt@attention}{div.attention_}{attentionborder}{1pt}
|
||||||
|
\spx@tempa{spx@danger@} {spx@opt@danger} {div.danger_} {dangerborder} {1pt}
|
||||||
|
\spx@tempa{spx@error@} {spx@opt@error} {div.error_} {errorborder} {1pt}
|
||||||
|
% Set default box-decoration-break style for codeblocks to slice
|
||||||
|
\spx@pre@border@opentrue % new default at 6.0.0: slice, not clone
|
||||||
|
|
||||||
|
% Padding keys
|
||||||
|
%
|
||||||
|
\def\spx@tempa#1{%
|
||||||
|
\expandafter\spx@tempb
|
||||||
|
\csname #1padding\expandafter\endcsname
|
||||||
|
\csname #1padding@top\expandafter\endcsname
|
||||||
|
\csname #1padding@right\expandafter\endcsname
|
||||||
|
\csname #1padding@bottom\expandafter\endcsname
|
||||||
|
\csname #1padding@left\endcsname
|
||||||
|
}%
|
||||||
|
\def\spx@tempb #1#2#3#4#5#6{% #6 = option prefix
|
||||||
|
\define@key{sphinx}{#6padding-top}{\def#2{##1}}%
|
||||||
|
\define@key{sphinx}{#6padding-right}{\def#3{##1}}%
|
||||||
|
\define@key{sphinx}{#6padding-bottom}{\def#4{##1}}%
|
||||||
|
\define@key{sphinx}{#6padding-left}{\def#5{##1}}%
|
||||||
|
\define@key{sphinx}{#6padding}{%
|
||||||
|
\def#1{##1}%
|
||||||
|
\def#2{#1}\let#3#2\let#4#2\let#5#2%
|
||||||
|
}%
|
||||||
|
% initialization (will fetch "init" argument next):
|
||||||
|
\csname KV@sphinx@#6padding\endcsname
|
||||||
|
}
|
||||||
|
% MEMO: prior to 6.2.0 the \fboxsep value (0.4pt, a priori) was
|
||||||
|
% frozen here via a \dimen assignement. Now it remains \fboxsep
|
||||||
|
% until being used.
|
||||||
|
% #1 macro prefix #6 option prefix init value
|
||||||
|
\spx@tempa{spx@pre@} {pre_} \fboxsep
|
||||||
|
\spx@tempa{spx@topic@} {div.topic_} {5pt}
|
||||||
|
% MEMO: prior to 5.1.0 padding was not separately customizable
|
||||||
|
% from border width for warning type admonitions. The below
|
||||||
|
% keeps the legacy behavior of a constant borderwidth+padding.
|
||||||
|
% The dim expression is not evaluated yet, only at time of use.
|
||||||
|
\spx@tempa{spx@warning@} {div.warning_} {\dimexpr.6\baselineskip-\spx@opt@warningborder\relax}
|
||||||
|
\spx@tempa{spx@caution@} {div.caution_} {\dimexpr.6\baselineskip-\spx@opt@cautionborder\relax}
|
||||||
|
\spx@tempa{spx@attention@}{div.attention_} {\dimexpr.6\baselineskip-\spx@opt@attentionborder\relax}
|
||||||
|
\spx@tempa{spx@danger@} {div.danger_} {\dimexpr.6\baselineskip-\spx@opt@dangerborder\relax}
|
||||||
|
\spx@tempa{spx@error@} {div.error_} {\dimexpr.6\baselineskip-\spx@opt@errorborder\relax}
|
||||||
% define legacy verbatimsep key as alias of pre_padding key
|
% define legacy verbatimsep key as alias of pre_padding key
|
||||||
\expandafter\let\expandafter\KV@sphinx@verbatimsep
|
\expandafter\let\expandafter\KV@sphinx@verbatimsep\csname KV@sphinx@pre_padding\endcsname
|
||||||
\csname KV@sphinx@pre_padding\endcsname
|
% define legacy shadowsep key as alias of div.topic_padding key
|
||||||
|
\expandafter\let\expandafter\KV@sphinx@shadowsep\csname KV@sphinx@div.topic_padding\endcsname
|
||||||
|
% also define a boxsep key as alias of box_padding key, because we defined boxborder
|
||||||
|
% boxborder was defined only as collateral of batch definitions so some hesitation
|
||||||
|
% we do keep these boxborder and boxsep as they configure the probably two most
|
||||||
|
% important parameters; still I feel not definitive about what is best to do
|
||||||
|
\expandafter\let\expandafter\KV@sphinx@boxsep\csname KV@sphinx@box_padding\endcsname
|
||||||
|
|
||||||
|
% Corner radii keys
|
||||||
%
|
%
|
||||||
% no \dimen but only macros used for the radii user interface
|
\def\spx@tempa#1{% #1 = macro prefix
|
||||||
% (\dimen's are defined and used by sphinxpackageboxes.sty)
|
\expandafter\spx@tempb
|
||||||
\define@key{sphinx}{pre_border-top-left-radius}{\def\spx@pre@radius@topleft{#1}}
|
\csname #1radius@topleft\expandafter\endcsname
|
||||||
\define@key{sphinx}{pre_border-top-right-radius}{\edef\spx@pre@radius@topright{#1}}
|
\csname #1radius@topright\expandafter\endcsname
|
||||||
\define@key{sphinx}{pre_border-bottom-right-radius}{\def\spx@pre@radius@bottomright{#1}}
|
\csname #1radius@bottomright\expandafter\endcsname
|
||||||
\define@key{sphinx}{pre_border-bottom-left-radius}{\def\spx@pre@radius@bottomleft{#1}}
|
\csname #1radius@bottomleft\endcsname
|
||||||
\define@key{sphinx}{pre_border-radius}{%
|
}%
|
||||||
\def\spx@pre@radius@topleft {#1}%
|
\def\spx@tempb #1#2#3#4#5{% #5 = option prefix
|
||||||
\let\spx@pre@radius@topright \spx@pre@radius@topleft
|
\define@key{sphinx}{#5border-top-left-radius}{\def#1{##1}}%
|
||||||
\let\spx@pre@radius@bottomright\spx@pre@radius@topleft
|
\define@key{sphinx}{#5border-top-right-radius}{\def#2{##1}}%
|
||||||
\let\spx@pre@radius@bottomleft \spx@pre@radius@topleft
|
\define@key{sphinx}{#5border-bottom-right-radius}{\def#3{##1}}%
|
||||||
|
\define@key{sphinx}{#5border-bottom-left-radius}{\def#4{##1}}%
|
||||||
|
\define@key{sphinx}{#5border-radius}{\def#1{##1}\let#2#1\let#3#1\let#4#1}%
|
||||||
|
\csname KV@sphinx@#5border-radius\endcsname % fetches next argument
|
||||||
}
|
}
|
||||||
% MEMO: keep in mind in using these macros in code elsewhere that they can
|
% macro prefix option prefix init value
|
||||||
% expand to dimen registers or dimension specs like here "3pt"
|
\spx@tempa{spx@pre@} {pre_} {3pt}% new default at 6.0.0
|
||||||
\def\spx@pre@radius@topleft {3pt}%
|
\spx@tempa{spx@topic@} {div.topic_} \z@
|
||||||
\let\spx@pre@radius@topright \spx@pre@radius@topleft
|
\spx@tempa{spx@warning@} {div.warning_} \z@
|
||||||
\let\spx@pre@radius@bottomright\spx@pre@radius@topleft
|
\spx@tempa{spx@caution@} {div.caution_} \z@
|
||||||
\let\spx@pre@radius@bottomleft \spx@pre@radius@topleft
|
\spx@tempa{spx@attention@}{div.attention_} \z@
|
||||||
\AtBeginDocument{\if1\ifdim\spx@pre@radius@topleft>\z@0\fi
|
\spx@tempa{spx@danger@} {div.danger_} \z@
|
||||||
\ifdim\spx@pre@radius@topright>\z@0\fi
|
\spx@tempa{spx@error@} {div.error_} \z@
|
||||||
\ifdim\spx@pre@radius@bottomright>\z@0\fi
|
|
||||||
\ifdim\spx@pre@radius@bottomleft>\z@0\fi
|
% Shadow and color keys
|
||||||
1\else\spx@RequirePackage@PictIIe\fi}
|
|
||||||
%
|
%
|
||||||
\newif\ifspx@pre@withshadow
|
\def\spx@tempa#1{%
|
||||||
\newif\ifspx@pre@insetshadow
|
\expandafter\spx@tempb
|
||||||
% Attention only "none" or "<xoffset> <yoffset> [optional inset]", no color
|
\csname if#1withshadow\expandafter\endcsname
|
||||||
\define@key{sphinx}{pre_box-shadow}{\spx@pre@box@shadow@setter #1 {} {} \@nnil}%
|
\csname if#1insetshadow\expandafter\endcsname
|
||||||
% TODO add parsing to fetch color... but this requires a TeX layer to convert
|
\csname if#1withshadowcolor\expandafter\endcsname
|
||||||
% color spec in CSS format to color/xcolor format
|
\csname if#1withbordercolor\expandafter\endcsname
|
||||||
\def\spx@pre@box@shadow@setter #1 #2 #3 #4\@nnil{%
|
\csname if#1withbackgroundcolor\endcsname
|
||||||
\begingroup\edef\spx@tempa{#1}\expandafter\endgroup
|
}%
|
||||||
|
\def\spx@tempb#1#2#3#4#5{\newif#1\newif#2\newif#3\newif#4\newif#5}%
|
||||||
|
% macro prefix
|
||||||
|
\spx@tempa{spx@pre@}
|
||||||
|
\spx@tempa{spx@topic@}
|
||||||
|
\spx@tempa{spx@warning@}
|
||||||
|
\spx@tempa{spx@caution@}
|
||||||
|
\spx@tempa{spx@attention@}
|
||||||
|
\spx@tempa{spx@danger@}
|
||||||
|
\spx@tempa{spx@error@}
|
||||||
|
%
|
||||||
|
\def\spx@tempa#1{% #1 = macro prefix
|
||||||
|
\expandafter\spx@tempb
|
||||||
|
\csname #1withshadowtrue\expandafter\endcsname
|
||||||
|
\csname #1withshadowfalse\expandafter\endcsname
|
||||||
|
\csname #1insetshadowtrue\expandafter\endcsname
|
||||||
|
\csname #1insetshadowfalse\expandafter\endcsname
|
||||||
|
\csname #1shadow@setter\expandafter\endcsname
|
||||||
|
\csname #1shadow@xoffset\expandafter\endcsname
|
||||||
|
\csname #1shadow@yoffset\endcsname
|
||||||
|
}%
|
||||||
|
\def\spx@tempb#1#2#3#4#5#6#7#8{% #8 = option prefix
|
||||||
|
\define@key{sphinx}{#8box-shadow}{#5##1 {} {} \@nnil}%
|
||||||
|
\def#5##1 ##2 ##3 ##4\@nnil{%
|
||||||
|
\begingroup\edef\spx@tempa{##1}\expandafter\endgroup
|
||||||
\ifx\spx@tempa\spxstring@none
|
\ifx\spx@tempa\spxstring@none
|
||||||
\spx@pre@withshadowfalse
|
#2%
|
||||||
\else
|
\else #1\edef#6{\number\dimexpr##1\relax sp}%
|
||||||
\spx@pre@withshadowtrue
|
\edef#7{\number\dimexpr##2+\z@\relax sp}%
|
||||||
\edef\spx@pre@shadow@xoffset{\number\dimexpr#1\relax sp}%
|
\if\relax\detokenize{##3}\relax#4\else#3\fi
|
||||||
\edef\spx@pre@shadow@yoffset{\number\dimexpr#2+\z@\relax sp}%
|
|
||||||
\if\relax\detokenize{#3}\relax
|
|
||||||
\spx@pre@insetshadowfalse
|
|
||||||
\else
|
|
||||||
\spx@pre@insetshadowtrue
|
|
||||||
\fi
|
|
||||||
\fi
|
\fi
|
||||||
}%
|
}%
|
||||||
\spx@pre@box@shadow@setter none {} {} \@nnil
|
#5none {} {} \@nnil % no shadow by default
|
||||||
%
|
|
||||||
\newif\ifspx@pre@withbordercolor
|
|
||||||
\spx@pre@withbordercolortrue % 6.0.0
|
|
||||||
\define@key{sphinx}{pre_border-TeXcolor}{%
|
|
||||||
\spx@pre@withbordercolortrue
|
|
||||||
\spx@defineorletcolor{VerbatimBorderColor}#1\relax
|
|
||||||
}
|
}
|
||||||
\expandafter\let\expandafter\KV@sphinx@VerbatimBorderColor
|
\spx@tempa{spx@pre@} {pre_}
|
||||||
\csname KV@sphinx@pre_border-TeXcolor\endcsname
|
\spx@tempa{spx@topic@} {div.topic_}
|
||||||
\newif\ifspx@pre@withbackgroundcolor
|
\spx@topic@shadow@setter 4pt 4pt {} \@nnil % legacy ShadowBox
|
||||||
\spx@pre@withbackgroundcolortrue % 6.0.0
|
\spx@tempa{spx@warning@} {div.warning_}
|
||||||
\define@key{sphinx}{pre_background-TeXcolor}{%
|
\spx@tempa{spx@caution@} {div.caution_}
|
||||||
\spx@pre@withbackgroundcolortrue
|
\spx@tempa{spx@attention@}{div.attention_}
|
||||||
\spx@defineorletcolor{VerbatimColor}#1\relax
|
\spx@tempa{spx@danger@} {div.danger_}
|
||||||
}
|
\spx@tempa{spx@error@} {div.error_}
|
||||||
\expandafter\let\expandafter\KV@sphinx@VerbatimColor
|
|
||||||
\csname KV@sphinx@pre_background-TeXcolor\endcsname
|
|
||||||
\newif\ifspx@pre@withshadowcolor
|
|
||||||
\define@key{sphinx}{pre_box-shadow-TeXcolor}{%
|
|
||||||
\spx@pre@withshadowcolortrue
|
|
||||||
\spx@defineorletcolor{sphinxVerbatimShadowColor}#1\relax
|
|
||||||
}
|
|
||||||
\definecolor{sphinxVerbatimShadowColor}{rgb}{0,0,0}
|
|
||||||
% topics
|
|
||||||
% 6.2.0 removes \sphinxshadowrule, \sphinxshadowsep and \sphinxshadowsize
|
|
||||||
\newdimen\spxdimen@topic@border
|
|
||||||
\spxdimen@topic@border=\fboxrule % catches current value (probably 0.4pt)
|
|
||||||
\define@key{sphinx}{div.topic_border-top-width}{\def\spx@topic@border@top{#1}}
|
|
||||||
\define@key{sphinx}{div.topic_border-right-width}{\def\spx@topic@border@right{#1}}
|
|
||||||
\define@key{sphinx}{div.topic_border-bottom-width}{\def\spx@topic@border@bottom{#1}}
|
|
||||||
\define@key{sphinx}{div.topic_border-left-width}{\def\spx@topic@border@left{#1}}
|
|
||||||
% attention currently accepts only one dimension specification
|
|
||||||
\define@key{sphinx}{div.topic_border-width}{%
|
|
||||||
\spxdimen@topic@border\dimexpr #1\relax
|
|
||||||
\def\spx@topic@border@top {\spxdimen@topic@border}%
|
|
||||||
\let\spx@topic@border@right \spx@topic@border@top
|
|
||||||
\let\spx@topic@border@bottom\spx@topic@border@top
|
|
||||||
\let\spx@topic@border@left \spx@topic@border@top
|
|
||||||
}
|
|
||||||
\let\spx@topic@border@top \spxdimen@topic@border
|
|
||||||
\let\spx@topic@border@right \spx@topic@border@top
|
|
||||||
\let\spx@topic@border@bottom\spx@topic@border@top
|
|
||||||
\let\spx@topic@border@left \spx@topic@border@top
|
|
||||||
% define legacy shadowrule key to act like div.topic_border-width
|
|
||||||
% (sadly 5.1.0 had forgotten the "div." here, fixed at 6.1.2)
|
|
||||||
\expandafter\let\expandafter\KV@sphinx@shadowrule
|
|
||||||
\csname KV@sphinx@div.topic_border-width\endcsname
|
|
||||||
\newif\ifspx@topic@border@open % defaults to false (legacy)
|
|
||||||
\define@key{sphinx}{div.topic_box-decoration-break}%
|
|
||||||
{\begingroup\edef\spx@tempa{#1}\expandafter\endgroup
|
|
||||||
\ifx\spx@tempa\spxstring@clone
|
|
||||||
\spx@topic@border@openfalse
|
|
||||||
\else\spx@topic@border@opentrue\fi}%
|
|
||||||
%
|
|
||||||
% no \dimen but only macros used for the padding user interface
|
|
||||||
% (\dimen's are defined and used by sphinxpackageboxes.sty)
|
|
||||||
% Sadly the 5.1.0 definitions forgot the "div." part of the key names
|
|
||||||
% Fixed at 6.1.2
|
|
||||||
\define@key{sphinx}{div.topic_padding-top}{\def\spx@topic@padding@top{#1}}
|
|
||||||
\define@key{sphinx}{div.topic_padding-right}{\def\spx@topic@padding@right{#1}}
|
|
||||||
\define@key{sphinx}{div.topic_padding-bottom}{\def\spx@topic@padding@bottom{#1}}
|
|
||||||
\define@key{sphinx}{div.topic_padding-left}{\def\spx@topic@padding@left{#1}}
|
|
||||||
\define@key{sphinx}{div.topic_padding}{%
|
|
||||||
\def\spx@topic@padding@top {#1}%
|
|
||||||
\let\spx@topic@padding@right \spx@topic@padding@top
|
|
||||||
\let\spx@topic@padding@bottom\spx@topic@padding@top
|
|
||||||
\let\spx@topic@padding@left \spx@topic@padding@top
|
|
||||||
}
|
|
||||||
\def\spx@topic@padding@top {5pt}
|
|
||||||
\let\spx@topic@padding@right \spx@topic@padding@top
|
|
||||||
\let\spx@topic@padding@bottom\spx@topic@padding@top
|
|
||||||
\let\spx@topic@padding@left \spx@topic@padding@top
|
|
||||||
% define legacy shadowsep key to act like div.topic_padding
|
|
||||||
\expandafter\let\expandafter\KV@sphinx@shadowsep
|
|
||||||
\csname KV@sphinx@div.topic_padding\endcsname
|
|
||||||
%
|
|
||||||
% no \dimen but only macros used for the radii user interface
|
|
||||||
% (\dimen's are defined and used by sphinxpackageboxes.sty)
|
|
||||||
\define@key{sphinx}{div.topic_border-top-left-radius}{\def\spx@topic@radius@topleft{#1}}
|
|
||||||
\define@key{sphinx}{div.topic_border-top-right-radius}{\def\spx@topic@radius@topright{#1}}
|
|
||||||
\define@key{sphinx}{div.topic_border-bottom-right-radius}{\def\spx@topic@radius@bottomright{#1}}
|
|
||||||
\define@key{sphinx}{div.topic_border-bottom-left-radius}{\def\spx@topic@radius@bottomleft{#1}}
|
|
||||||
\define@key{sphinx}{div.topic_border-radius}{%
|
|
||||||
\def\spx@topic@radius@topleft {#1}%
|
|
||||||
\let\spx@topic@radius@topright \spx@topic@radius@topleft
|
|
||||||
\let\spx@topic@radius@bottomright\spx@topic@radius@topleft
|
|
||||||
\let\spx@topic@radius@bottomleft \spx@topic@radius@topleft
|
|
||||||
}
|
|
||||||
\let\spx@topic@radius@topleft \z@
|
|
||||||
\let\spx@topic@radius@topright \z@
|
|
||||||
\let\spx@topic@radius@bottomright\z@
|
|
||||||
\let\spx@topic@radius@bottomleft \z@
|
|
||||||
\AtBeginDocument{\if1\ifdim\spx@topic@radius@topleft>\z@0\fi
|
|
||||||
\ifdim\spx@topic@radius@topright>\z@0\fi
|
|
||||||
\ifdim\spx@topic@radius@bottomright>\z@0\fi
|
|
||||||
\ifdim\spx@topic@radius@bottomleft>\z@0\fi
|
|
||||||
1\else\spx@RequirePackage@PictIIe\fi}
|
|
||||||
%
|
|
||||||
% no \dimen but only macros used for the shadow user interface
|
|
||||||
% (\dimen's are defined and used by sphinxpackageboxes.sty)
|
|
||||||
\newif\ifspx@topic@withshadow
|
|
||||||
\newif\ifspx@topic@insetshadow
|
|
||||||
% Attention only "none" or "<xoffset> <yoffset> [optional inset]", no color
|
|
||||||
\define@key{sphinx}{div.topic_box-shadow}{\spx@topic@box@shadow@setter #1 {} {} \@nnil}%
|
|
||||||
\def\spx@topic@box@shadow@setter #1 #2 #3 #4\@nnil{%
|
|
||||||
\begingroup\edef\spx@tempa{#1}\expandafter\endgroup
|
|
||||||
\ifx\spx@tempa\spxstring@none
|
|
||||||
\spx@topic@withshadowfalse
|
|
||||||
\else
|
|
||||||
\spx@topic@withshadowtrue
|
|
||||||
\edef\spx@topic@shadow@xoffset{\number\dimexpr#1\relax sp}%
|
|
||||||
\edef\spx@topic@shadow@yoffset{\number\dimexpr#2+\z@\relax sp}%
|
|
||||||
\if\relax\detokenize{#3}\relax
|
|
||||||
\spx@topic@insetshadowfalse
|
|
||||||
\else
|
|
||||||
\spx@topic@insetshadowtrue
|
|
||||||
\fi
|
|
||||||
\fi
|
|
||||||
}%
|
|
||||||
\spx@topic@box@shadow@setter 4pt 4pt {} \@nnil
|
|
||||||
% Support for legacy shadowsize
|
% Support for legacy shadowsize
|
||||||
% This definition was broken at 5.1.0 and fixed at 6.1.2
|
% This definition was broken at 5.1.0 and fixed at 6.1.2
|
||||||
\define@key{sphinx}{shadowsize}{%
|
\define@key{sphinx}{shadowsize}{%
|
||||||
@ -517,189 +499,54 @@ will be set to white}%
|
|||||||
\spx@topic@insetshadowfalse
|
\spx@topic@insetshadowfalse
|
||||||
\fi
|
\fi
|
||||||
}%
|
}%
|
||||||
\definecolor{sphinxTopicBorderColor}{rgb}{0,0,0}
|
|
||||||
\definecolor{sphinxTopicBackgroundColor}{rgb}{1,1,1}
|
|
||||||
\definecolor{sphinxTopicShadowColor}{rgb}{0,0,0}
|
|
||||||
\newif\ifspx@topic@withbordercolor
|
|
||||||
\define@key{sphinx}{div.topic_border-TeXcolor}{%
|
|
||||||
\spx@topic@withbordercolortrue
|
|
||||||
\spx@defineorletcolor{sphinxTopicBorderColor}#1\relax
|
|
||||||
}
|
|
||||||
\newif\ifspx@topic@withbackgroundcolor
|
|
||||||
\define@key{sphinx}{div.topic_background-TeXcolor}{%
|
|
||||||
\spx@topic@withbackgroundcolortrue
|
|
||||||
\spx@defineorletcolor{sphinxTopicBackgroundColor}#1\relax
|
|
||||||
}
|
|
||||||
\newif\ifspx@topic@withshadowcolor
|
|
||||||
\define@key{sphinx}{div.topic_box-shadow-TeXcolor}{%
|
|
||||||
\spx@topic@withshadowcolortrue
|
|
||||||
\spx@defineorletcolor{sphinxTopicShadowColor}#1\relax
|
|
||||||
}
|
|
||||||
% warning, caution, attention, danger, error
|
|
||||||
\def\spx@tempa#1{%
|
|
||||||
\expandafter\spx@tempb
|
|
||||||
% MEMO: the diverging naming of first one is conditioned at this time by the fact
|
|
||||||
% that sphinxnotice environment must work both for these admonitions and the
|
|
||||||
% note, tip etc... ones
|
|
||||||
\csname spx@opt@#1border\expandafter\endcsname
|
|
||||||
\csname spx@#1@border@top\expandafter\endcsname
|
|
||||||
\csname spx@#1@border@right\expandafter\endcsname
|
|
||||||
\csname spx@#1@border@bottom\expandafter\endcsname
|
|
||||||
\csname spx@#1@border@left\expandafter\endcsname
|
|
||||||
\csname ifspx@#1@border@open\expandafter\endcsname
|
|
||||||
\csname spx@#1@border@opentrue\expandafter\endcsname
|
|
||||||
\csname spx@#1@border@openfalse\endcsname
|
|
||||||
{#1}%
|
|
||||||
}%
|
|
||||||
\def\spx@tempb #1#2#3#4#5#6#7#8#9{%
|
|
||||||
\define@key{sphinx}{div.#9_border-top-width}{\def#2{##1}}%
|
|
||||||
\define@key{sphinx}{div.#9_border-right-width}{\def#3{##1}}%
|
|
||||||
\define@key{sphinx}{div.#9_border-bottom-width}{\def#4{##1}}%
|
|
||||||
\define@key{sphinx}{div.#9_border-left-width}{\def#5{##1}}%
|
|
||||||
\define@key{sphinx}{div.#9_border-width}{\def#1{##1}\def#2{#1}\let#3#2\let#4#2\let#5#2}%
|
|
||||||
\def#1{1pt}\let#2#1\let#3#2\let#4#2\let#5#2%
|
|
||||||
\newif#6%
|
|
||||||
\define@key{sphinx}{div.#9_box-decoration-break}%
|
|
||||||
{\begingroup\edef\spx@tempa{##1}\expandafter\endgroup
|
|
||||||
\ifx\spx@tempa\spxstring@clone#8\else#7\fi}%
|
|
||||||
\expandafter\let\csname KV@sphinx@#9border\expandafter\endcsname
|
|
||||||
\csname KV@sphinx@div.#9_border-width\endcsname
|
|
||||||
}
|
|
||||||
\spx@tempa{warning}
|
|
||||||
\spx@tempa{caution}
|
|
||||||
\spx@tempa{attention}
|
|
||||||
\spx@tempa{danger}
|
|
||||||
\spx@tempa{error}
|
|
||||||
|
|
||||||
\def\spx@tempa#1{%
|
\def\spx@tempa#1{% #1 = macro prefix
|
||||||
\expandafter\spx@tempb
|
\expandafter\spx@tempb
|
||||||
\csname spx@#1@padding\expandafter\endcsname
|
\csname #1withbordercolortrue\expandafter\endcsname
|
||||||
\csname spx@#1@padding@top\expandafter\endcsname
|
\csname #1withbackgroundcolortrue\expandafter\endcsname
|
||||||
\csname spx@#1@padding@right\expandafter\endcsname
|
\csname #1withshadowcolortrue\endcsname
|
||||||
\csname spx@#1@padding@bottom\expandafter\endcsname
|
|
||||||
\csname spx@#1@padding@left\expandafter\endcsname
|
|
||||||
% MEMO: this is to keep same behaviour as prior to 5.1.0 for which
|
|
||||||
% no key to set padding adjusted and border+padding was kept constant
|
|
||||||
\csname spx@opt@#1border\endcsname
|
|
||||||
{#1}%
|
|
||||||
}%
|
|
||||||
\def\spx@tempb #1#2#3#4#5#6#7{%
|
|
||||||
\define@key{sphinx}{div.#7_padding-top}{\def#2{##1}}%
|
|
||||||
\define@key{sphinx}{div.#7_padding-right}{\def#3{##1}}%
|
|
||||||
\define@key{sphinx}{div.#7_padding-bottom}{\def#4{##1}}%
|
|
||||||
\define@key{sphinx}{div.#7_padding-left}{\def#5{##1}}%
|
|
||||||
\define@key{sphinx}{div.#7_padding}{\def#1{##1}\def#2{#1}\let#3#2\let#4#2\let#5#2}%
|
|
||||||
% MEMO: prior to 5.1.0 padding was not separately customizable
|
|
||||||
% This keeps exactly the strange behaviour as prior to 5.1.0
|
|
||||||
% which used to be hard-coded in the sphinxheavybox environment
|
|
||||||
\def#1{\dimexpr.6\baselineskip-#6\relax}%
|
|
||||||
\let#2#1\let#3#2\let#4#2\let#5#2%
|
|
||||||
}
|
}
|
||||||
\spx@tempa{warning}
|
\def\spx@tempb#1#2#3#4#5{% #4 = option prefix, #5 = color name prefix
|
||||||
\spx@tempa{caution}
|
\define@key{sphinx}{#4border-TeXcolor}%
|
||||||
\spx@tempa{attention}
|
{#1\spx@defineorletcolor{#5BorderColor}##1\relax}%
|
||||||
\spx@tempa{danger}
|
\define@key{sphinx}{#4background-TeXcolor}%
|
||||||
\spx@tempa{error}
|
{#2\spx@defineorletcolor{#5BgColor}##1\relax}%
|
||||||
|
\define@key{sphinx}{#4box-shadow-TeXcolor}%
|
||||||
\def\spx@tempa#1{%
|
{#3\spx@defineorletcolor{#5ShadowColor}##1\relax}%
|
||||||
\expandafter\spx@tempb
|
|
||||||
\csname spx@#1@radius@topleft\expandafter\endcsname
|
|
||||||
\csname spx@#1@radius@topright\expandafter\endcsname
|
|
||||||
\csname spx@#1@radius@bottomright\expandafter\endcsname
|
|
||||||
\csname spx@#1@radius@bottomleft\endcsname
|
|
||||||
{#1}%
|
|
||||||
}%
|
|
||||||
\def\spx@tempb #1#2#3#4#5{%
|
|
||||||
\define@key{sphinx}{div.#5_border-top-left-radius}{\def#1{##1}}%
|
|
||||||
\define@key{sphinx}{div.#5_border-top-right-radius}{\def#2{##1}}%
|
|
||||||
\define@key{sphinx}{div.#5_border-bottom-right-radius}{\def#3{##1}}%
|
|
||||||
\define@key{sphinx}{div.#5_border-bottom-left-radius}{\def#4{##1}}%
|
|
||||||
\define@key{sphinx}{div.#5_border-radius}{\def#1{##1}\let#2#1\let#3#1\let#4#1}%
|
|
||||||
\let#1\z@\let#2#1\let#3#2\let#4#2%
|
|
||||||
\AtBeginDocument{\if1\ifdim#1>\z@0\fi
|
|
||||||
\ifdim#2>\z@0\fi
|
|
||||||
\ifdim#3>\z@0\fi
|
|
||||||
\ifdim#4>\z@0\fi
|
|
||||||
1\else\spx@RequirePackage@PictIIe\fi}%
|
|
||||||
}
|
}
|
||||||
\spx@tempa{warning}
|
% macro prefix option prefix color name prefix
|
||||||
\spx@tempa{caution}
|
\spx@tempa{spx@pre@} {pre_} {Verbatim}
|
||||||
\spx@tempa{attention}
|
% internal legacy color name is VerbatimColor not VerbatimBgColor:
|
||||||
\spx@tempa{danger}
|
\define@key{sphinx}{pre_background-TeXcolor}%
|
||||||
\spx@tempa{error}
|
{\spx@pre@withbackgroundcolortrue\spx@defineorletcolor{VerbatimColor}#1\relax}%
|
||||||
|
\spx@pre@withbordercolortrue % 6.0.0 VerbatimBorderColor {{RGB}{32,32,32}}
|
||||||
\def\spx@tempa#1{%
|
\spx@pre@withbackgroundcolortrue % 6.0.0 VerbatimColor {{gray}{0.95}}
|
||||||
\expandafter\spx@tempb
|
% Keep legacy sphinxsetup interface
|
||||||
\csname ifspx@#1@withshadow\expandafter\endcsname
|
\expandafter\let\expandafter\KV@sphinx@VerbatimBorderColor
|
||||||
\csname ifspx@#1@insetshadow\expandafter\endcsname
|
\csname KV@sphinx@pre_border-TeXcolor\endcsname
|
||||||
\csname ifspx@#1@withshadowcolor\expandafter\endcsname
|
\expandafter\let\expandafter\KV@sphinx@VerbatimColor
|
||||||
\csname ifspx@#1@withbordercolor\expandafter\endcsname
|
\csname KV@sphinx@pre_background-TeXcolor\endcsname
|
||||||
\csname ifspx@#1@withbackgroundcolor\endcsname
|
% macro prefix option prefix color name prefix
|
||||||
}%
|
% MEMO: prior to 6.2.0, internal color names started with sphinxtopic, not
|
||||||
\def\spx@tempb#1#2#3#4#5{\newif#1\newif#2\newif#3\newif#4\newif#5}%
|
% sphinxTopic, and it was sphinxTopicBackgroundColor, not sphinxtopicBgColor.
|
||||||
\spx@tempa{warning}
|
\spx@tempa{spx@topic@} {div.topic_} {sphinxtopic}% (no legacy interface)
|
||||||
\spx@tempa{caution}
|
\spx@tempa{spx@warning@} {div.warning_} {sphinxwarning}
|
||||||
\spx@tempa{attention}
|
\spx@tempa{spx@caution@} {div.caution_} {sphinxcaution}
|
||||||
\spx@tempa{danger}
|
\spx@tempa{spx@attention@}{div.attention_} {sphinxattention}
|
||||||
\spx@tempa{error}
|
\spx@tempa{spx@danger@} {div.danger_} {sphinxdanger}
|
||||||
|
\spx@tempa{spx@error@} {div.error_} {sphinxerror}
|
||||||
\def\spx@tempa#1{%
|
% Keep legacy sphinxsetup interface for warning type notices
|
||||||
\expandafter\spx@tempb
|
\def\spx@tempa#1#2{% #1 = option prefix, #2 = legacy option prefix
|
||||||
\csname spx@#1@withshadowtrue\expandafter\endcsname
|
\expandafter\let\csname KV@sphinx@#2BorderColor\expandafter\endcsname
|
||||||
\csname spx@#1@withshadowfalse\expandafter\endcsname
|
\csname KV@sphinx@#1border-TeXcolor\endcsname
|
||||||
\csname spx@#1@insetshadowtrue\expandafter\endcsname
|
\expandafter\let\csname KV@sphinx@#2BgColor\expandafter\endcsname
|
||||||
\csname spx@#1@insetshadowfalse\expandafter\endcsname
|
\csname KV@sphinx@#1background-TeXcolor\endcsname
|
||||||
\csname spx@#1@box@shadow@setter\expandafter\endcsname
|
|
||||||
\csname spx@#1@box@shadow@xoffset\expandafter\endcsname
|
|
||||||
\csname spx@#1@box@shadow@yoffset\endcsname
|
|
||||||
{#1}%
|
|
||||||
}%
|
|
||||||
\def\spx@tempb#1#2#3#4#5#6#7#8{%
|
|
||||||
\define@key{sphinx}{div.#8_box-shadow}{#5##1 {} {} \@nnil}%
|
|
||||||
\def#5##1 ##2 ##3 ##4\@nnil{%
|
|
||||||
\begingroup\edef\spx@tempa{##1}\expandafter\endgroup
|
|
||||||
\ifx\spx@tempa\spxstring@none
|
|
||||||
#2%
|
|
||||||
\else #1\edef#6{\number\dimexpr##1\relax sp}%
|
|
||||||
\edef#7{\number\dimexpr##2+\z@\relax sp}%
|
|
||||||
\if\relax\detokenize{##3}\relax#4\else#3\fi
|
|
||||||
\fi
|
|
||||||
}#5none {} {} \@nnil
|
|
||||||
}
|
}
|
||||||
\spx@tempa{warning}
|
\spx@tempa{div.warning_} {warning}
|
||||||
\spx@tempa{caution}
|
\spx@tempa{div.caution_} {caution}
|
||||||
\spx@tempa{attention}
|
\spx@tempa{div.attention_} {attention}
|
||||||
\spx@tempa{danger}
|
\spx@tempa{div.danger_} {danger}
|
||||||
\spx@tempa{error}
|
\spx@tempa{div.error_} {error}
|
||||||
|
|
||||||
\def\spx@tempa#1{%
|
|
||||||
\expandafter\spx@tempb
|
|
||||||
\csname spx@#1@withbordercolortrue\expandafter\endcsname
|
|
||||||
\csname spx@#1@withbackgroundcolortrue\expandafter\endcsname
|
|
||||||
\csname spx@#1@withshadowcolortrue\endcsname
|
|
||||||
{#1}%
|
|
||||||
}
|
|
||||||
\def\spx@tempb#1#2#3#4{%
|
|
||||||
\definecolor{sphinx#4BorderColor}{rgb}{0,0,0}%
|
|
||||||
\definecolor{sphinx#4BgColor}{rgb}{1,1,1}%
|
|
||||||
\definecolor{sphinx#4ShadowColor}{rgb}{0,0,0}%
|
|
||||||
\define@key{sphinx}{div.#4_border-TeXcolor}%
|
|
||||||
{#1\spx@defineorletcolor{sphinx#4BorderColor}##1\relax}%
|
|
||||||
\define@key{sphinx}{div.#4_background-TeXcolor}%
|
|
||||||
{#2\spx@defineorletcolor{sphinx#4BgColor}##1\relax}%
|
|
||||||
\define@key{sphinx}{div.#4_box-shadow-TeXcolor}%
|
|
||||||
{#3\spx@defineorletcolor{sphinx#4ShadowColor}##1\relax}%
|
|
||||||
\expandafter\let\csname KV@sphinx@#4BorderColor\expandafter\endcsname
|
|
||||||
\csname KV@sphinx@div.#4_border-TeXcolor\endcsname
|
|
||||||
\expandafter\let\csname KV@sphinx@#4BgColor\expandafter\endcsname
|
|
||||||
\csname KV@sphinx@div.#4_background-TeXcolor\endcsname
|
|
||||||
}
|
|
||||||
\spx@tempa{warning}
|
|
||||||
\spx@tempa{caution}
|
|
||||||
\spx@tempa{attention}
|
|
||||||
\spx@tempa{danger}
|
|
||||||
\spx@tempa{error}
|
|
||||||
|
|
||||||
|
|
||||||
\DeclareDefaultOption{\@unknownoptionerror}
|
\DeclareDefaultOption{\@unknownoptionerror}
|
||||||
\ProcessKeyvalOptions*
|
\ProcessKeyvalOptions*
|
||||||
@ -802,21 +649,19 @@ will be set to white}%
|
|||||||
%% FRAMED ENVIRONMENTS
|
%% FRAMED ENVIRONMENTS
|
||||||
%
|
%
|
||||||
\RequirePackage{sphinxpackageboxes}
|
\RequirePackage{sphinxpackageboxes}
|
||||||
% This macro is possibly executed at begin document if the check
|
|
||||||
% whether radii setting options have been used turns out positive
|
|
||||||
\def\spx@RequirePackage@PictIIe{%
|
\def\spx@RequirePackage@PictIIe{%
|
||||||
\IfFileExists{pict2e.sty}
|
\IfFileExists{pict2e.sty}
|
||||||
{\RequirePackage{pict2e}}
|
{\RequirePackage{pict2e}}
|
||||||
{\PackageWarningNoLine{sphinx}{%
|
{\PackageWarningNoLine{sphinx}{%
|
||||||
The package pict2e is required for rounded boxes.\MessageBreak
|
The package pict2e is required for rounded boxes.\MessageBreak
|
||||||
It does not seem to be available on your system.\MessageBreak
|
It does not seem to be available on your system.\MessageBreak
|
||||||
Options for setting radii have thus been ignored}%
|
Options for setting radii will be ignored}%
|
||||||
\sphinxbuildwarning{nopict2e}%
|
\sphinxbuildwarning{nopict2e}%
|
||||||
\def\spx@boxes@fcolorbox@rounded{\spx@boxes@fcolorbox}%
|
\def\spx@boxes@fcolorbox@rounded{\spx@boxes@fcolorbox}%
|
||||||
}%
|
}%
|
||||||
}%
|
}%
|
||||||
% This at begin document will be executed after \spx@RequirePackage@PictIIe
|
|
||||||
\AtBeginDocument{%
|
\AtBeginDocument{%
|
||||||
|
\spx@RequirePackage@PictIIe
|
||||||
\@ifpackageloaded{pict2e}{\let\spx@ifpackageloaded@pictiie\@firstoftwo}%
|
\@ifpackageloaded{pict2e}{\let\spx@ifpackageloaded@pictiie\@firstoftwo}%
|
||||||
{\let\spx@ifpackageloaded@pictiie\@secondoftwo}%
|
{\let\spx@ifpackageloaded@pictiie\@secondoftwo}%
|
||||||
}%
|
}%
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
%% NOTICES AND ADMONITIONS
|
%% NOTICES AND ADMONITIONS
|
||||||
%
|
%
|
||||||
% change this info string if making any custom modification
|
% change this info string if making any custom modification
|
||||||
\ProvidesFile{sphinxlatexadmonitions.sty}[2023/01/03 admonitions]
|
\ProvidesFile{sphinxlatexadmonitions.sty}[2023/03/06 admonitions]
|
||||||
|
|
||||||
% Provides support for this output mark-up from Sphinx latex writer:
|
% Provides support for this output mark-up from Sphinx latex writer:
|
||||||
%
|
%
|
||||||
@ -89,8 +89,8 @@
|
|||||||
\relax
|
\relax
|
||||||
\iftrue\@nameuse{ifspx@\spx@noticetype @withshadow}%
|
\iftrue\@nameuse{ifspx@\spx@noticetype @withshadow}%
|
||||||
\spx@boxes@withshadowtrue
|
\spx@boxes@withshadowtrue
|
||||||
\spx@boxes@shadow@xoffset \@nameuse{spx@\spx@noticetype @box@shadow@xoffset}%
|
\spx@boxes@shadow@xoffset \@nameuse{spx@\spx@noticetype @shadow@xoffset}%
|
||||||
\spx@boxes@shadow@yoffset \@nameuse{spx@\spx@noticetype @box@shadow@yoffset}\relax
|
\spx@boxes@shadow@yoffset \@nameuse{spx@\spx@noticetype @shadow@yoffset}\relax
|
||||||
\else
|
\else
|
||||||
\spx@boxes@withshadowfalse
|
\spx@boxes@withshadowfalse
|
||||||
\fi\@nameuse{fi}%
|
\fi\@nameuse{fi}%
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
%% LITERAL BLOCKS
|
%% LITERAL BLOCKS
|
||||||
%
|
%
|
||||||
% change this info string if making any custom modification
|
% change this info string if making any custom modification
|
||||||
\ProvidesFile{sphinxlatexliterals.sty}[2022/07/29 code-blocks and parsed literals]
|
\ProvidesFile{sphinxlatexliterals.sty}[2023/03/06 code-blocks and parsed literals]
|
||||||
|
|
||||||
% Provides support for this output mark-up from Sphinx latex writer:
|
% Provides support for this output mark-up from Sphinx latex writer:
|
||||||
%
|
%
|
||||||
@ -238,7 +238,7 @@
|
|||||||
\spx@boxes@border@right \spx@pre@border@right
|
\spx@boxes@border@right \spx@pre@border@right
|
||||||
\spx@boxes@border@bottom\spx@pre@border@bottom
|
\spx@boxes@border@bottom\spx@pre@border@bottom
|
||||||
\spx@boxes@border@left \spx@pre@border@left
|
\spx@boxes@border@left \spx@pre@border@left
|
||||||
\spx@boxes@border \spxdimen@pre@border
|
\spx@boxes@border \spx@pre@border\relax
|
||||||
%
|
%
|
||||||
\ifspx@opt@verbatimwithframe
|
\ifspx@opt@verbatimwithframe
|
||||||
\else
|
\else
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
%% TOPIC AND CONTENTS BOXES
|
%% TOPIC AND CONTENTS BOXES
|
||||||
%
|
%
|
||||||
% change this info string if making any custom modification
|
% change this info string if making any custom modification
|
||||||
\ProvidesFile{sphinxlatexshadowbox.sty}[2023/01/06 sphinxShadowBox]
|
\ProvidesFile{sphinxlatexshadowbox.sty}[2023/03/06 sphinxShadowBox]
|
||||||
|
|
||||||
% Provides support for this output mark-up from Sphinx latex writer:
|
% Provides support for this output mark-up from Sphinx latex writer:
|
||||||
%
|
%
|
||||||
@ -24,7 +24,7 @@
|
|||||||
\spx@boxes@border@right \spx@topic@border@right
|
\spx@boxes@border@right \spx@topic@border@right
|
||||||
\spx@boxes@border@bottom\spx@topic@border@bottom
|
\spx@boxes@border@bottom\spx@topic@border@bottom
|
||||||
\spx@boxes@border@left \spx@topic@border@left
|
\spx@boxes@border@left \spx@topic@border@left
|
||||||
\spx@boxes@border \spxdimen@topic@border
|
\spx@boxes@border \spx@topic@border
|
||||||
%
|
%
|
||||||
\spx@boxes@padding@top \spx@topic@padding@top
|
\spx@boxes@padding@top \spx@topic@padding@top
|
||||||
\spx@boxes@padding@right \spx@topic@padding@right
|
\spx@boxes@padding@right \spx@topic@padding@right
|
||||||
@ -50,15 +50,15 @@
|
|||||||
%
|
%
|
||||||
\ifspx@topic@withbackgroundcolor\spx@boxes@withbackgroundcolortrue\else
|
\ifspx@topic@withbackgroundcolor\spx@boxes@withbackgroundcolortrue\else
|
||||||
\spx@boxes@withbackgroundcolorfalse\fi
|
\spx@boxes@withbackgroundcolorfalse\fi
|
||||||
\sphinxcolorlet{spx@boxes@backgroundcolor}{sphinxTopicBackgroundColor}%
|
\sphinxcolorlet{spx@boxes@backgroundcolor}{sphinxtopicBgColor}%
|
||||||
%
|
%
|
||||||
\ifspx@topic@withbordercolor\spx@boxes@withbordercolortrue\else
|
\ifspx@topic@withbordercolor\spx@boxes@withbordercolortrue\else
|
||||||
\spx@boxes@withbordercolorfalse\fi
|
\spx@boxes@withbordercolorfalse\fi
|
||||||
\sphinxcolorlet{spx@boxes@bordercolor}{sphinxTopicBorderColor}%
|
\sphinxcolorlet{spx@boxes@bordercolor}{sphinxtopicBorderColor}%
|
||||||
%
|
%
|
||||||
\ifspx@topic@withshadowcolor\spx@boxes@withshadowcolortrue\else
|
\ifspx@topic@withshadowcolor\spx@boxes@withshadowcolortrue\else
|
||||||
\spx@boxes@withshadowcolorfalse\fi
|
\spx@boxes@withshadowcolorfalse\fi
|
||||||
\sphinxcolorlet{spx@boxes@shadowcolor}{sphinxTopicShadowColor}%
|
\sphinxcolorlet{spx@boxes@shadowcolor}{sphinxtopicShadowColor}%
|
||||||
}%
|
}%
|
||||||
|
|
||||||
% At 5.1.0 the code formerly here has been refactored and incorporated
|
% At 5.1.0 the code formerly here has been refactored and incorporated
|
||||||
|
Loading…
Reference in New Issue
Block a user