1%% TEXT STYLING
2%
3% change this info string if making any custom modification
4\ProvidesFile{sphinxlatexstyletext.sty}[2021/01/27 text styling]
5
6% Basically everything here consists of macros which are part of the latex
7% markup produced by the Sphinx latex writer
8
9% Some custom font markup commands.
10\protected\def\sphinxstrong#1{\textbf{#1}}
11\protected\def\sphinxcode#1{\texttt{#1}}
12\protected\def\sphinxbfcode#1{\textbf{\sphinxcode{#1}}}
13\protected\def\sphinxemail#1{\textsf{#1}}
14\protected\def\sphinxtablecontinued#1{\textsf{#1}}
15\protected\def\sphinxtitleref#1{\emph{#1}}
16\protected\def\sphinxmenuselection#1{\emph{#1}}
17\protected\def\sphinxguilabel#1{\emph{#1}}
18\protected\def\sphinxkeyboard#1{\sphinxcode{#1}}
19\protected\def\sphinxaccelerator#1{\underline{#1}}
20\protected\def\sphinxcrossref#1{\emph{#1}}
21\protected\def\sphinxtermref#1{\emph{#1}}
22% \optional is used for ``[, arg]``, i.e. desc_optional nodes.
23\long\protected\def\sphinxoptional#1{%
24  {\textnormal{\Large[}}{#1}\hspace{0.5mm}{\textnormal{\Large]}}}
25
26% additional customizable styling
27\def\sphinxstyleindexentry   #1{\texttt{#1}}
28\def\sphinxstyleindexextra   #1{ (\emph{#1})}
29\def\sphinxstyleindexpageref #1{, \pageref{#1}}
30\def\sphinxstyleindexpagemain#1{\textbf{#1}}
31\def\spxentry{\@backslashchar spxentry}% let to \sphinxstyleindexentry in index
32\def\spxextra{\@backslashchar spxextra}% let to \sphinxstyleindexextra in index
33\def\sphinxstyleindexlettergroup #1%
34    {{\Large\sffamily#1}\nopagebreak\vspace{1mm}}
35\def\sphinxstyleindexlettergroupDefault #1%
36    {{\Large\sffamily\sphinxnonalphabeticalgroupname}\nopagebreak\vspace{1mm}}
37\protected\def\sphinxstyletopictitle   #1{\textbf{#1}\par\medskip}
38\let\sphinxstylesidebartitle\sphinxstyletopictitle
39\protected\def\sphinxstyleothertitle   #1{\textbf{#1}}
40\protected\def\sphinxstylesidebarsubtitle #1{~\\\textbf{#1} \smallskip}
41% \text.. commands do not allow multiple paragraphs
42\protected\def\sphinxstyletheadfamily    {\sffamily}
43\protected\def\sphinxstyleemphasis     #1{\emph{#1}}
44\protected\def\sphinxstyleliteralemphasis#1{\emph{\sphinxcode{#1}}}
45\protected\def\sphinxstylestrong       #1{\textbf{#1}}
46\protected\def\sphinxstyleliteralstrong#1{\sphinxbfcode{#1}}
47\protected\def\sphinxstyleabbreviation #1{\textsc{#1}}
48\protected\def\sphinxstyleliteralintitle#1{\sphinxcode{#1}}
49\newcommand*\sphinxstylecodecontinued[1]{\footnotesize(#1)}%
50\newcommand*\sphinxstylecodecontinues[1]{\footnotesize(#1)}%
51% figure legend comes after caption and may contain arbitrary body elements
52\newenvironment{sphinxlegend}{\par\small}{\par}
53% reduce hyperref "Token not allowed in a PDF string" warnings on PDF builds
54\AtBeginDocument{\pdfstringdefDisableCommands{%
55% all "protected" macros possibly ending up in section titles should be here
56% TODO: examine if \sphinxhref, \sphinxurl, \sphinnolinkurl should be handled
57    \let\sphinxstyleemphasis        \@firstofone
58    \let\sphinxstyleliteralemphasis \@firstofone
59    \let\sphinxstylestrong          \@firstofone
60    \let\sphinxstyleliteralstrong   \@firstofone
61    \let\sphinxstyleabbreviation    \@firstofone
62    \let\sphinxstyleliteralintitle  \@firstofone
63    \let\sphinxupquote  \@firstofone
64    \let\sphinxstrong   \@firstofone
65    \let\sphinxcode     \@firstofone
66    \let\sphinxbfcode   \@firstofone
67    \let\sphinxemail    \@firstofone
68    \let\sphinxcrossref \@firstofone
69    \let\sphinxtermref  \@firstofone
70    \let\sphinxhyphen\sphinxhyphenforbookmarks
71}}
72
73% Special characters
74%
75% This definition prevents en-dash and em-dash TeX ligatures.
76%
77% It inserts a potential breakpoint after the hyphen. This is to keep in sync
78% with behavior in code-blocks, parsed and inline literals. For a breakpoint
79% before the hyphen use \leavevmode\kern\z@- (within \makeatletter/\makeatother)
80\protected\def\sphinxhyphen#1{-\kern\z@}
81% The {} from texescape mark-up is kept, else -- gives en-dash in PDF bookmark
82\def\sphinxhyphenforbookmarks{-}
83
84% For curly braces inside \index macro
85\def\sphinxleftcurlybrace{\{}
86\def\sphinxrightcurlybrace{\}}
87
88% Declare Unicode characters used by linux tree command to pdflatex utf8/utf8x
89\def\spx@bd#1#2{%
90  \leavevmode
91  \begingroup
92  \ifx\spx@bd@height   \@undefined\def\spx@bd@height{\baselineskip}\fi
93  \ifx\spx@bd@width    \@undefined\setbox0\hbox{0}\def\spx@bd@width{\wd0 }\fi
94  \ifx\spx@bd@thickness\@undefined\def\spx@bd@thickness{.6\p@}\fi
95  \ifx\spx@bd@lower    \@undefined\def\spx@bd@lower{\dp\strutbox}\fi
96  \lower\spx@bd@lower#1{#2}%
97  \endgroup
98}%
99\@namedef{sphinx@u2500}% BOX DRAWINGS LIGHT HORIZONTAL
100  {\spx@bd{\vbox to\spx@bd@height}
101          {\vss\hrule\@height\spx@bd@thickness
102                     \@width\spx@bd@width\vss}}%
103\@namedef{sphinx@u2502}% BOX DRAWINGS LIGHT VERTICAL
104  {\spx@bd{\hb@xt@\spx@bd@width}
105          {\hss\vrule\@height\spx@bd@height
106                     \@width \spx@bd@thickness\hss}}%
107\@namedef{sphinx@u2514}% BOX DRAWINGS LIGHT UP AND RIGHT
108  {\spx@bd{\hb@xt@\spx@bd@width}
109          {\hss\raise.5\spx@bd@height
110           \hb@xt@\z@{\hss\vrule\@height.5\spx@bd@height
111                                \@width \spx@bd@thickness\hss}%
112           \vbox to\spx@bd@height{\vss\hrule\@height\spx@bd@thickness
113                                            \@width.5\spx@bd@width\vss}}}%
114\@namedef{sphinx@u251C}% BOX DRAWINGS LIGHT VERTICAL AND RIGHT
115  {\spx@bd{\hb@xt@\spx@bd@width}
116          {\hss
117           \hb@xt@\z@{\hss\vrule\@height\spx@bd@height
118                                \@width \spx@bd@thickness\hss}%
119           \vbox to\spx@bd@height{\vss\hrule\@height\spx@bd@thickness
120                                            \@width.5\spx@bd@width\vss}}}%
121\protected\def\sphinxunichar#1{\@nameuse{sphinx@u#1}}%
122
123% Tell TeX about pathological hyphenation cases:
124\hyphenation{Base-HTTP-Re-quest-Hand-ler}
125
126\endinput
127