Skip to content

Commit

Permalink
LaTeX: fix some documentation from #11224
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Mar 7, 2023
1 parent 75da848 commit d50ae3c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
33 changes: 24 additions & 9 deletions doc/latex.rst
Expand Up @@ -1454,10 +1454,11 @@ The ``\sphinxbox`` command

.. versionadded:: 6.2.0

It can be used to "box" inline text elements with all the customizability which
has been described in :ref:`additionalcss`. It is a LaTeX command with one
optional argument, which is a comma-separated list of key=value pairs, as for
:ref:`latexsphinxsetup`. Here is the complete list of keys:
The ``\sphinxbox[key=value,...]{inline text}`` command can be used to "box"
inline text elements with all the customizability which has been described in
:ref:`additionalcss`. It is a LaTeX command with one optional argument, which
is a comma-separated list of key=value pairs, as for :ref:`latexsphinxsetup`.
Here is the complete list of keys:

- ``border-width``,
- ``border-top-width``, ``border-right-width``, ``border-bottom-width``,
Expand All @@ -1474,12 +1475,20 @@ Refer to :ref:`additionalcss` for important syntax information. The default
configuration uses no shadow, a border-width of ``\fboxrule``, a padding of
``\fboxsep``, rounded corners (with radius ``\fboxsep``) and background and
border colors as for the default rendering of code-blocks. One can modify
these defaults via using ``\sphinxboxsetup[key=value,...]`` or also via
these defaults via using ``\sphinxboxsetup{key=value,...}`` or also via
``\sphinxsetup`` but all key names must then be prefixed with ``box_``.

A utility ``\newsphinxbox`` if provided to create an alternative,
e.g. ``\foo`` to ``\sphinxbox`` with a different set of defaults, but which
otherwise behaves the same. Here is a random example of use:
.. hint::

The comma separated key-value list is to be used within curly braces with
``\sphinxsetup`` (keys must then be prefixed with ``box_``) or
``\sphinxboxsetup``. In contrast key-value options given to ``\sphinxbox``
must be within square brackets, are they are... options. See examples
below.

A utility ``\newsphinxbox`` is provided to create a new boxing macro, say
``\foo`` which will act exactly like ``\sphinxbox`` but with a possibly
different set of initial default option values. Here is some example:

.. code-block:: latex

Expand All @@ -1502,7 +1511,13 @@ otherwise behaves the same. Here is a random example of use:
}

In the above example, you can probably use ``\renewcommand`` syntax if you
prefer (with ``[1]`` in place of ``#1`` then).
prefer (with ``[1]`` in place of ``#1`` then). There is also
``\renewsphinxbox`` which one can imagine inserting in the midst of a document
via the :dudir:`raw` directive, so that from that point on, all the custom
text elements using ``\foo`` will start using re-defined box parameters,
without having to redefine for example ``\sphinxguilabel`` as it already uses
``\foo``.


Environments
~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion sphinx/texinputs/sphinxpackageboxes.sty
Expand Up @@ -15,7 +15,7 @@
% was to check if user had reverted that default and in fact pict2e was not
% neeeded. But with \sphinxbox, we can not know for sure even in that case
% that pict2e is not needed. And even back then it would have been possible
% to user to try to emploi \sphinxsetup via raw directive in document body
% to user to try to employ \sphinxsetup via raw directive in document body
% and require some rounded corners (which was thus impossible to satisfy).
% Time to be much simpler and attempt unconditionally to load pict2e
% immediately. This will also have advantage that we can use
Expand Down

0 comments on commit d50ae3c

Please sign in to comment.