Le 04/10/2019 à 19:51, Jeff Larson a écrit :
Sphinx references within a PDF are formatted as italics. How can I change
this to fixed width font?

The word "link: in a reference such as

:ref:`link<my-reference-label>`

will be italicized. Inspecting the generated .tex source shows that such
references are a sphinxcrossref, which is not a package that I know how to
access, for example, with the passoptionstopackages.

Hi,
\sphinxcrossref is a LaTeX macro defined in sphinx.sty to be

\protected\def\sphinxcrossref#1{\emph{#1}}


You can add to the latex_elements dictionary this

latex_elements = {
    'preamble': r"""
\protected\def\sphinxcrossref#1{#1}
""",
}

in your conf.py to suppress the \emph which gives the italic font

Cheers,

Jean-François

--
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/qn876a%244jui%241%40blaine.gmane.org.

Reply via email to