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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
3

T'íc›Cã@sNdZddlZddlZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZddlmZmZddlmZmZmZddlmZmZdd	lmZdd
lmZddlmZddl m!Z!dd
l"m#Z#m$Z$m%Z%ddl&m'Z'm(Z(m)Z)ddl*m+Z+ddl,m-Z-m.Z.ddl/m0Z0ddl1m2Z2yddl3m4Z4Wn"e5k
rFddl6m4Z4YnXerfddl7m8Z8ddl9m:Z:e'j;e<ƒZ=dZ>dddddddgZ?edd„d d!d"d#d$d%œƒZ@d&ZAd'ZBejCd(ƒZDGd)d*„d*ejEƒZFGd+d,„d,e!ƒZGGd-d.„d.ejHƒZIGd/d0„d0ƒZJGd1d2„d2ƒZKeLeLd3œd4d5„ZMd=eLeNeLd7œd8d9„ZOGd:d;„d;e+ƒZPdd<lQmRZRmSZSmTZTdS)>z~Custom docutils writer for LaTeX.

Much of this code is adapted from Dave Kuhlman's "docpy" writer from his
docutils sandbox.
éN)Údefaultdict)Úpath)Ú
TYPE_CHECKINGÚAnyÚDictÚIterableÚListÚSetÚTupleÚcast)ÚnodesÚwriters)ÚElementÚNodeÚText)ÚaddnodesÚhighlighting)ÚRemovedInSphinx50Warning)Ú
IndexEntry)ÚStandardDomain)ÚSphinxError)Ú_Ú__Úadmonitionlabels)ÚloggingÚ
split_intoÚ	texescape)ÚSphinxTranslator)Úclean_astextÚ
get_prev_node)Ú
LaTeXRenderer)Útex_replace_map)ÚtoRoman)ÚLaTeXBuilder)ÚThemeéÚpartÚchapterÚsectionZ
subsectionZ
subsubsectionÚ	paragraphZsubparagraphcCsdS)Nz\arabic©r*r*r*ú6/tmp/pip-build-gk9425m9/sphinx/sphinx/writers/latex.pyÚ<lambda>,sr,z\arabicz\alphz\Alphz\romanz\Roman)ÚarabicZ
loweralphaZ
upperalphaZ
lowerromanZ
upperromanÚ
z

z^(.*\S)\s+\(([^()]*)\)\s*$c@seZdZdZdS)Úcollected_footnotez5Footnotes that are collected are assigned this class.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r*r*r*r+r/:sr/c@seZdZdZdS)ÚUnsupportedErrorzMarkup is unsupported in LaTeXN)r0r1r2Úcategoryr*r*r*r+r4>sr4csxeZdZUdZddddgddifddgdd	ifd
dgddifffZiZedZd
ddœ‡fdd„Zddœdd„Z	‡Z
S)ÚLaTeXWriterÚsphinxlatexzLaTeX writer optionsÚz
Document namez	--docnameÚdefaultzDocument classz
--docclassÚmanualZAuthorz--authorNr#)ÚbuilderÚreturncstƒjƒ||_d|_dS)N)ÚsuperÚ__init__r;Útheme)Úselfr;)Ú	__class__r*r+r>Os
zLaTeXWriter.__init__)r<cCsry|jj|j|j|jƒ}Wn6tk
rPtjdtdd|jj|j|jƒ}YnX|jj|ƒt	t
|ƒjƒ|_dS)Nz0LaTeXTranslator now takes 3rd argument; "theme".é)Ú
stacklevel)
r;Zcreate_translatorÚdocumentr?Ú	TypeErrorÚwarningsÚwarnrZ	walkaboutrÚLaTeXTranslatorÚastextÚoutput)r@Úvisitorr*r*r+Ú	translateTs
zLaTeXWriter.translate)r7)r0r1r2Ú	supportedZ
settings_specZsettings_defaultsrrJr>rLÚ
__classcell__r*r*)rAr+r6Bs
r6c@speZdZdZeddœdd„Zedœdd„Zedœd	d
„Z	edœdd„Z
eedd
œdd„Zdeeddœdd„Z
dS)ÚTablezA table dataN)Únoder<cCsxg|_g|_|jddƒ|_|jdgƒ|_d|_d|_g|_d|_d|_	d|_
d|_g|_d|_
d|_ttƒ|_d|_dS)NÚalignr9ÚclassesrF)ÚheaderÚbodyÚgetrQrRÚcolcountÚcolspecÚ	colwidthsÚhas_problematicÚhas_oldproblematicÚhas_verbatimÚcaptionÚstubsÚcolÚrowrÚintÚcellsÚcell_id)r@rPr*r*r+r>es 
zTable.__init__)r<cCs|jdkpd|jkS)z5True if and only if table uses longtable environment.éÚ	longtable)r_rR)r@r*r*r+Úis_longtable{szTable.is_longtablecCsB|jƒrdS|jrdS|jr dS|js6|jr:d|jkr:dSdSdS)z›Returns the LaTeX environment name for the table.

        The class currently supports:

        * longtable
        * tabular
        * tabulary
        rdZtabularÚtabularyzcolwidths-givenN)rer[rWrYrXrR)r@r*r*r+Úget_table_types	zTable.get_table_typecs¼|jr|jS|jrLd|jkrLt|jƒ‰‡fdd„|jDƒ}ddj|ƒtS|jrfd|j|jftS|jƒdkrˆdd	|jd
tS|j	r¢d|j|jftSdd|jd
tSdS)
zßReturns a column spec of table.

        This is what LaTeX calls the 'preamble argument' of the used table environment.

        .. note:: the ``\X`` and ``T`` column type specifiers are defined in ``sphinx.sty``.
        zcolwidths-givencsg|]}d|ˆf‘qS)z
\X{%d}{%d}r*)Ú.0Úwidth)Útotalr*r+ú
<listcomp>žsz%Table.get_colspec.<locals>.<listcomp>z{|%s|}ú|z{|*{%d}{\X{1}{%d}|}}rfz{|zT|Ú}zl|N)
rWrXrRÚsumÚjoinÚCRrYrVrgrZ)r@Zcolspecsr*)rjr+Úget_colspec“s
zTable.get_colspec)Úheightrir<cCst|jd7_x`t|ƒD]T}xNt|ƒD]B}|j|j||j|fdksLt‚|j|j|j||j|f<q&WqWdS)zsAdds a new cell to a table.

        It will be located at current position: (``self.row``, ``self.col``).
        érN)rbÚrangerar_r^ÚAssertionError)r@rrrir^r_r*r*r+Úadd_cellªs
"zTable.add_cellÚ	TableCell)r_r^r<cCsBy(|dkr|j}|dkr|j}t|||ƒStk
r<dSXdS)zöReturns a cell object (i.e. rectangular area) containing given position.

        If no option arguments: ``row`` or ``col`` are given, the current position;
        ``self.row`` and ``self.col`` are used to get a cell object by default.
        N)r_r^rwÚ
IndexError)r@r_r^r*r*r+Úcellµsz
Table.cell)NN)r0r1r2r3rr>ÚboolreÚstrrgrqr`rvryr*r*r*r+rObsrOc@sHeZdZdZeeeddœdd„Zeedœdd„ƒZeedœd	d
„ƒZ	dS)rwzData of a cell in a table.N)Útabler_r^r<cCsœ|j||fdkrt‚||_|j||f|_||_||_x.|j|jd|jf|jkrf|jd8_q:Wx.|j|j|jdf|jkr–|jd8_qjWdS)Nrrs)rarxr|rbr_r^)r@r|r_r^r*r*r+r>ÈszTableCell.__init__)r<cCs4d}x*|jj|j|j|f|jkr.|d7}qW|S)zReturns the cell width.rrs)r|rar_r^rb)r@rir*r*r+ri×s zTableCell.widthcCs4d}x*|jj|j||jf|jkr.|d7}qW|S)zReturns the cell height.rrs)r|rar_r^rb)r@rrr*r*r+rrßs zTableCell.height)
r0r1r2r3rOr`r>Úpropertyrirrr*r*r*r+rwÅsrw)Útextr<cCstjdd|ƒS)z#Adjust spacing after abbreviations.z
\.(?=\s|$)z.\@)ÚreÚsub)r~r*r*r+Úescape_abbrèsréd)Ú	width_strÚscaler<cCsÔtjd|ƒ}|st‚|}|jƒdd…\}}|dkrzt|ƒ|dkrNd|}qÐ|dkr`d	|}qÐ|d
krÐdt|ƒd}nVt|ƒ|d}|dkrœd
|}n4|dkr®d|}n"|d
krÄd|d}nd||f}|S)z4Convert `width_str` with rst length to LaTeX length.z^(\d*\.?\d*)\s*(\S*)$NrBr‚r8Úpxz%s\sphinxpxdimenÚptz%sbpú%z%.3f\linewidthgY@z%.5f\sphinxpxdimenz%.5fbpz%.5f\linewidthz%.5f%s)r8r…)r8r…)rÚmatchÚ
ValueErrorÚgroupsÚfloat)rƒr„rˆÚresÚamountÚunitZamount_floatr*r*r+Úrstdim_to_latexdimís,



