Requirements
------------
j2sdk1.4.1_02
Worked Example
--------------
Step 1: Creating a LaTeX2XML project (this step is already done for the zip-file)
- Create the directory "projects"
- Create the directory named "projects\example"
- Copy the project file "project.xml" into "projects\example\project.xml"
- Copy the target dtd (here "script.dtd" and "scriptent.dtd") into
"projects\example"
- Copy the configuration files "LaTeXCommands.xml","LaTeXCommands.dtd"
"LaTeXSelfClosingCommands.xml", "LaTeXSelfClosingCommands.dtd",
"LabelAssociations.xml" and "LabelAssociations.dtd"
into "projects\example"
- Copy a LaTeX source file "sample2e.tex" into "projects\example"
(or set the path to the souce file in project.xml)
- You may have to edit "project.xml" to set the right directory and
the right filename (dir and externalfile XML-elements)
Step 2: Adapt configuration
- If you want to change the structuring hierarchy, edit the file
"LaTeXSelfClosingCommands.xml"
- First run
java -jar latex2xml.jar projects\example\project.xml
This first run may produce warnings if the parser encounters unknown
LaTeX commands in "sample2e.tex". A warning message (German) is
looking like
>End of Document Transformation
Es sind 29 Warnungen aufgetreten.
Bitte sehen Sie in der Datei warnings.log nach.
Have a look at "warning.log". A message like
Fehlendes Command auf Zeile: 2 Pos.: 1
means that \maketitle is unknown at the moment. Edit the file
"LaTeXCommands.xml" and add the command included in the warning.
You may have to edit the attributes.
This has to be done until no more "Fehlendes Command ..." warning
message is produced.
- Second run
java -jar latex2xml.jar projects\example\project.xml
This may stil produce warnings like
Keine LabelAssociation für Nr2.abstract gefunden.
Keine LabelAssociation für Nr4.footnote gefunden.
It means that "LabelAssociations.xml" does not contain any
translation of the LaTeX commands into a target XML element.
Add all missing LabelAssociation elements into
"LabelAssociations.xml"
Step 3: final run
java -jar latex2xml.jar projects\example\project.xml
should now translate the LaTeX source Document into XML. The system
will show you how LaTeX substructures are translated into XML
substructures with messages like
> Substructure für Nr1.document ok.
Source-Substructure:
Nr1.document
Nr2.title
Nr4.author
Nr7.abstract
Nr19.section
Nr35.section
Target-Substructure:
document
frontmatter
title
author
abstract
bodymatter
section
section
Remarks
- You may write your own handlers for special commands in Java. You
have to register the new Handler in the project file "project.xml"
It is also necessary to modify all command elements using this
handler in the file "LaTeXCommands.xml"