o
    i
                     @   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r3dd	 | jD |jd
< | jdur>| j|jd< | jdurI| 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latexpygments_definitions)stylepygments_style_nameNc                 S   s   g | ]}d |iqS )name ).0authorr   r   X/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/nbconvert/preprocessors/latex.py
<listcomp>I   s    z0LatexPreprocessor.preprocess.<locals>.<listcomp>authorsdatetitle)	pygments.formattersr   
setdefaultr   get_style_defsauthor_namesmetadatar   r   )selfnb	resourcesr   r   r   r   
preprocess4   s   


zLatexPreprocessor.preprocess)__name__
__module____qualname____doc__r   tagr   r   r   r   r   r"   r   r   r   r   r      s(    	r   N)r&   	traitletsr   r   baser   r   r   r   r   r   <module>   s    