diff --git a/CHANGES b/CHANGES index f95a500b2d..fa7b8407e5 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,8 @@ Dependencies Incompatible changes -------------------- +* #9962: texinfo: Customizing styles of emphasized text via ``@definfoenclose`` + command was not supported because the command was deprecated since texinfo 6.8 * #2068: :confval:`intersphinx_disabled_reftypes` has changed default value from an empty list to ``['std:doc']`` as avoid too surprising silent intersphinx resolutions. @@ -25,6 +27,9 @@ Features added Bugs fixed ---------- +* #9962: texinfo: Deprecation message for ``@definfoenclose`` command on + bulding texinfo document + Testing -------- diff --git a/doc/faq.rst b/doc/faq.rst index 2e10814395..68eb4745f6 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -350,19 +350,3 @@ The following notes may be helpful if you want to create Texinfo files: scheme ``info``. For example:: info:Texinfo#makeinfo_options - -- Inline markup - - The standard formatting for ``*strong*`` and ``_emphasis_`` can - result in ambiguous output when used to markup parameter names and - other values. Since this is a fairly common practice, the default - formatting has been changed so that ``emphasis`` and ``strong`` are - now displayed like ```literal'``\s. - - The standard formatting can be re-enabled by adding the following to - your :file:`conf.py`:: - - texinfo_elements = {'preamble': """ - @definfoenclose strong,*,* - @definfoenclose emph,_,_ - """} diff --git a/sphinx/writers/texinfo.py b/sphinx/writers/texinfo.py index 11f2fba0f9..9881598af4 100644 --- a/sphinx/writers/texinfo.py +++ b/sphinx/writers/texinfo.py @@ -58,8 +58,6 @@ @exampleindent %(exampleindent)s @finalout %(direntry)s -@definfoenclose strong,`,' -@definfoenclose emph,`,' @c %%**end of header @copying @@ -805,17 +803,21 @@ def depart_line(self, node: Element) -> None: # -- Inline def visit_strong(self, node: Element) -> None: - self.body.append('@strong{') + self.body.append('`') def depart_strong(self, node: Element) -> None: - self.body.append('}') + self.body.append("'") def visit_emphasis(self, node: Element) -> None: - element = 'emph' if not self.in_samp else 'var' - self.body.append('@%s{' % element) + if self.in_samp: + self.body.append('@var{') + self.context.append('}') + else: + self.body.append('`') + self.context.append("'") def depart_emphasis(self, node: Element) -> None: - self.body.append('}') + self.body.append(self.context.pop()) def is_samp(self, node: Element) -> bool: return 'samp' in node['classes'] diff --git a/tests/roots/test-glossary/index.rst b/tests/roots/test-glossary/index.rst index 88f6ef1b31..1d84a0201c 100644 --- a/tests/roots/test-glossary/index.rst +++ b/tests/roots/test-glossary/index.rst @@ -18,5 +18,5 @@ test-glossary über Gewisse - änhlich + ähnlich Dinge diff --git a/tests/roots/test-root/markup.txt b/tests/roots/test-root/markup.txt index 2ce542c3e8..41a2fa5831 100644 --- a/tests/roots/test-root/markup.txt +++ b/tests/roots/test-root/markup.txt @@ -352,7 +352,7 @@ This tests :CLASS:`role names in uppercase`. über Gewisse - änhlich + ähnlich Dinge .. productionlist:: diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index 19c59dc5e5..aa306bb9e0 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -1454,9 +1454,9 @@ def test_latex_glossary(app, status, warning): app.builder.build_all() result = (app.outdir / 'python.tex').read_text() - assert (r'\sphinxlineitem{änhlich\index{änhlich@\spxentry{änhlich}|spxpagem}' + assert (r'\sphinxlineitem{ähnlich\index{ähnlich@\spxentry{ähnlich}|spxpagem}' r'\phantomsection' - r'\label{\detokenize{index:term-anhlich}}}' in result) + r'\label{\detokenize{index:term-ahnlich}}}' in result) assert (r'\sphinxlineitem{boson\index{boson@\spxentry{boson}|spxpagem}\phantomsection' r'\label{\detokenize{index:term-boson}}}' in result) assert (r'\sphinxlineitem{\sphinxstyleemphasis{fermion}'