ó
¦į­Qc           @   sĆ   d  Z  d Z d d l Z d d l Z d d l Z d d l Z d d l m Z m Z m Z m	 Z	 m
 Z
 d d l m Z d e j f d     YZ d e j f d	     YZ d
 e j f d     YZ d S(   s   
XeLaTeX document tree Writer.

A variant of Docutils' standard 'latex2e' writer producing output
suited for processing with XeLaTeX (http://tug.org/xetex/).
t   reStructuredTexti’’’’N(   t   frontendt   nodest   utilst   writerst	   languages(   t   latex2et   Writerc           B   s   e  Z d  Z d Z d Z d j d d d d	 g  Z d
 Z d Z e	 j
 e j j d d d e d g i e d 6d d 6f d d d g i e d 6f Z d   Z RS(   s9   A writer for Unicode-based LaTeX variants (XeTeX, LuaTeX)t   xetext   xelatext   luatexs   xelatex.texs   
s;   % Linux Libertine (free, wide coverage, not only for Linux)s   \setmainfont{Linux Libertine O}s   \setsansfont{Linux Biolinum O}sD   \setmonofont[HyphenChar=None,Scale=MatchLowercase]{DejaVu Sans Mono}s   xetex writerR   s   latex2e writert   font_encodingt   templates   Template file. Default: "%s".s
   --templatet   defaults   <file>t   metavart   latex_preamblesl   Customization by LaTeX code in the preamble. Default: select PDF standard fonts (Times, Helvetica, Courier).s   --latex-preamblec         C   s4   t  j j |   |  j j i d d 6 t |  _ d  S(   Nt    t   fontencoding(   R   R   t   __init__t   settings_defaultst   updatet   XeLaTeXTranslatort   translator_class(   t   self(    (    sC   /usr/lib/python2.7/dist-packages/docutils/writers/xetex/__init__.pyR   >   s    (   R   R	   R
   (   s   writerss   latex2e writer(   t   __name__t
   __module__t   __doc__t	   supportedt   default_templatet   joint   default_preamblet   config_sectiont   config_section_dependenciesR   t   filter_settings_specR   R   t   settings_specR   (    (    (    sC   /usr/lib/python2.7/dist-packages/docutils/writers/xetex/__init__.pyR   "   s&   	t   Babelc           B   sż   e  Z d  Z e j j j   Z e j i d d 6d d 6d d 6d d 6d	 d
 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6 e g  e j	   D] \ Z
 Z e
 j   e f ^ q¤  Z x d& D] Z e e j   =qŅ Wd$   Z d%   Z RS('   s`   Language specifics for XeTeX.

    Use `polyglossia` instead of `babel` and adapt settings.
    t   coptict   copt   germant   det   ogermans   de-1901t   divehit   dvt   lsorbiant   dsbt	   polygreeks
   el-polytont   farsit   fat   ancientgreekt   grct   usorbiant   hsbt   serbians   sh-Cyrlt   croatians   sh-Latnt   albaniant   sqt   srt   thait   tht
   vietnameset   vit   afs   de-ATs
   de-AT-1901s   fr-CAs
   grc-ibycuss   sr-Latnc         C   sU   | |  _  | |  _ |  j |  |  _ i  |  _ d |  _ d |  _ d |  _ d |  _ d  S(   Ns3   Language "%s" not supported by XeTeX (polyglossia).i    t   "u   "(   R>   R>   (	   t   language_codet   reportert   language_namet   languaget   otherlanguagest   warn_msgt   quote_indext   quotest   literal_double_quote(   R   R?   R@   (    (    sC   /usr/lib/python2.7/dist-packages/docutils/writers/xetex/__init__.pyR   k   s    						c         C   sU   d d |  j  g } |  j rH | j d d j t |  j j      n  d j |  S(   Ns   \usepackage{polyglossia}s   \setdefaultlanguage{%s}s   \setotherlanguages{%s}t   ,s   
(   RB   RC   t   appendR   t   sortedt   keys(   R   t   setup(    (    sC   /usr/lib/python2.7/dist-packages/docutils/writers/xetex/__init__.pyt   __call__w   s    		#(   R=   s   de-ATs
   de-AT-1901s   fr-CAs
   grc-ibycuss   sr-Latn(   R   R   R   R   R#   t   language_codest   copyR   t   dictt   itemst   kt   vt   lowert   keyR   RM   (    (    (    sC   /usr/lib/python2.7/dist-packages/docutils/writers/xetex/__init__.pyR#   D   s8   	7    
	R   c           B   s   e  Z d    Z RS(   c         C   s\   t  |  _ t j j |  | t  |  j d k rD |  j j d d   n d |  j |  j d <d  S(   Nt   utf8t	   _inputencs   \XeTeXinputencoding %s (
   t   Truet   is_xetexR   t   LaTeXTranslatorR   R#   t   latex_encodingt   requirementst   popt   None(   R   t   document(    (    sC   /usr/lib/python2.7/dist-packages/docutils/writers/xetex/__init__.pyR      s    	(   R   R   R   (    (    (    sC   /usr/lib/python2.7/dist-packages/docutils/writers/xetex/__init__.pyR      s   (   R   t   __docformat__t   ost   os.patht   ret   docutilsR   R   R   R   R   t   docutils.writersR   R   R#   RZ   R   (    (    (    sC   /usr/lib/python2.7/dist-packages/docutils/writers/xetex/__init__.pyt   <module>   s   ("<