forked from sphinx-doc/sphinx
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define \sphinxliteraltext and \sphinxcodestyle for flexibility
This addresses the \sphinxcode usage issue in context of styling of declarations, as discussed in parent commit message.
- Loading branch information
Showing
2 changed files
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason for not using
\texttt{\sphinxliteraltext{#1}}
here but\sphinxcodestyle
is twofold:usage in
\pysigline
. It is wasteful to issue\sphinxcode{(}
, and it is arguably not good style to hard-code\texttt{(}
in\pysigline
. Hence the\sphinxcodestyle
. This is not very strong point.more important and decisive, the usage in definition of
\PYG@tok@d
in connection with latex.pyvisit_desc_element
.Here is what I would prefer to do: define
\sphinxcode
to do\texttt{#1}
by default, but let the latex writer everywhere it uses currently\sphinxcode{%s}
to issue\sphinxcode{\sphinxliteraltext{%s}}
. Same for\sphinxbfcode
.Then we don't have a
\sphinxcodestyle
at all. I think I will make a PR on master for this discussion, because it is useful to extract from current\sphinxcode
all the complicated "verbatim" set-up into a "\sphinxliteraltext
" (name to be decided) macro and revert\sphinxcode
to simple\texttt{#1}
as in Sphinx 1.4 or earlier.