예제 #1
0
파일: pdflatex.py 프로젝트: aqqaluk/doconce
def define(FILENAME_EXTENSION,
           BLANKLINE,
           INLINE_TAGS_SUBST,
           CODE,
           LIST,
           ARGLIST,
           TABLE,
           EXERCISE,
           FIGURE_EXT,
           CROSS_REFS,
           INDEX_BIB,
           TOC,
           ENVIRS,
           INTRO,
           OUTRO,
           filestr):

    if not 'latex' in BLANKLINE:
        # latex.define is not yet ran on these dictionaries, do it:
        import latex
        latex.define(FILENAME_EXTENSION,
           BLANKLINE,
           INLINE_TAGS_SUBST,
           CODE,
           LIST,
           ARGLIST,
           TABLE,
           EXERCISE,
           FIGURE_EXT,
           CROSS_REFS,
           INDEX_BIB,
           TOC,
           INTRO,
           OUTRO,
           filestr)

    # The big difference between pdflatex and latex is the image formats
    FIGURE_EXT['pdflatex'] = ('.pdf', '.png', '.jpg', '.jpeg', '.tif', '.tiff')

    # The rest is copy
    ENVIRS['pdflatex'] = ENVIRS['latex']
    FILENAME_EXTENSION['pdflatex'] = FILENAME_EXTENSION['latex']
    BLANKLINE['pdflatex'] = BLANKLINE['latex']
    CODE['pdflatex'] = CODE['latex']
    LIST['pdflatex'] = LIST['latex']
    CROSS_REFS['pdflatex'] = CROSS_REFS['latex']
    INDEX_BIB['pdflatex'] = INDEX_BIB['latex']
    TABLE['pdflatex'] = TABLE['latex']
    EXERCISE['pdflatex'] = EXERCISE['latex']
    INTRO['pdflatex'] = INTRO['latex'].replace('.eps', '.pdf')
    OUTRO['pdflatex'] = OUTRO['latex']
    ARGLIST['pdflatex'] = ARGLIST['latex']
    TOC['pdflatex'] = TOC['latex']

    # make true copy of INLINE_TAGS_SUBST:
    INLINE_TAGS_SUBST['pdflatex'] = {}
    for tag in INLINE_TAGS_SUBST['latex']:
        INLINE_TAGS_SUBST['pdflatex'][tag] = INLINE_TAGS_SUBST['latex'][tag]
예제 #2
0
def define(FILENAME_EXTENSION, BLANKLINE, INLINE_TAGS_SUBST, CODE, LIST,
           ARGLIST, TABLE, EXERCISE, FIGURE_EXT, CROSS_REFS, INDEX_BIB, TOC,
           ENVIRS, QUIZ, INTRO, OUTRO, filestr):

    if not 'latex' in BLANKLINE:
        # latex.define is not yet ran on these dictionaries, do it:
        import latex
        latex.define(FILENAME_EXTENSION, BLANKLINE, INLINE_TAGS_SUBST, CODE,
                     LIST, ARGLIST, TABLE, EXERCISE, FIGURE_EXT, CROSS_REFS,
                     INDEX_BIB, TOC, ENVIRS, QUIZ, INTRO, OUTRO, filestr)

    # The big difference between pdflatex and latex is the image formats
    FIGURE_EXT['pdflatex'] = {
        'search': ('.pgf', '.tikz', '.pdf', '.png', '.jpg', '.jpeg'),
        'convert': ('.pdf', '.png', '.jpg')
    }

    # The rest is copy
    ENVIRS['pdflatex'] = ENVIRS['latex']
    FILENAME_EXTENSION['pdflatex'] = FILENAME_EXTENSION['latex']
    BLANKLINE['pdflatex'] = BLANKLINE['latex']
    CODE['pdflatex'] = CODE['latex']
    LIST['pdflatex'] = LIST['latex']
    CROSS_REFS['pdflatex'] = CROSS_REFS['latex']
    INDEX_BIB['pdflatex'] = INDEX_BIB['latex']
    TABLE['pdflatex'] = TABLE['latex']
    EXERCISE['pdflatex'] = EXERCISE['latex']
    INTRO['pdflatex'] = INTRO['latex'].replace('.eps',
                                               '.pdf').replace('epsfig,', '')
    latex_style = option('latex_style=', 'std')
    if latex_style not in ('Springer_T2',
                           'Springer_T4') and not option('xelatex'):
        INTRO['pdflatex'] = INTRO['pdflatex'].replace(
            'usepackage{graphicx}', 'usepackage[pdftex]{graphicx}')
    OUTRO['pdflatex'] = OUTRO['latex']
    ARGLIST['pdflatex'] = ARGLIST['latex']
    TOC['pdflatex'] = TOC['latex']
    QUIZ['pdflatex'] = QUIZ['latex']

    # make true copy of INLINE_TAGS_SUBST:
    INLINE_TAGS_SUBST['pdflatex'] = {}
    for tag in INLINE_TAGS_SUBST['latex']:
        INLINE_TAGS_SUBST['pdflatex'][tag] = INLINE_TAGS_SUBST['latex'][tag]
    INLINE_TAGS_SUBST['pdflatex']['emoji'] = pdflatex_emoji
