mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
deprecate :confval:latex_keep_old_macro_names
This commit is contained in:
parent
36e9e98bb6
commit
43fd43932d
@ -1617,6 +1617,10 @@ These options influence LaTeX output. See further :doc:`latex`.
|
|||||||
|
|
||||||
.. versionadded:: 1.4.5
|
.. versionadded:: 1.4.5
|
||||||
|
|
||||||
|
.. versionchanged:: 1.6
|
||||||
|
|
||||||
|
For ``'xelatex'`` engine, the default is ``False`` because LaTeX package
|
||||||
|
``fontspec v2.6`` defines its own ``\strong`` macro.
|
||||||
|
|
||||||
.. confval:: latex_elements
|
.. confval:: latex_elements
|
||||||
|
|
||||||
|
@ -258,6 +258,11 @@ def validate_config_values(app):
|
|||||||
RemovedInSphinx17Warning)
|
RemovedInSphinx17Warning)
|
||||||
app.config.latex_elements['postamble'] = app.config.latex_elements['footer']
|
app.config.latex_elements['postamble'] = app.config.latex_elements['footer']
|
||||||
|
|
||||||
|
if app.config.latex_keep_old_macro_names:
|
||||||
|
warnings.warn("latex_keep_old_macro_names is deprecated. "
|
||||||
|
"LaTeX markup since Sphinx 1.4.5 uses only prefixed macro names.",
|
||||||
|
RemovedInSphinx17Warning)
|
||||||
|
|
||||||
|
|
||||||
def default_latex_engine(config):
|
def default_latex_engine(config):
|
||||||
# type: (Config) -> unicode
|
# type: (Config) -> unicode
|
||||||
@ -291,7 +296,7 @@ def setup(app):
|
|||||||
None)
|
None)
|
||||||
app.add_config_value('latex_logo', None, None, string_classes)
|
app.add_config_value('latex_logo', None, None, string_classes)
|
||||||
app.add_config_value('latex_appendices', [], None)
|
app.add_config_value('latex_appendices', [], None)
|
||||||
app.add_config_value('latex_keep_old_macro_names', True, None)
|
app.add_config_value('latex_keep_old_macro_names', False, None)
|
||||||
app.add_config_value('latex_toplevel_sectioning', None, None, [str])
|
app.add_config_value('latex_toplevel_sectioning', None, None, [str])
|
||||||
app.add_config_value('latex_domain_indices', True, None, [list])
|
app.add_config_value('latex_domain_indices', True, None, [list])
|
||||||
app.add_config_value('latex_show_urls', 'no', None)
|
app.add_config_value('latex_show_urls', 'no', None)
|
||||||
|
@ -1199,7 +1199,7 @@
|
|||||||
\ifspx@opt@dontkeepoldnames\else
|
\ifspx@opt@dontkeepoldnames\else
|
||||||
\let\spx@alreadydefinedlist\@empty
|
\let\spx@alreadydefinedlist\@empty
|
||||||
\typeout{** (sphinx) defining (legacy) text style macros without \string\sphinx\space prefix}
|
\typeout{** (sphinx) defining (legacy) text style macros without \string\sphinx\space prefix}
|
||||||
\typeout{** if clashes with packages, set latex_keep_old_macro_names=False
|
\typeout{** if clashes with packages, do not set latex_keep_old_macro_names=True
|
||||||
in conf.py}
|
in conf.py}
|
||||||
\@for\@tempa:=code,strong,bfcode,email,tablecontinued,titleref,%
|
\@for\@tempa:=code,strong,bfcode,email,tablecontinued,titleref,%
|
||||||
menuselection,accelerator,crossref,termref,optional\do
|
menuselection,accelerator,crossref,termref,optional\do
|
||||||
@ -1224,6 +1224,7 @@
|
|||||||
Sphinx mark-up uses only \string\sphinx\expandafter\@gobble\sphinxdeprecatedmacro.}%
|
Sphinx mark-up uses only \string\sphinx\expandafter\@gobble\sphinxdeprecatedmacro.}%
|
||||||
}%
|
}%
|
||||||
\fi
|
\fi
|
||||||
|
\sphinxdeprecationwarning{latex_keep_old_macro_names=True}{1.6}{1.7}{}%
|
||||||
\fi
|
\fi
|
||||||
|
|
||||||
% additional customizable styling
|
% additional customizable styling
|
||||||
|
@ -58,7 +58,7 @@ DEFAULT_SETTINGS = {
|
|||||||
'classoptions': '',
|
'classoptions': '',
|
||||||
'extraclassoptions': '',
|
'extraclassoptions': '',
|
||||||
'maxlistdepth': '',
|
'maxlistdepth': '',
|
||||||
'sphinxpkgoptions': '',
|
'sphinxpkgoptions': 'dontkeepoldnames',
|
||||||
'sphinxsetup': '',
|
'sphinxsetup': '',
|
||||||
'passoptionstopackages': '',
|
'passoptionstopackages': '',
|
||||||
'geometry': '\\usepackage{geometry}',
|
'geometry': '\\usepackage{geometry}',
|
||||||
@ -539,8 +539,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
self.elements.update({
|
self.elements.update({
|
||||||
'releasename': _('Release'),
|
'releasename': _('Release'),
|
||||||
})
|
})
|
||||||
if not builder.config.latex_keep_old_macro_names:
|
if builder.config.latex_keep_old_macro_names:
|
||||||
self.elements['sphinxpkgoptions'] = 'dontkeepoldnames'
|
self.elements['sphinxpkgoptions'] = ''
|
||||||
if document.settings.docclass == 'howto':
|
if document.settings.docclass == 'howto':
|
||||||
docclass = builder.config.latex_docclass.get('howto', 'article')
|
docclass = builder.config.latex_docclass.get('howto', 'article')
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user