rcs†eZdZUdZddZdZd×ZdØejddddœ‡fd	d
„
Z	e
eddœdd
„Ze
edœdd„Z
eedœdd„Zedœdd„ZdÙeeeedœdd„ZdÚeeedœdd„Zeedœdd„Zeedœd d!„Zeed"œd#d$„Zeedœd%d&„Zeeed'œd(d)„Zedœd*d+„Zeeed,œd-d.„Zeedœd/d0„ƒZedd1œd2d3„Zedd1œd4d5„Z edd1œd6d7„Z!edd1œd8d9„Z"edd1œd:d;„Z#edd1œd<d=„Z$edd1œd>d?„Z%edd1œd@dA„Z&edd1œdBdC„Z'edd1œdDdE„Z(e'Z)e(Z*edd1œdFdG„Z+edd1œdHdI„Z,edd1œdJdK„Z-edd1œdLdM„Z.edd1œdNdO„Z/edd1œdPdQ„Z0edd1œdRdS„Z1edd1œdTdU„Z2edd1œdVdW„Z3edd1œdXdY„Z4edd1œdZd[„Z5edd1œd\d]„Z6edd1œd^d_„Z7edd1œd`da„Z8edd1œdbdc„Z9edd1œddde„Z:edd1œdfdg„Z;edd1œdhdi„Z<edd1œdjdk„Z=edd1œdldm„Z>edd1œdndo„Z?edd1œdpdq„Z@edd1œdrds„ZAedd1œdtdu„ZBedd1œdvdw„ZCedd1œdxdy„ZDedd1œdzd{„ZEedd1œd|d}„ZFedd1œd~d„ZGedd1œd€d„ZHedd1œd‚dƒ„ZIedd1œd„d…„ZJedd1œd†d‡„ZKedd1œdˆd‰„ZLedd1œdŠd‹„ZMedd1œdŒd„ZNedd1œdŽd„ZOedd1œdd‘„ZPedd1œd’d“„ZQedd1œd”d•„ZRedd1œd–d—„ZSedd1œd˜d™„ZTedd1œdšd›„ZUedd1œdœd„ZVedd1œdždŸ„ZWedd1œd d¡„ZXedd1œd¢d£„ZYedd1œd¤d¥„ZZedd1œd¦d§„Z[edd1œd¨d©„Z\edd1œdªd«„Z]edd1œd¬d­„Z^edd1œd®d¯„Z_edd1œd°d±„Z`edd1œd²d³„Zaedd1œd´dµ„Zbedd1œd¶d·„Zcedd1œd¸d¹„Zdedd1œdºd»„Zeedd1œd¼d½„Zfedd1œd¾d¿„Zgedd1œdÀdÁ„Zhedd1œdÂdÄZiedd1œdÄdńZjedd1œdÆdDŽZkedd1œdÈdɄZledd1œdÊd˄Zmedd1œdÌd̈́Znedd1œdÎdτZoedd1œdÐdфZpedd1œdÒdӄZqedd1œdÔdՄZredd1œdÖdׄZsedd1œdØdلZtedd1œdÚdۄZuedd1œdÜd݄Zvedd1œdÞd߄Zwedd1œdàdá„Zxedd1œdâdã„Zyedd1œdädå„Zzedd1œdædç„Z{edd1œdèdé„Z|edd1œdêdë„Z}etZ~euZexZ€eyZedd1œdìdí„Z‚edd1œdîdï„Zƒedd1œdðdñ„Z„edd1œdòdó„Z…edd1œdôdõ„Z†edd1œdöd÷„Z‡edd1œdødù„Zˆedd1œdúdû„Z‰dÛeeŠedýœdþdÿ„Z‹eed1œdd„ZŒedd1œdd„Zedd1œdd„ZŽedd1œdd„Zedd1œdd	„Zedd1œd
d„Z‘edd1œdd
„Z’edd1œdd„Z“edd1œdd„Z”edd1œdd„Z•edd1œdd„Z–edd1œdd„Z—edd1œdd„Z˜e—Z™e˜Zše—Z›e˜Zœe—Ze˜Zže—ZŸe˜Z e—Z¡e˜Z¢e—Z£e˜Z¤e—Z¥e˜Z¦e—Z§e˜Z¨e—Z©e˜Zªedd1œdd„Z«edd1œdd„Z¬edd1œdd„Z­edd1œd d!„Z®edd1œd"d#„Z¯edd1œd$d%„Z°edd1œd&d'„Z±edd1œd(d)„Z²edd1œd*d+„Z³edd1œd,d-„Z´edd1œd.d/„Zµedd1œd0d1„Z¶edd1œd2d3„Z·edd1œd4d5„Z¸edd1œd6d7„Z¹edd1œd8d9„Zºedd1œd:d;„Z»edd1œd<d=„Z¼edd1œd>d?„Z½edd1œd@dA„Z¾edd1œdBdC„Z¿edd1œdDdE„ZÀedd1œdFdG„ZÁedd1œdHdI„ZÂedd1œdJdK„ZÃedd1œdLdM„ZÄedd1œdNdO„ZÅedd1œdPdQ„ZÆedd1œdRdS„ZÇedd1œdTdU„ZÈedd1œdVdW„ZÉedd1œdXdY„ZÊedd1œdZd[„ZËedd1œd\d]„ZÌedd1œd^d_„ZÍedd1œd`da„ZÎedd1œdbdc„ZÏedd1œddde„ZÐedd1œdfdg„ZÑedd1œdhdi„ZÒedd1œdjdk„ZÓedd1œdldm„ZÔedd1œdndo„ZÕedd1œdpdq„ZÖedd1œdrds„Z×edd1œdtdu„ZØe×ZÙeØZÚedd1œdvdw„ZÛedd1œdxdy„ZÜedd1œdzd{„ZÝedd1œd|d}„ZÞedd1œd~d„Zßedd1œd€d„Zàedd1œd‚dƒ„Záedd1œd„d…„Zâedd1œd†d‡„Zãedd1œdˆd‰„Zäedd1œdŠd‹„Zåedd1œdŒd„Zæedd1œdŽd„Zçedd1œdd‘„Zèedd1œd’d“„Zéedd1œd”d•„Zêedd1œd–d—„Zëedd1œd˜d™„Zìedd1œdšd›„Zíedd1œdœd„Zîedd1œdždŸ„Zïedd1œd d¡„Zðedd1œd¢d£„Zñedd1œd¤d¥„Zòedd1œd¦d§„Zóedd1œd¨d©„Zôedd1œdªd«„Zõedd1œd¬d­„Zöedd1œd®d¯„Z÷edd1œd°d±„Zøedd1œd²d³„Zùedd1œd´dµ„Zúedd1œd¶d·„Zûedd1œd¸d¹„Züedd1œdºd»„Zýedd1œd¼d½„Zþeed¾œd¿dÀ„Zÿeed¾œdÁd„Zedd1œdÐdĄZedd1œdŐdƄZedd1œdǐdȄZedd1œdɐdʄZedd1œdːd̄Zedd1œd͐d΄Zedd1œdϐdЄZedd1œdѐd҄Z	edd1œdӐdԄZ
edd1œdՐdքZ‡ZS(ÜrHNr#rBFÚhowtor:r$)rDr;r?r<c	sŽtƒj||ƒg|_||_|dkr2tjdtddd|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_g}|jjjƒ|_tdd…|_|jrÔ|jj}|jjdkrÒ|jjdƒnl|j|j jƒ|jd	<|j!d
ƒdkr&|j"j#j!ddƒ}|dd
krn|jjdƒn|j"j#j!ddƒ}||jd
<d|_$|j"j%r˜y|jj&|j"j%ƒ|_$Wn0t'k
r–t(j)t*dƒ|j"j%|fƒYnX|j"j+r0|j"j,|_,|j,dkr&t-|jƒt-tƒkrê|j$dkrê|j,|j$7_,n|j,|j$d7_,t.|j,t-tƒdƒ|_,|j/d|j,ƒn
|j/dƒ|j"j+rN|j"j0rN|j/dƒ|j"j1d.kr„d|j"j2kr„dt3dt3d|jd<|jj4|_4|j"j1rº|j4j5ƒrºt(j)t*dƒ|j"j1ƒ|j6}|j7j!dƒrR|j7j!ddƒ|j$d}t-|jƒt-tƒkr|j$dkr|d7}|t-tƒdkr:t(j)t*dƒƒt-tƒd}d||jd<t8||ƒ}|j"j+rz|j"j,dkrzt8||j,dƒ}||j6kr”d||jd <|j!d!ƒ}|r¶|j9d"|ƒ|jd!<|jd#rÖ|j/d$|jd#ƒ|rðd%d&j:|ƒ|jd'<|jd(rd)|jd(|jd(<|jd*r8|jd+d&|jd*7<t;j<d,|j"j=|j"j>d-|_?g|_g|_@g|_Ad|_Bg|_Cd|_Dg|_Eg|_FtGƒ|_HdS)/Nz0LaTeXTranslator now takes 3rd argument; "theme".rB)rCrrsFr(r'ZwrapperclassÚdocclassrÚarticleÚjr:Úreportz+unknown %r toplevel_sectioning for class %rznumfigreset=%sZ
nonumfigresetZ
mathnumfigÚenÚjaZfncychapz\usepackage[Sonny]{fncychap}z&\ChNameVar{\Large\normalfont\sffamily}z'\ChTitleVar{\Large\normalfont\sffamily}z%no Babel option known for language %rÚtocdepthiçztoo large :maxdepth:, ignored.z\setcounter{tocdepth}{%d}z\setcounter{secnumdepth}{%d}ÚsecnumdepthÚcontentsnamez
\contentsnameZmaxlistdepthzmaxlistdepth=%sz[,%s]ú,ÚsphinxpkgoptionsZsphinxsetupz\sphinxsetup{%s}ZextraclassoptionsZclassoptionsÚlatex)Úlatex_engine>Nr•r–)Ir=r>rTr?rFrGrÚin_titleÚin_production_listÚin_footnoteÚ
in_captionÚin_termÚneeds_linetrimmingÚin_minipageÚno_latex_floatsÚfirst_documentÚthis_is_the_titleÚliteral_whitespaceÚin_parsed_literalÚcompact_listÚfirst_paramÚin_desc_signaturer;ÚcontextÚcopyÚelementsÚLATEXSECTIONNAMESÚsectionnamesr‘Ztoplevel_sectioningÚremoveÚformat_docclassÚsettingsrUÚconfigZlatex_docclassÚtop_sectionlevelZlatex_toplevel_sectioningÚindexr‰ÚloggerÚwarningrZnumfigZnumfig_secnum_depthÚlenÚminÚappendZmath_numfigÚlanguageZlatex_elementsrpÚbabelZis_supported_languager˜rDÚmaxÚbabel_renewcommandrorZPygmentsBridgeZpygments_stylerÚhighlighterZ	descstackÚtablesÚnext_table_colspecÚ	bodystackZfootnote_restrictedZpending_footnotesÚcurfilestackÚsetÚ
handled_abbrs)	r@rDr;r?r›r‘Zminsecnumdepthr—r™)rAr*r+r>sÐ












zLaTeXTranslator.__init__)Únewbodyr<cCs|jj|jƒ||_dS)N)rÄr¼rT)r@rÈr*r*r+Úpushbody°szLaTeXTranslator.pushbody)r<cCs|j}|jjƒ|_|S)N)rTrÄÚpop)r@rTr*r*r+Úpopbody´szLaTeXTranslator.popbody)r‘r<cCs&tjdtdd||jkr"d|}|S)z*Prepends prefix to sphinx document classesz,LaTeXWriter.format_docclass() is deprecated.rB)rCÚsphinx)rFrGrÚ
docclasses)r@r‘r*r*r+r³¹s


