U C^E@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. ZreStructuredTextN)frontendnodesutilswriters languages)latex2ec@sneZdZdZdZdZdddddgZd Zd Z e j e j jd d ed geddfddgdeifdZddZdS)Writerz9A writer for Unicode-aware LaTeX variants (XeTeX, LuaTeX))ZlxtexZxetexZxelatexZluatexZlualatexz 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)rzlatex2e writerZ font_encodingzTemplate file. Default: "%s".z --templatez)defaultmetavarzUCustomization by LaTeX code in the preamble. Default: select "Linux Libertine" fonts.z--latex-preambler )templateZlatex_preamblecCs&tj||jddit|_dS)NZ fontencoding)rr__init__Zsettings_defaultsupdateXeLaTeXTranslatorZtranslator_class)selfrE/tmp/pip-install-6_kvzl1k/docutils/docutils/writers/xetex/__init__.pyr?s zWriter.__init__N)__name__ __module__ __qualname____doc__ supportedZdefault_templatejoinZdefault_preambleZconfig_sectionZconfig_section_dependenciesrZfilter_settings_specrrZ settings_specrrrrrr#s0 rc@seZdZdZejjZedddddddd d d d d d ddde dde e DZdD]Z ee =q`ddZddZdS)Babelz`Language specifics for XeTeX. Use `polyglossia` instead of `babel` and adapt settings. ZcopticgermanZogermanZdivehiZlsorbianZ polygreekZfarsiZ ancientgreekZusorbianZserbiancroatianZalbanianthaiZ vietnamese)Zcopdezde-1901ZdvZdsbz el-polytonfaZgrcZhsbzsh-Cyrlzsh-LatnsqsrthvicCsg|]\}}||fqSr)lower).0kvrrr `szBabel.) 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)"r*r*) language_codereporterZ language_namelanguageotherlanguagesZwarn_msgZ quote_indexquotesZliteral_double_quote)rr+r,rrrrqs zBabel.__init__cCs<dd|jg}|jr2|ddt|jd|S)Nz\usepackage{polyglossia}z\setdefaultlanguage{%s}z\setotherlanguages{%s},r )r-r.appendrsortedkeys)rsetuprrr__call__}szBabel.__call__N)rrrrrrZlanguage_codescopyrdictlistitemskeyr$rr5rrrrrEs0   rc@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. cCsDd|_tj||t|jdkr0|jddnd|j|jd<dS)NTutf8Z _inputencz\XeTeXinputencoding %s )Zis_xetexrLaTeXTranslatorrrZlatex_encoding requirementspop)rdocumentrrrrs zXeLaTeXTranslator.__init__N)rrrrrrrrrrsr)rZ __docformat__osos.pathreZdocutilsrrrrrZdocutils.writersrrrr<rrrrrs "A