コード例 #1
0
ファイル: format_pdf.py プロジェクト: balancededge/pyxam
def load():
    """
    Adds two dummy formats to the formatter, `pdf` and `dvi`. Hooks `pdf_bypass` to after `post_status` in the
    [process_list](%/Modules/process_list.html) to ensure that arguments from the command line and from the template
    file are both loaded. The bypass function checks to see if either PDF or DVI formats have been requested. Loads the
    following [options](%/Modules/options.html):
     - `recomps -r` The number of LaTeX recompilations

    :return: plugin signature
    """
    parser_composer.add_format(
        name='pdf',
        extensions=['pdf'],
        description='PDF export support',
        format={}
    )
    parser_composer.add_format(
        name='dvi',
        extensions=['dvi'],
        description='DVI export support',
        format={}
    )
    process_list.run_after('post_status', pdf_bypass)
    options.add_option('recomps', '-r', 'The number of LaTeX recompilations',  config.recomps, int)
    return signature
コード例 #2
0
def pdf_bypass():
    """
    Saves the originally specified format and then checks if either the PDF or DVI format have been requested. When
    selected the format is changed to tex and `pdf_compile` hooks to after `export` to compile the final set of tex
    files.
    """
    global compile_format
    compile_format = options.state.format()
    if options.state.format() in ['pdf', 'dvi']:
        options.state.format('tex')
        process_list.run_after('export', pdf_compile)
コード例 #3
0
ファイル: format_pdf.py プロジェクト: balancededge/pyxam
def pdf_bypass():
    """
    Saves the originally specified format and then checks if either the PDF or DVI format have been requested. When
    selected the format is changed to tex and `pdf_compile` hooks to after `export` to compile the final set of tex
    files.
    """
    global compile_format
    compile_format = options.state.format()
    if options.state.format() in ['pdf', 'dvi']:
        options.state.format('tex')
        process_list.run_after('export', pdf_compile)
コード例 #4
0
def load():
    """
    Adds two dummy formats to the formatter, `pdf` and `dvi`. Hooks `pdf_bypass` to after `post_status` in the
    [process_list](%/Modules/process_list.html) to ensure that arguments from the command line and from the template
    file are both loaded. The bypass function checks to see if either PDF or DVI formats have been requested. Loads the
    following [options](%/Modules/options.html):
     - `recomps -r` The number of LaTeX recompilations

    :return: plugin signature
    """
    parser_composer.add_format(name='pdf',
                               extensions=['pdf'],
                               description='PDF export support',
                               format={})
    parser_composer.add_format(name='dvi',
                               extensions=['dvi'],
                               description='DVI export support',
                               format={})
    process_list.run_after('post_status', pdf_bypass)
    options.add_option('recomps', '-r', 'The number of LaTeX recompilations',
                       config.recomps, int)
    return signature