zLaTeXTranslator.format_docclasscCs,|jjdj|jƒ|jƒdœƒ|jd|jƒS)Nr8)rTÚindiceszlatex.tex_t)r¯ÚupdaterorTÚgenerate_indicesÚrender)r@r*r*r+rIÁs
zLaTeXTranslator.astextT)ÚidÚwithdocÚanchorr<cCs0|r|jdd|}|rdndd|j|ƒS)Nrsú:z\phantomsectionr8z
\label{%s}éÿÿÿÿ)rÅÚidescape)r@rÒrÓrÔr*r*r+ÚhypertargetÈszLaTeXTranslator.hypertarget)rPrÔr<cs0dj‡fdd„|dDƒƒ}|r(d|S|SdS)Nr8c3s|]}ˆj|ddVqdS)F)rÔN)rØ)rhÚnode_id)r@r*r+ú	<genexpr>Îsz1LaTeXTranslator.hypertarget_to.<locals>.<genexpr>Úidsz\phantomsection)ro)r@rPrÔÚlabelsr*)r@r+Úhypertarget_toÍszLaTeXTranslator.hypertarget_to)rÒr<cCsd|j|ƒS)Nz{\hyperref[%s]{)r×)r@rÒr*r*r+Ú	hyperlinkÔszLaTeXTranslator.hyperlinkcCsd|j|ƒS)Nz\autopageref*{%s})r×)r@rÒr*r*r+Úhyperpageref×szLaTeXTranslator.hyperpageref)Úsr<cCstj||jjƒS)N)rÚescaperµr)r@ràr*r*r+ráÚszLaTeXTranslator.escapecCs(dt|ƒjtƒjddƒjdƒjddƒS)Nz\detokenize{%s}ÚasciiÚbackslashreplaceú\r)r{rLr!ÚencodeÚdecodeÚreplace)r@rÒr*r*r+r×ÝszLaTeXTranslator.idescape)ÚcommandÚ
definitionr<cCs:|jdrd|jjƒ}d}nd}d}d||||ftS)NZmultilingualz\addto\captions%s{rmr8z%s\renewcommand{%s}{%s}%s)r¯r¾Zget_languagerp)r@rèréÚprefixÚsuffixr*r*r+rÀâs
z"LaTeXTranslator.babel_renewcommandcsÈtttttftddœ‡‡fdd„}g‰ˆjj}|r¾x„ˆjjj	j
ƒD]r}xl|jD]b}d|j|jf}t
|tƒr|||kr|qT||ƒjˆjjƒ\}}|s˜qTˆjd|jtƒ|||ƒqTWqHWdjˆƒS)N)ÚcontentÚ	collapsedr<csêˆjdtƒˆjdtƒxºt|ƒD]®\}\}}|dkrHˆjdtƒˆjdˆj|ƒtƒxr|D]j}|dstqfˆjdˆj|dƒƒ|dr¬ˆjd	ˆj|dƒƒˆjd
|dˆj|dƒftƒqfWq&WˆjdtƒdS)
Nz\begin{sphinxtheindex}z*\let\bigletter\sphinxstyleindexlettergrouprz\indexspacez\bigletter{%s}éz%\item\relax\sphinxstyleindexentry{%s}éz\sphinxstyleindexextra{%s}z\sphinxstyleindexpageref{%s:%s}rBz\end{sphinxtheindex})r¼rpÚ	enumeraterárår×)rìríÚiÚletterÚentriesÚentry)Úretr@r*r+Úgenerateís 
&z2LaTeXTranslator.generate_indices.<locals>.generatez%s-%sz\renewcommand{\indexname}{%s}r8)rr
r{rrzrµZlatex_domain_indicesr;ÚenvÚdomainsÚvaluesrÎÚnameÚ
isinstanceÚliströZdocnamesr¼Ú	localnamerpro)r@röZindices_configÚdomainZindexclsZ	indexnamerìrír*)rõr@r+rÐìs"(
z LaTeXTranslator.generate_indices)Ú
template_nameÚ	variablesr<cCsTt|jjd}x8|jjD],}tj|jj||ƒ}tj|ƒr|j	||ƒSqW|j	||ƒS)N)r)
r rµrZtemplates_pathrror;ZconfdirÚexistsrÑ)r@rÿrZrendererZtemplate_dirÚtemplater*r*r+rÑs
zLaTeXTranslator.rendercCs|jr|jdSdSdS)zGet current table.rsNrÖ)rÂ)r@r*r*r+r|s
zLaTeXTranslator.table)rPr<cCst|jj|jddƒƒ|jdkr&d|_n$|jdkrJ|jjtdtƒd|_d|krd|jj|jdƒƒ|jd|_dS)NÚdocnamer8rsrz	\appendixz:docrÖ)	rÅr¼rUr¦rTrprØr¶Úsectionlevel)r@rPr*r*r+Úvisit_document%s

zLaTeXTranslator.visit_documentcCsdS)Nr*)r@rPr*r*r+Údepart_document3szLaTeXTranslator.depart_documentcCs(|jj|dƒ|jjtdtƒdS)Nrz\sphinxstepscope)rÅr¼rTrp)r@rPr*r*r+Úvisit_start_of_file6sz#LaTeXTranslator.visit_start_of_filecCs|jjƒdS)N)rÅrÊ)r@rPr*r*r+Údepart_start_of_file:sz$LaTeXTranslator.depart_start_of_filecCs$|js|jd7_|jjtƒdS)Nrs)r§rrTr¼Ú	BLANKLINE)r@rPr*r*r+Ú
visit_section=szLaTeXTranslator.visit_sectioncCst|jd|jdƒ|_dS)Nrs)r¿rr¶)r@rPr*r*r+Údepart_sectionBs
zLaTeXTranslator.depart_sectioncCs|jjdƒdS)Nz{\color{red}\bfseries{})rTr¼)r@rPr*r*r+Úvisit_problematicFsz!LaTeXTranslator.visit_problematiccCs|jjdƒdS)Nrm)rTr¼)r@rPr*r*r+Údepart_problematicIsz"LaTeXTranslator.depart_problematiccCsd|_|jjtdtƒdS)Nrsz\begin{sphinxShadowBox})r¤rTr¼rp)r@rPr*r*r+Úvisit_topicLszLaTeXTranslator.visit_topiccCsd|_|jjdtƒdS)Nrz\end{sphinxShadowBox})r¤rTr¼rp)r@rPr*r*r+Údepart_topicPszLaTeXTranslator.depart_topiccCsdS)Nr*)r@rPr*r*r+Úvisit_glossaryVszLaTeXTranslator.visit_glossarycCsdS)Nr*)r@rPr*r*r+Údepart_glossaryYszLaTeXTranslator.depart_glossarycCs&|jjtƒ|jjdtƒd|_dS)Nz\begin{productionlist}rs)rTr¼r	rprŸ)r@rPr*r*r+Úvisit_productionlist\sz$LaTeXTranslator.visit_productionlistcCs|jjdtƒd|_dS)Nz\end{productionlist}r)rTr¼r	rŸ)r@rPr*r*r+Údepart_productionlistasz%LaTeXTranslator.depart_productionlistcCsN|dr>|d}|jj|jd|ƒƒ|jjd|j|ƒƒn|jjdƒdS)NZ	tokennamezgrammar-token-z\production{%s}{z\productioncont{)rTr¼rØrå)r@rPÚtnr*r*r+Úvisit_productiones
z LaTeXTranslator.visit_productioncCs|jjdtƒdS)Nrm)rTr¼rp)r@rPr*r*r+Údepart_productionmsz!LaTeXTranslator.depart_productioncCs|jj|jdƒdS)NZ
transition)rTr¼r¯)r@rPr*r*r+Úvisit_transitionpsz LaTeXTranslator.visit_transitioncCsdS)Nr*)r@rPr*r*r+Údepart_transitionssz!LaTeXTranslator.depart_transitioncCs|j}t|tjƒrtj‚nàt|tjƒr0|jrt|j	ƒdkrdt|j	dtj
ƒrdtjt
dƒ|d|jds‚|j|jƒƒ|jd<d|_tj‚nžd}t|jtjƒƒrÀd|jdjt|ƒjƒƒƒ}y |jjd	|j|j|fƒWn0tk
r|jjd	|jd|fƒYnX|jjd
t|j|jƒƒnÌt|tjƒr\|jjdƒ|jjd
tƒn t|tj ƒrˆ|jjdƒ|jjd
tƒntt|tj!ƒr´|jjd
ƒ|jjd
tƒnHt|tj"ƒrÎ|j#gƒn.tjt
dƒ|d|jjdƒ|jjd
tƒd|_$dS)Nrsrz(document title is not a single Text node)ÚlocationÚtitler8z[%s]ú z\%s%s{rmz\sphinxstyletopictitle{z\sphinxstylesidebartitle{Ú{zJencountered title node not in section, topic, table, admonition or sidebarz\sphinxstyleothertitle{rÖ)%ÚparentrûrÚseealsorÚSkipNoder(r§rºÚchildrenrr¸r¹rr¯rárIÚanyÚfindallÚimagerorÚsplitrTr¼r±rrxr­rprÝZtopicÚsidebarZ
Admonitionr|rÉrž)r@rPrÚshortr*r*r+Úvisit_titlevsJ



  
zLaTeXTranslator.visit_titlecCs8d|_t|jtjƒr"|jƒ|j_n|jj|j	j
ƒƒdS)Nr)ržrûrrr|rËr\rTr¼r­rÊ)r@rPr*r*r+Údepart_title¦szLaTeXTranslator.depart_titlecCs<t|jtjƒr,|jjdƒ|jjdtƒn|jjdƒdS)Nz\sphinxstylesidebarsubtitle{rmr8)rûrrr%rTr¼r­rp)r@rPr*r*r+Úvisit_subtitle­szLaTeXTranslator.visit_subtitlecCs|jj|jjƒƒdS)N)rTr¼r­rÊ)r@rPr*r*r+Údepart_subtitle´szLaTeXTranslator.depart_subtitlecCsX|jjdkr*|jjtƒ|jjdtƒn|jjtƒ|jjdtƒ|jrTd|j_dS)NÚfootnotez&\begin{savenotes}\begin{fulllineitems}z\begin{fulllineitems}T)rµÚlatex_show_urlsrTr¼r	rpr|rY)r@rPr*r*r+Ú
visit_desc¾szLaTeXTranslator.visit_desccCsV|jr|jjtdƒd|_|jjdkr>|jjtdtƒn|jjtdtƒdS)Nz\pysigstopsignaturesFr+z"\end{fulllineitems}\end{savenotes}z\end{fulllineitems})r¬rTr¼rprµr,r	)r@rPr*r*r+Údepart_descÈszLaTeXTranslator.depart_desccCs@x:|D]"}t|tjƒr|jjtdƒPqW|jjtdƒdS)Nz\pysiglinewithargsret{z\pysigline{)rûrZdesc_parameterlistrTr¼rp)r@rPÚchildr*r*r+Ú_visit_signature_lineÑs

