Skip to content

Commit

Permalink
LaTeX: let mark-up for seealso directive use explicit colon (fix #11264)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Mar 26, 2023
1 parent 318914f commit 7d65fc6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 2 additions & 4 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ Incompatible changes
Deprecated
----------

* LaTeX: some internals of the ``sphinxadmonition`` environment have been
marked for removal at 7.0.0 in the :file:`sphinxlatexadmonitions.sty`.
Custom re-definitions of ``sphinxlightbox`` or ``sphinxheavybox`` will have
to be updated if they depended upon them.
* #11247: Deprecate the legacy ``intersphinx_mapping`` format

Features added
Expand Down Expand Up @@ -62,6 +58,8 @@ Bugs fixed
respective to contents (when using rounded corners)
* #11235: LaTeX: added ``\color`` in topic (or admonition) contents may cause color
leak to the shadow and border at a page break
* #11264: LaTeX: missing space before colon after "Voir aussi" for :dudir:`seealso`
directive in French (refs: #6744)
* #11147: Fix source file/line number info in object description content and in
other uses of ``nested_parse_with_titles``. Patch by Jeremy Maitin-Shepard.
* #11192: Restore correct parallel search index building.
Expand Down
10 changes: 6 additions & 4 deletions doc/latex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1689,12 +1689,14 @@ Environments
``warningBgColor``, ``warningBorderColor``, ``warningborder``, ...

- Environment for the :rst:dir:`seealso` directive: ``sphinxseealso``.
It takes one argument which will be the localized string ``See also``. Its
default definition maintains the legacy behavior: the localized ``See
also``, followed with a colon, will be rendered using ``\sphinxstrong``.
Nothing particular is done for the contents.
It takes one argument which will be the localized string ``See also``
followed with a colon.

.. versionadded:: 6.1.0
.. versionchanged:: 6.2.0

Colon made part of the mark-up rather than being inserted by the
environment for coherence with how admonitions are handled generally.

- The contents_ directive (with ``:local:`` option) and the
:dudir:`topic` directive are implemented by environment ``sphinxShadowBox``.
Expand Down
2 changes: 1 addition & 1 deletion sphinx/texinputs/sphinxlatexadmonitions.sty
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}

% Some are quite plain
\newenvironment{sphinxseealso}[1]{\sphinxstrong{#1:}\par\nopagebreak}{}
\newenvironment{sphinxseealso}[1]{\sphinxstrong{#1}\par\nopagebreak}{}

% 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.
Expand Down
2 changes: 1 addition & 1 deletion sphinx/writers/latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ def depart_desc_annotation(self, node: Element) -> None:

def visit_seealso(self, node: Element) -> None:
self.body.append(BLANKLINE)
self.body.append(r'\begin{sphinxseealso}{%s}' % admonitionlabels['seealso'] + CR)
self.body.append(r'\begin{sphinxseealso}{%s:}' % admonitionlabels['seealso'] + CR)

def depart_seealso(self, node: Element) -> None:
self.body.append(BLANKLINE)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_build_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_writer(app, status, warning):

assert 'Footnotes' not in result

assert ('\\begin{sphinxseealso}{See also}\n\n'
assert ('\\begin{sphinxseealso}{See also:}\n\n'
'\\sphinxAtStartPar\n'
'something, something else, something more\n'
'\\begin{description}\n'
Expand Down

0 comments on commit 7d65fc6

Please sign in to comment.