ó
§‰]c           @   s’   d  Z  d d l Z d d l m Z m Z d d l m Z d d l m Z d d l	 m
 Z
 d d l m Z d d	 l m Z d
 e f d „  ƒ  YZ d S(   s   LaTeX Exporter classiÿÿÿÿN(   t   Unicodet   default(   t   Config(   t   jupyter_path(   t   Highlight2Latex(   t   resolve_referencesi   (   t   TemplateExportert   LatexExporterc           B   sÈ   e  Z d  Z d Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d „  ƒ Z e d ƒ d	 „  ƒ Z e d
 ƒ d „  ƒ Z	 e
 d ƒ j d e ƒ Z d Z d „  Z e d „  ƒ Z d d „ Z d „  Z RS(   sN  
    Exports to a Latex template.  Inherit from this class if your template is
    LaTeX based and you need custom transformers/filters.
    If you don't need custom transformers/filters, just change the 
    'template_file' config option.  Place your template in the special "/latex" 
    subfolder of the "../templates" folder.
    t   LaTeXt   file_extensionc         C   s   d S(   Ns   .tex(    (   t   self(    (    s8   lib/python2.7/site-packages/nbconvert/exporters/latex.pyt   _file_extension_default   s    t   template_filec         C   s   d S(   Ns   article.tplx(    (   R
   (    (    s8   lib/python2.7/site-packages/nbconvert/exporters/latex.pyt   _template_file_default   s    t   default_template_pathc         C   s   t  j j d d d ƒ S(   Ns   ..t	   templatest   latex(   t   ost   patht   join(   R
   (    (    s8   lib/python2.7/site-packages/nbconvert/exporters/latex.pyt   _default_template_path_default#   s    t   template_skeleton_pathc         C   s   t  j j d d d d ƒ S(   Ns   ..R   R   t   skeleton(   R   R   R   (   R
   (    (    s8   lib/python2.7/site-packages/nbconvert/exporters/latex.pyt   _template_skeleton_path_default'   s    t   template_data_pathsc         C   s   t  d d d ƒ S(   Nt	   nbconvertR   R   (   R   (   R
   (    (    s8   lib/python2.7/site-packages/nbconvert/exporters/latex.pyt   _template_data_paths_default+   s    s   .tplxt   configs
   text/latexc         c   s4   x" t  t |  ƒ j ƒ  D] } | Vq Wd t f Vd  S(   NR   (   t   superR   t   default_filtersR   (   R
   t   x(    (    s8   lib/python2.7/site-packages/nbconvert/exporters/latex.pyR   4   s    	c      
   C   s’   t  i i d d d d d d d g d 6d	 6i t d
 6d 6i t d
 6d 6i t d
 6d 6i t d
 6d 6i t d
 6d 6ƒ } | j t t |  ƒ j ƒ | S(   Ns
   text/latexs   application/pdfs	   image/pngs
   image/jpegs   image/svg+xmls   text/markdowns
   text/plaint   display_data_priorityt   NbConvertBaset   enabledt   ExtractOutputPreprocessort   SVG2PDFPreprocessort   LatexPreprocessort   SphinxPreprocessort   HighlightMagicsPreprocessor(   R   t   Truet   mergeR   R   t   default_config(   R
   t   c(    (    s8   lib/python2.7/site-packages/nbconvert/exporters/latex.pyR)   9   s     c         K   sƒ   | j  j d i  ƒ } | j d | j d d  ƒ ƒ } |  j j d t d | d |  ƒ ƒ } |  j d | ƒ t t |  ƒ j | | |  S(   Nt   language_infot   pygments_lexert   namet   highlight_codet   parent(	   t   metadatat   gett   Nonet   filtersR   t   register_filterR   R   t   from_notebook_node(   R
   t   nbt	   resourcest   kwt   langinfot   lexerR.   (    (    s8   lib/python2.7/site-packages/nbconvert/exporters/latex.pyR5   R   s
    $c         C   sO   t  t |  ƒ j ƒ  } d | _ d | _ d | _ d | _ d | _ d | _ | S(   Ns   ((*s   *))s   (((s   )))s   ((=s   =))(	   R   R   t   _create_environmentt   block_start_stringt   block_end_stringt   variable_start_stringt   variable_end_stringt   comment_start_stringt   comment_end_string(   R
   t   environment(    (    s8   lib/python2.7/site-packages/nbconvert/exporters/latex.pyR;   Z   s    						N(   t   __name__t
   __module__t   __doc__t   export_from_notebookR   R   R   R   R   R   R    t   tagR'   t   template_extensiont   output_mimetypeR   t   propertyR)   R2   R5   R;   (    (    (    s8   lib/python2.7/site-packages/nbconvert/exporters/latex.pyR      s   	(   RE   R   t	   traitletsR    R   t   traitlets.configR   t   jupyter_core.pathsR   t   nbconvert.filters.highlightR   t   nbconvert.filters.filter_linksR   t   templateexporterR   R   (    (    (    s8   lib/python2.7/site-packages/nbconvert/exporters/latex.pyt   <module>   s   