z%LaTeXTranslator._visit_signature_linecCs|jjdƒdS)Nrm)rTr¼)r@rPr*r*r+Ú_depart_signature_lineÙsz&LaTeXTranslator._depart_signature_linecCs€|jddkr*|dr*|j|ddƒ}nd}|jj|ƒ|jsVd|_|jjtdƒ|jdƒsl|j|ƒn|jjtd	ƒdS)
NZobjtypeZdescriberÛrr8Tz\pysigstartsignaturesÚis_multilinez\pysigstartmultiline)rrØrTr¼r¬rprUr0)r@rPZhyperr*r*r+Úvisit_desc_signatureÜs
z$LaTeXTranslator.visit_desc_signaturecCs*|jdƒs|j|ƒn|jjtdƒdS)Nr2z\pysigstopmultiline)rUr1rTr¼rp)r@rPr*r*r+Údepart_desc_signatureês
z%LaTeXTranslator.depart_desc_signaturecCs|j|ƒdS)N)r0)r@rPr*r*r+Úvisit_desc_signature_lineðsz)LaTeXTranslator.visit_desc_signature_linecCs|j|ƒdS)N)r1)r@rPr*r*r+Údepart_desc_signature_lineósz*LaTeXTranslator.depart_desc_signature_linecCs$|js
t‚|jjtdƒd|_dS)Nz\pysigstopsignaturesF)r¬rurTr¼rp)r@rPr*r*r+Úvisit_desc_contentös
z"LaTeXTranslator.visit_desc_contentcCsdS)Nr*)r@rPr*r*r+Údepart_desc_contentûsz#LaTeXTranslator.depart_desc_contentcCs|jjdƒdS)Nz\sphinxcode{\sphinxupquote{)rTr¼)r@rPr*r*r+Úvisit_desc_inlineþsz!LaTeXTranslator.visit_desc_inlinecCs|jjdƒdS)Nz}})rTr¼)r@rPr*r*r+Údepart_desc_inlinesz"LaTeXTranslator.depart_desc_inlinecCs|jjdƒ|jd7_dS)Nz\sphinxbfcode{\sphinxupquote{rs)rTr¼r¨)r@rPr*r*r+Úvisit_desc_nameszLaTeXTranslator.visit_desc_namecCs|jjdƒ|jd8_dS)Nz}}rs)rTr¼r¨)r@rPr*r*r+Údepart_desc_namesz LaTeXTranslator.depart_desc_namecCs|jjdƒ|jd7_dS)Nz\sphinxcode{\sphinxupquote{rs)rTr¼r¨)r@rPr*r*r+Úvisit_desc_addnamesz"LaTeXTranslator.visit_desc_addnamecCs|jjdƒ|jd8_dS)Nz}}rs)rTr¼r¨)r@rPr*r*r+Údepart_desc_addnamesz#LaTeXTranslator.depart_desc_addnamecCsdS)Nr*)r@rPr*r*r+Úvisit_desc_typeszLaTeXTranslator.visit_desc_typecCsdS)Nr*)r@rPr*r*r+Údepart_desc_typesz LaTeXTranslator.depart_desc_typecCs|jjdƒdS)Nz{ $\rightarrow$ )rTr¼)r@rPr*r*r+Úvisit_desc_returnssz"LaTeXTranslator.visit_desc_returnscCs|jjdƒdS)Nrm)rTr¼)r@rPr*r*r+Údepart_desc_returns sz#LaTeXTranslator.depart_desc_returnscCs|jjdƒd|_dS)Nz}{rs)rTr¼r«)r@rPr*r*r+Úvisit_desc_parameterlist#sz(LaTeXTranslator.visit_desc_parameterlistcCs|jjdƒdS)Nz}{)rTr¼)r@rPr*r*r+Údepart_desc_parameterlist(sz)LaTeXTranslator.depart_desc_parameterlistcCs4|js|jjdƒnd|_|jdƒs0|jjdƒdS)Nz, rÚnoemphz\emph{)r«rTr¼Úhasattr)r@rPr*r*r+Úvisit_desc_parameter,s

z$LaTeXTranslator.visit_desc_parametercCs|jdƒs|jjdƒdS)NrErm)rFrTr¼)r@rPr*r*r+Údepart_desc_parameter4s
z%LaTeXTranslator.depart_desc_parametercCs|jjdƒdS)Nz\sphinxoptional{)rTr¼)r@rPr*r*r+Úvisit_desc_optional8sz#LaTeXTranslator.visit_desc_optionalcCs|jjdƒdS)Nrm)rTr¼)r@rPr*r*r+Údepart_desc_optional;sz$LaTeXTranslator.depart_desc_optionalcCs|jjdƒdS)Nz\sphinxbfcode{\sphinxupquote{)rTr¼)r@rPr*r*r+Úvisit_desc_annotation>sz%LaTeXTranslator.visit_desc_annotationcCs|jjdƒdS)Nz}})rTr¼)r@rPr*r*r+Údepart_desc_annotationAsz&LaTeXTranslator.depart_desc_annotationcCs8|jjtƒ|jjdtdtƒ|jjdtƒdS)Nz\sphinxstrong{%s:}rz\nopagebreak)rTr¼r	rrp)r@rPr*r*r+Ú
visit_seealsoFszLaTeXTranslator.visit_seealsocCs|jjtƒdS)N)rTr¼r	)r@rPr*r*r+Údepart_seealsoKszLaTeXTranslator.depart_seealsocCsLt|ƒdkr&|jƒdtdƒfkr&tj‚|jjdƒ|jjdtƒd|_	dS)NrsZ	Footnotesz\subsubsection*{rm)
rºrIrrrrTr¼r­rprž)r@rPr*r*r+Úvisit_rubricNs
 zLaTeXTranslator.visit_rubriccCsd|_|jj|jjƒƒdS)Nr)ržrTr¼r­rÊ)r@rPr*r*r+Ú
depart_rubricUszLaTeXTranslator.depart_rubriccCs¦|jd7_ttj|dƒ}d|kr2|jjdƒ|jrN|jjd|jƒƒn$|jjdtƒ|jjd|jƒƒd|kr’|jjd|jƒtƒ|jjdtƒdS)	NrsrZreferredz\sphinxstepexplicit z\begin{footnote}[%s]r‡z+\phantomsection\label{\thesphinxscope.%s}%%z\sphinxAtStartFootnote)	r rrÚlabelrTr¼r©rIrp)r@rPrQr*r*r+Úvisit_footnoteYszLaTeXTranslator.visit_footnotecCsB|jr|jjdƒn|jjdtƒ|jjdƒ|jd8_dS)Nz\end{footnote}r‡rs)r©rTr¼rpr )r@rPr*r*r+Údepart_footnotehs
zLaTeXTranslator.depart_footnotecCs
tj‚dS)N)rr)r@rPr*r*r+Úvisit_labelpszLaTeXTranslator.visit_labelcCs|d|_tj‚dS)NÚspec)rÃrr)r@rPr*r*r+Úvisit_tabular_col_specss
z&LaTeXTranslator.visit_tabular_col_speccCsÂt|jƒdkrD|jjƒdkr:td|jd
|jp0dfƒ‚qnd|j_n*t|jƒdkrntd|jd|jpfdfƒ‚|jjt	|ƒƒ|j
r¸d|j
t|j_d	|j
d
gƒkr¸tjtdƒ|dd|_
dS)Nrsrdz2%s:%s: longtable does not support nesting a table.r8TrBz0%s:%s: deeply nested tables are not implemented.z{%s}zcolwidths-givenrRzGboth tabularcolumns and :widths: option are given. :widths: is ignored.)rrÖrÖ)rºrÂr|rgr4rÅÚlinerYr¼rOrÃrprWrUr¸Úinfor)r@rPr*r*r+Úvisit_tablews"

