diff options
author | Jean-François B <2589111+jfbu@users.noreply.github.com> | 2023-03-26 18:52:06 +0200 |
---|---|---|
committer | Jean-François B <2589111+jfbu@users.noreply.github.com> | 2023-03-26 23:57:04 +0200 |
commit | a7949d42903efa64bc5f8f870d39d811e272ecda (patch) | |
tree | 2a13895564a2e7599b86369af5af7dd68f8b3a8d | |
parent | 321f8860970664ba343dc53e4d26e380a1bc20b2 (diff) | |
download | sphinx-git-a7949d42903efa64bc5f8f870d39d811e272ecda.tar.gz |
LaTeX: let mark-up for seealso directive use explicit colon (fix #11264)
-rw-r--r-- | CHANGES | 6 | ||||
-rw-r--r-- | doc/latex.rst | 10 | ||||
-rw-r--r-- | sphinx/texinputs/sphinxlatexadmonitions.sty | 2 | ||||
-rw-r--r-- | sphinx/writers/latex.py | 2 | ||||
-rw-r--r-- | tests/test_build_latex.py | 2 |
5 files changed, 11 insertions, 11 deletions
@@ -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 @@ -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. diff --git a/doc/latex.rst b/doc/latex.rst index 9fb283973..08b2ace85 100644 --- a/doc/latex.rst +++ b/doc/latex.rst @@ -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``. diff --git a/sphinx/texinputs/sphinxlatexadmonitions.sty b/sphinx/texinputs/sphinxlatexadmonitions.sty index fa2d3d83a..b1f29c718 100644 --- a/sphinx/texinputs/sphinxlatexadmonitions.sty +++ b/sphinx/texinputs/sphinxlatexadmonitions.sty @@ -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. diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 1039c941c..e50b11b4f 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -820,7 +820,7 @@ class LaTeXTranslator(SphinxTranslator): 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) diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index d1533ed5a..f895f56d3 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -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' |