Greeting to all,
I am pleased to announce the first release of JATS to PDF converter: Releases · Vitaliy-1/JATS2LaTeX · GitHub
The idea behind converter is that if you managed to create JATS XML you need no additional effort to make pretty look PDF.
As input converter takes article in XML format and gives 2 files as output - latex (for main text) and bibtex (for references). After this they can be easily compiled with a distribution of the TeX/LaTeX typesetting system.
The examples can be find here: JATS2LaTeX/example at jats2latex-0.5 · Vitaliy-1/JATS2LaTeX · GitHub
There lie 2 JATS XML files, example output tex and bib and one-click compiled pdf’s (without modifications)
For working with program you will need (all are free):
distribution of the TeX/LaTeX typesetting system. For Windows I prefer MikTeX.
any LaTeX editor. I prefer TeXstudio (to finalize the look of the article)
download converter latest release (executional jar file)
To start the convertion from Windows simply write in windows cmd (win + r → type there
java -jar path/to/latex.jar path/to/article.xml path/to/article.tex path/to/article.bib
where path/to means absolute and relative path to latex.jar, input article in JATS XML format, output tex and bib files.
For creating pdf from the files just open LaTeX editor and compile with XeLaTeX (it has good support of UTF-8). In MikTeX you will need to compile several times - first time with XeLaTeX, than compile bibliography, and than compile with XeLaTeX once more. So 3 times press a button Actually this is a standard procedure for latex compiling.
The program can be modified to produce PDF from JATS automatically. But because we use it for production purpose we prefer to make the article’s look perfect. And this may need changing the output tex.
Parsing of sections, subsections and subsubsections. Italic and bold text is supported. Intext links to bibliography, tables and figure are also supported. LaTeX special symbols are replaced. If I forgot about a symbol, that need to be replaced - please tell me. It can be fixed in no-time. Or if one is familiar with Java, it can be fixed here.
Parsing of figures. Moreover it tries to download the figure if it has valid url link to the file inside JATS.
Parsing of Tables. Because tables in XML and LaTeX are very different, the problems may occur in complex tables. For example, if in a one row article has multicolumn followed with multirow parser may place “&” symbol in not appropriate place in the next row. I am planing to fix this in a future release. Nevertheless it takes several seconds to fix if ones knows latex syntax.
Parsing of reference list. As I noted earlier, converter produces reference list in bib format. As I know, bib file is most extensively used format for bibliography exchange, moreover, with bib reference list in LaTeX can be styled in any wide used reference styles (Vancouver, APA etc.). The program supports references to journals, books, chapters and conferences. We prefer to code the in JATS
<element-citation publication-type="journal">. You can find our JATS in examples folder (articles are copyrighted by authors). If citation type is not explicitly pointed, the parser will look at the used tags inside element-citation element.
Don’t hesitate to ask questions. If you found a bug it is better to open an issue on github (on the project page). Detail description of the converter will be soon available there.