zLaTeXTranslator.visit_tablecCs`|j|ƒ}|jjƒ}|j|dt|j|dƒ}|jjtƒ|jj|ƒ|jjtƒ|j	j
ƒdS)Nz.tex_t)r|rÜ)rÝr|rgrÑÚdictrTr¼r	rprÂrÊ)r@rPrÜZ
table_typer|r*r*r+Údepart_tableŽs


zLaTeXTranslator.depart_tablecCsL|jjd7_d|kr*|jjj|dƒd|krH|jjj|jjdƒdS)NrsÚcolwidthZstub)r|rVrXr¼r])r@rPr*r*r+Ú
visit_colspec™s
zLaTeXTranslator.visit_colspeccCsdS)Nr*)r@rPr*r*r+Údepart_colspec szLaTeXTranslator.depart_colspeccCsdS)Nr*)r@rPr*r*r+Úvisit_tgroup£szLaTeXTranslator.visit_tgroupcCsdS)Nr*)r@rPr*r*r+Ú
depart_tgroup¦szLaTeXTranslator.depart_tgroupcCs|j|jjƒdS)N)rÉr|rS)r@rPr*r*r+Úvisit_thead©szLaTeXTranslator.visit_theadcCs|jƒdS)N)rË)r@rPr*r*r+Údepart_thead­szLaTeXTranslator.depart_theadcCs|j|jjƒdS)N)rÉr|rT)r@rPr*r*r+Úvisit_tbody°szLaTeXTranslator.visit_tbodycCs|jƒdS)N)rË)r@rPr*r*r+Údepart_tbody´szLaTeXTranslator.depart_tbodycCsŽd|j_x€|jj|jj|jjƒ}|dkr,Pq
|jj|j7_|jrP|jjdƒ|jdkrn|jjd|jƒq
|jjd|j|jfƒq
WdS)Nrú&rsz\sphinxtablestrut{%d}z,\multicolumn{%d}{|l|}{\sphinxtablestrut{%d}})r|r^ryr_rirTr¼rb)r@rPryr*r*r+Ú	visit_row·s
zLaTeXTranslator.visit_rowcs҈jjdtƒ‡fdd„tˆjjƒDƒ}‡fdd„|Dƒ}t|ƒrRˆjjdƒnld}|jdgƒxZ|t|ƒkr¼||dkr²||d…j	dƒ}ˆjjd	|d
||fƒ||7}|d
7}qdWˆjj
d
7_
dS)Nz\\csg|]}ˆjjˆjj|ƒ‘qSr*)r|ryr_)rhrñ)r@r*r+rkÌsz.LaTeXTranslator.depart_row.<locals>.<listcomp>cs$g|]}|j|jˆjjdk‘qS)rs)r_rrr|)rhry)r@r*r+rkÍsz\hlinerFTz
\cline{%d-%d}rs)rTr¼rprtr|rVÚallÚextendrºr·r_)r@rPraZ
underlinedrñr“r*)r@r+Ú
depart_rowÊszLaTeXTranslator.depart_rowcCsä|jjdkr|jjdƒ|jj|jddƒd|jddƒdƒ|jjƒ}d}|jdkrÀ|jj	r¢|jjdkr‚|jjd|jt
ƒn|jjd|jt
ƒd	t
}n|jjd
|jt
ƒdt
}|jdkrò|jjd|j|jft
ƒd	t
|}|jdks
|jdkrB|jjd
|j|jj
ft
ƒdt
dt
|}d|_tt|jtjƒƒƒdkrdd|j_t|jjtjƒs†|j|jjkrÂt|ƒdkr¶t|dtjƒr¶|jƒdkr¶n|jjdƒ|jrÔ|jgƒ|jj|ƒdS)NrreZmorerowsrsZmorecolsr8z\multicolumn{%d}{|l|}{%%z\multicolumn{%d}{l|}{%%z}%z\sphinxstartmulticolumn{%d}%%z\sphinxstopmulticolumnz\sphinxmultirow{%d}{%d}{%%z,\begin{varwidth}[t]{\sphinxcolwidth{%d}{%d}}z\parz7\vskip-\baselineskip\vbox{\hbox{\strut}}\end{varwidth}%rBTz\sphinxstyletheadfamily )r|r^rTr¼rvrUryrirµZlatex_use_latex_multicolumnrprrrbrVr£rºrür"rr)rZrûrÚtheadr]rIrÉr­)r@rPryr­r*r*r+Úvisit_entryÛs<&



".
zLaTeXTranslator.visit_entrycCsâ|jr@d|_|jƒ}x|r2|dtkr2|jdƒqW|jj|ƒ|jj|jjƒƒ|jj	ƒ}|jj
|j7_
xn|jj	ƒ}|dkr†Pqp|jj
|j7_
|jjdƒ|jdkrÂ|jjd|jƒqp|jjd|j|jfƒqpWdS)Nrrersz\sphinxtablestrut{%d}z+\multicolumn{%d}{l|}{\sphinxtablestrut{%d}})
r£rËrprÊrTrhr¼r­r|ryr^rirb)r@rPrTryZnextcellr*r*r+Údepart_entrys&


zLaTeXTranslator.depart_entrycCsbttj|dƒ}tttj|ƒ}|jjtƒ|jjdjdd„|Dƒƒdƒ|jjtƒtj	‚dS)Nrz, css|]}|jƒVqdS)N)rI)rhÚnr*r*r+rÚ&sz-LaTeXTranslator.visit_acks.<locals>.<genexpr>Ú.)
rrÚbullet_listrZ	list_itemrTr¼r	ror)r@rProZ
list_itemsr*r*r+Ú
visit_acks s zLaTeXTranslator.visit_ackscCs(|js|jjdtƒ|jr$d|j_dS)Nz\begin{itemize}T)rªrTr¼rpr|rY)r@rPr*r*r+Úvisit_bullet_list*sz!LaTeXTranslator.visit_bullet_listcCs|js|jjdtƒdS)Nz
\end{itemize})rªrTr¼rp)r@rPr*r*r+Údepart_bullet_list0sz"LaTeXTranslator.depart_bullet_listcsÞttdœdd„}ttdœ‡fdd„‰dtˆ|ƒƒjƒ}dtˆ|ƒdƒjƒ}tj||ƒƒ}|jdd	ƒ}|jd
dƒ}|jjdt	ƒ|jjd
|||||ft	ƒd|krÌ|jjd||ddft	ƒ|j
rÚd|j
_dS)N)rPr<cSs4|jddƒ}d|kr0d|jddƒt|ƒkr0d}|S)NÚenumtyper-ÚalphaéÚstartr)rUrº)rPrsr*r*r+Úget_enumtype5s z;LaTeXTranslator.visit_enumerated_list.<locals>.get_enumtypecs4|dkrdSt|tjƒr&ˆ|jƒdSˆ|jƒSdS)Nrrs)rûrÚenumerated_listr)rP)Úget_nested_levelr*r+ry=s
z?LaTeXTranslator.visit_enumerated_list.<locals>.get_nested_levelzenum%srsrêr8rërnz\begin{enumerate}z*\sphinxsetlistlabels{%s}{%s}{%s}{%s}{%s}%%rvz\setcounter{%s}{%d}T)rr{r`r"ÚlowerÚENUMERATE_LIST_STYLErUrTr¼rpr|rY)r@rPrwÚenumZenumnextÚstylerêrër*)ryr+Úvisit_enumerated_list4s z%LaTeXTranslator.visit_enumerated_listcCs|jjdtƒdS)Nz\end{enumerate})rTr¼rp)r@rPr*r*r+Údepart_enumerated_listSsz&LaTeXTranslator.depart_enumerated_listcCs|jjdƒdS)Nz	\item {} )rTr¼)r@rPr*r*r+Úvisit_list_itemVszLaTeXTranslator.visit_list_itemcCs|jjtƒdS)N)rTr¼rp)r@rPr*r*r+Údepart_list_item[sz LaTeXTranslator.depart_list_itemcCs"|jjdtƒ|jrd|j_dS)Nz\begin{description}T)rTr¼rpr|rY)r@rPr*r*r+Úvisit_definition_list^sz%LaTeXTranslator.visit_definition_listcCs|jjdtƒdS)Nz\end{description})rTr¼rp)r@rPr*r*r+Údepart_definition_listcsz&LaTeXTranslator.depart_definition_listcCsdS)Nr*)r@rPr*r*r+Úvisit_definition_list_itemfsz*LaTeXTranslator.visit_definition_list_itemcCsdS)Nr*)r@rPr*r*r+Údepart_definition_list_itemisz+LaTeXTranslator.depart_definition_list_itemcCsh|jd7_d}|jdƒrDd}x"|dD]}||j|dd7}q*W|d7}|jjdƒ|jj|ƒdS)	Nrsr8rÛz\phantomsectionF)rÔz}] \leavevmodez\item[{)r¢rUrØrTr¼r­)r@rPÚctxrÙr*r*r+Ú
visit_termls
zLaTeXTranslator.visit_termcCs$|jj|jjƒƒ|jd8_dS)Nrs)rTr¼r­rÊr¢)r@rPr*r*r+Údepart_termwszLaTeXTranslator.depart_termcCs|jjdƒdS)Nz{[})rTr¼)r@rPr*r*r+Úvisit_classifier{sz LaTeXTranslator.visit_classifiercCs|jjdƒdS)Nz{]})rTr¼)r@rPr*r*r+Údepart_classifier~sz!LaTeXTranslator.depart_classifiercCsdS)Nr*)r@rPr*r*r+Úvisit_definitionsz LaTeXTranslator.visit_definitioncCs|jjtƒdS)N)rTr¼rp)r@rPr*r*r+Údepart_definition„sz!LaTeXTranslator.depart_definitioncCs"|jjdtƒ|jrd|j_dS)Nz \begin{quote}\begin{description}T)rTr¼rpr|rY)r@rPr*r*r+Úvisit_field_list‡sz LaTeXTranslator.visit_field_listcCs|jjdtƒdS)Nz\end{description}\end{quote})rTr¼rp)r@rPr*r*r+Údepart_field_listŒsz!LaTeXTranslator.depart_field_listcCsdS)Nr*)r@rPr*r*r+Úvisit_fieldszLaTeXTranslator.visit_fieldcCsdS)Nr*)r@rPr*r*r+Údepart_field’szLaTeXTranslator.depart_fieldcCs˜|jj|ƒ}|dkrdt|jtjƒrdt|j|dtjƒrdt|j|dtjƒrd|jjdtƒn0|dkr€t|jtj	t
fƒr€n|jjtdtgƒdS)Nrrsz	\noindentz\sphinxAtStartPar)rr·rûrZcompoundr)rTr¼rpr+Úfootnotetextrh)r@rPr·r*r*r+Úvisit_paragraph›szLaTeXTranslator.visit_paragraphcCs|jjtƒdS)N)rTr¼rp)r@rPr*r*r+Údepart_paragraph¬sz LaTeXTranslator.depart_paragraphcCs"|jjtdƒ|jrd|j_dS)Nz\begin{center}T)rTr¼rpr|rY)r@rPr*r*r+Úvisit_centered¯szLaTeXTranslator.visit_centeredcCs|jjtdƒdS)Nz\end{center})rTr¼rp)r@rPr*r*r+Údepart_centered´szLaTeXTranslator.depart_centeredcCsj|jd7_|d}|jdkr0|jjdtƒ|jjd|dtƒ|jjdtƒ|jrfd|j_dS)NrsÚncolumnsz\setlength{\multicolsep}{0pt}z\begin{multicols}{z
}\raggedrightzA\begin{itemize}\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}T)rªrTr¼rpr|rY)r@rPr–r*r*r+Úvisit_hlist·s
zLaTeXTranslator.visit_hlistcCs"|jd8_|jjdtƒdS)Nrsz*\end{itemize}\raggedcolumns\end{multicols})rªrTr¼rp)r@rPr*r*r+Údepart_hlistÂszLaTeXTranslator.depart_hlistcCsdS)Nr*)r@rPr*r*r+Úvisit_hlistcolÆszLaTeXTranslator.visit_hlistcolcCsdS)Nr*)r@rPr*r*r+Údepart_hlistcolÉszLaTeXTranslator.depart_hlistcolr‚)rƒr„r<cCs4y
t||ƒStk
r.tjtdƒ|ƒdSXdS)Nz&dimension unit %s is invalid. Ignored.)rr‰r¸r¹r)r@rƒr„r*r*r+Úlatex_image_lengthÑs