예제 #3
0
파일: pdflatex.py 프로젝트: apetcho/doconce
def define(FILENAME_EXTENSION,
           BLANKLINE,
           INLINE_TAGS_SUBST,
           CODE,
           LIST,
           ARGLIST,
           TABLE,
           EXERCISE,
           FIGURE_EXT,
           CROSS_REFS,
           INDEX_BIB,
           TOC,
           ENVIRS,
           QUIZ,
           INTRO,
           OUTRO,
           filestr):

    if not 'latex' in BLANKLINE:
        # latex.define is not yet ran on these dictionaries, do it:
        import latex
        latex.define(FILENAME_EXTENSION,
                     BLANKLINE,
                     INLINE_TAGS_SUBST,
                     CODE,
                     LIST,
                     ARGLIST,
                     TABLE,
                     EXERCISE,
                     FIGURE_EXT,
                     CROSS_REFS,
                     INDEX_BIB,
                     TOC,
                     ENVIRS,
                     QUIZ,
                     INTRO,
                     OUTRO,
                     filestr)

    # The big difference between pdflatex and latex is the image formats
    FIGURE_EXT['pdflatex'] = {
        'search': ('.pgf', '.pdf', '.png', '.jpg', '.jpeg'),
        'convert': ('.pdf', '.png', '.jpg')}

    # The rest is copy
    ENVIRS['pdflatex'] = ENVIRS['latex']
    FILENAME_EXTENSION['pdflatex'] = FILENAME_EXTENSION['latex']
    BLANKLINE['pdflatex'] = BLANKLINE['latex']
    CODE['pdflatex'] = CODE['latex']
    LIST['pdflatex'] = LIST['latex']
    CROSS_REFS['pdflatex'] = CROSS_REFS['latex']
    INDEX_BIB['pdflatex'] = INDEX_BIB['latex']
    TABLE['pdflatex'] = TABLE['latex']
    EXERCISE['pdflatex'] = EXERCISE['latex']
    INTRO['pdflatex'] = INTRO['latex'].replace('.eps', '.pdf').replace('epsfig,', '')
    latex_style = option('latex_style=', 'std')
    if latex_style not in ('Springer_T2',):
        INTRO['pdflatex'] = INTRO['pdflatex'].replace(
            'usepackage{graphicx}', 'usepackage[pdftex]{graphicx}')
    OUTRO['pdflatex'] = OUTRO['latex']
    ARGLIST['pdflatex'] = ARGLIST['latex']
    TOC['pdflatex'] = TOC['latex']
    QUIZ['pdflatex'] = QUIZ['latex']

    # make true copy of INLINE_TAGS_SUBST:
    INLINE_TAGS_SUBST['pdflatex'] = {}
    for tag in INLINE_TAGS_SUBST['latex']:
        INLINE_TAGS_SUBST['pdflatex'][tag] = INLINE_TAGS_SUBST['latex'][tag]
    INLINE_TAGS_SUBST['pdflatex']['emoji'] = pdflatex_emoji
