Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sphinxlatexstyletext.sty « texinputs « sphinx - github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ab50aed569b864b6accf34abc48e3f0119072ec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
%% TEXT STYLING
%
% change this info string if making any custom modification
\ProvidesFile{sphinxlatexstyletext.sty}[2021/01/27 text styling]

% Basically everything here consists of macros which are part of the latex
% markup produced by the Sphinx latex writer

% Some custom font markup commands.
\protected\def\sphinxstrong#1{\textbf{#1}}
\protected\def\sphinxcode#1{\texttt{#1}}
\protected\def\sphinxbfcode#1{\textbf{\sphinxcode{#1}}}
\protected\def\sphinxemail#1{\textsf{#1}}
\protected\def\sphinxtablecontinued#1{\textsf{#1}}
\protected\def\sphinxtitleref#1{\emph{#1}}
\protected\def\sphinxmenuselection#1{\emph{#1}}
\protected\def\sphinxguilabel#1{\emph{#1}}
\protected\def\sphinxkeyboard#1{\sphinxcode{#1}}
\protected\def\sphinxaccelerator#1{\underline{#1}}
\protected\def\sphinxcrossref#1{\emph{#1}}
\protected\def\sphinxtermref#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]}}}

% additional customizable styling
\def\sphinxstyleindexentry   #1{\texttt{#1}}
\def\sphinxstyleindexextra   #1{ (\emph{#1})}
\def\sphinxstyleindexpageref #1{, \pageref{#1}}
\def\sphinxstyleindexpagemain#1{\textbf{#1}}
\def\spxentry{\@backslashchar spxentry}% let to \sphinxstyleindexentry in index
\def\spxextra{\@backslashchar spxextra}% let to \sphinxstyleindexextra in index
\def\sphinxstyleindexlettergroup #1%
    {{\Large\sffamily#1}\nopagebreak\vspace{1mm}}
\def\sphinxstyleindexlettergroupDefault #1%
    {{\Large\sffamily\sphinxnonalphabeticalgroupname}\nopagebreak\vspace{1mm}}
\protected\def\sphinxstyletopictitle   #1{\textbf{#1}\par\medskip}
\let\sphinxstylesidebartitle\sphinxstyletopictitle
\protected\def\sphinxstyleothertitle   #1{\textbf{#1}}
\protected\def\sphinxstylesidebarsubtitle #1{~\\\textbf{#1} \smallskip}
% \text.. commands do not allow multiple paragraphs
\protected\def\sphinxstyletheadfamily    {\sffamily}
\protected\def\sphinxstyleemphasis     #1{\emph{#1}}
\protected\def\sphinxstyleliteralemphasis#1{\emph{\sphinxcode{#1}}}
\protected\def\sphinxstylestrong       #1{\textbf{#1}}
\protected\def\sphinxstyleliteralstrong#1{\sphinxbfcode{#1}}
\protected\def\sphinxstyleabbreviation #1{\textsc{#1}}
\protected\def\sphinxstyleliteralintitle#1{\sphinxcode{#1}}
\newcommand*\sphinxstylecodecontinued[1]{\footnotesize(#1)}%
\newcommand*\sphinxstylecodecontinues[1]{\footnotesize(#1)}%
% figure legend comes after caption and may contain arbitrary body elements
\newenvironment{sphinxlegend}{\par\small}{\par}
% reduce hyperref "Token not allowed in a PDF string" warnings on PDF builds
\AtBeginDocument{\pdfstringdefDisableCommands{%
% all "protected" macros possibly ending up in section titles should be here
% TODO: examine if \sphinxhref, \sphinxurl, \sphinnolinkurl should be handled
    \let\sphinxstyleemphasis        \@firstofone
    \let\sphinxstyleliteralemphasis \@firstofone
    \let\sphinxstylestrong          \@firstofone
    \let\sphinxstyleliteralstrong   \@firstofone
    \let\sphinxstyleabbreviation    \@firstofone
    \let\sphinxstyleliteralintitle  \@firstofone
    \let\sphinxupquote  \@firstofone
    \let\sphinxstrong   \@firstofone
    \let\sphinxcode     \@firstofone
    \let\sphinxbfcode   \@firstofone
    \let\sphinxemail    \@firstofone
    \let\sphinxcrossref \@firstofone
    \let\sphinxtermref  \@firstofone
    \let\sphinxhyphen\sphinxhyphenforbookmarks
}}

% Special characters
%
% This definition prevents en-dash and em-dash TeX ligatures.
%
% It inserts a potential breakpoint after the hyphen. This is to keep in sync
% with behavior in code-blocks, parsed and inline literals. For a breakpoint
% before the hyphen use \leavevmode\kern\z@- (within \makeatletter/\makeatother)
\protected\def\sphinxhyphen#1{-\kern\z@}
% The {} from texescape mark-up is kept, else -- gives en-dash in PDF bookmark
\def\sphinxhyphenforbookmarks{-}

% For curly braces inside \index macro
\def\sphinxleftcurlybrace{\{}
\def\sphinxrightcurlybrace{\}}

% Declare Unicode characters used by linux tree command to pdflatex utf8/utf8x
\def\spx@bd#1#2{%
  \leavevmode
  \begingroup
  \ifx\spx@bd@height   \@undefined\def\spx@bd@height{\baselineskip}\fi
  \ifx\spx@bd@width    \@undefined\setbox0\hbox{0}\def\spx@bd@width{\wd0 }\fi
  \ifx\spx@bd@thickness\@undefined\def\spx@bd@thickness{.6\p@}\fi
  \ifx\spx@bd@lower    \@undefined\def\spx@bd@lower{\dp\strutbox}\fi
  \lower\spx@bd@lower#1{#2}%
  \endgroup
}%
\@namedef{sphinx@u2500}% BOX DRAWINGS LIGHT HORIZONTAL
  {\spx@bd{\vbox to\spx@bd@height}
          {\vss\hrule\@height\spx@bd@thickness
                     \@width\spx@bd@width\vss}}%
\@namedef{sphinx@u2502}% BOX DRAWINGS LIGHT VERTICAL
  {\spx@bd{\hb@xt@\spx@bd@width}
          {\hss\vrule\@height\spx@bd@height
                     \@width \spx@bd@thickness\hss}}%
\@namedef{sphinx@u2514}% BOX DRAWINGS LIGHT UP AND RIGHT
  {\spx@bd{\hb@xt@\spx@bd@width}
          {\hss\raise.5\spx@bd@height
           \hb@xt@\z@{\hss\vrule\@height.5\spx@bd@height
                                \@width \spx@bd@thickness\hss}%
           \vbox to\spx@bd@height{\vss\hrule\@height\spx@bd@thickness
                                            \@width.5\spx@bd@width\vss}}}%
\@namedef{sphinx@u251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
  {\spx@bd{\hb@xt@\spx@bd@width}
          {\hss
           \hb@xt@\z@{\hss\vrule\@height\spx@bd@height
                                \@width \spx@bd@thickness\hss}%
           \vbox to\spx@bd@height{\vss\hrule\@height\spx@bd@thickness
                                            \@width.5\spx@bd@width\vss}}}%
\protected\def\sphinxunichar#1{\@nameuse{sphinx@u#1}}%

% Tell TeX about pathological hyphenation cases:
\hyphenation{Base-HTTP-Re-quest-Hand-ler}

\endinput