1 package eu.simuline.m2latex.core;
2
3 /**
4 * Enumerates the various degrees of usage of the latexmk command
5 * specified by {@link ConverterCategory#Latexmk}.
6 */
7 public enum LatexmkUsage {
8
9 /**
10 * The command related with {@link ConverterCategory#Latexmk} is never invoked.
11 * Refraining from latexmk has the advantage that this builder software controls all log files
12 * and all return values.
13 * As a consequence, the user can check that the build process passed without warning or error.
14 * This is the default value.
15 */
16 NotAtAll {
17 boolean runLatexmk() {
18 return false;
19 }
20 },
21
22 /**
23 * Graphic files needed to compile latex main files are created in a traditional way
24 * before invoking {@link ConverterCategory#Latexmk}, so that they are present
25 * when latexmk is used to convert the latex main files.
26 * Unlike for {@link #NotAtAll} this builder software cannot check log files in this mode.
27 * Still, unlike for {@link #Fully},
28 * excessive reruns because of missing graphic files, i.e. graphic files to be created are avoided.
29 */
30 AsBackend,
31
32 /**
33 * All build processes are delegated to the tool {@link ConverterCategory#Latexmk}.
34 * In particular, this builder cannot check log files
35 * and also the builder does not create graphic files a priori.
36 * Instead latexmk decides on the needed graphic files.
37 * This may cause excessive rerun of the latex compiler,
38 * because the compiler run is stopped for each missing graphic file,
39 * then it is created and the compiler is rerun.
40 * <p>
41 * Even in this mode, this builder decides on which tex files are to be compiled,
42 * although latexmk could do this as well
43 * and latexmk is applied to individual latex files only.
44 * Note also that latexmk is not used to cleanup.
45 */
46 // TBD: well: cleanup shall be done by latexmk in this case also.
47 Fully {
48 boolean preProcessInternally() {
49 return false;
50 }
51 };
52
53 /**
54 * Returns whether this kind of usage
55 * triggers {@link Converter#Latexmk} at all.
56 * This is true except for {@link #NotAtAll}.
57 *
58 * @return
59 * whether this kind of usage
60 * triggers {@link Converter#Latexmk} at all.
61 */
62 boolean runLatexmk() {
63 return true;
64 }
65 // If false preprocessing is not performed.
66 // This occurs only if latexmk is invoked.
67 // Consequently it is also latexmk which performs graphic processing.
68 /**
69 * Returns whether this kind of usage
70 * performs preprocessing which is processing internally.
71 * Preprocessing is processing logically done before compilation of latex files
72 * can be completed.
73 * Currently, this applies to graphic files.
74 * If not, {@link Converter#Latexmk} creates the according files
75 * in the course of its build process.
76 * Processing is internal except for {@link #Fully}.
77 * @return
78 * whether this kind of usage
79 * performs preprocessing which is processing internally.
80 */
81 boolean preProcessInternally() {
82 return true;
83 }
84 }