mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
LaTeX: rename `\sphinxnotetitle
into
\sphinxstylenotetitle
` (etc)
Follow-up to #11266. Using \sphinxstyle prefix looked a posteriori better, for coherency, although it is a bit long.
This commit is contained in:
parent
64bf782d60
commit
8f9bac9c4f
6
CHANGES
6
CHANGES
@ -35,9 +35,9 @@ Features added
|
|||||||
* LaTeX: a command ``\sphinxbox`` for styling text elements with a (possibly
|
* LaTeX: a command ``\sphinxbox`` for styling text elements with a (possibly
|
||||||
rounded) box, optional background color and shadow, has been added.
|
rounded) box, optional background color and shadow, has been added.
|
||||||
See :ref:`sphinxbox`. (refs: #11224)
|
See :ref:`sphinxbox`. (refs: #11224)
|
||||||
* LaTeX: add ``\sphinxnotetitle``, ..., ``\sphinxwarningtitle``, ..., for
|
* LaTeX: add ``\sphinxstylenotetitle``, ..., ``\sphinxstylewarningtitle``, ...,
|
||||||
an extra layer of mark-up freeing up ``\sphinxstrong`` for other uses.
|
for an extra layer of mark-up freeing up ``\sphinxstrong`` for other uses.
|
||||||
See :ref:`latex-macros`. (refs: #11266)
|
See :ref:`latex-macros`. (refs: #11267)
|
||||||
* LaTeX: :dudir:`note`, :dudir:`hint`, :dudir:`important` and :dudir:`tip` can
|
* LaTeX: :dudir:`note`, :dudir:`hint`, :dudir:`important` and :dudir:`tip` can
|
||||||
now each be styled as the other admonitions, i.e. possibly with a background
|
now each be styled as the other admonitions, i.e. possibly with a background
|
||||||
color, individual border widths and paddings, possibly rounded corners, and
|
color, individual border widths and paddings, possibly rounded corners, and
|
||||||
|
@ -1464,16 +1464,6 @@ Macros
|
|||||||
``\sphinxsamedocref``; ``\emph{#1}``
|
``\sphinxsamedocref``; ``\emph{#1}``
|
||||||
``\sphinxparam``; ``\emph{#1}``
|
``\sphinxparam``; ``\emph{#1}``
|
||||||
``\sphinxoptional``; ``[#1]`` with larger brackets, see source
|
``\sphinxoptional``; ``[#1]`` with larger brackets, see source
|
||||||
``\sphinxnotetitle``; ``\sphinxstrong{#1}<space>``
|
|
||||||
``\sphinxhinttitle``; *idem*
|
|
||||||
``\sphinximportanttitle``; *idem*
|
|
||||||
``\sphinxtiptitle``; *idem*
|
|
||||||
``\sphinxwarningtitle``; *idem*
|
|
||||||
``\sphinxcautiontitle``; *idem*
|
|
||||||
``\sphinxattentiontitle``; *idem*
|
|
||||||
``\sphinxdangertitle``; *idem*
|
|
||||||
``\sphinxerrortitle``; *idem*
|
|
||||||
``\sphinxseealsotitle``; ``\sphinxstrong{#1}\par\nopagebreak``
|
|
||||||
|
|
||||||
.. versionadded:: 1.4.5
|
.. versionadded:: 1.4.5
|
||||||
Use of ``\sphinx`` prefixed macro names to limit possibilities of conflict
|
Use of ``\sphinx`` prefixed macro names to limit possibilities of conflict
|
||||||
@ -1488,27 +1478,6 @@ Macros
|
|||||||
.. versionadded:: 6.2.0
|
.. versionadded:: 6.2.0
|
||||||
``\sphinxparam``, ``\sphinxsamedocref``
|
``\sphinxparam``, ``\sphinxsamedocref``
|
||||||
|
|
||||||
.. versionadded:: 6.2.0
|
|
||||||
``\sphinxnotetitle`` et al. The ``#1`` is the localized name of the
|
|
||||||
directive, with a final colon. Wrap it as ``\sphinxremovefinalcolon{#1}``
|
|
||||||
if this final colon is to be removed. Example:
|
|
||||||
|
|
||||||
.. code-block:: latex
|
|
||||||
|
|
||||||
\renewcommand\sphinxwarningtitle[1]{%
|
|
||||||
\underline{\textbf{\sphinxremovefinalcolon{#1}}}\par
|
|
||||||
}
|
|
||||||
\renewcommand{\sphinxnotetitle}[1]{%
|
|
||||||
\textit{\textbf{\sphinxremovefinalcolon{#1}}}\par\nobreak
|
|
||||||
% LaTeX syntax is complex and we would be better off using \hrule here.
|
|
||||||
{\parskip0pt\noindent}%
|
|
||||||
\raisebox{1ex}%
|
|
||||||
{\makebox[\linewidth]{\textcolor{sphinxnoteBorderColor}{\dotfill}}}
|
|
||||||
% It is complex to obtain nice vertical spacing for both a paragraph or
|
|
||||||
% a list following up; this set-up is better for a text paragraph next.
|
|
||||||
\par\vskip-\parskip
|
|
||||||
}
|
|
||||||
|
|
||||||
- More text styling:
|
- More text styling:
|
||||||
|
|
||||||
.. csv-table::
|
.. csv-table::
|
||||||
@ -1516,25 +1485,35 @@ Macros
|
|||||||
:align: left
|
:align: left
|
||||||
:delim: ;
|
:delim: ;
|
||||||
|
|
||||||
``\sphinxstyleindexentry``; ``\texttt{#1}``
|
``\sphinxstyleindexentry``; ``\texttt{#1}``
|
||||||
``\sphinxstyleindexextra``; ``(\emph{#1})`` (with a space upfront)
|
``\sphinxstyleindexextra``; ``(\emph{#1})`` (with a space upfront)
|
||||||
``\sphinxstyleindexpageref``; ``, \pageref{#1}``
|
``\sphinxstyleindexpageref``; ``, \pageref{#1}``
|
||||||
``\sphinxstyleindexpagemain``; ``\textbf{#1}``
|
``\sphinxstyleindexpagemain``; ``\textbf{#1}``
|
||||||
``\sphinxstyleindexlettergroup``; ``{\Large\sffamily#1}\nopagebreak\vspace{1mm}``
|
``\sphinxstyleindexlettergroup``; ``{\Large\sffamily#1}\nopagebreak\vspace{1mm}``
|
||||||
``\sphinxstyleindexlettergroupDefault``; check source, too long for here
|
``\sphinxstyleindexlettergroupDefault``; check source, too long for here
|
||||||
``\sphinxstyletopictitle``; ``\textbf{#1}\par\medskip``
|
``\sphinxstyletopictitle``; ``\textbf{#1}\par\medskip``
|
||||||
``\sphinxstylesidebartitle``; ``\textbf{#1}\par\medskip``
|
``\sphinxstylesidebartitle``; ``\textbf{#1}\par\medskip``
|
||||||
``\sphinxstyleothertitle``; ``\textbf{#1}``
|
``\sphinxstyleothertitle``; ``\textbf{#1}``
|
||||||
``\sphinxstylesidebarsubtitle``; ``~\\\textbf{#1} \smallskip``
|
``\sphinxstylesidebarsubtitle``; ``~\\\textbf{#1} \smallskip``
|
||||||
``\sphinxstyletheadfamily``; ``\sffamily`` (*this one has no argument*)
|
``\sphinxstyletheadfamily``; ``\sffamily`` (*this one has no argument*)
|
||||||
``\sphinxstyleemphasis``; ``\emph{#1}``
|
``\sphinxstyleemphasis``; ``\emph{#1}``
|
||||||
``\sphinxstyleliteralemphasis``; ``\emph{\sphinxcode{#1}}``
|
``\sphinxstyleliteralemphasis``; ``\emph{\sphinxcode{#1}}``
|
||||||
``\sphinxstylestrong``; ``\textbf{#1}``
|
``\sphinxstylestrong``; ``\textbf{#1}``
|
||||||
``\sphinxstyleliteralstrong``; ``\sphinxbfcode{#1}``
|
``\sphinxstyleliteralstrong``; ``\sphinxbfcode{#1}``
|
||||||
``\sphinxstyleabbreviation``; ``\textsc{#1}``
|
``\sphinxstyleabbreviation``; ``\textsc{#1}``
|
||||||
``\sphinxstyleliteralintitle``; ``\sphinxcode{#1}``
|
``\sphinxstyleliteralintitle``; ``\sphinxcode{#1}``
|
||||||
``\sphinxstylecodecontinued``; ``{\footnotesize(#1)}}``
|
``\sphinxstylecodecontinued``; ``{\footnotesize(#1)}}``
|
||||||
``\sphinxstylecodecontinues``; ``{\footnotesize(#1)}}``
|
``\sphinxstylecodecontinues``; ``{\footnotesize(#1)}}``
|
||||||
|
``\sphinxstylenotetitle``; ``\sphinxstrong{#1}<space>``
|
||||||
|
``\sphinxstylehinttitle``; *idem*
|
||||||
|
``\sphinxstyleimportanttitle``; *idem*
|
||||||
|
``\sphinxstyletiptitle``; *idem*
|
||||||
|
``\sphinxstylewarningtitle``; *idem*
|
||||||
|
``\sphinxstylecautiontitle``; *idem*
|
||||||
|
``\sphinxstyleattentiontitle``; *idem*
|
||||||
|
``\sphinxstyledangertitle``; *idem*
|
||||||
|
``\sphinxstyleerrortitle``; *idem*
|
||||||
|
``\sphinxstyleseealsotitle``; ``\sphinxstrong{#1}\par\nopagebreak``
|
||||||
|
|
||||||
.. versionadded:: 1.5
|
.. versionadded:: 1.5
|
||||||
These macros were formerly hard-coded as non customizable ``\texttt``,
|
These macros were formerly hard-coded as non customizable ``\texttt``,
|
||||||
@ -1550,6 +1529,26 @@ Macros
|
|||||||
.. versionadded:: 1.8
|
.. versionadded:: 1.8
|
||||||
``\sphinxstyleindexlettergroup``, ``\sphinxstyleindexlettergroupDefault``.
|
``\sphinxstyleindexlettergroup``, ``\sphinxstyleindexlettergroupDefault``.
|
||||||
|
|
||||||
|
.. versionadded:: 6.2.0
|
||||||
|
``\sphinxstylenotetitle`` et al. The ``#1`` is the localized name of the
|
||||||
|
directive, with a final colon. Wrap it as ``\sphinxremovefinalcolon{#1}``
|
||||||
|
if this final colon is to be removed. Examples:
|
||||||
|
|
||||||
|
.. code-block:: latex
|
||||||
|
|
||||||
|
\renewcommand\sphinxstylewarningtitle[1]{%
|
||||||
|
\underline{\textbf{\sphinxremovefinalcolon{#1}}}\par
|
||||||
|
}
|
||||||
|
\renewcommand{\sphinxstylenotetitle}[1]{%
|
||||||
|
\textit{\textbf{\sphinxremovefinalcolon{#1}}}\par\nobreak
|
||||||
|
% LaTeX syntax is complex and we would be better off using \hrule.
|
||||||
|
{\parskip0pt\noindent}%
|
||||||
|
\raisebox{1ex}%
|
||||||
|
{\makebox[\linewidth]{\textcolor{sphinxnoteBorderColor}{\dotfill}}}
|
||||||
|
% It is complex to obtain nice vertical spacing for both a paragraph
|
||||||
|
% or a list following up; this set-up is better for a paragraph next.
|
||||||
|
\par\vskip-\parskip
|
||||||
|
}
|
||||||
|
|
||||||
- ``\sphinxtableofcontents``: A wrapper (defined differently in
|
- ``\sphinxtableofcontents``: A wrapper (defined differently in
|
||||||
:file:`sphinxhowto.cls` and in :file:`sphinxmanual.cls`) of standard
|
:file:`sphinxhowto.cls` and in :file:`sphinxmanual.cls`) of standard
|
||||||
|
@ -26,16 +26,14 @@
|
|||||||
%
|
%
|
||||||
% - of course the various colour and dimension options handled via sphinx.sty
|
% - of course the various colour and dimension options handled via sphinx.sty
|
||||||
%
|
%
|
||||||
% - \sphinxstrong (for sphinxlightbox and sphinxheavybox)
|
|
||||||
%
|
|
||||||
% - dimension register \spx@image@maxheight from sphinxlatexgraphics.sty
|
% - dimension register \spx@image@maxheight from sphinxlatexgraphics.sty
|
||||||
%
|
%
|
||||||
% - \savenotes/\spewnotes from sphinxpackagefootnote (for sphinxheavybox)
|
% - \savenotes/\spewnotes from sphinxpackagefootnote (for sphinxheavybox)
|
||||||
%
|
%
|
||||||
% - \sphinxnotetitle, ..., \sphinxwarningtitle, etc... which are used by
|
% - \sphinxstylenotetitle, ..., \sphinxstylewarningtitle, etc... which are used by
|
||||||
% default in the corresponding sphinx<notice> environments to replace at 6.2.0
|
% default in the corresponding sphinx<notice> environments to replace at 6.2.0
|
||||||
% formerly hard-coded \sphinxstrong{#1}<space>
|
% formerly hard-coded \sphinxstrong{#1}<space>
|
||||||
% Their definitions are in sphinxlatexstyletext.sty. Also \sphinxseealsotitle
|
% Their definitions are in sphinxlatexstyletext.sty.
|
||||||
|
|
||||||
|
|
||||||
% Provides: (also in sphinxlatexliterals.sty)
|
% Provides: (also in sphinxlatexliterals.sty)
|
||||||
@ -44,7 +42,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
% Some are quite plain
|
% Some are quite plain
|
||||||
\newenvironment{sphinxseealso}[1]{\sphinxseealsotitle{#1}}{}
|
\newenvironment{sphinxseealso}[1]{\sphinxstyleseealsotitle{#1}}{}
|
||||||
|
|
||||||
% This \dimen register is a legacy relic from Sphinx 1.5 which is used now
|
% This \dimen register is a legacy relic from Sphinx 1.5 which is used now
|
||||||
% only for sphinxlightbox. It is set in the sphinxadmonition environment.
|
% only for sphinxlightbox. It is set in the sphinxadmonition environment.
|
||||||
@ -94,19 +92,19 @@
|
|||||||
% code in sphinxVerbatim.
|
% code in sphinxVerbatim.
|
||||||
\newenvironment{sphinxnote}[1]
|
\newenvironment{sphinxnote}[1]
|
||||||
{\edef\spx@env{sphinx\ifspx@opt@heavynote heavy\else light\fi box}%
|
{\edef\spx@env{sphinx\ifspx@opt@heavynote heavy\else light\fi box}%
|
||||||
\expandafter\begin\expandafter{\spx@env}\sphinxnotetitle{#1}}
|
\expandafter\begin\expandafter{\spx@env}\sphinxstylenotetitle{#1}}
|
||||||
{\expandafter\end\expandafter{\spx@env}}
|
{\expandafter\end\expandafter{\spx@env}}
|
||||||
\newenvironment{sphinxhint}[1]
|
\newenvironment{sphinxhint}[1]
|
||||||
{\edef\spx@env{sphinx\ifspx@opt@heavyhint heavy\else light\fi box}%
|
{\edef\spx@env{sphinx\ifspx@opt@heavyhint heavy\else light\fi box}%
|
||||||
\expandafter\begin\expandafter{\spx@env}\sphinxhinttitle{#1}}
|
\expandafter\begin\expandafter{\spx@env}\sphinxstylehinttitle{#1}}
|
||||||
{\expandafter\end\expandafter{\spx@env}}
|
{\expandafter\end\expandafter{\spx@env}}
|
||||||
\newenvironment{sphinximportant}[1]
|
\newenvironment{sphinximportant}[1]
|
||||||
{\edef\spx@env{sphinx\ifspx@opt@heavyimportant heavy\else light\fi box}%
|
{\edef\spx@env{sphinx\ifspx@opt@heavyimportant heavy\else light\fi box}%
|
||||||
\expandafter\begin\expandafter{\spx@env}\sphinximportanttitle{#1}}
|
\expandafter\begin\expandafter{\spx@env}\sphinxstyleimportanttitle{#1}}
|
||||||
{\expandafter\end\expandafter{\spx@env}}
|
{\expandafter\end\expandafter{\spx@env}}
|
||||||
\newenvironment{sphinxtip}[1]
|
\newenvironment{sphinxtip}[1]
|
||||||
{\edef\spx@env{sphinx\ifspx@opt@heavytip heavy\else light\fi box}%
|
{\edef\spx@env{sphinx\ifspx@opt@heavytip heavy\else light\fi box}%
|
||||||
\expandafter\begin\expandafter{\spx@env}\sphinxtiptitle{#1}}
|
\expandafter\begin\expandafter{\spx@env}\sphinxstyletiptitle{#1}}
|
||||||
{\expandafter\end\expandafter{\spx@env}}
|
{\expandafter\end\expandafter{\spx@env}}
|
||||||
|
|
||||||
% warning/caution/attention/danger/error get more distinction
|
% warning/caution/attention/danger/error get more distinction
|
||||||
@ -208,15 +206,15 @@
|
|||||||
% \renewcommand{\sphinxwarningtitle}[1]{\textbf{#1}\par\smallskip
|
% \renewcommand{\sphinxwarningtitle}[1]{\textbf{#1}\par\smallskip
|
||||||
% {\color{sphinxwarningBorderColor}\hrule height1pt}\smallskip}
|
% {\color{sphinxwarningBorderColor}\hrule height1pt}\smallskip}
|
||||||
\newenvironment{sphinxwarning}[1]
|
\newenvironment{sphinxwarning}[1]
|
||||||
{\begin{sphinxheavybox}\sphinxwarningtitle{#1}}{\end{sphinxheavybox}}
|
{\begin{sphinxheavybox}\sphinxstylewarningtitle{#1}}{\end{sphinxheavybox}}
|
||||||
\newenvironment{sphinxcaution}[1]
|
\newenvironment{sphinxcaution}[1]
|
||||||
{\begin{sphinxheavybox}\sphinxcautiontitle{#1}}{\end{sphinxheavybox}}
|
{\begin{sphinxheavybox}\sphinxstylecautiontitle{#1}}{\end{sphinxheavybox}}
|
||||||
\newenvironment{sphinxattention}[1]
|
\newenvironment{sphinxattention}[1]
|
||||||
{\begin{sphinxheavybox}\sphinxattentiontitle{#1}}{\end{sphinxheavybox}}
|
{\begin{sphinxheavybox}\sphinxstyleattentiontitle{#1}}{\end{sphinxheavybox}}
|
||||||
\newenvironment{sphinxdanger}[1]
|
\newenvironment{sphinxdanger}[1]
|
||||||
{\begin{sphinxheavybox}\sphinxdangertitle{#1}}{\end{sphinxheavybox}}
|
{\begin{sphinxheavybox}\sphinxstyledangertitle{#1}}{\end{sphinxheavybox}}
|
||||||
\newenvironment{sphinxerror}[1]
|
\newenvironment{sphinxerror}[1]
|
||||||
{\begin{sphinxheavybox}\sphinxerrortitle{#1}}{\end{sphinxheavybox}}
|
{\begin{sphinxheavybox}\sphinxstyleerrortitle{#1}}{\end{sphinxheavybox}}
|
||||||
|
|
||||||
% the main dispatch for all types of notices
|
% the main dispatch for all types of notices
|
||||||
\newenvironment{sphinxadmonition}[2]{% #1=type, #2=heading
|
\newenvironment{sphinxadmonition}[2]{% #1=type, #2=heading
|
||||||
|
@ -8,16 +8,16 @@
|
|||||||
|
|
||||||
% But those arise rather from the default definitions of the respective
|
% But those arise rather from the default definitions of the respective
|
||||||
% latex environments done in sphinxlatexadmonitions.sty
|
% latex environments done in sphinxlatexadmonitions.sty
|
||||||
\def\sphinxnotetitle#1{\sphinxstrong{#1} }
|
\def\sphinxstylenotetitle #1{\sphinxstrong{#1} }
|
||||||
\let\sphinxhinttitle \sphinxnotetitle % #1 holds the localized notice name
|
\let\sphinxstylehinttitle \sphinxstylenotetitle % #1 holds the localized notice name
|
||||||
\let\sphinximportanttitle\sphinxnotetitle % followed by a colon
|
\let\sphinxstyleimportanttitle\sphinxstylenotetitle % followed by a colon
|
||||||
\let\sphinxtiptitle \sphinxnotetitle
|
\let\sphinxstyletiptitle \sphinxstylenotetitle
|
||||||
\let\sphinxwarningtitle \sphinxnotetitle
|
\let\sphinxstylewarningtitle \sphinxstylenotetitle
|
||||||
\let\sphinxcautiontitle \sphinxnotetitle
|
\let\sphinxstylecautiontitle \sphinxstylenotetitle
|
||||||
\let\sphinxattentiontitle\sphinxnotetitle
|
\let\sphinxstyleattentiontitle\sphinxstylenotetitle
|
||||||
\let\sphinxdangertitle \sphinxnotetitle
|
\let\sphinxstyledangertitle \sphinxstylenotetitle
|
||||||
\let\sphinxerrortitle \sphinxnotetitle
|
\let\sphinxstyleerrortitle \sphinxstylenotetitle
|
||||||
\def\sphinxseealsotitle#1{\sphinxstrong{#1}\par\nopagebreak}
|
\def\sphinxstyleseealsotitle#1{\sphinxstrong{#1}\par\nopagebreak}
|
||||||
%
|
%
|
||||||
% A utility to remove a final colon. Removing last token is not easy in
|
% A utility to remove a final colon. Removing last token is not easy in
|
||||||
% LaTeX, and there are additional complications:
|
% LaTeX, and there are additional complications:
|
||||||
|
Loading…
Reference in New Issue
Block a user