z"LaTeXTranslator.latex_image_lengthcCst|jtjƒS)z2Check whether a node represents an inline element.)rûrrZTextElement)r@rPr*r*r+Ú	is_inlineØszLaTeXTranslator.is_inlinec
Cstg}g}g}t|jtjƒ}|r,|j|jƒ}n
|j|ƒ}d|kr|d|kr\|j|d|dƒ}n|j|dƒ}|r||jd|ƒd|krÂd|kr¢|j|d|dƒ}n|j|dƒ}|rÂ|jd|ƒd|krè|sè|jdt|dƒdƒd|kr^d d!d"d#d$d%d&d'd(d)d*d+i}	y8|j|	||dfdƒ|j|	||dfd	ƒWntk
r\YnX|j	rz|jdƒ|jdƒ|r¢|r¢|jt
dƒ|jt
ƒ|jƒ|d|jj
krÎ|jj
|d}
n|jrÚdS|d}
|
jdƒd,krödS|jj|ƒd}|rddj|ƒ}tj|
ƒ\}}
|jrN|rN|jjd|||
fƒn|jjd|||
fƒ|jj|ƒdS)-Nrir„zwidth=%srrz	height=%szscale=%sgY@rQrsÚtopr8Úmiddleú\raisebox{-0.5\height}{rmÚbottomú\raisebox{-\height}{rÚcenterú{\hspace*{\fill}ú\hspace*{\fill}}ÚleftrÚrightz!{\sphinxunactivateextrasandspace z	\noindentÚuriz://z[%s]ršz,\lowercase{\sphinxincludegraphics%s}{{%s}%s}z \sphinxincludegraphics%s{{%s}%s})rsr)r8r8)rsrž)rŸrm)rsr )r¡rm)rr¢)r£r¤)rr¥)rr¤)rr¦)r£rmrÖ)rûrrÚ	referencerœr›r¼r‹ÚKeyErrorr©rpÚreverser;ZimagesÚignore_missing_imagesÚfindrTrhrorÚsplitextrž)r@rPÚpreÚpostZinclude_graphics_optionsZ
has_hyperlinkrœÚwÚhZ
align_prepostr§ÚoptionsÚbaseÚextr*r*r+Úvisit_imageÜsx




zLaTeXTranslator.visit_imagecCsdS)Nr*)r@rPr*r*r+Údepart_image+szLaTeXTranslator.depart_imagecCsî|jd}|jrd}|jr¬d|krZ|j|dƒ}|rz|jjd|tƒ|jjdtƒn |jjdtƒ|jjdtƒtdd„|Dƒƒr˜|jjd	ƒ|jjd
tƒn>|j	ddƒdkrdd}d|krÚ|j|dƒ}n0t
|dtjƒoôd|dkr
|j|ddƒ}|jjt
ƒ|jjd|ddkr0dnd|p:dftƒ|jjdƒ|jjdtƒn†|jrŽ|jjtdƒ|jjdtƒn\|jjtd|tƒ|jjdtƒtdd„|DƒƒrÚ|jjd	tƒ|jjdtƒdS)NZfigure_alignÚHriz!\begin{sphinxfigure-in-table}[%s]z
\centeringz\begin{sphinxfigure-in-table}css|]}t|tjƒVqdS)N)rûrr\)rhr/r*r*r+rÚ<sz/LaTeXTranslator.visit_figure.<locals>.<genexpr>z	\capstartz!\end{sphinxfigure-in-table}\relaxrQr8r¥r¦rz\begin{wrapfigure}{%s}{%s}ÚrÚlZ0ptz\end{wrapfigure}z\begin{center}z\end{center}z\begin{figure}[%s]css|]}t|tjƒVqdS)N)rûrr\)rhr/r*r*r+rÚQsz\end{figure})r¥r¦)r¯r¥r|r›rTr¼rpr!r­rUrûrr#r	r¤)r@rPrQÚlengthr*r*r+Úvisit_figure.sB
(zLaTeXTranslator.visit_figurecCs|jj|jjƒƒdS)N)rTr¼r­rÊ)r@rPr*r*r+Ú
depart_figureUszLaTeXTranslator.depart_figurecCsz|jd7_t|jtƒr(|jjdƒnN|jrJt|jtjƒrJ|jjdƒn,|j	rj|jj
dkrj|jjdƒn|jjdƒdS)Nrsz\sphinxSetupCaptionForVerbatim{z\captionof{figure}{Úfigurez\sphinxfigcaption{z	\caption{)r¡rûrÚcaptioned_literal_blockrTr¼r¤rr½r|Útagname)r@rPr*r*r+Ú
visit_captionXszLaTeXTranslator.visit_captioncCsD|jjdƒt|jtjƒr2|j|jƒ}|jj|ƒ|jd8_dS)Nrmrs)rTr¼rûrrr½rÝr¡)r@rPrÜr*r*r+Údepart_captioncs
zLaTeXTranslator.depart_captioncCs|jjtdƒdS)Nz\begin{sphinxlegend})rTr¼rp)r@rPr*r*r+Úvisit_legendjszLaTeXTranslator.visit_legendcCs|jjdtƒdS)Nz\end{sphinxlegend})rTr¼rp)r@rPr*r*r+Ú
depart_legendmszLaTeXTranslator.depart_legendcCs"|jjtdƒ|jd7_dS)Nz\begin{sphinxadmonition}{note}rs)rTr¼rpr¥)r@rPr*r*r+Úvisit_admonitionpsz LaTeXTranslator.visit_admonitioncCs"|jjdtƒ|jd8_dS)Nz\end{sphinxadmonition}rs)rTr¼rpr¥)r@rPr*r*r+Údepart_admonitiontsz!LaTeXTranslator.depart_admonitioncCs6t|j}|jjtd|j|fƒ|jd7_dS)Nz!\begin{sphinxadmonition}{%s}{%s:}rs)rr¿rTr¼rpr¥)r@rPrQr*r*r+Ú_visit_named_admonitionxs

z'LaTeXTranslator._visit_named_admonitioncCs"|jjdtƒ|jd8_dS)Nz\end{sphinxadmonition}rs)rTr¼rpr¥)r@rPr*r*r+Ú_depart_named_admonition~sz(LaTeXTranslator._depart_named_admonitioncCsdS)Nr*)r@rPr*r*r+Úvisit_versionmodified•sz%LaTeXTranslator.visit_versionmodifiedcCsdS)Nr*)r@rPr*r*r+Údepart_versionmodified˜sz&LaTeXTranslator.depart_versionmodifiedcsätddœ‡‡fdd„}ˆ}xt|tjƒr6|jdd}qWttˆjjj	dƒƒ}t|t
ƒrZdS|j|ƒrr|j|ƒrrdSdˆkr~dSdˆkrŠdSˆj
d	ƒrÆtˆƒ}t|tjƒrºˆd	|d	krºn|ˆd	ƒxˆd
D]}||ƒqÐWdS)N)rÒr<cst|jdƒrdS|jdƒrdSˆjjˆƒ}|dkrRtˆj|dtjƒrRˆjjtƒˆj	}ˆjjˆj
||dƒdS)Nzindex-z	equation-rrs)rÔ)Ú
startswithrr·rûrr)rTr¼rpržrØ)rÒr·rÔ)rPr@r*r+Ú
add_targetœs

z0LaTeXTranslator.visit_target.<locals>.add_targetT)ZascendZstdÚrefuriZ	anonymousÚrefidrÛ)r{rûrÚtargetÚ	next_noderrr;r÷Z
get_domainÚHYPERLINK_SUPPORT_NODESZget_enumerable_node_typeZget_numfig_titlerUrr¨)r@rPrËrÏrþZ	prev_noderÒr*)rPr@r+Úvisit_target›s(

zLaTeXTranslator.visit_targetcCsdS)Nr*)r@rPr*r*r+Ú
depart_targetÉszLaTeXTranslator.depart_targetcCs$|jjtdtƒ|jjdƒdS)Nz\begin{flushright}z---)rTr¼rp)r@rPr*r*r+Úvisit_attributionÌsz!LaTeXTranslator.visit_attributioncCs|jjtdtƒdS)Nz\end{flushright})rTr¼rp)r@rPr*r*r+Údepart_attributionÐsz"LaTeXTranslator.depart_attributioncsôttdœ‡fdd„‰ttdœdd„}|jddƒs<ˆjjtƒ|d	}xˆ|D]~\}}}}}d
}	|rhd}	y.|dkryN‡fd
d„tdd|ƒDƒ\}
}||
ƒ||ƒ}}
ˆjjd|
|||
|	fƒWnHtk
rˆtdd|ƒdƒ}||ƒ}ˆjjd|||	fƒYnXn„|dkrt‡fdd„tdd|ƒDƒ\}
}||
ƒ||ƒ}}
ˆjjd|
|||
|	||
|
||	f
ƒn"|dkrö‡fdd„tdd|ƒDƒ\}
}}||
ƒ||ƒ||ƒ}}
}ˆjjd|
||||
||	||
||
|||	|||
|||
|	fƒn |dkr>‡fdd„tdd|ƒDƒ\}
}||
ƒ}ˆjjd|
||fƒnX|dkr†‡fdd„tdd|ƒDƒ\}
}||
ƒ}ˆjjd|
||fƒntjt	d ƒ|ƒWqLtk
rÊ}ztjt|ƒƒWYdd}~XqLXqLW|jddƒsêˆjjd!ƒt
j‚dS)"N)Úvaluer<csVˆj|ƒ}|jddƒ}|jddƒ}|jddƒ}|jddƒ}|jd	d
ƒ}|jddƒ}|S)
Nz\{z\sphinxleftcurlybrace{}z\}z\sphinxrightcurlybrace{}ú"z""ú@z"@ú!z"!rlz
\textbar{})rårç)rÕ)r@r*r+ráÔs
z+LaTeXTranslator.visit_index.<locals>.escape)Ústringr<cSs$tj|ƒ}|r|jdƒSd|SdS)Nz\\spxentry{\1}\\spxextra{\2}z
\spxentry{%s})ÚEXTRA_RErˆÚexpand)rÙrˆr*r*r+r}Þs

z*LaTeXTranslator.visit_index.<locals>.styleÚinlineTrór8z	|spxpagemZsinglecsg|]}ˆ|ƒ‘qSr*r*)rhÚx)rár*r+rkïsz/LaTeXTranslator.visit_index.<locals>.<listcomp>rBz\index{%s@%s!%s@%s%s}rsrz\index{%s@%s%s}Úpaircsg|]}ˆ|ƒ‘qSr*r*)rhrÝ)rár*r+rk÷sz*\index{%s@%s!%s@%s%s}\index{%s@%s!%s@%s%s}Ztriplecsg|]}ˆ|ƒ‘qSr*r*)rhrÝ)rár*r+rküsrîzS\index{%s@%s!%s %s@%s %s%s}\index{%s@%s!%s, %s@%s, %s%s}\index{%s@%s!%s %s@%s %s%s}Zseecsg|]}ˆ|ƒ‘qSr*r*)rhrÝ)rár*r+rksz\index{%s@%s|see{%s}}rcsg|]}ˆ|ƒ‘qSr*r*)rhrÝ)rár*r+rk
sz!unknown index entry type %s foundz\ignorespaces )r{rUrTr¼rprr‰r¸r¹rrr)r@rPr}róÚtyperÙZ_tidZismainÚ_keyÚmÚp1Úp2ZP1ZP2ÚpÚPZp3ZP3Úerrr*)rár@r+Úvisit_indexÓs\

 
 
 

$zLaTeXTranslator.visit_indexcCsZ|j|ƒs|jjtƒd|jddƒjƒkr:|jj|jƒƒ|j|ƒsP|jjtƒtj‚dS)NrœÚformatr8)	rœrTr¼rprUr$rIrr)r@rPr*r*r+Ú	visit_raws

zLaTeXTranslator.visit_rawcCsŽ|js:x2|jdƒD]$}|j}|j|j||d7_qW|j|ƒsP|jjtƒ|jddƒ}|r†|jdƒr†d|jdd|d}|js’|r¢|j	jdƒnè|j
dƒr |jdd	|dd…}|jj|j|ƒƒ|jjd
ƒ|jj
oô|jr|j	jd|j|ƒƒn|j	jdƒnj|j
dƒr
|jdƒ}|dkrR|dd…d
}n|dd…jdd	ƒ}|jj|j|ƒƒt|ƒrÄt|dtjƒrÄd|djdgƒkrÄ|j	jdƒ|jjdƒnD|jjdƒ|jj
rü|jrü|j	jd|j|ƒƒn|j	jdƒn€t|ƒdkrh||dkrh|jdƒrJ|jjd|j|ƒƒn|jjd|j|ƒƒtj‚n"|jjd|j|ƒƒ|j	jdƒdS)NrÛ)rÔrÌr8rÍr‡rsú#rÕz\emph{z}}} (%s)z}}}z::docrzstd-termrRz\sphinxtermref{z\sphinxcrossref{Z	nolinkurlz\sphinxnolinkurl{%s}z\sphinxurl{%s}z\sphinxhref{%s}{rmrÖrÖrÖ)ržrUr¡rTrØrœr¼rprÅr­rÊrÞrµZlatex_show_pagerefsrŸrßr¬rçrºrûrrÚ
encode_urir)r@rPrÒrÔr§Z	hashindexr*r*r+Úvisit_referencesR




