|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dante.extex.ExTeX
de.dante.extex.main.TeX
This is the command line interface to
The command line interface provides the following features:
This program is normally used through a wrapper which performs all necessary initializations and hides the implementation language from the casual user. Since this is the default case it is described here first. Details about the direct usage without the wrapper can be found in section Direct Java Invocation.
This program – called extex here – has in its simplest form of invocation one parameter. This parameter is the name of the file to process:
extex file.tex
The input file is sought in the current directory and other locations. Details about searching can be found in Searching TeX Files.
In general the syntax of invocation is as follows:
extex 〈options〉 〈file〉 〈code〉
Command line parameters are the way of setting options with highest priority. The command line parameters overrule all settings in other parameter files. The command line options are contained in the table below.
The properties mentioned throughout this description can be set directly. It is even possible to set a property with any name to a value. The name is not checked checked against a list. Thus it is possible to overwrite system and user settings.
For instance the properties user.name and java.version are used at some places, but can not by set on the command line by other means.
Example: The following invocations are identical:
extex --extex.file=abc extex --extex.file abc extex -- abc extex abc
Spec | DescriptionSee | |
F | This specifier contains the indicator whether or not to trace the searching for input files. | extex.trace.input.files |
f | This specifier contains the indicator whether or not to trace the searching for font files. | extex.trace.font.files |
M | This specifier contains the indicator whether or not to trace the execution of macros. | extex.trace.macros |
T | This specifier contains the indicator whether or not to trace the work of the tokenizer. | extex.trace.tokenizer |
true
then the attempt to load a format with the
name derived from the prog name is omitted.
Command line parameters can be abbreviated up to a unique prefix – and sometimes even more. Thus the following invocations are equivalent:
extex -v extex -ve extex -ver extex -vers extex -versi extex -versio extex -version
The feature of first line parsing can be enabled with the command line option -parse-first-line and the property extex.parse.first.line.
If the feature is enabled then the first line of the first input file is parsed. If this line starts with %& then the next characters up to a white-space are taken as format name to be loaded. The remaining characters up to the newline characters are ignored.
The first line is simply passed to the interpreter if it does not start with %&.
The following sample shows a first line which pre-loads the format latex.
%&latex some comment
Settings can be stored in properties files. Those settings are the fallbacks if no corresponding command line arguments are found.
The properties are stored in a file named .extex. It is sought in the users home directory. This determined by the system property user.home. Afterwards it is sought in the current directory. The local settings of a directory overwrite the user's setting. The user's setting overwrite the compiled in defaults
The following properties are recognized:
true
then act as initex. This command line
option is defined for compatibility to true
and the first line starts
with %& then the following characters up to a white-space
character are taken as the name of a format to be loaded.
There is another level of properties which is considered between the compiled in defaults and the user's Those are the system properties of the Java system. There system wide settings can be stored. Nevertheless, you should use this feature sparsely.
The direct invocation of the Java needs some settings to be preset.
These settings are needed for
Now
java de.dante.extex.ExTeX 〈options〉 〈file〉
The result should be the same as the invocation of the wrapper.
Field Summary | |
protected static int |
EXIT_INTERNAL_ERROR
The constant EXIT_INTERNAL_ERROR contains the exit code for internal errors. |
protected static int |
EXIT_OK
The constant EXIT_OK contains the exit code of the program for the success case. |
Constructor Summary | |
TeX(java.util.Properties theProperties,
java.lang.String dotFile)
Creates a new object and initializes the properties from given properties and possibly from a user's properties in the file .extex. |
Method Summary | |
protected Localizer |
getLocalizer()
Getter for localizer. |
QueryFileHandler |
getQueryFileHandler()
Getter for queryFileHandler. |
protected boolean |
initializeStreams(Interpreter interpreter,
java.util.Properties properties)
Initialize the input streams. |
protected void |
logPages(BackendDriver backend)
Write the indicator of the pages produced to the logger. |
static void |
main(java.lang.String[] args)
This is the main method which is invoked to run the whole engine from the command line. |
protected BackendDriver |
makeBackend(Configuration config,
OutputStreamFactory outFactory,
DocumentWriterOptions options,
Configuration colorConfig,
ResourceFinder finder,
FontFactory fontFactory)
Create a new document writer. |
protected Interpreter |
makeInterpreter(Configuration config,
OutputStreamFactory outFactory,
ResourceFinder finder,
java.lang.String jobname)
Create a new interpreter. |
protected TokenStreamFactory |
makeTokenStreamFactory(Configuration config,
ResourceFinder finder)
Create a TokenStreamFactory. |
protected boolean |
mergeProperties(java.lang.String arg)
Loads a properties file into the already existing properties. |
int |
run(java.lang.String[] args)
This method provides access to the whole functionality of |
protected int |
runCL(java.lang.String[] args)
Process the command line arguments. |
protected boolean |
set(java.lang.String name,
java.lang.String tag,
java.lang.String[] arguments,
int position)
Acquire the next argument from the command line and set a property accordingly. |
void |
setQueryFileHandler(QueryFileHandler queryFileHandler)
Setter for queryFileHandler. |
protected void |
useTrace(java.lang.String arg)
Acquire the next argument from the command line and use it as a specification to control the tracing features. |
Methods inherited from class de.dante.extex.ExTeX |
applyInteraction, applyLanguage, getBooleanProperty, getLogger, getOutStream, getProperties, getProperty, getVersion, loadFormat, loadUserProperties, logException, logInternalError, makeColorConverter, makeContext, makeDefaultFont, makeFontFactory, makeLanguageManager, makeLogFile, makeLogHandler, makeOutputFactory, makeResourceFinder, makeTokenFactory, makeTypesetter, propertyDefault, run, setErrorHandler, setLogger, setOutStream, setProperty, showBanner |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int EXIT_INTERNAL_ERROR
protected static final int EXIT_OK
Constructor Detail |
public TeX(java.util.Properties theProperties, java.lang.String dotFile) throws InterpreterException, java.io.IOException
theProperties
- the properties to considerdotFile
- the name of the local configuration file. In the case
that this value is null
no user properties
will be considered.
InterpreterException
- in case of an invalid interaction mode
java.io.IOException
- in case of an IO Error during the reading of the
properties fileExTeX.ExTeX(java.util.Properties, java.lang.String)
Method Detail |
public static void main(java.lang.String[] args)
run()
on it.
The return value is used as the exit status.
The properties to be used are taken from the
System.properties
and
the user's properties in the file .extex. The user properties
are loaded both from the users home directory and the current directory.
Finally the properties can be overwritten on the command line.
args
- the list of command line argumentsprotected Localizer getLocalizer()
getLocalizer
in class ExTeX
public QueryFileHandler getQueryFileHandler()
protected boolean initializeStreams(Interpreter interpreter, java.util.Properties properties) throws ConfigurationException
initializeStreams
in class ExTeX
interpreter
- the interpreter contextproperties
- the controlling properties
true
if the stream have not been initialized
ConfigurationException
- in case of a configuration errorExTeX.initializeStreams(
de.dante.extex.interpreter.Interpreter,
java.util.Properties)
protected Interpreter makeInterpreter(Configuration config, OutputStreamFactory outFactory, ResourceFinder finder, java.lang.String jobname) throws ConfigurationException, GeneralException, FontException, java.io.IOException
ExTeX
makeInterpreter
in class ExTeX
config
- the configuration object for the interpreteroutFactory
- the factory for new output streamsfinder
- the resource finderjobname
- the job name
java.io.IOException
- in case of an IO error
FontException
- in case of problems with the font itself
GeneralException
- in case of an error of some other kind
ConfigurationException
- in case that some kind of problems have
been detected in the configurationExTeX.makeInterpreter(
de.dante.util.framework.configuration.Configuration,
de.dante.extex.backend.outputStream.OutputStreamFactory,
de.dante.util.resource.ResourceFinder,
java.lang.String)
protected BackendDriver makeBackend(Configuration config, OutputStreamFactory outFactory, DocumentWriterOptions options, Configuration colorConfig, ResourceFinder finder, FontFactory fontFactory) throws DocumentWriterException, ConfigurationException
ExTeX
makeBackend
in class ExTeX
config
- the configuration object for the document writeroutFactory
- the output factoryoptions
- the options to be passed to the document writercolorConfig
- the configuration for the color converterfinder
- the resource finder if one is requestedfontFactory
- the font factory
ConfigurationException
- in case of a configuration problem
DocumentWriterException
- in case of an errorExTeX.makeBackend(
de.dante.util.framework.configuration.Configuration,
de.dante.extex.backend.outputStream.OutputStreamFactory,
de.dante.extex.backend.documentWriter.DocumentWriterOptions,
de.dante.util.framework.configuration.Configuration,
de.dante.util.resource.ResourceFinder,
de.dante.extex.font.FontFactory)
protected TokenStreamFactory makeTokenStreamFactory(Configuration config, ResourceFinder finder) throws ConfigurationException, NotObservableException
makeTokenStreamFactory
in class ExTeX
config
- the configuration object for the token stream factoryfinder
- the file finder for the token stream factory
ConfigurationException
- in case that some kind of problems have
been detected in the configuration
NotObservableException
- in case that the observer for file
events could not be registeredprotected void logPages(BackendDriver backend)
logPages
in class ExTeX
backend
- the back-end driverExTeX.logPages(de.dante.extex.backend.BackendDriver)
protected boolean mergeProperties(java.lang.String arg) throws java.io.IOException
arg
- the name of the resource to load
true
iff the resource has been loaded successfully
java.io.IOException
- just in casepublic int run(java.lang.String[] args)
System.exit()
but returns the exit status as result.
args
- the list of command line arguments
protected int runCL(java.lang.String[] args) throws MainException, java.io.IOException, InteractionUnknownException
args
- the command line arguments
MainException
- in case of an error
java.io.IOException
- in case of an IO error
InteractionUnknownException
- in case of an unknown interaction
modeprotected boolean set(java.lang.String name, java.lang.String tag, java.lang.String[] arguments, int position) throws MainMissingArgumentException
name
- the name of the argumenttag
- the name of the property to setarguments
- the list of argumentsposition
- the starting index
true
iff the syntax is correct and the value of the
property has been set
MainMissingArgumentException
- in case of an errorpublic void setQueryFileHandler(QueryFileHandler queryFileHandler)
queryFileHandler
- the queryFileHandler to setprotected void useTrace(java.lang.String arg) throws MainUnknownOptionException
arg
- the argument
MainUnknownOptionException
- in case that the specified option
letter has no assigned property to set
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |