mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
LaTeX: polish code comments
This commit is contained in:
@@ -1166,7 +1166,7 @@ which is then followed by an underscore, then the option name.
|
||||
|
||||
Here are now these options as well as their common defaults.
|
||||
Replace below ``<prefix>`` by the actual prefix as explained above. Don't
|
||||
forget the underscore separating the prefix from the attribute name.
|
||||
forget the underscore separating the prefix from the property names.
|
||||
|
||||
- | ``<prefix>_border-top-width``,
|
||||
| ``<prefix>_border-right-width``,
|
||||
@@ -1176,7 +1176,7 @@ forget the underscore separating the prefix from the attribute name.
|
||||
dimension which then sets all four others.
|
||||
The default is that all those dimensions are equal. They are set to:
|
||||
|
||||
* ``\fboxrule`` (i.e. normally ``0.4pt``) for :rst:dir:`code-block`,
|
||||
* ``\fboxrule`` (i.e. a priori ``0.4pt``) for :rst:dir:`code-block`,
|
||||
* ``\fboxrule`` for :dudir:`topic` or contents_ directive,
|
||||
* ``1pt`` for :dudir:`warning` and other "strong" admonitions,
|
||||
* ``0.5pt`` for :dudir:`note` and other "light" admonitions. The framing
|
||||
@@ -1197,7 +1197,7 @@ forget the underscore separating the prefix from the attribute name.
|
||||
dimension which then sets all four others.
|
||||
The default is that all those dimensions are equal. They are set to:
|
||||
|
||||
* ``\fboxsep`` (i.e. normally ``3pt``) for :rst:dir:`code-block`,
|
||||
* ``\fboxsep`` (i.e. a priori ``3pt``) for :rst:dir:`code-block`,
|
||||
* ``5pt`` for :dudir:`topic` or contents_ directive,
|
||||
* a special value for :dudir:`warning` and other "strong" admonitions,
|
||||
which ensures a backward compatible behavior.
|
||||
@@ -1221,8 +1221,8 @@ forget the underscore separating the prefix from the attribute name.
|
||||
circular arcs only, no ellipses).
|
||||
The default is that all those dimensions are equal. They are set to:
|
||||
|
||||
* ``3pt`` for :rst:dir:`code-block` (since 6.0.0).
|
||||
* ``0pt``, i.e. straight corners for all other directives.
|
||||
* ``\fboxsep`` (i.e. a priori ``3pt``) for :rst:dir:`code-block` (since 6.0.0).
|
||||
* ``0pt`` for all other directives; this means to use straight corners.
|
||||
- ``<prefix>_box-shadow`` is special in so far as it may be:
|
||||
|
||||
* the ``none`` keyword,
|
||||
|
||||
@@ -73,21 +73,24 @@
|
||||
|
||||
% MEMO: xcolor \fcolorbox coloured boxes render better in some PDF viewers
|
||||
% than with color package \fcolorbox. Since 1.6.3, Sphinx uses only its own
|
||||
% custom variant of \fcolorbox when handling verbatim code. Currently (last
|
||||
% checked at 5.0.0) \fcolorbox is used for admonitions (sphinxheavybox)
|
||||
% and appears also in Pygmentize output mark-up.
|
||||
% custom variant of \fcolorbox when handling code-blocks. But \fcolorbox
|
||||
% appears also in Pygmentize output mark-up. Also, since 5.3.0, 'sphinxsetup'
|
||||
% color options get a richer input syntax if Sphinx knows xcolor is loaded,
|
||||
% and the \sphinxcolorblend (for tables) is made available only if xcolor is
|
||||
% loaded.
|
||||
\IfFileExists{xcolor.sty}{
|
||||
% Should Sphinx load xcolor with its dvipsnames and svgnames options?
|
||||
\RequirePackage{xcolor}
|
||||
}{
|
||||
\RequirePackage{color}
|
||||
}
|
||||
|
||||
% the \colorlet of xcolor (if at all loaded) is overkill for our internal use
|
||||
% the \colorlet of xcolor (if at all loaded) is overkill for most internal use
|
||||
\newcommand{\sphinxcolorlet}[2]
|
||||
{\expandafter\let\csname\@backslashchar color@#1\expandafter\endcsname
|
||||
\csname\@backslashchar color@#2\endcsname }
|
||||
|
||||
% (5.3.0) allow colour options to use both the \definecolor and the \colorlet
|
||||
% (5.3.0) Allow colour options to use both the \definecolor and the \colorlet
|
||||
% syntaxes, for example VerbatimColor={gray}{0.9} or VerbatimColor=red!10
|
||||
% In the latter case we need the real \colorlet from xcolor package.
|
||||
\def\spx@defineorletcolor#1{%
|
||||
@@ -158,7 +161,7 @@ will be set to white}%
|
||||
% \DeclareBoolOption[false]{usespart}% not used
|
||||
% INFO: the keys for padding and border widths were extended at 5.1.0,
|
||||
% and legacy names for user interface were kept, but their definitions
|
||||
% are delayed further down. The legacy dimen registers used internally
|
||||
% are delayed further down. The legacy internally used dimen registers
|
||||
% \sphinxverbatimborder and \sphinxverbatimsep got removed at 6.2.0.
|
||||
\DeclareBoolOption[true]{verbatimwithframe}
|
||||
\DeclareBoolOption[true]{verbatimwrapslines}
|
||||
@@ -178,24 +181,32 @@ will be set to white}%
|
||||
[{\makebox[2\fontcharwd\font`\x][r]{\textcolor{red}{\tiny$\m@th\hookrightarrow$}}}]%
|
||||
{verbatimcontinued}
|
||||
% topic boxes
|
||||
%
|
||||
% 5.1.0 added new keys for configuration. The legacy keys shadowsep,
|
||||
% shadowsize, shadowrule are kept for backwards compatibility. See further
|
||||
% down for definitions. Unfortunately this had bugs due to typos, which got
|
||||
% fixed later at 6.1.2. The \sphinxshadowsep, \sphinxshadowsize,
|
||||
% \sphinxshadowrule \dimen registers became at 5.1.0 either no-op or, for the
|
||||
% latter, were used under an aliased name. They got removed at 6.2.0.
|
||||
% shadowsize, shadowrule were kept for backward compatibility. Unfortunately
|
||||
% this had bugs due to typos, which got fixed later at 6.1.2.
|
||||
%
|
||||
% All configuration is now to be found in the "CSS" section below.
|
||||
%
|
||||
% \sphinxshadowsep, \sphinxshadowsize, \sphinxshadowrule \dimen registers
|
||||
% became at 5.1.0 either no-op or, for the latter, were used under an aliased
|
||||
% name. They got removed at 6.2.0.
|
||||
%
|
||||
% notices/admonitions
|
||||
%
|
||||
% 5.1.0 added much customizability to warning, caution, attention, danger and
|
||||
% error types of notices via an enhanced sphinxheavybox environment.
|
||||
% 6.2.0 has added the possiblity to use the same kind of rendering also for
|
||||
%
|
||||
% 6.2.0 added the possibility to use the same kind of rendering also for
|
||||
% note, hint, important, and tip.
|
||||
% All this is now handled below in the "CSS" section. Legacy user interface
|
||||
% for options is kept working, but all of it is handled in the "CSS" section.
|
||||
% We do define here some non-documented booleans which will serve internally.
|
||||
% There is no reason for user to know about them, except if it is desired to
|
||||
% toggle mid-way in the document whether note, hint, important, and tip
|
||||
% should use the "lightbox" or the "heavybox" rendering.
|
||||
%
|
||||
% Legacy user interface for options was kept working. All of it is handled in
|
||||
% the "CSS" section below.
|
||||
%
|
||||
% These 6.2.0 added booleans serve internally. There is no reason for user to
|
||||
% know about them, except if it is desired to toggle mid-way in the document
|
||||
% whether note, hint, important, and tip should use the "lightbox" or the
|
||||
% "heavybox" rendering.
|
||||
\DeclareBoolOption[false]{heavynote}
|
||||
\DeclareBoolOption[false]{heavyhint}
|
||||
\DeclareBoolOption[false]{heavyimportant}
|
||||
@@ -210,7 +221,7 @@ will be set to white}%
|
||||
\DeclareStringOption[\sffamily\bfseries]{HeaderFamily}
|
||||
% colours
|
||||
% same problems as for dimensions: we want the key handler to use \definecolor.
|
||||
% first, some colours with no prefix, for backwards compatibility
|
||||
% first, some colours with no prefix, for backward compatibility
|
||||
\newcommand*{\sphinxDeclareColorOption}[2]{%
|
||||
% set the initial default; only \definecolor syntax for defaults!
|
||||
\definecolor{#1}#2%
|
||||
@@ -279,47 +290,38 @@ will be set to white}%
|
||||
\sphinxDeclareSphinxColorOption{errorBgColor}{{rgb}{1,1,1}}
|
||||
%%%%%%%%
|
||||
%
|
||||
% Additions of CSS-like keys (in particular for rounded boxes) at 5.1.0
|
||||
% --------------------------
|
||||
% Additions of CSS-like keys at 5.1.0 (and possibility of rounded boxes)
|
||||
% -----------------------------------
|
||||
%
|
||||
% In future, an alternative user interface will perhaps be provided via
|
||||
% CSS-like input in a configuration variable latex_css, and Sphinx
|
||||
% will then parse it into the \sphinxsetup options described it.
|
||||
% These CSS-named alikes allow to configure 4 border widths, 4 padding seps, 4
|
||||
% corner radii, optional shadow, border color, background color, shadow color.
|
||||
%
|
||||
% In the meantime we adopt already some CSS-like names. However,
|
||||
% attention to not use these options as genuine CSS properties, only
|
||||
% very limited syntax is supported.
|
||||
%
|
||||
\def\spxstring@none{none}
|
||||
\def\spxstring@clone{clone}
|
||||
% In future, an alternative user interface will perhaps be provided to parse
|
||||
% genuine CSS, but this will be easier to do in Python than in LaTeX.
|
||||
%
|
||||
% Refactoring (and extension) at 6.2.0
|
||||
% ------------------------------------
|
||||
%
|
||||
% - Legacy \dimen registers \sphinxverbatimborder, \sphinxverbatimsep,
|
||||
% \sphinxshadowsep, \sphinxshadowsize, and \sphinxshadowrule,
|
||||
% which had been deprecated have finally been removed,
|
||||
% 6.2.0 batch defines in one go all auxiliaries for code-blocks, topics, and
|
||||
% admonitions. The needed steps to maintain the legacy option names working
|
||||
% and to set some specific defaults are handled in a second step.
|
||||
%
|
||||
% - No \dimen registers used here, all dimensions are stored in macros.
|
||||
% This allowed to:
|
||||
%
|
||||
% - "note/hint/..." types of admonitions now accept same user interface as
|
||||
% for "warning/danger/...", and if this is used, they will be rendered
|
||||
% using sphinxheavybox, not sphinxlightbox from sphinxlatexadmonitions.sty
|
||||
% - associate these CSS-named options also to note, hint, important, and tip
|
||||
% which thus can access the full customizability of sphinxheavybox if they use
|
||||
% it.
|
||||
%
|
||||
% 6.2.0 batch defines in one go all auxiliaries for code blocks, topics,
|
||||
% and warning-type admonitions. Some needed add-ons due to maintaining
|
||||
% legacy options and specific defaults are handled in a second step.
|
||||
% - provide a \sphinxbox command for boxing inline text elements with the same
|
||||
% full customizability.
|
||||
%
|
||||
% This unification facilitates adding a \sphinxbox which has full key=value
|
||||
% of all options with CSS-inspired names which were added at 5.1.0 for
|
||||
% extended customization possibility of code-blocks, topics and admonitions.
|
||||
% Except that \sphinxbox is for boxing inline elements (no linebreak, no
|
||||
% pagebreak).
|
||||
% The \dimen's \sphinxverbatimborder, \sphinxverbatimsep, \sphinxshadowsep,
|
||||
% \sphinxshadowsize, and \sphinxshadowrule, which had been deprecated have
|
||||
% finally been removed entirely. No more \dimen register is used here only
|
||||
% storage in macros.
|
||||
%
|
||||
% MEMO: the 6.2.0 refactoring induced a change that the default \fboxrule used
|
||||
% by verbatimborder and shadowrule is now not expanded to its value immediately in
|
||||
% preamble (no assignment to a \dimen register is done, only storage in a
|
||||
% macro). In practice this changed nothing to existing projects.
|
||||
\def\spxstring@none{none}
|
||||
\def\spxstring@clone{clone}
|
||||
%
|
||||
% Border keys
|
||||
%
|
||||
@@ -356,6 +358,8 @@ will be set to white}%
|
||||
% init border-width (fetches next argument)
|
||||
\csname KV@sphinx@#1border-width\endcsname
|
||||
}
|
||||
% MEMO: prior to 6.2.0 the \fboxrule value (0.4pt, a priori) was frozen here via
|
||||
% a \dimen assignment done immediately. Now it remains \fboxrule until being used.
|
||||
% macro prefix option prefix legacy option init value
|
||||
\spx@tempa{spx@pre@} {pre_} {verbatimborder} \fboxrule
|
||||
\spx@tempa{spx@topic@} {div.topic_} {shadowrule} \fboxrule
|
||||
@@ -395,30 +399,34 @@ will be set to white}%
|
||||
% 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.
|
||||
% MEMO: prior to 6.2.0 the \fboxsep value (3pt, a priori) was frozen here via
|
||||
% a \dimen assignment done immediately. 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 6.2.0, "note" type admonitions used sphinxlightbox automatically
|
||||
% and had no interface to set the padding parameters needed by sphinxheavybox.
|
||||
% At 6.2.0 they acquire such interface and the default is set as for legacy
|
||||
% default of "warning" type.
|
||||
% At 6.2.0 they acquired such interface and the default is set as for legacy
|
||||
% default of "warning" type. I hesitated using \fboxsep, but if I did I would
|
||||
% then need to explain how to change "note etc..." into behaving exactly
|
||||
% as "warning etc...", which goes via the \dimexpr here which is too scary to
|
||||
% put sanely into documentation.
|
||||
\spx@tempa{spx@note@} {div.note_} {\dimexpr.6\baselineskip-\spx@note@border\relax}
|
||||
\spx@tempa{spx@hint@} {div.hint_} {\dimexpr.6\baselineskip-\spx@hint@border\relax}
|
||||
\spx@tempa{spx@important@}{div.important_} {\dimexpr.6\baselineskip-\spx@important@border\relax}
|
||||
\spx@tempa{spx@tip@} {div.tip_} {\dimexpr.6\baselineskip-\spx@tip@border\relax}
|
||||
% 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
|
||||
% 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.
|
||||
% at time of use (so that it dynamically adapts to the border width setting).
|
||||
% MEMO: I could use everywhere \spx@notice@border, as sphinxadmonition environment
|
||||
% configures it to hold the \spx@<type>@border value.
|
||||
\spx@tempa{spx@warning@} {div.warning_} {\dimexpr.6\baselineskip-\spx@warning@border\relax}
|
||||
\spx@tempa{spx@caution@} {div.caution_} {\dimexpr.6\baselineskip-\spx@caution@border\relax}
|
||||
\spx@tempa{spx@attention@}{div.attention_} {\dimexpr.6\baselineskip-\spx@attention@border\relax}
|
||||
\spx@tempa{spx@danger@} {div.danger_} {\dimexpr.6\baselineskip-\spx@danger@border\relax}
|
||||
\spx@tempa{spx@error@} {div.error_} {\dimexpr.6\baselineskip-\spx@error@border\relax}
|
||||
\spx@tempa{spx@box@} {box_} \fboxsep % new at 6.2.0
|
||||
\spx@tempa{spx@box@} {box_} \fboxsep
|
||||
% define legacy verbatimsep key as alias of pre_padding key
|
||||
\expandafter\let\expandafter\KV@sphinx@verbatimsep\csname KV@sphinx@pre_padding\endcsname
|
||||
% define legacy shadowsep key as alias of div.topic_padding key
|
||||
@@ -441,19 +449,22 @@ will be set to white}%
|
||||
\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
|
||||
}
|
||||
% The init value for corner radius in code-blocks was \z@ (i.e. 0pt) prior
|
||||
% to 6.0.0., then 3pt, then \fboxsep at 6.2.0 as padding is \fboxsep,
|
||||
% and \fboxsep=3pt per default (also with platex).
|
||||
% macro prefix option prefix init value
|
||||
\spx@tempa{spx@pre@} {pre_} {3pt}% new default at 6.0.0
|
||||
\spx@tempa{spx@pre@} {pre_} \fboxsep
|
||||
\spx@tempa{spx@topic@} {div.topic_} \z@
|
||||
\spx@tempa{spx@note@} {div.note_} \z@ % new at 6.2.0
|
||||
\spx@tempa{spx@hint@} {div.hint_} \z@ % new at 6.2.0
|
||||
\spx@tempa{spx@important@}{div.important_} \z@ % new at 6.2.0
|
||||
\spx@tempa{spx@tip@} {div.tip_} \z@ % new at 6.2.0
|
||||
\spx@tempa{spx@note@} {div.note_} \z@
|
||||
\spx@tempa{spx@hint@} {div.hint_} \z@
|
||||
\spx@tempa{spx@important@}{div.important_} \z@
|
||||
\spx@tempa{spx@tip@} {div.tip_} \z@
|
||||
\spx@tempa{spx@warning@} {div.warning_} \z@
|
||||
\spx@tempa{spx@caution@} {div.caution_} \z@
|
||||
\spx@tempa{spx@attention@}{div.attention_} \z@
|
||||
\spx@tempa{spx@danger@} {div.danger_} \z@
|
||||
\spx@tempa{spx@error@} {div.error_} \z@
|
||||
\spx@tempa{spx@box@} {box_} {3pt}% new at 6.2.0
|
||||
\spx@tempa{spx@box@} {box_} \fboxsep
|
||||
|
||||
% Shadow keys
|
||||
%
|
||||
@@ -466,16 +477,16 @@ will be set to white}%
|
||||
% macro prefix
|
||||
\spx@tempa{spx@pre@}
|
||||
\spx@tempa{spx@topic@}
|
||||
\spx@tempa{spx@note@} % new at 6.2.0
|
||||
\spx@tempa{spx@hint@} % new at 6.2.0
|
||||
\spx@tempa{spx@important@} % new at 6.2.0
|
||||
\spx@tempa{spx@tip@} % new at 6.2.0
|
||||
\spx@tempa{spx@note@}
|
||||
\spx@tempa{spx@hint@}
|
||||
\spx@tempa{spx@important@}
|
||||
\spx@tempa{spx@tip@}
|
||||
\spx@tempa{spx@warning@}
|
||||
\spx@tempa{spx@caution@}
|
||||
\spx@tempa{spx@attention@}
|
||||
\spx@tempa{spx@danger@}
|
||||
\spx@tempa{spx@error@}
|
||||
\spx@tempa{spx@box@} % new at 6.2.0
|
||||
\spx@tempa{spx@box@}
|
||||
%
|
||||
\def\spx@tempa#1{% #1 = macro prefix
|
||||
\expandafter\spx@tempb
|
||||
@@ -493,13 +504,11 @@ will be set to white}%
|
||||
\begingroup\edef\spx@tempa{##1}\expandafter\endgroup
|
||||
\ifx\spx@tempa\spxstring@none
|
||||
#2%
|
||||
% MEMO: here the code uses an \edef+\number so dimensions
|
||||
% are evaluated at time of use of option, they are not
|
||||
% delayed (this is in contrast with other dimension specs,
|
||||
% the delay being only strictly required by padding key of
|
||||
% warning type notices, for backward legacy behavior).
|
||||
% These things probably do not matter at all, as users
|
||||
% will mainly use explicit dimension denotations like "4pt".
|
||||
% MEMO: here the code uses an \edef+\number so dimensions are
|
||||
% evaluated at time of configuration of the option, not at time of
|
||||
% usage of its value; this is in contrast with other dimension specs.
|
||||
% These things probably do not matter much, as users will (a priori)
|
||||
% use only explicit dimension denotations such as "4pt".
|
||||
\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
|
||||
@@ -511,10 +520,10 @@ will be set to white}%
|
||||
\spx@tempa{spx@topic@} {div.topic_}
|
||||
% This corresponds to the legacy parameters of ShadowBox
|
||||
\spx@topic@shadow@setter 4pt 4pt {} \@nnil
|
||||
\spx@tempa{spx@note@} {div.note_} % new at 6.2.0
|
||||
\spx@tempa{spx@hint@} {div.hint_} % new at 6.2.0
|
||||
\spx@tempa{spx@important@}{div.important_} % new at 6.2.0
|
||||
\spx@tempa{spx@tip@} {div.tip_} % new at 6.2.0
|
||||
\spx@tempa{spx@note@} {div.note_}
|
||||
\spx@tempa{spx@hint@} {div.hint_}
|
||||
\spx@tempa{spx@important@}{div.important_}
|
||||
\spx@tempa{spx@tip@} {div.tip_}
|
||||
\spx@tempa{spx@warning@} {div.warning_}
|
||||
\spx@tempa{spx@caution@} {div.caution_}
|
||||
\spx@tempa{spx@attention@}{div.attention_}
|
||||
@@ -523,7 +532,7 @@ will be set to white}%
|
||||
\spx@tempa{spx@box@} {box_}% new at 6.2.0
|
||||
|
||||
% Support for legacy shadowsize (topic/contents)
|
||||
% This definition was broken at 5.1.0 and fixed at 6.1.2
|
||||
% This definition was broken due to a typo at 5.1.0 and got fixed at 6.1.2
|
||||
\define@key{sphinx}{shadowsize}{%
|
||||
\edef\spx@topic@shadow@xoffset{\number\dimexpr#1\relax sp}%
|
||||
\let\spx@topic@shadow@yoffset\spx@topic@shadow@xoffset
|
||||
@@ -539,9 +548,7 @@ will be set to white}%
|
||||
% (three of them: border, background, shadow)
|
||||
%
|
||||
% We associate a boolean to each color, so that the box code can
|
||||
% decide to insert a \color call or consider it not needed.
|
||||
% (pending question: should the box code systematically do
|
||||
% a \normalcolor?)
|
||||
% decide to insert a \color command or consider it is not needed.
|
||||
\def\spx@tempa#1{%
|
||||
\expandafter\spx@tempb
|
||||
\csname if#1withshadowcolor\expandafter\endcsname
|
||||
@@ -579,30 +586,29 @@ will be set to white}%
|
||||
}
|
||||
% macro prefix option prefix color name prefix
|
||||
\spx@tempa{spx@pre@} {pre_} {Verbatim}
|
||||
% internal legacy color name is VerbatimColor not VerbatimBgColor:
|
||||
% internal legacy color name is VerbatimColor not VerbatimBgColor, so redefine:
|
||||
\define@key{sphinx}{pre_background-TeXcolor}%
|
||||
{\spx@pre@withbackgroundcolortrue\spx@defineorletcolor{VerbatimColor}#1\relax}%
|
||||
\spx@pre@withbordercolortrue % 6.0.0 VerbatimBorderColor {RGB}{32,32,32}
|
||||
\spx@pre@withbackgroundcolortrue % 6.0.0 VerbatimColor {gray}{0.95}
|
||||
% Keep functioning these legacy sphinxsetup option names
|
||||
% Keep legacy option names working
|
||||
\expandafter\let\expandafter\KV@sphinx@VerbatimBorderColor
|
||||
\csname KV@sphinx@pre_border-TeXcolor\endcsname
|
||||
\expandafter\let\expandafter\KV@sphinx@VerbatimColor
|
||||
\csname KV@sphinx@pre_background-TeXcolor\endcsname
|
||||
% MEMO: prior to 6.2.0, internal color names started with sphinxtopic, not
|
||||
% sphinxTopic, and it was sphinxTopicBackgroundColor, not sphinxtopicBgColor.
|
||||
% (6.2.0 modified some internal namings for the colors of topic boxes)
|
||||
% macro prefix option prefix color name prefix
|
||||
\spx@tempa{spx@topic@} {div.topic_} {sphinxtopic}% (no legacy interface)
|
||||
\spx@tempa{spx@note@} {div.note_} {sphinxnote} % new at 6.2.0
|
||||
\spx@tempa{spx@hint@} {div.hint_} {sphinxhint} % new at 6.2.0
|
||||
\spx@tempa{spx@important@}{div.important_} {sphinximportant} % new at 6.2.0
|
||||
\spx@tempa{spx@tip@} {div.tip_} {sphinxtip} % new at 6.2.0
|
||||
\spx@tempa{spx@note@} {div.note_} {sphinxnote}
|
||||
\spx@tempa{spx@hint@} {div.hint_} {sphinxhint}
|
||||
\spx@tempa{spx@important@}{div.important_} {sphinximportant}
|
||||
\spx@tempa{spx@tip@} {div.tip_} {sphinxtip}
|
||||
\spx@tempa{spx@warning@} {div.warning_} {sphinxwarning}
|
||||
\spx@tempa{spx@caution@} {div.caution_} {sphinxcaution}
|
||||
\spx@tempa{spx@attention@}{div.attention_} {sphinxattention}
|
||||
\spx@tempa{spx@danger@} {div.danger_} {sphinxdanger}
|
||||
\spx@tempa{spx@error@} {div.error_} {sphinxerror}
|
||||
\spx@tempa{spx@box@} {box_} {sphinxbox}% new at 6.2.0
|
||||
\spx@tempa{spx@box@} {box_} {sphinxbox}
|
||||
% Keep legacy sphinxsetup color options interface for "strong" admonitions
|
||||
\def\spx@tempa#1#2{% #1 = option prefix, #2 = legacy option prefix
|
||||
\expandafter\let\csname KV@sphinx@#2BorderColor\expandafter\endcsname
|
||||
@@ -616,7 +622,7 @@ will be set to white}%
|
||||
\spx@tempa{div.danger_} {danger}
|
||||
\spx@tempa{div.error_} {error}
|
||||
|
||||
% Let us recreate the legacy {note,...}BorderColor option interface
|
||||
% Keep legacy sphinxsetup <type>BorderColor for <type>=note, hint, ...
|
||||
\def\spx@tempa#1#2{% #1 = CSS like option prefix, #2 = legacy option prefix
|
||||
\expandafter\let\csname KV@sphinx@#2BorderColor\expandafter\endcsname
|
||||
\csname KV@sphinx@#1border-TeXcolor\endcsname
|
||||
@@ -624,15 +630,18 @@ will be set to white}%
|
||||
\spx@tempa{div.note_} {note}
|
||||
\spx@tempa{div.hint_} {hint}
|
||||
\spx@tempa{div.important_} {important}
|
||||
\spx@tempa{div.tip_} {tip}
|
||||
\spx@tempa{div.tip_} {tip}
|
||||
|
||||
% For note type admonitions, redefine all CSS-like named options to trigger
|
||||
% the "heavybox" path. This goes via rather hardcore TeX here.
|
||||
% the "heavybox" path.
|
||||
%
|
||||
% MEMO: the noteBorderColor and noteborder legacy options have already been
|
||||
% re-created and they do not trigger the "heavybox" as their meaning will not
|
||||
% be modified in the loop below contrarily to their CSS counterparts
|
||||
% border-TeXcolor and border-width.
|
||||
% div.note_border-TeXcolor and div.note_border-width, and to the noteBgColor
|
||||
% next.
|
||||
%
|
||||
% This goes via rather hardcore TeX here.
|
||||
\def\spx@tempa#1{\if\relax#1\expandafter\@gobble
|
||||
\else
|
||||
\toks@{##1}%
|
||||
@@ -667,10 +676,10 @@ will be set to white}%
|
||||
{border-TeXcolor}{background-TeXcolor}{box-shadow-TeXcolor}%
|
||||
\relax
|
||||
|
||||
% Now we add at 6.2.0 {note,...}BgColor named options which will trigger
|
||||
% the "heavybox" as they are \let to the background-TeXColor option which has
|
||||
% already been enhanced to set the boolean for rendering via "heavybox".
|
||||
% This is in contrast with legacy {note,...}BorderColor.
|
||||
% Now we add at 6.2.0 <type>BgColor et al. options which will trigger the
|
||||
% "heavybox" as they are \let to the div.<type>_background-TeXColor option
|
||||
% which has already been enhanced to set the boolean for rendering via
|
||||
% "heavybox". This is in contrast with legacy <type>BorderColor.
|
||||
\def\spx@tempa#1#2{% #1 = CSS like option prefix, #2 = legacy style option prefix
|
||||
\expandafter\let\csname KV@sphinx@#2BgColor\expandafter\endcsname
|
||||
\csname KV@sphinx@#1background-TeXcolor\endcsname
|
||||
@@ -678,7 +687,7 @@ will be set to white}%
|
||||
\spx@tempa{div.note_} {note}
|
||||
\spx@tempa{div.hint_} {hint}
|
||||
\spx@tempa{div.important_} {important}
|
||||
\spx@tempa{div.tip_} {tip}
|
||||
\spx@tempa{div.tip_} {tip}
|
||||
|
||||
|
||||
\DeclareDefaultOption{\@unknownoptionerror}
|
||||
@@ -783,18 +792,9 @@ will be set to white}%
|
||||
%
|
||||
% \sphinxbox added at 6.2.0, its definition is in sphinxpackageboxes.
|
||||
%
|
||||
% It would be nice to have a \setkeys which would allow an argument
|
||||
% holding an assumed tacit prefix, which here would be "box_", allowing
|
||||
% the user to not have to use it and thus abbreviate the key names.
|
||||
% But kvoptions does not provide it seems this on top of keyval.
|
||||
% So I decided to alias all already defined options.
|
||||
% - advantage: \sphinxbox options are shorter for user: no box_ prefix
|
||||
% - inconventient: this \sphinxboxsetup can not customize other things
|
||||
% Alias all \sphinxsetup "box_" keys to become \sphinxboxsetup no-prefix keys
|
||||
\@tfor\x:={border-width}%
|
||||
{border-top-width}%
|
||||
{border-right-width}%
|
||||
{border-bottom-width}%
|
||||
{border-left-width}%
|
||||
{border-top-width}{border-right-width}{border-bottom-width}{border-left-width}%
|
||||
{box-decoration-break}% This one is actually useless, as \sphinxbox
|
||||
% creates an unbreakable horizontal box, not a breakable vertical
|
||||
% box. And as is well-known it is very complicated (not to say
|
||||
@@ -803,19 +803,12 @@ will be set to white}%
|
||||
% verbatimforcewraps in sphinxlatexliterals.sty or see the source
|
||||
% code of the soul or soulutf8 packages.
|
||||
{padding}%
|
||||
{padding-top}%
|
||||
{padding-right}%
|
||||
{padding-bottom}%
|
||||
{padding-left}%
|
||||
{padding-top}{padding-right}{padding-bottom}{padding-left}%
|
||||
{border-radius}%
|
||||
{border-top-left-radius}%
|
||||
{border-top-right-radius}%
|
||||
{border-bottom-right-radius}%
|
||||
{border-bottom-left-radius}%
|
||||
{border-top-left-radius}{border-top-right-radius}%
|
||||
{border-bottom-right-radius}{border-bottom-left-radius}%
|
||||
{box-shadow}%
|
||||
{border-TeXcolor}%
|
||||
{background-TeXcolor}%
|
||||
{box-shadow-TeXcolor}%
|
||||
{border-TeXcolor}{background-TeXcolor}{box-shadow-TeXcolor}%
|
||||
\do{\expandafter\let\csname KV@sphinxbox@\x\expandafter\endcsname
|
||||
\csname KV@sphinx@box_\x\endcsname}
|
||||
\newcommand\sphinxboxsetup{\setkeys{sphinxbox}}
|
||||
|
||||
@@ -458,7 +458,7 @@
|
||||
}%
|
||||
\newif\ifspx@table@inmergedcell
|
||||
\def\spx@CT@setup@inmergedcell #1\endgroup{%
|
||||
% - obey only row color and disable effect of \sphinxblendcolor
|
||||
% - obey only row color and disable effect of \sphinxcolorblend
|
||||
% - turn on the inmergedcell boolean to signal to \CT@row@color
|
||||
\spx@original@CT@setup
|
||||
\spx@table@inmergedcelltrue % needed by \CT@row@color
|
||||
|
||||
Reference in New Issue
Block a user