zLaTeXTranslator.visit_referencecCs,|jj|jjƒƒ|j|ƒs(|jjtƒdS)N)rTr¼r­rÊrœrp)r@rPr*r*r+Údepart_referenceVs
z LaTeXTranslator.depart_referencecCsâ|jdƒr"|jdd|d}n|jddƒdd…jddƒ}|j|jddƒƒjd	dƒ}d
|kshd|kr¤|jd
dƒjdd
ƒ}t|ƒjd|j|ƒd|j|ƒd}nt|ƒd|j|ƒ}d|j|ƒ|f}|jj|ƒt	j
‚dS)NrÍrsrÕrÌr8rêrz%sz\%sz\{name\}z
\{number\}z{name}z{number}z\nameref{%s}z\ref{%s})rúÚnumberz\hyperref[%s]{%s}rÖ)rUrÅrçrárrèr×rTr¼rr)r@rPrÒrr~Zhyperrefr*r*r+Úvisit_number_reference[s
z&LaTeXTranslator.visit_number_referencecCsdS)Nr*)r@rPr*r*r+Úvisit_download_referenceosz(LaTeXTranslator.visit_download_referencecCsdS)Nr*)r@rPr*r*r+Údepart_download_referencersz)LaTeXTranslator.depart_download_referencecCsdS)Nr*)r@rPr*r*r+Úvisit_pending_xrefusz"LaTeXTranslator.visit_pending_xrefcCsdS)Nr*)r@rPr*r*r+Údepart_pending_xrefxsz#LaTeXTranslator.depart_pending_xrefcCs|jjdƒdS)Nz\sphinxstyleemphasis{)rTr¼)r@rPr*r*r+Úvisit_emphasis{szLaTeXTranslator.visit_emphasiscCs|jjdƒdS)Nrm)rTr¼)r@rPr*r*r+Údepart_emphasis~szLaTeXTranslator.depart_emphasiscCs|jjdƒdS)Nz+\sphinxstyleliteralemphasis{\sphinxupquote{)rTr¼)r@rPr*r*r+Úvisit_literal_emphasissz&LaTeXTranslator.visit_literal_emphasiscCs|jjdƒdS)Nz}})rTr¼)r@rPr*r*r+Údepart_literal_emphasis„sz'LaTeXTranslator.depart_literal_emphasiscCs|jjdƒdS)Nz\sphinxstylestrong{)rTr¼)r@rPr*r*r+Úvisit_strong‡szLaTeXTranslator.visit_strongcCs|jjdƒdS)Nrm)rTr¼)r@rPr*r*r+Ú
depart_strongŠszLaTeXTranslator.depart_strongcCs|jjdƒdS)Nz)\sphinxstyleliteralstrong{\sphinxupquote{)rTr¼)r@rPr*r*r+Úvisit_literal_strongsz$LaTeXTranslator.visit_literal_strongcCs|jjdƒdS)Nz}})rTr¼)r@rPr*r*r+Údepart_literal_strongsz%LaTeXTranslator.depart_literal_strongcCs`|jƒ}|jjdƒ|jdƒrP||jkrP|jjd|j|dƒƒ|jj|ƒn|jjdƒdS)Nz\sphinxstyleabbreviation{Zexplanationz} (%s)rm)rIrTr¼rFrÇr­råÚadd)r@rPZabbrr*r*r+Úvisit_abbreviation“sz"LaTeXTranslator.visit_abbreviationcCs|jj|jjƒƒdS)N)rTr¼r­rÊ)r@rPr*r*r+Údepart_abbreviationsz#LaTeXTranslator.depart_abbreviationcCs
|j|ƒS)N)rö)r@rPr*r*r+Ú
visit_manpage szLaTeXTranslator.visit_manpagecCs
|j|ƒS)N)r÷)r@rPr*r*r+Údepart_manpage£szLaTeXTranslator.depart_manpagecCs|jjdƒdS)Nz\sphinxtitleref{)rTr¼)r@rPr*r*r+Úvisit_title_reference¦sz%LaTeXTranslator.visit_title_referencecCs|jjdƒdS)Nrm)rTr¼)r@rPr*r*r+Údepart_title_reference©sz&LaTeXTranslator.depart_title_referencecCsntttj|ƒ}dd„|Dƒ}tdd„|Dƒtd}t|ƒtkrL|dt…}|jjt	d|j
|ƒt	ƒdS)Ncss|]}ttj|dƒVqdS)rN)rrrQ)rhÚcitationr*r*r+rÚ®sz8LaTeXTranslator.visit_thebibliography.<locals>.<genexpr>css|]}|jƒVqdS)N)rI)rhrQr*r*r+rÚ¯s)Úkeyz!\begin{sphinxthebibliography}{%s})rrrrr¿rºÚMAX_CITATION_LABEL_LENGTHrTr¼rprå)r@rPZ	citationsrÜZ
longest_labelr*r*r+Úvisit_thebibliography¬sz%LaTeXTranslator.visit_thebibliographycCs|jjdtƒdS)Nz\end{sphinxthebibliography})rTr¼rp)r@rPr*r*r+Údepart_thebibliography·sz&LaTeXTranslator.depart_thebibliographycCs@ttj|dƒ}|jjd|j|jƒƒ|d|ddfƒdS)Nrz\bibitem[%s]{%s:%s}rrÛ)rrrQrTr¼rårI)r@rPrQr*r*r+Úvisit_citationºszLaTeXTranslator.visit_citationcCsdS)Nr*)r@rPr*r*r+Údepart_citation¿szLaTeXTranslator.depart_citationcCs.|jrn"|jjd|d|dfƒtj‚dS)Nz\sphinxcite{%s:%s}rZrefname)ržrTr¼rr)r@rPr*r*r+Úvisit_citation_referenceÂsz(LaTeXTranslator.visit_citation_referencecCsdS)Nr*)r@rPr*r*r+Údepart_citation_referenceÉsz)LaTeXTranslator.depart_citation_referencecCs>|jr|jjdƒn&d|dkr.|jjdƒn|jjdƒdS)Nz*\sphinxstyleliteralintitle{\sphinxupquote{ZkbdrRz\sphinxkeyboard{\sphinxupquote{z\sphinxcode{\sphinxupquote{)ržrTr¼)r@rPr*r*r+Ú
visit_literalÌs
zLaTeXTranslator.visit_literalcCs|jjdƒdS)Nz}})rTr¼)r@rPr*r*r+Údepart_literalÔszLaTeXTranslator.depart_literalcCs
tj‚dS)N)rr)r@rPr*r*r+Úvisit_footnote_reference×sz(LaTeXTranslator.visit_footnote_referencecCs|jjdƒdS)Nz\sphinxfootnotemark[)rTr¼)r@rPr*r*r+Úvisit_footnotemarkÚsz"LaTeXTranslator.visit_footnotemarkcCs|jjdƒdS)Nú])rTr¼)r@rPr*r*r+Údepart_footnotemarkÝsz#LaTeXTranslator.depart_footnotemarkcCsTttj|dƒ}|jjdtƒ|jjd|jƒ|jƒftƒ|jjdtƒdS)Nrr‡zC\begin{footnotetext}[%s]\phantomsection\label{\thesphinxscope.%s}%%z\sphinxAtStartFootnote)rrrQrTr¼rprI)r@rPrQr*r*r+Úvisit_footnotetextàs
z"LaTeXTranslator.visit_footnotetextcCs |jjdtƒ|jjdƒdS)Nr‡z \end{footnotetext}\ignorespaces )rTr¼rp)r@rPr*r*r+Údepart_footnotetextèsz#LaTeXTranslator.depart_footnotetextcCsdS)Nr*)r@rPr*r*r+Úvisit_captioned_literal_blockísz-LaTeXTranslator.visit_captioned_literal_blockcCsdS)Nr*)r@rPr*r*r+Údepart_captioned_literal_blockðsz.LaTeXTranslator.depart_captioned_literal_blockc	CsÐ|j|jƒkr0|jd7_|jjdtƒnœ|j|ƒ}t|jt	ƒrV||j|jƒ7}|rz|j
rz|jjtd|dƒ|jddƒ}|jddƒ}|jd	iƒ}|jd
dƒ|d
<|jj
j|iƒ}|jj|j|f|||dœ|—Ž}|j
r|jjtdƒ|jd
dƒ}n2|jr*d|j_d|j_|jd
dƒ}n|jd
dƒ}|jƒdd…}|jrb|j
rb|d7}n|d7}t|jdgƒƒdd…}|rœ|jjtd|ƒ|jjt|tƒ|rÆ|jjdtƒtj‚dS)Nrsz\begin{sphinxalltt}z\def\sphinxLiteralBlockLabel{rmr½r9ÚlinenosFÚhighlight_argsÚforce)Úoptsrrz\sphinxSetupCodeBlockInFootnotez\begin{Verbatim}z\begin{sphinxVerbatim}Tz\begin{sphinxVerbatimintable}éz\end{sphinxVerbatimintable}z\end{sphinxVerbatim}Zhl_linesz\fvset{hllines={, %s,}}%%z\sphinxresetverbatimhllinesiòÿÿÿrÖ)Z	rawsourcerIr©rTr¼rprÝrûrr¾r rUrµZhighlight_optionsrÁZhighlight_blockrçr|rYr[Úrstripr{rr)	r@rPrÜÚlangrrrZhlcodeZhllinesr*r*r+Úvisit_literal_blockósL

z#LaTeXTranslator.visit_literal_blockcCs&|jjtdtƒ|jd8_dS)Nz\end{sphinxalltt}rs)rTr¼rpr©)r@rPr*r*r+Údepart_literal_block&sz$LaTeXTranslator.depart_literal_blockcCs|jjdƒdS)Nz\item[] )rTr¼)r@rPr*r*r+Ú
visit_line,szLaTeXTranslator.visit_linecCs|jjtƒdS)N)rTr¼rp)r@rPr*r*r+Údepart_line/szLaTeXTranslator.depart_linecCsVt|jtjƒr0|jjdtƒ|jjdtƒn|jjtdtƒ|jrRd|j_dS)Nz\item[]z'\begin{DUlineblock}{\DUlineblockindent}z\begin{DUlineblock}{0em}T)	rûrrZ
line_blockrTr¼rpr|rY)r@rPr*r*r+Úvisit_line_block2sz LaTeXTranslator.visit_line_blockcCs|jjdtƒdS)Nz\end{DUlineblock})rTr¼rp)r@rPr*r*r+Údepart_line_block;sz!LaTeXTranslator.depart_line_blockcCsXd}t|jƒdkr2|jd}t|tjtjfƒr2d}|sT|jjdtƒ|j	rTd|j	_
dS)Nrrsz
\begin{quote}T)rºr rûrrorxrTr¼rpr|rY)r@rPÚdoner/r*r*r+Úvisit_block_quote>s
z!LaTeXTranslator.visit_block_quotecCsJd}t|jƒdkr2|jd}t|tjtjfƒr2d}|sF|jjdtƒdS)Nrrsz\end{quote})	rºr rûrrorxrTr¼rp)r@rPr#r/r*r*r+Údepart_block_quoteLs
z"LaTeXTranslator.depart_block_quotecCs|jdr|jjdƒdS)Nrsz, rÖ)r­rTr¼)r@rPr*r*r+Úvisit_optionWs
zLaTeXTranslator.visit_optioncCs|jdd7<dS)NrsrÖ)r­)r@rPr*r*r+Ú
depart_option\szLaTeXTranslator.depart_optioncCs|jj|jddƒƒdS)z1The delimiter between an option and its argument.Ú	delimiterrN)rTr¼rU)r@rPr*r*r+Úvisit_option_argument`sz%LaTeXTranslator.visit_option_argumentcCsdS)Nr*)r@rPr*r*r+Údepart_option_argumentdsz&LaTeXTranslator.depart_option_argumentcCs|jjdƒ|jjdƒdS)Nz\item [r)rTr¼r­)r@rPr*r*r+Úvisit_option_groupgsz"LaTeXTranslator.visit_option_groupcCs|jjƒ|jjdƒdS)Nz] )r­rÊrTr¼)r@rPr*r*r+Údepart_option_groupls
z#LaTeXTranslator.depart_option_groupcCs"|jjdtƒ|jrd|j_dS)Nz\begin{optionlist}{3cm}T)rTr¼rpr|rY)r@rPr*r*r+Úvisit_option_listpsz!LaTeXTranslator.visit_option_listcCs|jjdtƒdS)Nz\end{optionlist})rTr¼rp)r@rPr*r*r+Údepart_option_listusz"LaTeXTranslator.depart_option_listcCsdS)Nr*)r@rPr*r*r+Úvisit_option_list_itemxsz&LaTeXTranslator.visit_option_list_itemcCsdS)Nr*)r@rPr*r*r+Údepart_option_list_item{sz'LaTeXTranslator.depart_option_list_itemcCs$|jƒ}|jj|j|ƒƒtj‚dS)N)rIrTr¼rårr)r@rPZostringr*r*r+Úvisit_option_string~sz#LaTeXTranslator.visit_option_stringcCs|jjdƒdS)Nr)rTr¼)r@rPr*r*r+Úvisit_descriptionƒsz!LaTeXTranslator.visit_descriptioncCsdS)Nr*)r@rPr*r*r+Údepart_description†sz"LaTeXTranslator.depart_descriptioncCs|jjdƒdS)Nz	$^{\text{)rTr¼)r@rPr*r*r+Úvisit_superscript‰sz!LaTeXTranslator.visit_superscriptcCs|jjdƒdS)Nz}}$)rTr¼)r@rPr*r*r+Údepart_superscriptŒsz"LaTeXTranslator.depart_superscriptcCs|jjdƒdS)Nz	$_{\text{)rTr¼)r@rPr*r*r+Úvisit_subscriptszLaTeXTranslator.visit_subscriptcCs|jjdƒdS)Nz}}$)rTr¼)r@rPr*r*r+Údepart_subscript’sz LaTeXTranslator.depart_subscriptcCs¾|jdgƒ}|dggkr2|jjdƒ|jjdƒnˆ|dggkrX|jjdƒ|jjdƒnb|dggkr~|jjdƒ|jjdƒn<|r®|jr®|jjd	d
j|ƒƒ|jjdƒn|jjdƒdS)NrRZ
menuselectionz\sphinxmenuselection{rmZguilabelz\sphinxguilabel{Zacceleratorz\sphinxaccelerator{z\DUrole{%s}{ršr8)rUrTr¼r­ržro)r@rPrRr*r*r+Úvisit_inline•szLaTeXTranslator.visit_inlinecCs|jj|jjƒƒdS)N)rTr¼r­rÊ)r@rPr*r*r+Ú
depart_inline¦szLaTeXTranslator.depart_inlinecCsdS)Nr*)r@rPr*r*r+Úvisit_generated©szLaTeXTranslator.visit_generatedcCsdS)Nr*)r@rPr*r*r+Údepart_generated¬sz LaTeXTranslator.depart_generatedcCsdS)Nr*)r@rPr*r*r+Úvisit_compound¯szLaTeXTranslator.visit_compoundcCsdS)Nr*)r@rPr*r*r+Údepart_compound²szLaTeXTranslator.depart_compoundcCs.|jdgƒ}x|D]}|jjd|ƒqWdS)NrRz
\begin{sphinxuseclass}{%s})rUrTr¼)r@rPrRÚcr*r*r+Úvisit_containerµs
zLaTeXTranslator.visit_containercCs*|jdgƒ}x|D]}|jjdƒqWdS)NrRz
\end{sphinxuseclass})rUrTr¼)r@rPrRZ_cr*r*r+Údepart_containerºs
z LaTeXTranslator.depart_containercCsdS)Nr*)r@rPr*r*r+Úvisit_decoration¿sz LaTeXTranslator.visit_decorationcCsdS)Nr*)r@rPr*r*r+Údepart_decorationÂsz!LaTeXTranslator.depart_decorationcCs
tj‚dS)N)rr)r@rPr*r*r+Úvisit_headerÇszLaTeXTranslator.visit_headercCs
tj‚dS)N)rr)r@rPr*r*r+Úvisit_footerÊszLaTeXTranslator.visit_footercCs
tj‚dS)N)rr)r@rPr*r*r+Ú
visit_docinfoÍszLaTeXTranslator.visit_docinfo)r~r<cCs,|j|ƒ}|jr(|jtdtƒjddƒ}|S)Nz~\\rú~)rár¨rçrp)r@r~r*r*r+råÒs
zLaTeXTranslator.encodecCs"|j|ƒjddƒjddƒjddƒS)Nz\textasciitilde{}rFz\sphinxhyphen{}ú-z\textquotesingle{}ú')rårç)r@r~r*r*r+rëÚszLaTeXTranslator.encode_uricCs|j|jƒƒ}|jj|ƒdS)N)rårIrTr¼)r@rPr~r*r*r+Ú
visit_TextãszLaTeXTranslator.visit_TextcCsdS)Nr*)r@rPr*r*r+Údepart_TextçszLaTeXTranslator.depart_TextcCs
tj‚dS)N)rr)r@rPr*r*r+Ú
visit_commentêszLaTeXTranslator.visit_commentcCs
tj‚dS)N)rr)r@rPr*r*r+Ú
visit_metaíszLaTeXTranslator.visit_metacCsdS)Nr*)r@rPr*r*r+Úvisit_system_messageñsz$LaTeXTranslator.visit_system_messagecCs|jjtƒdS)N)rTr¼rp)r@rPr*r*r+Údepart_system_messageôsz%LaTeXTranslator.depart_system_messagecCs:|jr|jjd|jƒƒn|jjd|jƒƒtj‚dS)Nz\protect\(%s\protect\)z\(%s\))ržrTr¼rIrr)r@rPr*r*r+Ú
visit_math÷szLaTeXTranslator.visit_mathcCs†|jdƒr d|d|df}nd}|jdƒrT|rB|jjd|ƒ|jj|jƒƒn(ddlm}|jj||jƒ||jjƒƒtj	‚dS)NrQzequation:%s:%srZnowrapz
\label{%s}r)Úwrap_displaymath)
rUrTr¼rIZsphinx.util.mathrPrµZmath_number_allrr)r@rPrQrPr*r*r+Úvisit_math_blockþs

