o !5p`@sdZdZddlZddlZddlZddlZddlmZmZmZm Z m Z ddl m Z Gddde j Z Gdd d e jZGd d d e jZdS) z XeLaTeX document tree Writer. A variant of Docutils' standard 'latex2e' writer producing LaTeX output suited for processing with the Unicode-aware TeX engines LuaTeX and XeTeX. reStructuredTextN)frontendnodesutilswriters languages)latex2ec@sleZdZdZdZ dZdgdZdZdZ e j e j jdd ed ged d fd dgdeifdZddZdS)Writerz9A writer for Unicode-aware LaTeX variants (XeTeX, LuaTeX))lxtexxetexxelatexluatexlualatexz xelatex.tex )z;% Linux Libertine (free, wide coverage, not only for Linux)z\setmainfont{Linux Libertine O}z\setsansfont{Linux Biolinum O}zD\setmonofont[HyphenChar=None,Scale=MatchLowercase]{DejaVu Sans Mono}z xetex writer)rz latex writerszlatex2e writer font_encodingzTemplate file. Default: "%s".z --templatez)defaultmetavarzUCustomization by LaTeX code in the preamble. Default: select "Linux Libertine" fonts.z--latex-preambler)templatelatex_preamblecCs&tj||jddit|_dS)N fontencoding)rr __init__settings_defaultsupdateXeLaTeXTranslatortranslator_class)selfrA/usr/lib/python3/dist-packages/docutils/writers/xetex/__init__.pyr@s  zWriter.__init__N)__name__ __module__ __qualname____doc__ supporteddefault_templatejoindefault_preambleconfig_sectionconfig_section_dependenciesrfilter_settings_specrr settings_specrrrrrr #s(  r c@seZdZdZejjZedddddddd d d d d d ddde dde DZdD]Z ee =q.ddZ ddZdS)Babelz`Language specifics for XeTeX. Use `polyglossia` instead of `babel` and adapt settings. copticgermanogermandivehilsorbian polygreekfarsi ancientgreekusorbianserbiancroatianalbanianthai vietnamese)copdezde-1901dvdsbz el-polytonfagrchsbzsh-Cyrlzsh-LatnsqsrthvicCsg|] \}}||fqSr)lower).0kvrrr aszBabel.) afzde-ATz de-AT-1901zen-CAzen-GBzen-NZzen-USzfr-CAz grc-ibycuszsr-LatncCs:||_||_|||_i|_d|_d|_d|_d|_dS)Nz+Language "%s" not supported by Polyglossia.r)"rKrK) language_codereporter language_namelanguageotherlanguageswarn_msg quote_indexquotesliteral_double_quote)rrLrMrrrrrs  zBabel.__init__cCs<dd|jg}|jr|ddt|jd|S)Nz\usepackage{polyglossia}z\setdefaultlanguage{%s}z\setotherlanguages{%s},r)rOrPappendr%sortedkeys)rsetuprrr__call__~s zBabel.__call__N)rr r!r"rr+language_codescopyrdictitemskeyrErrZrrrrr+Fs2   r+c@seZdZdZddZdS)rz Generate code for LaTeX using Unicode fonts (XeLaTex or LuaLaTeX). See the docstring of docutils.writers._html_base.HTMLTranslator for notes on and examples of safe subclassing. cCsFd|_tj||t|jdkr|jdddSd|j|jd<dS)NTutf8 _inputencz\XeTeXinputencoding %s )is_xetexrLaTeXTranslatorrr+latex_encoding requirementspop)rdocumentrrrrs zXeLaTeXTranslator.__init__N)rr r!r"rrrrrrs r)r" __docformat__osos.pathredocutilsrrrrrdocutils.writersrr r+rcrrrrrs #A