mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-08-01 09:07:55 -05:00
LaTeX: `\emph replaced by \sphinxparam and \sphinxsamedocref`
This commit is contained in:
@@ -1332,14 +1332,19 @@ Macros
|
||||
- Text styling commands:
|
||||
|
||||
- ``\sphinxstrong``,
|
||||
- ``\sphinxcode``,
|
||||
- ``\sphinxbfcode``,
|
||||
- ``\sphinxemail``,
|
||||
- ``\sphinxtablecontinued``,
|
||||
- ``\sphinxtitleref``,
|
||||
- ``\sphinxmenuselection``,
|
||||
- ``\sphinxguilabel``,
|
||||
- ``\sphinxkeyboard``,
|
||||
- ``\sphinxaccelerator``,
|
||||
- ``\sphinxcrossref``,
|
||||
- ``\sphinxtermref``,
|
||||
- ``\sphinxsamedocref``,
|
||||
- ``\sphinxparam``,
|
||||
- ``\sphinxoptional``.
|
||||
|
||||
.. versionadded:: 1.4.5
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
\protected\def\sphinxaccelerator#1{\underline{#1}}
|
||||
\protected\def\sphinxcrossref#1{\emph{#1}}
|
||||
\protected\def\sphinxtermref#1{\emph{#1}}
|
||||
\protected\def\sphinxsamedocref#1{\emph{#1}}
|
||||
\protected\def\sphinxparam#1{\emph{#1}}
|
||||
% \optional is used for ``[, arg]``, i.e. desc_optional nodes.
|
||||
\long\protected\def\sphinxoptional#1{%
|
||||
{\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}}
|
||||
@@ -68,6 +70,7 @@
|
||||
\let\sphinxemail \@firstofone
|
||||
\let\sphinxcrossref \@firstofone
|
||||
\let\sphinxtermref \@firstofone
|
||||
\let\sphinxsamedocref\@firstofone
|
||||
\let\sphinxhyphen\sphinxhyphenforbookmarks
|
||||
\def\PYG#1#2{#2}% (can not yet appear in section titles, but perhaps in future)
|
||||
}}
|
||||
|
||||
@@ -799,7 +799,7 @@ class LaTeXTranslator(SphinxTranslator):
|
||||
else:
|
||||
self.first_param = 0
|
||||
if not node.hasattr('noemph'):
|
||||
self.body.append(r'\emph{')
|
||||
self.body.append(r'\sphinxparam{')
|
||||
|
||||
def depart_desc_parameter(self, node: Element) -> None:
|
||||
if not node.hasattr('noemph'):
|
||||
@@ -1597,7 +1597,7 @@ class LaTeXTranslator(SphinxTranslator):
|
||||
# references to labels in the same document
|
||||
id = self.curfilestack[-1] + ':' + uri[1:]
|
||||
self.body.append(self.hyperlink(id))
|
||||
self.body.append(r'\emph{')
|
||||
self.body.append(r'\sphinxsamedocref{')
|
||||
if self.config.latex_show_pagerefs and not \
|
||||
self.in_production_list:
|
||||
self.context.append('}}} (%s)' % self.hyperpageref(id))
|
||||
|
||||
Reference in New Issue
Block a user