z LaTeXTranslator.visit_math_blockcCsžd|d|df}|jj}|rŠy d|}|jj|j|dƒWqštk
r†}z*tjtdƒ||d|jjd|ƒWYdd}~XqšXn|jjd|ƒdS)	Nzequation:%s:%srrÎz\ref{%s})rîzInvalid math_eqref_format: %r)rz
\eqref{%s})	rµZmath_eqref_formatrTr¼rèr©r¸r¹r)r@rPrQZeqref_formatÚrefÚexcr*r*r+Úvisit_math_references$z$LaTeXTranslator.visit_math_referencecCsdS)Nr*)r@rPr*r*r+Údepart_math_referencesz%LaTeXTranslator.depart_math_reference)rr:)N)TT)F)r‚(
r0r1r2r;r˜r«rÍrrDr>rr{rÉrËr³rIrzrØrrÝrÞrßrár×rÀrÐrrÑr}rOr|rrrrr
rrr
rrZ
visit_sidebarZdepart_sidebarrrrrrrrrr'r(r)r*r-r.r0r1r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrGrHrIrJrKrLrMrNrOrPrRrSrTrVrYr[r]r^r_r`rarbrcrdrfrirkrlrprqrrr~rr€rr‚rƒr„r…r‡rˆr‰rŠr‹rŒrrŽrrZvisit_field_nameZdepart_field_nameZvisit_field_bodyZdepart_field_bodyr’r“r”r•r—r˜r™ršr`r›rœrµr¶r»r¼rÀrÁrÂrÃrÄrÅrÆrÇZvisit_attentionZdepart_attentionZ
visit_cautionZdepart_cautionZvisit_dangerZ
depart_dangerZvisit_errorZdepart_errorZ
visit_hintZdepart_hintZvisit_importantZdepart_importantZ
visit_noteZdepart_noteZ	visit_tipZ
depart_tipZ
visit_warningZdepart_warningrÈrÉrÑrÒrÓrÔrçrérìrírïrðrñròrórôrõrör÷rørùrúrûrýrþrÿrrrrrrr	r
rrr
rrrrrrrrrZvisit_doctest_blockZdepart_doctest_blockrr r!r"r$r%r&r'r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r?r@rArBrCrDrErårërrIrJrKrLrMrNrOrQrTrUrNr*r*)rAr+rH	s

'
0

	% 
O'.B	8
3		rH)rÐr¾r‘)r‚)Ur3rrFÚcollectionsrÚosrÚtypingrrrrrr	r
rZdocutilsrr
Zdocutils.nodesrrrrÌrrZsphinx.deprecationrZsphinx.domainsrZsphinx.domains.stdrZ
sphinx.errorsrZ
sphinx.localerrrZsphinx.utilrrrZsphinx.util.docutilsrZsphinx.util.nodesrrZsphinx.util.templater Zsphinx.util.texescaper!Zdocutils.utils.romanr"ÚImportErrorZromanZsphinx.builders.latexr#Zsphinx.builders.latex.themingr$Ú	getLoggerr0r¸rr°r{rpr	ÚcompilerÚr+r/r4ÚWriterr6rOrwr{rr`rrHZsphinx.builders.latex.nodesrÐr¾r‘r*r*r*r+Ú<module>sz(



 c#'