Class LatexProcessor
- java.lang.Object
-
- eu.simuline.m2latex.core.AbstractLatexProcessor
-
- eu.simuline.m2latex.core.LatexProcessor
-
public class LatexProcessor extends AbstractLatexProcessor
The latex processor creates various output from latex sources including also preprocessing of graphic files in several formats. This is the core class of this piece of software. The main method iscreate()which is executed by the ant task and by the maven plugin given byCfgLatexMojo. Also important areclearAll()which is executed by the maven plugin given byClearMojo. alsoprocessGraphics()which is executed by the maven plugin given byGraphicsMojowhich is helpful for information development.This class delegates preprocessing of the graphic files, selection of the latex main files and deleting their targets to
LatexPreProcessor. Processing of the latex main files is done increate()according to the target(s) given by the parameters. The elements of the enumerationTargetuse methodsprocessLatex2rtf(File),processLatex2dvi(File),processLatex2pdf(File),processLatex2html(File),processLatex2odt(File),processLatex2docx(File)andprocessLatex2txt(File).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classLatexProcessor.LatexMainDescContainer which comprises, besides the latex main file also several files creation of which shall be done once for ever.
-
Field Summary
Fields Modifier and Type Field Description private static intGRP_IDENT_IDXIndex of the group inIDX_EXPLcontaining the identifier of the index.private static StringIDX_EXPLThe shape of the entries of an index file with explicit identifier of the index.private static StringIMPL_IDENT_IDXThe implicit default identifier of an index hardcoded into the packagesplitidxand into the programsplitindex.private ParameterAdapterparamAdapt(package private) static StringPATTERN_NEED_BIBTEX_RUN(package private) static StringPATTERN_OUFULL_HVBOXprivate LatexPreProcessorpreProcprivate static StringSEP_IDENT_IDXSeparator-of the index identifier used in filesxxx-yy.idx,xxx-yy.indandxxx-yy.ilg.(package private) static StringSUFFIX_AUX(package private) static StringSUFFIX_BBL(package private) static StringSUFFIX_BLGprivate static StringSUFFIX_CLG(package private) static StringSUFFIX_DVI(package private) static StringSUFFIX_GLG(package private) static StringSUFFIX_GLO(package private) static StringSUFFIX_GLS(package private) static StringSUFFIX_HTML(package private) static StringSUFFIX_IDX(package private) static StringSUFFIX_ILG(package private) static StringSUFFIX_IND(package private) static StringSUFFIX_LOF(package private) static StringSUFFIX_LOTprivate static StringSUFFIX_ODTprivate static StringSUFFIX_RTF(package private) static StringSUFFIX_TOCprivate static StringSUFFIX_TXT-
Fields inherited from class eu.simuline.m2latex.core.AbstractLatexProcessor
executor, fileUtils, log, settings, SUFFIX_FLS, SUFFIX_LOG, SUFFIX_PDF, SUFFIX_VOID
-
-
Constructor Summary
Constructors Constructor Description LatexProcessor(Settings settings, CommandExecutor executor, LogWrapper log, TexFileUtils fileUtils, ParameterAdapter paramAdapt)LatexProcessor(Settings settings, LogWrapper log, ParameterAdapter paramAdapt)Creates a LatexProcessor with parameters given bysettingswhich logs ontologand used byparamAdapt.
-
Method Summary
Modifier and Type Method Description protected static String[]buildChkTexArguments(String options, File texFile, File clgFile)Returns an array of strings, each entry with a single option given byoptionsexcept the last three which represent-o clgFile texFile.protected static String[]buildHtlatexArguments(Settings settings, File texFile)protected static String[]buildLatexArguments(Settings settings, LatexDev dev, File texFile)voidcheckAll()Defines check goal of the maven plugin inChkMojo.voidclearAll()Defines clearing ant-task defined inLatexClrTaskand the according goal inClearMojoof the maven plugin.voidcreate()Defines creational ant-task defined inLatexCfgTaskand the according goals inCfgLatexMojoand subclasses of the maven plugin.private File[]files(String filePrefix, Collection<String> variant, String suffix)Combines an array of files from a file prefixfilePrefix, a collection of intermediate stringsvariantand of the suffixsuffix.private LatexProcessor.LatexMainDescgetLatexMainDesc(File texFile)private voidlogErrs(File logFile, String command)Logs errors detected in the according log file: The log file is by replacing the ending oftexFilebylog.private voidlogWarns(File logFile, String command)Logs warnings detected in the according log-filelogFile: Before logging warnings, errors are logged vialogErrs(File, String).private booleanneedRun(boolean another, String application, File logFile, String pattern)Returns whether a(n other) run (seeanother) of the applicationapplicationis necessary based on a patternpatternmatching in the log filelogFile.private intpreProcessLatex2dev(LatexProcessor.LatexMainDesc desc, LatexDev dev)Runs LaTeX on on the latex main filetexFiledescribed bydesconce, runs BibTeX, MakeIndex and MakeGlossaries by need and returns whether a second LaTeX run is required.voidprocessGraphics()Defines graphics goal of the maven plugin inGraphicsMojo.private voidprocessLatex2dev(LatexProcessor.LatexMainDesc desc, LatexDev dev)Runs LaTeX, BibTeX, MakeIndex and MakeGlossaries on the latex main filetexFiledescribed bydescrepeatedly as described forprocessLatex2devCore(LatexProcessor.LatexMainDesc, LatexDev)and issue a warning if the last LaTeX run issued a warning.private voidprocessLatex2devCore(LatexProcessor.LatexMainDesc desc, LatexDev dev)Runs LaTeX on the latex main filetexFiledescribed bydesconce, runs BibTeX, MakeIndex and MakeGlossaries by need according topreProcessLatex2dev(LatexMainDesc, LatexDev)and reruns MakeIndex, MakeGlossaries and LaTeX as often as needed to get all links satisfied or as thresholdSettings.maxNumReRunsLatexspecifies.(package private) voidprocessLatex2docx(File texFile)Runs conversion oftexFileto docx or other MS word formats after processing latex to set up the references, bibliography, index and that like.(package private) voidprocessLatex2dvi(File texFile)(package private) voidprocessLatex2html(File texFile)Runs conversion oftexFileto html or xhtml after processing latex to set up the references, bibliography, index and that like.(package private) voidprocessLatex2odt(File texFile)Runs conversion oftexFileto odt or other open office formats after processing latex to set up the references, bibliography, index and that like.(package private) voidprocessLatex2pdf(File texFile)(package private) voidprocessLatex2rtf(File texFile)Runs direct conversion oftexFileto rtf format.(package private) voidprocessLatex2txt(File texFile)Runs conversion oftexFileto txt format via pdf.private booleanrunBibtexByNeed(File texFile)Runs the BibTeX command given bySettings.getBibtexCommand()on the aux-file corresponding withtexFilein the directory containingtexFileprovided an according pattern in the aux-file indicates that a bibliography shall be created.private voidrunCheck(File texFile)Runs the check command given bySettings.getChkTexCommand()on the latex main filetexFilein the directory containingtexFilecreating a log file with endingSUFFIX_CLGin that directory.private voidrunDvi2pdf(LatexProcessor.LatexMainDesc desc)Runs conversion from dvi to pdf-file executingSettings.getDvi2pdfCommand()on a dvi-file covered bydescwith arguments given bybuildLatexArguments(Settings, LatexDev, File).private voidrunLatex2dev(LatexProcessor.LatexMainDesc desc, LatexDev dev)Runs the LaTeX command given bySettings.getLatex2pdfCommand()on the latex main filetexFiledescribed bydescin the directory containingtexFilewith arguments given bybuildLatexArguments(Settings, LatexDev, File).private voidrunLatex2html(LatexProcessor.LatexMainDesc desc)Runs the tex4ht command given bySettings.getTex4htCommand()ontexFiledescribed bydescin the directory containingtexFilewith arguments given bybuildHtlatexArguments(Settings, File).private voidrunLatex2odt(LatexProcessor.LatexMainDesc desc)Runs conversion from latex to odt executingSettings.getTex4htCommand()ontexFilein the directory containingtexFilewith arguments given bybuildLatexArguments(Settings, LatexDev, File).private voidrunLatex2rtf(File texFile)Runs the latex2rtf command given bySettings.getLatex2rtfCommand()ontexFilein the directory containingtexFilewith arguments given byAbstractLatexProcessor.buildArguments(String, File).private booleanrunMakeGlossaryByNeed(LatexProcessor.LatexMainDesc desc)Runs the MakeGlossaries command given bySettings.getMakeGlossariesCommand()on the aux-file corresponding withtexFilein the directory containingtexFileprovided that the existence of an glo-file indicates that a glossary shall be created.private voidrunMakeIndex(LatexProcessor.LatexMainDesc desc)Runs the MakeIndex command given bySettings.getMakeIndexCommand().private booleanrunMakeIndexByNeed(LatexProcessor.LatexMainDesc desc)Runs the MakeIndex command given bySettings.getMakeIndexCommand()on the idx-file corresponding withtexFilein the directory containingtexFileprovided that the existence of an idx-file indicates that an index shall be created.private voidrunOdt2doc(File texFile)Runs conversion from odt to doc or docx-file executingSettings.getOdt2docCommand()on an odt-file created fromtexFilein the directory containingtexFilewith arguments given bybuildLatexArguments(Settings, LatexDev, File).private voidrunPdf2txt(File texFile)Runs conversion from pdf to txt-file executingSettings.getPdf2txtCommand()on a pdf-file created fromtexFilein the directory containingtexFilewith arguments given bybuildLatexArguments(Settings, LatexDev, File).private voidrunSplitIndex(LatexProcessor.LatexMainDesc desc, Collection<String> explIdxIdent)Runs the SplitIndex command given bySettings.getSplitIndexCommand().-
Methods inherited from class eu.simuline.m2latex.core.AbstractLatexProcessor
buildArguments, hasErrsWarns, logErrs, logWarn, logWarns, update
-
-
-
-
Field Detail
-
PATTERN_NEED_BIBTEX_RUN
static final String PATTERN_NEED_BIBTEX_RUN
- See Also:
- Constant Field Values
-
PATTERN_OUFULL_HVBOX
static final String PATTERN_OUFULL_HVBOX
- See Also:
- Constant Field Values
-
SUFFIX_TOC
static final String SUFFIX_TOC
- See Also:
- Constant Field Values
-
SUFFIX_LOF
static final String SUFFIX_LOF
- See Also:
- Constant Field Values
-
SUFFIX_LOT
static final String SUFFIX_LOT
- See Also:
- Constant Field Values
-
SUFFIX_AUX
static final String SUFFIX_AUX
- See Also:
- Constant Field Values
-
SUFFIX_DVI
static final String SUFFIX_DVI
- See Also:
- Constant Field Values
-
SUFFIX_BLG
static final String SUFFIX_BLG
- See Also:
- Constant Field Values
-
SUFFIX_BBL
static final String SUFFIX_BBL
- See Also:
- Constant Field Values
-
SUFFIX_IDX
static final String SUFFIX_IDX
- See Also:
- Constant Field Values
-
SUFFIX_IND
static final String SUFFIX_IND
- See Also:
- Constant Field Values
-
SUFFIX_ILG
static final String SUFFIX_ILG
- See Also:
- Constant Field Values
-
SUFFIX_GLO
static final String SUFFIX_GLO
- See Also:
- Constant Field Values
-
SUFFIX_GLS
static final String SUFFIX_GLS
- See Also:
- Constant Field Values
-
SUFFIX_GLG
static final String SUFFIX_GLG
- See Also:
- Constant Field Values
-
SUFFIX_RTF
private static final String SUFFIX_RTF
- See Also:
- Constant Field Values
-
SUFFIX_ODT
private static final String SUFFIX_ODT
- See Also:
- Constant Field Values
-
SUFFIX_HTML
static final String SUFFIX_HTML
- See Also:
- Constant Field Values
-
SUFFIX_TXT
private static final String SUFFIX_TXT
- See Also:
- Constant Field Values
-
SUFFIX_CLG
private static final String SUFFIX_CLG
- See Also:
- Constant Field Values
-
IDX_EXPL
private static final String IDX_EXPL
The shape of the entries of an index file with explicit identifier of the index. If not explicitly given, this is justidx. Note that this regular expression has three groups as in the specification ofsplitindex.- See Also:
- Constant Field Values
-
GRP_IDENT_IDX
private static final int GRP_IDENT_IDX
Index of the group inIDX_EXPLcontaining the identifier of the index.- See Also:
- Constant Field Values
-
IMPL_IDENT_IDX
private static final String IMPL_IDENT_IDX
The implicit default identifier of an index hardcoded into the packagesplitidxand into the programsplitindex.- See Also:
- Constant Field Values
-
SEP_IDENT_IDX
private static final String SEP_IDENT_IDX
Separator-of the index identifier used in filesxxx-yy.idx,xxx-yy.indandxxx-yy.ilg. This is hardcoded by the packagesplitidxwhen readingxxx-yy.indfiles but is configurable as an option in the programsplitindex.- See Also:
- Constant Field Values
-
paramAdapt
private final ParameterAdapter paramAdapt
-
preProc
private final LatexPreProcessor preProc
-
-
Constructor Detail
-
LatexProcessor
LatexProcessor(Settings settings, CommandExecutor executor, LogWrapper log, TexFileUtils fileUtils, ParameterAdapter paramAdapt)
-
LatexProcessor
public LatexProcessor(Settings settings, LogWrapper log, ParameterAdapter paramAdapt)
Creates a LatexProcessor with parameters given bysettingswhich logs ontologand used byparamAdapt.- Parameters:
settings- the settings controlling latex processinglog- the logger to write on events while processingparamAdapt- the parameter adapter, refers to maven-plugin or ant-task.
-
-
Method Detail
-
create
public void create() throws BuildFailureExceptionDefines creational ant-task defined inLatexCfgTaskand the according goals inCfgLatexMojoand subclasses of the maven plugin.This consists in reading the parameters via
ParameterAdapter.initialize()processing graphic-files viaLatexPreProcessor.processGraphicsSelectMain(File, DirNode)and processing the tex main files viaTarget.processSource(LatexProcessor, File). The resulting files are identified by its suffixes viaTarget.getPatternOutputFiles(Settings)and copied to the target folder. Finally, by default a cleanup is performed invokingTexFileUtils.cleanUp(DirNode, File).Logging:
- WFU01: Cannot read directory...
- WFU03: cannot close file
- EFU05: Cannot delete file
- EFU06: Cannot move file
- WPP02: tex file may be latex main file
- WPP03: Skipped processing of files with suffixes ...
- EEX01, EEX02, EEX03, WEX04, WEX05: applications for preprocessing graphic files or processing a latex main file fails.
- Throws:
BuildFailureException-- TSS01 if the tex source directory does either not exist or is not a directory.
- TSS02 if the tex source processing directory does either not exist or is not a directory.
- TSS03 if the output directory exists and is no directory.
- TEX01 if invocation of applications for preprocessing graphic files or processing a latex main file fails
- TFU01 if the target directory that would be returned exists already as a regular file.
- TFU03, TFU04, TFU05, TFU06 if
copy of output files to target folder fails.
For details see
TexFileUtils.copyOutputToTargetFolder(File, FileFilter, File)
-
checkAll
public void checkAll() throws BuildFailureExceptionDefines check goal of the maven plugin inChkMojo. This includes also creation of graphic files.- Throws:
BuildFailureException-- TSS02 if the tex source processing directory does either not exist or is not a directory.
- TEX01 invoking FIXME
-
processGraphics
public void processGraphics() throws BuildFailureExceptionDefines graphics goal of the maven plugin inGraphicsMojo.Logging:
- WFU01: Cannot read directory
- WFU03: cannot close file
- EFU06: Cannot move file
- WPP02: tex file may be latex main file
- WPP03: Skipped processing of files with suffixes ...
- EEX01, EEX02, EEX03, WEX04, WEX05: if running graphic processors failed.
- Throws:
BuildFailureException-- TSS02 if the tex source processing directory does either not exist or is not a directory.
- TEX01 invoking FIXME
-
clearAll
public void clearAll() throws BuildFailureExceptionDefines clearing ant-task defined inLatexClrTaskand the according goal inClearMojoof the maven plugin. Consists in clearing created graphic files and created files derived from latex main file.The parameters this method depends on are (currently):
-
Settings.getTexSrcProcDirectoryFile() -
Settings.getPatternLatexMainFile() -
Settings.getPatternCreatedFromLatexMain()
Logging:
- WPP02: tex file may be latex main file
- WFU01: Cannot read directory...
- WFU03: cannot close tex file
- EFU05: Failed to delete file
- Throws:
BuildFailureException- TSS02 if the tex source processing directory does either not exist or is not a directory.
-
-
getLatexMainDesc
private LatexProcessor.LatexMainDesc getLatexMainDesc(File texFile)
-
preProcessLatex2dev
private int preProcessLatex2dev(LatexProcessor.LatexMainDesc desc, LatexDev dev) throws BuildFailureException
Runs LaTeX on on the latex main filetexFiledescribed bydesconce, runs BibTeX, MakeIndex and MakeGlossaries by need and returns whether a second LaTeX run is required. The latter also holds, if a table of contents, a list of figures or a list of tables is specified. The output format of the LaTeX run is given bydev, to be more precise byLatexDev.getLatexOutputFormat().A warning is logged if the LaTeX, a BibTeX run a MakeIndex or a MakeGlossaries run fails or if a BibTeX run or a MakeIndex or a MakeGlossary run issues a warning in the according methods
runLatex2dev(LatexProcessor.LatexMainDesc, LatexDev),runBibtexByNeed(File),runMakeIndexByNeed(LatexMainDesc)andrunMakeGlossaryByNeed(LatexMainDesc).Logging:
- EAP01: Running
commandfailed. For details... - EAP02: Running
commandfailed. No log file - WAP04: if
logFileis not readable. - WLP04: Cannot read idx file; skip creation of index
- WLP05: Use package 'splitidx' without option 'split'
- WLP02: Cannot read blg file: BibTeX run required?
- WFU03: cannot close log file
- EEX01, EEX02, EEX03, WEX04, WEX05: if one of the commands mentioned in the throws-tag fails
- Parameters:
desc- the description of a latex main filetexFileto be processed.dev- the device describing the output format which is either pdf or dvi. SeeLatexDev.getLatexOutputFormat().- Returns:
- the number of LaTeX runs required
because bibtex, makeindex or makeglossaries had been run
or to update a table of contents or a list figures or tables.
- If neither of these are present, no rerun is required.
- If a bibliography, an index and a glossary is included and a table of contents, we assume that these are in the table of contents. Thus two reruns are required: one to include the bibliography or that like and the second one to make it appear in the table of contents.
- In all other cases, a single rerun suffices
- Throws:
BuildFailureException- TEX01 if invocation one of the following commands fails: the- latex2pdf command from
Settings.getLatex2pdfCommand() - BibTeX command from
Settings.getBibtexCommand() - makeindex command from
Settings.getMakeIndexCommand() - makeglossaries command
from
Settings.getMakeGlossariesCommand()
- latex2pdf command from
- See Also:
processLatex2devCore(LatexProcessor.LatexMainDesc, LatexDev),processLatex2html(File),processLatex2odt(File),processLatex2docx(File)
- EAP01: Running
-
processLatex2devCore
private void processLatex2devCore(LatexProcessor.LatexMainDesc desc, LatexDev dev) throws BuildFailureException
Runs LaTeX on the latex main filetexFiledescribed bydesconce, runs BibTeX, MakeIndex and MakeGlossaries by need according topreProcessLatex2dev(LatexMainDesc, LatexDev)and reruns MakeIndex, MakeGlossaries and LaTeX as often as needed to get all links satisfied or as thresholdSettings.maxNumReRunsLatexspecifies.Note that still no logging of warnings from a latex run is done. This is done in
processLatex2dev(LatexProcessor.LatexMainDesc, LatexDev). The exclusion of logging of warnings is indicated by the name part 'Core'. Processing without logging of warnings is required byprocessLatex2txt(File).The output format of the LaTeX run is given by
dev, to be more precise byLatexDev.getLatexOutputFormat().Logging: WLP01: if another rerun is required but the maximum number of runs
Settings.getMaxNumReRunsLatex()is reached. Further logging is inherited by invoked methods:- WLP04: Cannot read idx file; skip creation of index
- WLP05: Use package 'splitidx' without option 'split'
- EAP01: Running
commandfailed. For details... - EAP02: Running
commandfailed. No log file - WAP04: if
logFileis not readable. - WLP02: Cannot read log file: run BibTeX/ (re)run MakeIndex/LaTeX required?
- WFU03: cannot close
- EEX01, EEX02, EEX03, WEX04, WEX05: as for
preProcessLatex2dev(LatexProcessor.LatexMainDesc, LatexDev)maybe caused by subsequent runs.
- Parameters:
desc- the description of a latex main filetexFileto be processed.dev- the device describing the output format which is either pdf or dvi. SeeLatexDev.getLatexOutputFormat().- Throws:
BuildFailureException- TEX01 as forpreProcessLatex2dev(LatexProcessor.LatexMainDesc, LatexDev)maybe caused by subsequent runs.- See Also:
processLatex2dvi(File),processLatex2txt(File)
-
needRun
private boolean needRun(boolean another, String application, File logFile, String pattern)Returns whether a(n other) run (seeanother) of the applicationapplicationis necessary based on a patternpatternmatching in the log filelogFile. Note that onlylogFileandpatternare required unless a warning needs to be issued.Logging:
- WLP02: Cannot read log file: (re)run required?
- WFU03: cannot close log file
- Parameters:
another- whether it is requested whether another run (a 'rerun') is required. If false, just a run is requiredapplication- Determines the application to be rerun. This may beLaTeX,MakeIndexbut alsoBibTeX.logFile- the log file which determines whether to rerunapplication.pattern- the pattern in thelogFilewhich determines whether to rerun .- Returns:
- whether
applicationneeds to be rerun based on a patternpatternmatching in the log filelogFile. - See Also:
TexFileUtils.matchInFile(File, String)
-
processLatex2dev
private void processLatex2dev(LatexProcessor.LatexMainDesc desc, LatexDev dev) throws BuildFailureException
Runs LaTeX, BibTeX, MakeIndex and MakeGlossaries on the latex main filetexFiledescribed bydescrepeatedly as described forprocessLatex2devCore(LatexProcessor.LatexMainDesc, LatexDev)and issue a warning if the last LaTeX run issued a warning.Logging:
- WFU03: cannot close
- WAP04: if
logFileis not readable. - WLP01: if another rerun is required but the maximum number of runs is reached.
- WLP03:
commandcreated bad boxes - WLP04:
commandemitted warnings - WLP04: Cannot read idx file; skip creation of index
- WLP05: Use package 'splitidx' without option 'split'
- EEX01, EEX02, EEX03, WEX04, WEX05:
processLatex2devCore(LatexProcessor.LatexMainDesc, LatexDev)if running an exernal command fails.
- Parameters:
desc- the description of a latex main filetexFileto be processed.dev- the device describing the output format which is either pdf or dvi. SeeLatexDev.getLatexOutputFormat().- Throws:
BuildFailureException- TEX01 as forprocessLatex2devCore(LatexProcessor.LatexMainDesc, LatexDev).- See Also:
needRun(boolean, String, File, String),Target.pdf
-
processLatex2dvi
void processLatex2dvi(File texFile) throws BuildFailureException
- Throws:
BuildFailureException
-
processLatex2pdf
void processLatex2pdf(File texFile) throws BuildFailureException
- Throws:
BuildFailureException
-
logErrs
private void logErrs(File logFile, String command)
Logs errors detected in the according log file: The log file is by replacing the ending oftexFilebylog. If the log file exists, a warning is logged if the error pattern given bySettings.getPatternErrLatex()occurs in the log file. If the log file does not exist, an error is logged. In both cases, the message logged refers to thecommandwhich failed.Logging:
- EAP01: Running
commandfailed. For details... - EAP02: Running
commandfailed. No log file - WAP04: if
logFileis not readable. - WFU03: cannot close
- EAP01: Running
-
logWarns
private void logWarns(File logFile, String command)
Logs warnings detected in the according log-filelogFile: Before logging warnings, errors are logged vialogErrs(File, String). So, if the log-file does not exist, an error was already shown and so nothing is to be done here. If the log-file exists, a warning is logged if-
another LaTeX rerun is required
beyond
Settings.maxNumReRunsLatex, -
bad boxes occurred and shall be logged
according to
Settings.getDebugBadBoxes(). -
warnings occurred and shall be logged
according to
Settings.getDebugWarnings().
PATTERN_OUFULL_HVBOXfor bad boxes is fixed, whereasSettings.getPatternWarnLatex()is configurable. The message logged refers to thecommandwhich failed.Logging:
- WFU03: cannot close
- WAP04: if
logFileis not readable. - WLP03:
commandcreated bad boxes - WLP04:
commandemitted warnings
- Parameters:
logFile- the log-file to detect warnings in.command- the command which createdlogFileand which maybe created warnings.
-
another LaTeX rerun is required
beyond
-
processLatex2html
void processLatex2html(File texFile) throws BuildFailureException
Runs conversion oftexFileto html or xhtml after processing latex to set up the references, bibliography, index and that like.Logging: FIXME: incomplete
- EAP01: Running
commandfailed. For details... - EAP02: Running
commandfailed. No log file - WAP04: if
logFileis not readable. - WLP02: Cannot read blg file: BibTeX run required?
- WFU03: cannot close log file
- WLP04: Cannot read idx file; skip creation of index
- WLP05: Use package 'splitidx' without option 'split'
- EEX01, EEX02, EEX03, WEX04, WEX05: if running an exernal command fails.
- Parameters:
texFile- the tex file to be processed.- Throws:
BuildFailureException- TEX01 as forpreProcessLatex2dev(LatexProcessor.LatexMainDesc, LatexDev)but also as forrunLatex2html(LatexProcessor.LatexMainDesc).- See Also:
preProcessLatex2dev(LatexProcessor.LatexMainDesc, LatexDev),runLatex2html(LatexProcessor.LatexMainDesc),Target.html
- EAP01: Running
-
processLatex2odt
void processLatex2odt(File texFile) throws BuildFailureException
Runs conversion oftexFileto odt or other open office formats after processing latex to set up the references, bibliography, index and that like.Logging: FIXME: incomplete
- EAP01: Running
commandfailed. For details... - EAP02: Running
commandfailed. No log file - WAP04: if
logFileis not readable. - WLP02: Cannot read blg file: BibTeX run required?
- WFU03: cannot close log file
- WLP04: Cannot read idx file; skip creation of index
- WLP05: Use package 'splitidx' without option 'split'
- EEX01, EEX02, EEX03, WEX04, WEX05: if running an exernal command fails.
- Parameters:
texFile- the tex file to be processed.- Throws:
BuildFailureException- TEX01 as forpreProcessLatex2dev(LatexProcessor.LatexMainDesc, LatexDev)but also as forrunLatex2odt(LatexProcessor.LatexMainDesc).- See Also:
preProcessLatex2dev(LatexProcessor.LatexMainDesc, LatexDev),runLatex2odt(LatexProcessor.LatexMainDesc),Target.odt
- EAP01: Running
-
processLatex2docx
void processLatex2docx(File texFile) throws BuildFailureException
Runs conversion oftexFileto docx or other MS word formats after processing latex to set up the references, bibliography, index and that like.Logging: FIXME: incomplete
- EAP01: Running
commandfailed. For details... - EAP02: Running
commandfailed. No log file - WAP04: if
logFileis not readable. - WLP02: Cannot read blg file: BibTeX run required?
- WFU03: cannot close log file
- WLP04: Cannot read idx file; skip creation of index
- WLP05: Use package 'splitidx' without option 'split'
- EEX01, EEX02, EEX03, WEX04, WEX05: if running an exernal command fails.
- Parameters:
texFile- the latex main file to be processed.- Throws:
BuildFailureException- TEX01 as forpreProcessLatex2dev(LatexProcessor.LatexMainDesc, LatexDev)but also as forrunLatex2odt(LatexProcessor.LatexMainDesc)and forrunOdt2doc(File).- See Also:
preProcessLatex2dev(LatexMainDesc, LatexDev),runLatex2odt(LatexProcessor.LatexMainDesc),runOdt2doc(File),Target.docx
- EAP01: Running
-
processLatex2rtf
void processLatex2rtf(File texFile) throws BuildFailureException
Runs direct conversion oftexFileto rtf format.FIXME: Maybe prior invocation of LaTeX MakeIndex and BibTeX after set up the references, bibliography, index and that like would be better.
Logging: FIXME: incomplete
- EEX01, EEX02, EEX03, WEX04, WEX05: if running an exernal command fails.
- Parameters:
texFile- the tex file to be processed.- Throws:
BuildFailureException- TEX01 if running the latex2rtf command returned bySettings.getLatex2rtfCommand()failed.- See Also:
runLatex2rtf(File),Target.rtf
-
processLatex2txt
void processLatex2txt(File texFile) throws BuildFailureException
Runs conversion oftexFileto txt format via pdf.Logging: FIXME: incomplete
- WLP04: Cannot read idx file; skip creation of index
- WLP05: Use package 'splitidx' without option 'split'
- EEX01, EEX02, EEX03, WEX04, WEX05: if running an exernal command fails.
- Parameters:
texFile- the tex file to be processed.- Throws:
BuildFailureException- TEX01 as forprocessLatex2devCore(LatexProcessor.LatexMainDesc, LatexDev)and forrunPdf2txt(File).- See Also:
processLatex2devCore(LatexProcessor.LatexMainDesc, LatexDev),runPdf2txt(File),Target.txt
-
runBibtexByNeed
private boolean runBibtexByNeed(File texFile) throws BuildFailureException
Runs the BibTeX command given bySettings.getBibtexCommand()on the aux-file corresponding withtexFilein the directory containingtexFileprovided an according pattern in the aux-file indicates that a bibliography shall be created.Logging:
- EAP01: Running
bibtexfailed. For details... - EAP02: Running
bibtexfailed. No log file - WAP03: Running
bibtexemitted warnings. - WAP04: if
logFileis not readable. - WLP02: Cannot read log file: run required?
- WFU03: cannot close
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the BibTeX command failed.
- Parameters:
texFile- the latex main file BibTeX is to be processed for.- Returns:
- whether BibTeX has been run. Equivalently, whether LaTeX has to be rerun because of BibTeX.
- Throws:
BuildFailureException- TEX01 if invocation of the BibTeX command returned bySettings.getBibtexCommand()failed.
- EAP01: Running
-
runMakeIndexByNeed
private boolean runMakeIndexByNeed(LatexProcessor.LatexMainDesc desc) throws BuildFailureException
Runs the MakeIndex command given bySettings.getMakeIndexCommand()on the idx-file corresponding withtexFilein the directory containingtexFileprovided that the existence of an idx-file indicates that an index shall be created.Note that
Settings.getMakeIndexCommand()is invoked either directly, or, in case of a multiple index, viaSettings.getSplitIndexCommand().Logging:
- WLP04: Cannot read idx file; skip creation of index
- WLP05: Use package 'splitidx' without option 'split'
- EAP01: Running
makeindexfailed. For details... - EAP02: Running
makeindexfailed. No log file - WAP03: Running
makeindexemitted warnings. - WAP04: .ilg-file is not readable.
- WFU03: cannot close .ilg-file
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the makeindex command failed.
- Parameters:
desc- the description of a latex main filedviFileincluding the idx-file MakeIndex is to be run on.- Returns:
- whether MakeIndex had been run. Equivalently, whether LaTeX has to be rerun because of MakeIndex.
- Throws:
BuildFailureException- TEX01 if invocation of the makeindex command returned bySettings.getMakeIndexCommand()failed.
-
runMakeIndex
private void runMakeIndex(LatexProcessor.LatexMainDesc desc) throws BuildFailureException
Runs the MakeIndex command given bySettings.getMakeIndexCommand().Logging:
- EAP01: Running
makeindexfailed. For details... - EAP02: Running
makeindexfailed. No log file - WAP03: Running
makeindexemitted warnings. - WAP04 .ilg-file is not readable.
- WFU03: cannot close .ilg-file
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the makeindex command failed.
- Parameters:
desc- the description of a latex main filetexFileincluding the idx-file MakeIndex is to be run on.- Throws:
BuildFailureException- TEX01 if invocation of the MakeIndex command returned bySettings.getMakeIndexCommand()failed.
- EAP01: Running
-
files
private File[] files(String filePrefix, Collection<String> variant, String suffix)
Combines an array of files from a file prefixfilePrefix, a collection of intermediate stringsvariantand of the suffixsuffix.- Parameters:
filePrefix- prefix of file name; in practice of index file without suffixvariant- collection of strings; in practice set of identifiers of indicessuffix- the suffix of a file; in practiceSUFFIX_IDX.- Returns:
- an array of file names of the form
<filePrefix><ident><suffix>, whereidentruns invariant.
-
runSplitIndex
private void runSplitIndex(LatexProcessor.LatexMainDesc desc, Collection<String> explIdxIdent) throws BuildFailureException
Runs the SplitIndex command given bySettings.getSplitIndexCommand().Logging: Note that
splitindexneither writes a log file nor may it fail in itself but invokingmakeindexor whatever program it uses.- EAP01: Running
splitindexfailed. For details... - EAP02: Running
splitindexfailed. No log file - WAP03: Running
splitindexemitted warnings. - WAP04 .ilg-file is not readable.
- WFU03: cannot close .ilg-file
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the splitindex command failed.
- Parameters:
desc- the description of a latex main filetexFileincluding the idx-file SplitIndex is to be run on.explIdxIdent- the set of identifiers of indices, whether explicitly given or not in the idx file.- Throws:
BuildFailureException- TEX01 if invocation of the SplitIndex command returned bySettings.getSplitIndexCommand()failed.
- EAP01: Running
-
runMakeGlossaryByNeed
private boolean runMakeGlossaryByNeed(LatexProcessor.LatexMainDesc desc) throws BuildFailureException
Runs the MakeGlossaries command given bySettings.getMakeGlossariesCommand()on the aux-file corresponding withtexFilein the directory containingtexFileprovided that the existence of an glo-file indicates that a glossary shall be created. The MakeGlossaries command is just a wrapper arround the programsmakeindexandxindy.Logging:
- EAP01: Running
makeglossariesfailed. For details... - EAP02 Running
makeglossariesfailed. No log file - WAP03: Running
makeglossariesemitted warnings. - WAP04: .glg-file is not readable.
- WFU03: cannot close .glg-file
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the makeglossaries command failed.
- Parameters:
desc- the description of a latex main filetexFileincluding the idx-file MakeGlossaries is to be run on.- Returns:
- whether MakeGlossaries had been run. Equivalently, whether LaTeX has to be rerun because of MakeGlossaries.
- Throws:
BuildFailureException- TEX01 if invocation of the makeglossaries command returned bySettings.getMakeGlossariesCommand()failed.
- EAP01: Running
-
runLatex2dev
private void runLatex2dev(LatexProcessor.LatexMainDesc desc, LatexDev dev) throws BuildFailureException
Runs the LaTeX command given bySettings.getLatex2pdfCommand()on the latex main filetexFiledescribed bydescin the directory containingtexFilewith arguments given bybuildLatexArguments(Settings, LatexDev, File). The output format of the LaTeX run is given bydev, to be more precise byLatexDev.getLatexOutputFormat().Logs a warning or an error if the latex run failed invoking
logErrs(File, String)but not if bad boxes occurred or if warnings occurred. This is done inprocessLatex2dev(LatexProcessor.LatexMainDesc, LatexDev)after the last LaTeX run only.Logging:
- EAP01: Running
latex2pdffailed. For details... - EAP02: Running
latex2pdffailed. No log file - WAP04: .log-file is not readable.
- WFU03: cannot close .log-file
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the latex2pdf command failed.
- Parameters:
desc- the description of a latex main filetexFileto be processed.dev- the device describing the output format which is either pdf or dvi. SeeLatexDev.getLatexOutputFormat().- Throws:
BuildFailureException- TEX01 if invocation of the latex2pdf command returned bySettings.getLatex2pdfCommand()failed.
- EAP01: Running
-
buildLatexArguments
protected static String[] buildLatexArguments(Settings settings, LatexDev dev, File texFile)
-
runDvi2pdf
private void runDvi2pdf(LatexProcessor.LatexMainDesc desc) throws BuildFailureException
Runs conversion from dvi to pdf-file executingSettings.getDvi2pdfCommand()on a dvi-file covered bydescwith arguments given bybuildLatexArguments(Settings, LatexDev, File).Logging:
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the dvi2pdf command failed.
- Parameters:
desc- the description of a latex main filedviFileincluding the dvi-file dvi2pdf is to be run on.- Throws:
BuildFailureException- TEX01 if invocation of the dvi2pdf command returned bySettings.getDvi2pdfCommand()failed.
-
runLatex2html
private void runLatex2html(LatexProcessor.LatexMainDesc desc) throws BuildFailureException
Runs the tex4ht command given bySettings.getTex4htCommand()ontexFiledescribed bydescin the directory containingtexFilewith arguments given bybuildHtlatexArguments(Settings, File).Logging:
- EAP01: Running
htlatexfailed. For details... - EAP02: Running
htlatexfailed. No log file - WLP03:
htlatexcreated bad boxes - WLP04:
htlatexemitted warnings - WAP04: log file is not readable.
- WFU03: cannot close log file
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the tex4ht command failed.
- Parameters:
desc- the description of a latex main filetexFileto be processed.- Throws:
BuildFailureException- TEX01 if invocation of the tex4ht command returned bySettings.getTex4htCommand()failed.
- EAP01: Running
-
buildHtlatexArguments
protected static String[] buildHtlatexArguments(Settings settings, File texFile)
-
runLatex2rtf
private void runLatex2rtf(File texFile) throws BuildFailureException
Runs the latex2rtf command given bySettings.getLatex2rtfCommand()ontexFilein the directory containingtexFilewith arguments given byAbstractLatexProcessor.buildArguments(String, File).Logging:
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the latex2rtf command failed.
- Parameters:
texFile- the latex file to be processed.- Throws:
BuildFailureException- TEX01 if invocation of the latex2rtf command returned bySettings.getLatex2rtfCommand()failed.
-
runLatex2odt
private void runLatex2odt(LatexProcessor.LatexMainDesc desc) throws BuildFailureException
Runs conversion from latex to odt executingSettings.getTex4htCommand()ontexFilein the directory containingtexFilewith arguments given bybuildLatexArguments(Settings, LatexDev, File).Logs a warning or an error if the latex run failed invoking
logErrs(File, String)but not if bad boxes ocurred or if warnings occurred. This is done inprocessLatex2dev(LatexProcessor.LatexMainDesc, LatexDev)after the last LaTeX run only.Logging:
- EAP01: Running
htlatexfailed. For details... - EAP02: Running
htlatexfailed. No log file - WLP03:
htlatexcreated bad boxes - WLP04:
htlatexemitted warnings - WAP04: log file is not readable.
- WFU03: cannot close log file
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the tex4ht command failed.
- Parameters:
desc- the descriptor of the latex main file to be processed.- Throws:
BuildFailureException- TEX01 if invocation of the tex4ht command returned bySettings.getTex4htCommand()failed.
- EAP01: Running
-
runOdt2doc
private void runOdt2doc(File texFile) throws BuildFailureException
Runs conversion from odt to doc or docx-file executingSettings.getOdt2docCommand()on an odt-file created fromtexFilein the directory containingtexFilewith arguments given bybuildLatexArguments(Settings, LatexDev, File).Logging:
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the odt2doc command failed.
- Parameters:
texFile- the latex file to be processed.- Throws:
BuildFailureException- TEX01 if invocation of the odt2doc command returned bySettings.getOdt2docCommand()failed.
-
runPdf2txt
private void runPdf2txt(File texFile) throws BuildFailureException
Runs conversion from pdf to txt-file executingSettings.getPdf2txtCommand()on a pdf-file created fromtexFilein the directory containingtexFilewith arguments given bybuildLatexArguments(Settings, LatexDev, File).Logging:
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the pdf2txt command failed.
- Parameters:
texFile- the latex-file to be processed.- Throws:
BuildFailureException- TEX01 if invocation of the pdf2txt command returned bySettings.getPdf2txtCommand()failed.
-
runCheck
private void runCheck(File texFile) throws BuildFailureException
Runs the check command given bySettings.getChkTexCommand()on the latex main filetexFilein the directory containingtexFilecreating a log file with endingSUFFIX_CLGin that directory.Logging:
- EEX01, EEX02, EEX03, WEX04, WEX05: if running the ChkTeX command failed.
- Parameters:
texFile- the latex main file to be checked for.- Throws:
BuildFailureException- TEX01 if invocation of the check command returned bySettings.getChkTexCommand()failed.
-
buildChkTexArguments
protected static String[] buildChkTexArguments(String options, File texFile, File clgFile)
Returns an array of strings, each entry with a single option given byoptionsexcept the last three which represent-o clgFile texFile.- Parameters:
options- the options string. The individual options are expected to be separated by a single blank.texFile- the latex main file to be checked.clgFile- the log-file with the result of the check oftexFile.- Returns:
- An array of strings:
If
optionsis not empty, the first entries are the options inoptions. The last three entries are-o,clgFileandtexFile.
-
-