示例#1
0
from pytex.src import PytexTools
import commons
import plugins_agreg

myRequest = PytexTools.Request("mesure")
myRequest.ok_hash = commons.ok_hash
myRequest.original_filename = "mazhe.tex"

# L'ordre dans les plugin est important parce que set_isFrido retourne
# un code latex sans les commentaires
# alors que keep_script_marks compte dessus pour faire sa sélection.
myRequest.add_plugin(PytexTools.accept_all_input, "options")
plugin = PytexTools.keep_script_marks(plugins_agreg.frido_mark_list)
myRequest.add_plugin(plugin, "before_pytex")

# the plugin "split_doc" should better be of type "medicament"
# because the "Traitement" object can find the toc filename
# by himself instead of hard-code it in the function.

# If you change the '4' here, you have to change it also in 'split_book.py'
myRequest.add_plugin(plugins_agreg.split_toc("book", 4), "before_compilation")

myRequest.add_plugin(plugins_agreg.set_boolean("isBook", "true"),
                     "before_pytex")
myRequest.add_plugin(plugins_agreg.set_pdftitle("Le Frido"), "before_pytex")
myRequest.add_plugin(plugins_agreg.set_commit_hexsha, "after_pytex")
myRequest.add_plugin(plugins_agreg.assert_MonCerveau_first,
                     "after_compilation")

myRequest.new_output_filename = "0-book.pdf"
示例#2
0
"""
 Ce fichier est destiné à compiler des parties du Frido. Il sert d'exemple et il est donc suivit par Git et pas censé être modifié.
- le copier sous le nom lst_<bla>.py
- modifier la liste des fichiers à inclure (ok_filenames_list)
- modifier le nom de fichier final (ici : 0-exemple.pdf).

- compiler votre partie de Frido avec 'pytex lst_<bla>.py'
"""

from pytex.src import PytexTools
import commons
import plugins_agreg

myRequest = PytexTools.Request()
myRequest.ok_hash = commons.ok_hash

myRequest.add_plugin(plugins_agreg.set_isFrido, "before_pytex")
myRequest.original_filename = "mazhe.tex"
myRequest.ok_filenames_list = ["e_mazhe"]

myRequest.ok_filenames_list.extend(["81_Hilbert"])
myRequest.ok_filenames_list.extend(["48_StructAnneaux"])

myRequest.ok_filenames_list.extend(["157_thematique"])
myRequest.ok_filenames_list.extend(["134_choses_finales"])

myRequest.new_output_filename = "0-exemple.pdf"
示例#3
0
# -*- coding: utf8 -*-

from pytex.src import PytexTools
import commons
import plugins_agreg

myRequest = PytexTools.Request("mesure")
myRequest.ok_hash=commons.ok_hash
myRequest.original_filename="mazhe.tex"

# L'ordre dans les plugin est important parce que set_boolean retourne un code latex sans les commentaires
# alors que keep_script_marks compte dessus pour faire sa sélection.
myRequest.add_plugin(PytexTools.accept_all_input, "options")
myRequest.add_plugin(PytexTools.keep_script_marks(plugins_agreg.frido_mark_list),"before_pytex")


# the plugin "split_doc" should better be of type "medicament"
# because the "Traitement" object can find the toc filename
# by himself instead of hard-code it in the function.

# If you change the '4' here, you have to change it also in 'split_book.py'
myRequest.add_plugin(plugins_agreg.split_toc("frido",4),
                                             "before_compilation")

myRequest.add_plugin(plugins_agreg.set_boolean("isFrido","true"),"before_pytex")
myRequest.add_plugin(plugins_agreg.set_pdftitle("Le Frido"),"before_pytex")
myRequest.add_plugin(plugins_agreg.set_commit_hexsha,"after_pytex")
myRequest.add_plugin(plugins_agreg.assert_MonCerveau_first,"after_compilation")

myRequest.new_output_filename="0-lefrido.pdf"
示例#4
0
# -*- coding: utf8 -*-

from pytex.src import PytexTools
import commons
import plugins_agreg


def print_future_reference(future_reference):
    """Print the future reference."""
    for filename in future_reference.concerned_files:
        if "front_back_matter" in filename:
            return
    future_reference.output()


myRequest = PytexTools.Request("mesure")
myRequest.ok_hash = commons.ok_hash

# L'ordre dans les plugin est important parce que set_isFrido retourne un code latex sans les commentaires
# alors que keep_script_marks compte dessus pour faire sa sélection.
myRequest.add_plugin(PytexTools.accept_all_input, "options")
myRequest.add_plugin(
    PytexTools.keep_script_marks(plugins_agreg.mazhe_mark_list),
    "before_pytex")
myRequest.add_plugin(plugins_agreg.set_boolean("isGiulietta", "true"),
                     "before_pytex")
myRequest.add_plugin(plugins_agreg.set_commit_hexsha, "after_pytex")

myRequest.new_output_filename = "0-giulietta.pdf"

myRequest.original_filename = "mazhe.tex"
示例#5
0
import sys
from pytex.src import PytexTools

myRequest = PytexTools.Request("seconde")
myRequest.original_filename = "smath.tex"


def set_corrPosition_and_Draft(A):
    u = "\corrPosition{1}"
    v = "\corrPosition{2}"
    A = A.replace(u, v)
    u = "\corrPosition{2}"
    A = A.replace(u, v)
    u = "\corrDraft"
    A = A.replace(u, "%")
    return A


def accept_all_input(medicament):
    medicament.accept_input = lambda x: True


myRequest.add_plugin(accept_all_input, "options")
myRequest.add_plugin(set_corrPosition_and_Draft, "after_pytex")
myRequest.new_output_filename = "0-smath.pdf"