예제 #4
0
def define(
    FILENAME_EXTENSION,
    BLANKLINE,
    INLINE_TAGS_SUBST,
    CODE,
    LIST,
    ARGLIST,
    TABLE,
    EXERCISE,
    FIGURE_EXT,
    CROSS_REFS,
    INDEX_BIB,
    TOC,
    ENVIRS,
    INTRO,
    OUTRO,
    filestr,
):

    if not "latex" in BLANKLINE:
        # latex.define is not yet ran on these dictionaries, do it:
        import latex

        latex.define(
            FILENAME_EXTENSION,
            BLANKLINE,
            INLINE_TAGS_SUBST,
            CODE,
            LIST,
            ARGLIST,
            TABLE,
            EXERCISE,
            FIGURE_EXT,
            CROSS_REFS,
            INDEX_BIB,
            TOC,
            INTRO,
            OUTRO,
            filestr,
        )

    # The big difference between pdflatex and latex is the image formats
    FIGURE_EXT["pdflatex"] = (".pdf", ".png", ".jpg", ".jpeg", ".tif", ".tiff")

    # The rest is copy
    ENVIRS["pdflatex"] = ENVIRS["latex"]
    FILENAME_EXTENSION["pdflatex"] = FILENAME_EXTENSION["latex"]
    BLANKLINE["pdflatex"] = BLANKLINE["latex"]
    CODE["pdflatex"] = CODE["latex"]
    LIST["pdflatex"] = LIST["latex"]
    CROSS_REFS["pdflatex"] = CROSS_REFS["latex"]
    INDEX_BIB["pdflatex"] = INDEX_BIB["latex"]
    TABLE["pdflatex"] = TABLE["latex"]
    EXERCISE["pdflatex"] = EXERCISE["latex"]
    INTRO["pdflatex"] = INTRO["latex"].replace(".eps", ".pdf")
    OUTRO["pdflatex"] = OUTRO["latex"]
    ARGLIST["pdflatex"] = ARGLIST["latex"]
    TOC["pdflatex"] = TOC["latex"]

    # make true copy of INLINE_TAGS_SUBST:
    INLINE_TAGS_SUBST["pdflatex"] = {}
    for tag in INLINE_TAGS_SUBST["latex"]:
        INLINE_TAGS_SUBST["pdflatex"][tag] = INLINE_TAGS_SUBST["latex"][tag]
예제 #5
0
파일: pdflatex.py 프로젝트: ahmadia/doconce
def define(FILENAME_EXTENSION,
           BLANKLINE,
           INLINE_TAGS_SUBST,
           CODE,
           LIST,
           ARGLIST,
           TABLE,
           EXERCISE,
           FIGURE_EXT,
           CROSS_REFS,
           INDEX_BIB,
           TOC,
           ENVIRS,
           QUIZ,
           INTRO,
           OUTRO,
           filestr):

    if not 'latex' in BLANKLINE:
        # latex.define is not yet ran on these dictionaries, do it:
        import latex
        latex.define(FILENAME_EXTENSION,
                     BLANKLINE,
                     INLINE_TAGS_SUBST,
                     CODE,
                     LIST,
                     ARGLIST,
                     TABLE,
                     EXERCISE,
                     FIGURE_EXT,
                     CROSS_REFS,
                     INDEX_BIB,
                     TOC,
                     ENVIRS,
                     QUIZ,
                     INTRO,
                     OUTRO,
                     filestr)

    # The big difference between pdflatex and latex is the image formats
    FIGURE_EXT['pdflatex'] = ('.pdf', '.png', '.jpg', '.jpeg')

    # The rest is copy
    ENVIRS['pdflatex'] = ENVIRS['latex']
    FILENAME_EXTENSION['pdflatex'] = FILENAME_EXTENSION['latex']
    BLANKLINE['pdflatex'] = BLANKLINE['latex']
    CODE['pdflatex'] = CODE['latex']
    LIST['pdflatex'] = LIST['latex']
    CROSS_REFS['pdflatex'] = CROSS_REFS['latex']
    INDEX_BIB['pdflatex'] = INDEX_BIB['latex']
    TABLE['pdflatex'] = TABLE['latex']
    EXERCISE['pdflatex'] = EXERCISE['latex']
    INTRO['pdflatex'] = INTRO['latex'].replace('.eps', '.pdf')
    OUTRO['pdflatex'] = OUTRO['latex']
    ARGLIST['pdflatex'] = ARGLIST['latex']
    TOC['pdflatex'] = TOC['latex']
    QUIZ['pdflatex'] = QUIZ['latex']

    # make true copy of INLINE_TAGS_SUBST:
    INLINE_TAGS_SUBST['pdflatex'] = {}
    for tag in INLINE_TAGS_SUBST['latex']:
        INLINE_TAGS_SUBST['pdflatex'][tag] = INLINE_TAGS_SUBST['latex'][tag]