docutils.writers.latex2e package
LaTeX2e document tree Writer.
- class Writer[source]
Bases:
Writer- supported = ('latex', 'latex2e')
Formats this writer supports.
- default_template = 'default.tex'
- default_template_path = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/sphinx-docutils/envs/latest/lib/python3.12/site-packages/docutils/writers/latex2e')
- default_preamble = '% PDF Standard Fonts\n\\usepackage{mathptmx} % Times\n\\usepackage[scaled=.90]{helvet}\n\\usepackage{courier}'
- table_style_values = ['booktabs', 'borderless', 'colwidths-auto', 'nolines', 'standard']
- settings_spec = ('LaTeX-Specific Options', None, (('Specify LaTeX documentclass. Default: "article".', ['--documentclass'], {'default': 'article'}), ('Specify document options. Multiple options can be given, separated by commas. Default: "a4paper".', ['--documentoptions'], {'default': 'a4paper'}), ('Format for footnote references: one of "superscript" or "brackets". Default: "superscript".', ['--footnote-references'], {'choices': ['superscript', 'brackets'], 'default': 'superscript', 'metavar': '<format>', 'overrides': 'trim_footnote_reference_space'}), ('Use \\cite command for citations. (future default)', ['--use-latex-citations'], {'action': 'store_true', 'default': None, 'validator': <function validate_boolean>}), ('Use figure floats for citations (might get mixed with real figures). (provisional default)', ['--figure-citations'], {'action': 'store_false', 'dest': 'use_latex_citations', 'validator': <function validate_boolean>}), ('Format for block quote attributions: one of "dash" (em-dash prefix), "parentheses"/"parens", or "none". Default: "dash".', ['--attribution'], {'choices': ['dash', 'parentheses', 'parens', 'none'], 'default': 'dash', 'metavar': '<format>'}), ('Specify LaTeX packages/stylesheets. A style is referenced with "\\usepackage" if extension is ".sty" or omitted and with "\\input" else. Overrides previous --stylesheet and --stylesheet-path settings.', ['--stylesheet'], {'default': '', 'metavar': '<file[,file,...]>', 'overrides': 'stylesheet_path', 'validator': <function validate_comma_separated_list>}), ('Comma separated list of LaTeX packages/stylesheets. Relative paths are expanded if a matching file is found in the --stylesheet-dirs. With --link-stylesheet, the path is rewritten relative to the output *.tex file. ', ['--stylesheet-path'], {'metavar': '<file[,file,...]>', 'overrides': 'stylesheet', 'validator': <function validate_comma_separated_list>}), ('Link to the stylesheet(s) in the output file. (default)', ['--link-stylesheet'], {'action': 'store_false', 'dest': 'embed_stylesheet'}), ('Embed the stylesheet(s) in the output file. Stylesheets must be accessible during processing. ', ['--embed-stylesheet'], {'action': 'store_true', 'default': False, 'validator': <function validate_boolean>}), ('Comma-separated list of directories where stylesheets are found. Used by --stylesheet-path when expanding relative path arguments. Default: ".".', ['--stylesheet-dirs'], {'default': ['.'], 'metavar': '<dir[,dir,...]>', 'validator': <function validate_comma_separated_list>}), ('Customization by LaTeX code in the preamble. Default: select PDF standard fonts (Times, Helvetica, Courier).', ['--latex-preamble'], {'default': '% PDF Standard Fonts\n\\usepackage{mathptmx} % Times\n\\usepackage[scaled=.90]{helvet}\n\\usepackage{courier}'}), ('Specify the template file. Default: "default.tex".', ['--template'], {'default': 'default.tex', 'metavar': '<file>'}), ('Table of contents by LaTeX. (default)', ['--use-latex-toc'], {'action': 'store_true', 'default': True, 'validator': <function validate_boolean>}), ('Table of contents by Docutils (without page numbers).', ['--use-docutils-toc'], {'action': 'store_false', 'dest': 'use_latex_toc', 'validator': <function validate_boolean>}), ('Add parts on top of the section hierarchy.', ['--use-part-section'], {'action': 'store_true', 'default': False, 'validator': <function validate_boolean>}), ('Attach author and date to the document info table. (default)', ['--use-docutils-docinfo'], {'action': 'store_false', 'dest': 'use_latex_docinfo', 'validator': <function validate_boolean>}), ('Attach author and date to the document title.', ['--use-latex-docinfo'], {'action': 'store_true', 'default': False, 'validator': <function validate_boolean>}), ('Typeset abstract as topic. (default)', ['--topic-abstract'], {'action': 'store_false', 'dest': 'use_latex_abstract', 'validator': <function validate_boolean>}), ("Use LaTeX abstract environment for the document's abstract.", ['--use-latex-abstract'], {'action': 'store_true', 'default': False, 'validator': <function validate_boolean>}), ('Color of any hyperlinks embedded in text. Default: "blue" (use "false" to disable).', ['--hyperlink-color'], {'default': 'blue'}), ('Additional options to the "hyperref" package.', ['--hyperref-options'], {'default': ''}), ('Enable compound enumerators for nested enumerated lists (e.g. "1.2.a.ii").', ['--compound-enumerators'], {'action': 'store_true', 'default': False, 'validator': <function validate_boolean>}), ('Disable compound enumerators for nested enumerated lists. (default)', ['--no-compound-enumerators'], {'action': 'store_false', 'dest': 'compound_enumerators'}), ('Enable section ("." subsection ...) prefixes for compound enumerators. This has no effect without --compound-enumerators.', ['--section-prefix-for-enumerators'], {'action': 'store_true', 'default': None, 'validator': <function validate_boolean>}), ('Disable section prefixes for compound enumerators. (default)', ['--no-section-prefix-for-enumerators'], {'action': 'store_false', 'dest': 'section_prefix_for_enumerators'}), ('Set the separator between section number and enumerator for compound enumerated lists. Default: "-".', ['--section-enumerator-separator'], {'default': '-', 'metavar': '<char>'}), ('When possible, use the specified environment for literal-blocks. Default: "" (fall back to "alltt").', ['--literal-block-env'], {'default': ''}), ('Deprecated alias for "--literal-block-env=verbatim".', ['--use-verbatim-when-possible'], {'action': 'store_true', 'validator': <function validate_boolean>}), ('Table style. "standard" with horizontal and vertical lines, "booktabs" (LaTeX booktabs style) only horizontal lines above and below the table and below the header, or "borderless". Default: "standard"', ['--table-style'], {'action': 'append', 'choices': ['booktabs', 'borderless', 'colwidths-auto', 'nolines', 'standard'], 'default': ['standard'], 'metavar': '<format>', 'validator': <function validate_comma_separated_list>}), ('LaTeX graphicx package option. Possible values are "dvipdfmx", "dvips", "dvisvgm", "luatex", "pdftex", and "xetex".Default: "".', ['--graphicx-option'], {'default': ''}), ('LaTeX font encoding. Possible values are "", "T1" (default), "OT1", "LGR,T1" or any other combination of options to the `fontenc` package. ', ['--font-encoding'], {'default': 'T1'}), ('Per default the latex-writer puts the reference title into hyperreferences. Specify "ref*" or "pageref*" to get the section number or the page number.', ['--reference-label'], {'default': ''}), ('Specify style and database(s) for bibtex, for example "--use-bibtex=unsrt,mydb1,mydb2". Provisional!', ['--use-bibtex'], {'default': '', 'metavar': '<style,bibfile[,bibfile,...]>', 'validator': <function validate_comma_separated_list>}), ('Use legacy functions with class value list for \\DUtitle and \\DUadmonition.', ['--legacy-class-functions'], {'action': 'store_true', 'default': False, 'validator': <function validate_boolean>}), ('Use \\DUrole and "DUclass" wrappers for class values. Place admonition content in an environment. (default)', ['--new-class-functions'], {'action': 'store_false', 'dest': 'legacy_class_functions', 'validator': <function validate_boolean>}), ('Use legacy algorithm to determine table column widths. (provisional default)', ['--legacy-column-widths'], {'action': 'store_true', 'default': None, 'validator': <function validate_boolean>}), ('Use new algorithm to determine table column widths. (future default)', ['--new-column-widths'], {'action': 'store_false', 'dest': 'legacy_column_widths', 'validator': <function validate_boolean>}), ('Footnotes with numbers/symbols by Docutils. (default) (The alternative, --latex-footnotes, is not implemented yet.)', ['--docutils-footnotes'], {'action': 'store_true', 'default': True, 'validator': <function validate_boolean>})))
Runtime settings specification. Override in subclasses.
Defines runtime settings and associated command-line options, as used by docutils.frontend.OptionParser. This is a tuple of:
Option group title (string or None which implies no group, just a list of single options).
Description (string or None).
A sequence of option tuples. Each consists of:
Help text (string)
List of option strings (e.g.
['-Q', '--quux']).Dictionary of keyword arguments sent to the OptionParser/OptionGroup
add_optionmethod.Runtime setting names are derived implicitly from long option names (’–a-setting’ becomes
settings.a_setting) or explicitly from the ‘dest’ keyword argument.Most settings will also have a ‘validator’ keyword & function. The validator function validates setting values (from configuration files and command-line option arguments) and converts them to appropriate types. For example, the
docutils.frontend.validate_booleanfunction, required by all boolean settings, converts true values (‘1’, ‘on’, ‘yes’, and ‘true’) to 1 and false values (‘0’, ‘off’, ‘no’, ‘false’, and ‘’) to 0. Validators need only be set once per setting. See the docutils.frontend.validate_* functions.See the optparse docs for more details.
More triples of group title, description, options, as many times as needed. Thus, settings_spec tuples can be simply concatenated.
- settings_defaults = {'sectnum_depth': 0}
A dictionary of defaults for settings not in settings_spec (internal settings, intended to be inaccessible by command-line and config file). Override in subclasses.
- config_section = 'latex2e writer'
The name of the config file section specific to this component (lowercase, no brackets). Override in subclasses.
- config_section_dependencies = ('writers', 'latex writers')
A list of names of config file sections that are to be applied before config_section, in order (from general to specific). In other words, the settings in config_section are to be overlaid on top of the settings from these sections. The “general” section is assumed implicitly. Override in subclasses.
- head_parts = ('head_prefix', 'requirements', 'latex_preamble', 'stylesheet', 'fallbacks', 'pdfsetup', 'titledata')
- visitor_attributes = ('head_prefix', 'requirements', 'latex_preamble', 'stylesheet', 'fallbacks', 'pdfsetup', 'titledata', 'title', 'subtitle', 'body_pre_docinfo', 'docinfo', 'dedication', 'abstract', 'body')
- output = None
Final translated form of document.
- translate()[source]
Do final translation of self.document into self.output. Called from write. Override in subclasses.
Usually done with a docutils.nodes.NodeVisitor subclass, in combination with a call to docutils.nodes.Node.walk() or docutils.nodes.Node.walkabout(). The
NodeVisitorsubclass must support all standard elements (listed in docutils.nodes.node_class_names) and possibly non-standard elements used by the current Reader as well.
- class Babel(language_code, reporter=None)[source]
Bases:
objectLanguage specifics for LaTeX.
- language_codes = {'af': 'afrikaans', 'ar': 'arabic', 'bg': 'bulgarian', 'br': 'breton', 'ca': 'catalan', 'cs': 'czech', 'cy': 'welsh', 'da': 'danish', 'de': 'ngerman', 'de-1901': 'german', 'de-at': 'naustrian', 'de-at-1901': 'austrian', 'dsb': 'lowersorbian', 'el': 'greek', 'el-polyton': 'polutonikogreek', 'en': 'english', 'en-au': 'australian', 'en-ca': 'canadian', 'en-gb': 'british', 'en-nz': 'newzealand', 'en-us': 'american', 'eo': 'esperanto', 'es': 'spanish', 'et': 'estonian', 'eu': 'basque', 'fi': 'finnish', 'fr': 'french', 'fr-ca': 'canadien', 'ga': 'irish', 'gl': 'galician', 'grc-ibycus': 'ibycus', 'he': 'hebrew', 'hr': 'croatian', 'hsb': 'uppersorbian', 'hu': 'magyar', 'ia': 'interlingua', 'id': 'bahasai', 'is': 'icelandic', 'it': 'italian', 'ja': 'japanese', 'kk': 'kazakh', 'la': 'latin', 'lt': 'lithuanian', 'lv': 'latvian', 'mn': 'mongolian', 'ms': 'bahasam', 'nb': 'norsk', 'nl': 'dutch', 'nn': 'nynorsk', 'no': 'norsk', 'pl': 'polish', 'pt': 'portuges', 'pt-br': 'brazil', 'ro': 'romanian', 'ru': 'russian', 'se': 'samin', 'sh-cyrl': 'serbianc', 'sh-latn': 'serbian', 'sk': 'slovak', 'sl': 'slovene', 'sq': 'albanian', 'sr': 'serbianc', 'sr-latn': 'serbian', 'sv': 'swedish', 'tr': 'turkish', 'uk': 'ukrainian', 'vi': 'vietnam'}
- warn_msg = 'Language "%s" not supported by LaTeX (babel)'
- active_chars = {'galician': '.<>', 'spanish': '.<>'}
- class SortableDict[source]
Bases:
dictDictionary with additional sorting methods
- Tip: use key starting with with ‘_’ for sorting before small letters
and with ‘~’ for sorting after small letters.
- class PreambleCmds[source]
Bases:
objectBuilding blocks for the latex preamble.
- abstract = '\n\\providecommand*{\\DUCLASSabstract}{\n \\renewcommand{\\DUtitle}[1]{\\centerline{\\textbf{##1}}}\n}'
- abstract_legacy = '\n% abstract title\n\\providecommand*{\\DUtitleabstract}[1]{\\centerline{\\textbf{#1}}}'
- admonition = '\n% admonition environment (specially marked topic)\n\\ifx\\DUadmonition\\undefined % poor man\'s "provideenvironment"\n \\newbox{\\DUadmonitionbox}\n \\newenvironment{DUadmonition}%\n {\\begin{center}\n \\begin{lrbox}{\\DUadmonitionbox}\n \\begin{minipage}{0.9\\linewidth}\n }%\n { \\end{minipage}\n \\end{lrbox}\n \\fbox{\\usebox{\\DUadmonitionbox}}\n \\end{center}\n }\n\\fi'
- admonition_legacy = '\n% admonition (specially marked topic)\n\\providecommand{\\DUadmonition}[2][class-arg]{%\n % try \\DUadmonition#1{#2}:\n \\ifcsname DUadmonition#1\\endcsname%\n \\csname DUadmonition#1\\endcsname{#2}%\n \\else\n \\begin{center}\n \\fbox{\\parbox{0.9\\linewidth}{#2}}\n \\end{center}\n \\fi\n}'
- color = '\\usepackage{color}'
- dedication = '\n% special topic for dedications\n\\providecommand*{\\DUCLASSdedication}{%\n \\renewenvironment{quote}{\\begin{center}}{\\end{center}}%\n}'
- docinfo = '\n% width of docinfo table\n\\DUprovidelength{\\DUdocinfowidth}{0.9\\linewidth}'
- documentsubtitle = '\n% subtitle (in document title)\n\\providecommand*{\\DUdocumentsubtitle}[1]{{\\large #1}}'
- duclass = '\n% class handling for environments (block-level elements)\n% \\begin{DUclass}{spam} tries \\DUCLASSspam and\n% \\end{DUclass}{spam} tries \\endDUCLASSspam\n\\ifx\\DUclass\\undefined % poor man\'s "provideenvironment"\n \\newenvironment{DUclass}[1]%\n {% "#1" does not work in end-part of environment.\n \\def\\DocutilsClassFunctionName{DUCLASS#1}\n \\csname \\DocutilsClassFunctionName \\endcsname}%\n {\\csname end\\DocutilsClassFunctionName \\endcsname}%\n\\fi'
- error = '\n\\providecommand*{\\DUCLASSerror}{\\color{red}}'
- error_legacy = '\n% error admonition title\n\\providecommand*{\\DUtitleerror}[1]{\\DUtitle{\\color{red}#1}}'
- fieldlist = '\n% field list environment (for separate configuration of `field lists`)\n\\ifthenelse{\\isundefined{\\DUfieldlist}}{\n \\newenvironment{DUfieldlist}%\n {\\quote\\description}\n {\\enddescription\\endquote}\n}{}'
- float = '\\usepackage{float} % extended float configuration\n\\floatplacement{figure}{H} % place figures here definitely'
- footnotes = '\n% numerical or symbol footnotes with hyperlinks and backlinks\n\\providecommand*{\\DUfootnotemark}[3]{%\n \\raisebox{1em}{\\hypertarget{#1}{}}%\n \\hyperlink{#2}{\\textsuperscript{#3}}%\n}\n\\providecommand{\\DUfootnotetext}[4]{%\n \\begingroup%\n \\renewcommand{\\thefootnote}{%\n \\protect\\raisebox{1em}{\\protect\\hypertarget{#1}{}}%\n \\protect\\hyperlink{#2}{#3}}%\n \\footnotetext{#4}%\n \\endgroup%\n}'
- highlight_rules = '\n% basic code highlight:\n\\providecommand*\\DUrolecomment[1]{\\textcolor[rgb]{0.40,0.40,0.40}{#1}}\n\\providecommand*\\DUroledeleted[1]{\\textcolor[rgb]{0.40,0.40,0.40}{#1}}\n\\providecommand*\\DUrolekeyword[1]{\\textbf{#1}}\n\\providecommand*\\DUrolestring[1]{\\textit{#1}}'
- inline = '\n% custom inline roles: \\DUrole{#1}{#2} tries \\DUrole#1{#2}\n\\providecommand*{\\DUrole}[2]{%\n \\ifcsname DUrole#1\\endcsname%\n \\csname DUrole#1\\endcsname{#2}%\n \\else%\n #2%\n \\fi%\n}'
- legend = '\n% legend environment (in figures and formal tables)\n\\ifthenelse{\\isundefined{\\DUlegend}}{\n \\newenvironment{DUlegend}{\\small}{}\n}{}'
- lineblock = '\n% line block environment\n\\DUprovidelength{\\DUlineblockindent}{2.5em}\n\\ifthenelse{\\isundefined{\\DUlineblock}}{\n \\newenvironment{DUlineblock}[1]{%\n \\list{}{\\setlength{\\partopsep}{\\parskip}\n \\addtolength{\\partopsep}{\\baselineskip}\n \\setlength{\\topsep}{0pt}\n \\setlength{\\itemsep}{0.15\\baselineskip}\n \\setlength{\\parsep}{0pt}\n \\setlength{\\leftmargin}{#1}}\n \\raggedright\n }\n {\\endlist}\n}{}'
- linking = '%% hyperlinks:\n\\ifthenelse{\\isundefined{\\hypersetup}}{\n \\usepackage[%s]{hyperref}\n \\usepackage{bookmark}\n \\urlstyle{same} %% normal text font (alternatives: tt, rm, sf)\n}{}'
- minitoc = '%% local table of contents\n\\usepackage{minitoc}'
- optionlist = '\n% list of command line options\n\\providecommand*{\\DUoptionlistlabel}[1]{\\bfseries #1 \\hfill}\n\\DUprovidelength{\\DUoptionlistindent}{3cm}\n\\ifthenelse{\\isundefined{\\DUoptionlist}}{\n \\newenvironment{DUoptionlist}{%\n \\list{}{\\setlength{\\labelwidth}{\\DUoptionlistindent}\n \\setlength{\\rightmargin}{1cm}\n \\setlength{\\leftmargin}{\\rightmargin}\n \\addtolength{\\leftmargin}{\\labelwidth}\n \\addtolength{\\leftmargin}{\\labelsep}\n \\renewcommand{\\makelabel}{\\DUoptionlistlabel}}\n }\n {\\endlist}\n}{}'
- providelength = '\n% Provide a length variable and set default, if it is new\n\\providecommand*{\\DUprovidelength}[2]{\n \\ifthenelse{\\isundefined{#1}}{\\newlength{#1}\\setlength{#1}{#2}}{}\n}'
- rubric = '\n% informal heading\n\\providecommand*{\\DUrubric}[1]{\\subsubsection*{\\emph{#1}}}'
- sidebar = '\n% text outside the main text flow\n\\providecommand{\\DUsidebar}[1]{%\n \\begin{center}\n \\colorbox[gray]{0.80}{\\parbox{0.9\\linewidth}{#1}}\n \\end{center}\n}'
- subtitle = '\n% subtitle (for sidebar)\n\\providecommand*{\\DUsubtitle}[1]{\\par\\emph{#1}\\smallskip}'
- table = '\\usepackage{longtable,ltcaption,array}\n\\setlength{\\extrarowheight}{2pt}\n\\newlength{\\DUtablewidth} % internal use in tables'
- table_columnwidth = '\\newcommand{\\DUcolumnwidth}[1]{\\dimexpr#1\\DUtablewidth-2\\tabcolsep\\relax}'
- textcomp = '\\usepackage{textcomp} % text symbol macros'
- title = '\n% title for topics, admonitions, unsupported section levels, and sidebar\n\\providecommand*{\\DUtitle}[1]{%\n \\smallskip\\noindent\\textbf{#1}\\smallskip}'
- title_legacy = '\n% title for topics, admonitions, unsupported section levels, and sidebar\n\\providecommand*{\\DUtitle}[2][class-arg]{%\n % call \\DUtitle#1{#2} if it exists:\n \\ifcsname DUtitle#1\\endcsname%\n \\csname DUtitle#1\\endcsname{#2}%\n \\else\n \\smallskip\\noindent\\textbf{#2}\\smallskip%\n \\fi\n}'
- titlereference = '\n% titlereference standard role\n\\providecommand*{\\DUroletitlereference}[1]{\\textsl{#1}}'
- toc_list = '\n\\providecommand*{\\DUCLASScontents}{%\n \\renewenvironment{itemize}%\n {\\begin{list}{}{\\setlength{\\partopsep}{0pt}\n \\setlength{\\parsep}{0pt}}\n }%\n {\\end{list}}%\n}'
- transition = '\n% transition (break / fancybreak / anonymous section)\n\\providecommand*{\\DUtransition}{%\n \\hspace*{\\fill}\\hrulefill\\hspace*{\\fill}\n \\vskip 0.5\\baselineskip\n}'
- ttem = '\n% character width in monospaced font\n\\newlength{\\ttemwidth}\n\\settowidth{\\ttemwidth}{\\ttfamily M}'
- class CharMaps[source]
Bases:
objectLaTeX representations for active and Unicode characters.
- alltt = {92: '\\textbackslash{}', 123: '\\{', 125: '\\}'}
- special = {34: '\\textquotedbl{}', 35: '\\#', 36: '\\$', 37: '\\%', 38: '\\&', 91: '{[}', 93: '{]}', 94: '\\textasciicircum{}', 95: '\\_', 126: '\\textasciitilde{}', 173: '\\-'}
- unsupported_unicode = {8192: '\\enskip', 8193: '\\quad', 8194: '\\enskip', 8195: '\\quad', 8200: '\\,', 8203: '\\hspace{0pt}', 8209: '\\hbox{-}', 8239: '\\,', 8491: '\\AA', 8660: '\\ensuremath{\\Leftrightarrow}', 8800: '\\ensuremath{\\neq}', 8801: '\\ensuremath{\\equiv}', 8804: '\\ensuremath{\\le}', 8805: '\\ensuremath{\\ge}', 9824: '\\ensuremath{\\spadesuit}', 9827: '\\ensuremath{\\clubsuit}', 64256: 'ff', 64257: 'fi', 64258: 'fl', 64259: 'ffi', 64260: 'ffl'}
- utf8_supported_unicode = {160: '~', 171: '\\guillemotleft{}', 187: '\\guillemotright{}', 8204: '\\textcompwordmark{}', 8211: '\\textendash{}', 8212: '\\textemdash{}', 8216: '\\textquoteleft{}', 8217: '\\textquoteright{}', 8218: '\\quotesinglbase{}', 8220: '\\textquotedblleft{}', 8221: '\\textquotedblright{}', 8222: '\\quotedblbase{}', 8224: '\\dag{}', 8225: '\\ddag{}', 8230: '\\dots{}', 8240: '\\textperthousand{}', 8241: '\\textpertenthousand{}', 8249: '\\guilsinglleft{}', 8250: '\\guilsinglright{}', 8482: '\\texttrademark{}', 9251: '\\textvisiblespace{}'}
- textcomp = {162: '\\textcent{}', 164: '\\textcurrency{}', 165: '\\textyen{}', 166: '\\textbrokenbar{}', 167: '\\textsection{}', 168: '\\textasciidieresis{}', 169: '\\textcopyright{}', 170: '\\textordfeminine{}', 172: '\\textlnot{}', 174: '\\textregistered{}', 175: '\\textasciimacron{}', 176: '\\textdegree{}', 177: '\\textpm{}', 178: '\\texttwosuperior{}', 179: '\\textthreesuperior{}', 180: '\\textasciiacute{}', 181: '\\textmu{}', 182: '\\textparagraph{}', 185: '\\textonesuperior{}', 186: '\\textordmasculine{}', 188: '\\textonequarter{}', 189: '\\textonehalf{}', 190: '\\textthreequarters{}', 215: '\\texttimes{}', 247: '\\textdiv{}', 402: '\\textflorin{}', 697: '\\textasciiacute{}', 698: '\\textacutedbl{}', 8214: '\\textbardbl{}', 8226: '\\textbullet{}', 8242: '\\textasciiacute{}', 8243: '\\textacutedbl{}', 8245: '\\textasciigrave{}', 8246: '\\textgravedbl{}', 8251: '\\textreferencemark{}', 8253: '\\textinterrobang{}', 8260: '\\textfractionsolidus{}', 8261: '\\textlquill{}', 8262: '\\textrquill{}', 8274: '\\textdiscount{}', 8353: '\\textcolonmonetary{}', 8355: '\\textfrenchfranc{}', 8356: '\\textlira{}', 8358: '\\textnaira{}', 8361: '\\textwon{}', 8363: '\\textdong{}', 8364: '\\texteuro{}', 8369: '\\textpeso{}', 8370: '\\textguarani{}', 8451: '\\textcelsius{}', 8470: '\\textnumero{}', 8471: '\\textcircledP{}', 8478: '\\textrecipe{}', 8480: '\\textservicemark{}', 8482: '\\texttrademark{}', 8486: '\\textohm{}', 8487: '\\textmho{}', 8494: '\\textestimated{}', 8592: '\\textleftarrow{}', 8593: '\\textuparrow{}', 8594: '\\textrightarrow{}', 8595: '\\textdownarrow{}', 8722: '\\textminus{}', 8727: '\\textasteriskcentered{}', 8730: '\\textsurd{}', 9250: '\\textblank{}', 9702: '\\textopenbullet{}', 9711: '\\textbigcircle{}', 9834: '\\textmusicalnote{}', 9901: '\\textmarried{}', 9902: '\\textdivorced{}', 10216: '\\textlangle{}', 10217: '\\textrangle{}'}
- pifont = {9829: '\\ding{170}', 9830: '\\ding{169}', 10003: '\\ding{51}', 10007: '\\ding{55}'}
- class DocumentClass(document_class, with_part=False)[source]
Bases:
objectDetails of a LaTeX document class.
- class Table(translator, latex_type)[source]
Bases:
objectManage a table while traversing.
Table style might be
- Standard:
horizontal and vertical lines
- Booktabs:
only horizontal lines (requires “booktabs” LaTeX package)
- Borderless:
no borders around table cells
- Nolines:
alias for borderless
- Colwidths-auto:
column widths determined by LaTeX
- class LaTeXTranslator(document, babel_class=<class 'docutils.writers.latex2e.Babel'>)[source]
Bases:
NodeVisitorGenerate code for 8-bit LaTeX from a Docutils document tree.
See the docstring of docutils.writers._html_base.HTMLTranslator for notes on and examples of safe subclassing.
- is_xetex = False
- has_latex_toc = False
- section_level = 0
- inside_citation_reference_label = False
- verbatim = False
- insert_non_breaking_blanks = False
- insert_newline = False
- literal = False
- alltt = False
- compound_enumerators = False
- section_prefix_for_enumerators = False
- section_enumerator_separator = '-'
- context
Heterogeneous stack.
Used by visit_* and depart_* functions in conjunction with the tree traversal. Make sure that the pops correspond to the pushes.
- to_latex_encoding(docutils_encoding)[source]
Translate docutils encoding name into LaTeX’s.
Default method is remove “-” and “_” chars from docutils_encoding.
- encode(text)[source]
Return text with ‘problematic’ characters escaped.
Escape the special printing characters
# $ % & ~ _ ^ \ { }, square brackets[ ], double quotes and (in OT1)< | >.Translate non-supported Unicode characters.
Separate
-(and more in literal text) to prevent input ligatures.
- attval(text, whitespace=re.compile('[\n\r\t\x0b\x0c]'))[source]
Cleanse, encode, and return attribute value text.
- ids_to_labels(node, set_anchor=True, protect=False, newline=False)[source]
Return list of label definitions for all ids of node
If set_anchor is True, an anchor is set with phantomsection. If protect is True, the label cmd is made robust. If newline is True, a newline is added if there are labels.
- term_postfix(node)[source]
Return LaTeX code required between term or field name and content.
In a LaTeX “description” environment (used for definition lists and non-docinfo field lists), a
\leavevmodebetween an item’s label and content ensures the correct placement of certain block constructs.
- to_latex_length(length_str, pxunit=None)[source]
Convert length_str with rst length to LaTeX length
- visit_literal_block(node)[source]
Render a literal block.
Corresponding rST elements: literal block, parsed-literal, code.
- visit_option_argument(node)[source]
Append the delimiter between an option and its argument to body.
- attribution_formats = {'dash': ('—', ''), 'none': ('', ''), 'parens': ('(', ')'), 'parentheses': ('(', ')')}
- _thead_depth = 0