a
    ø£Be°
  ã                   @   s4   d Z ddlmZmZ ddlmZ G dd„ deƒZdS )zWModule that allows latex output notebooks to be conditioned before
they are converted.
é    )ÚListÚUnicodeé   )ÚPreprocessorc                   @   sr   e Zd ZdZedddd�jdd�Zedddd�jdd�Zeeƒ dddd	�jdd�Z	ed
dd�jdd�Z
dd„ ZdS )ÚLatexPreprocessora  Preprocessor for latex destined documents.

    Populates the ``latex`` key in the resources dict,
    adding definitions for pygments highlight styles.

    Sets the authors, date and title of the latex document,
    overriding the values given in the metadata.
    NzDate of the LaTeX documentT)ÚhelpÚ
allow_none)ÚconfigzTitle of the LaTeX documentz*Author names to list in the LaTeX document)Údefault_valuer   r   Údefaultz!Name of the pygments style to use)r   c                 C   sš   ddl m} | di ¡ |d  d|| jd� ¡ ¡ |d  d| j¡ | jdurfdd	„ | jD ƒ|jd
< | jdur|| j|jd< | jdur’| j|jd< ||fS )aB  Preprocessing to apply on each notebook.

        Parameters
        ----------
        nb : NotebookNode
            Notebook being converted
        resources : dictionary
            Additional resources used in the conversion process.  Allows
            preprocessors to pass variables into the Jinja engine.
        r   )ÚLatexFormatterÚlatexZpygments_definitions)ÚstyleZpygments_style_nameNc                 S   s   g | ]}d |i‘qS )Úname© )Ú.0Úauthorr   r   ú`/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/nbconvert/preprocessors/latex.pyÚ
<listcomp>J   ó    z0LatexPreprocessor.preprocess.<locals>.<listcomp>ZauthorsÚdateÚtitle)	Zpygments.formattersr   Ú
setdefaultr   Zget_style_defsÚauthor_namesÚmetadatar   r   )ÚselfÚnbÚ	resourcesr   r   r   r   Ú
preprocess5   s    ÿ


zLatexPreprocessor.preprocess)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Útagr   r   r   r   r   r   r   r   r   r   r      s&   	ýüüûr   N)r"   Z	traitletsr   r   Úbaser   r   r   r   r   r   Ú<module>   s   