PyXMake Developer Guide 1.0
PyXMake
Loading...
Searching...
No Matches
latex.py
1# -*- coding: utf-8 -*-
2# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3# % PyXMake - Build environment for PyXMake %
4# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5"""
6Triple-use minimum working example for PyXMake. This script can be
7executed in three different ways in varying levels of accessibility
8
9@note: Compile a single PDF document using Latex from TeXFiles or reStructuredText.
10Created on 08.09.2020
11
12@version: 1.0
13----------------------------------------------------------------------------------------------
14@requires:
15 - PyXMake
16
17@change:
18 - Requires PyCODAC in PYTHONPATH.
19
20@author: garb_ma [DLR-FA,STM Braunschweig]
21----------------------------------------------------------------------------------------------
22"""
23import os, sys
24
25try:
26 import PyXMake as _ #@UnusedImport
27except ImportError:
28 # Script is executed as a plug-in
29 sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
30finally:
31 from PyXMake import VTL #@UnresolvedImport
32 from PyXMake.Build.Make import Latex #@UnresolvedImport
33
34def main(
35 BuildID,
36 # Build nothing by default
37 file="",
38 # Resource paths
39 include=[],
40 # Encryption, mode, verbose and scratch directory
41 scratch=VTL.Scratch, verbosity=2,
42 # Additional keyword arguments
43 **kwargs):
44 """
45 Main function to execute the script.
46 """
47 # Create a new class instance
48 Tex = Latex(BuildID, file, scratch=scratch, verbose=verbosity, secret=kwargs.pop("secret",None))
49 # Add include paths
50 Tex.AddIncludePath(include)
51 # Compile Latex document directly or open GUI.
52 Tex.create(**kwargs)
53
54if __name__ == "__main__":
55# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
56# % Access command line inputs %
57# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58 # Execute CLI command
59 Latex.run()
60 # Finish
61 print("==================================")
62 print("Finished compiling Latex documents")
63 print("==================================")
64 sys.exit()
Base class for all Latex build events.
Create a make object to define the building environment.
Definition Make.py:1
main(BuildID, file="", include=[], scratch=VTL.Scratch, verbosity=2, **kwargs)
Definition latex.py:43