User:Derbeth/javaLatex

From Wikibooks, open books for an open world
Jump to: navigation, search

Application[edit]

javaLatex is a program creating PDF versions of Wikibooks textbooks. It is able to download book structure, chapter text and graphics from Wikibooks server, generate list of authors and table of contents.

The application can be also used to convert single Wikipedia articles.

Limitations[edit]

javaLatex does not convert most of templates automatically. Some templates remain commented out in source code, so to make them appear correctly you might have to use Perl/Python script or implement handling of these templates in javaLatex source code.

The program is not capable of handling of all odd usages of MediaWiki syntax, so sometimes errors in parsing LaTeX source may appear and in such situations you may be required to edit generated files and fix errors. Consequently, knowledge of LaTeX is very useful when dealing with javaLatex, but with some amount of luck it won't be required.

javaLatex won't detect lines in source code listings which are too long, nor will it fix them. If your book covers a programming language, you should look through the output PDF and check if source code exceeds margin.

Since pdflatex tool, which translates LaTeX code to PDF, does not support GIF images, books using GIF images won't be translated and will cause pdflatex errors. javaLatex downloads GIF images, but you will have to convert them manually to PNG and replace GIF with PNG in LaTeX sources. See LaTeX/Importing Graphics for more information.

The program cannot assure that graphics and tables used in text will look good. The larger the image is, the greater is the chance of damaging text layout around it. You should look through the PDF and manually fix the mistakes. LaTeX/Floats, Figures and Captions is a great source of information in this field.

Example output[edit]

See Image:How To Assemble A Desktop PC.pdf (generated by Hagindaz program, see below). pl:Grafika:C.pdf is created with the most current version (the book is written in Polish).

Basic information[edit]

Program home page, when you can find binaries and the source code, is http://code.google.com/p/javalatex/. Blog http://javalatex.blogspot.com/ serves as a placeholder for announcements and is available as an Atom news feed.

javaLatex was created from Wiki2LaTeX code released to public domain by Hagindaz. It is free software released under MIT license and written in Java.

Requirements[edit]

  • Java Runtime Environment 1.5 or newer
  • LaTeX distribution

You can use Kile to edit generated LaTeX source.

Netbeans 6 IDE is recommended to edit source code.

Usage[edit]

Before you run the program, you have to edit conversion.properties file.

To get help on running the program, type

java -jar javaLatex.jar --help

http://code.google.com/p/javalatex/wiki/CommandLineOptions gives extensive explanation of command line options.

The simplest program invocation is:

java -jar javaLatex.jar --title="Raising Chickens" --genall
pdflatex main.tex

Tips[edit]

I've got a table that is so wide that it exceeds page
You have to bound size of at least the widest column. See LaTeX/Tables#Text wrapping in tables
I get "! LaTeX Error: Something's wrong--perhaps a missing \item."
Perhaps there's a verbatim or enumerate enviroment inside a table. Change column specifier from c to eg. p{5cm}. See LaTeX/Tables#Other environments inside tables
I get "! Missing $ inserted."
If there's a math text inside a table – see above.
Oh my god! Everything crashes and I can't find the solution!
Try to locate the error - first remove text from chapter that causes error. If this makes the error disappear, bring the chapter text back and try to remove a smaller part of text. After several attempts you should isolate a place where the error resides. Try to fix it and if it does not help - simply remove it and add the text manually.