tags:

views:

266

answers:

4

The team I work for manages a large collection of technical documentation which is written in LaTeX.

Currently all the documentation we have is manually built by the editors and then checked into a version control system. Sometimes people forget to compile their documents so we have a situation where the PDF and .tex files are often out of step. Unfortunately when this happens our users find themselves reading old versions of our document.

I've managed to hack a simple script to build PDFs using Make - it's rather clumsy.

I was wondering if there was a better way to do it? Most people in our department use Eclipse + Pydev for a Python project which means we are all very familiar with this IDE. I know that Ant plays nicely with Eclipse, so might we be able to use this tool for our doc building?

So what's the best way of doing this? I hope I will not have to learn everything there is to know about a new build-system in order to automate the building of some quite simple docs.

+1  A: 

Haven't tried it, but I remember seeing a blog post about it.

Uri
+3  A: 

There is an external Ant task for LaTeX PDF generation, though the site is in German.

To use it, download the jar to a location on your machine, then define a taskdef as follows:

<taskdef name="latex"    classname="de.dokutransdata.antlatex.LaTeX"  
  classpath="/path/to/ant/lib/ant_latex.jar"/>

Then to use it, define a target like this:

<target name="doLaTeX">  
  <latex  
    latexfile="${ltx2.file}"  
    verbose="on"  
    clean="on"  
    pdftex="off"  
    workingDir="${basedir}"  
  />  
</target>

Where ltx2.file is the file to process.

This is a link to the howto page listing the parameters. If you need any more options, my German is just about passable enough to explain, maybe.

There is also a maven plugin for LaTeX, but I can't find any documentation.

Rich Seller
I saw that link, unfortunately I only speak English.
Salim Fadhley
My German's not great either, but I found a link to the howto page and posted one of the examples. The parameters are at least in English so you may be ok...
Rich Seller
+1  A: 

If you know python, this blog post might be interesting

EDIT: Also, I would assume that you're using some kind of version control system, and I can't say for sure, but I use git to manage all my latex docs, and it might be possible to use some kind of post-commit hook to execute a script to rebuild the document. This would depend on how your repository is structured... just thinking out loud, so to speak.

Mica
+1  A: 

I went into great detail on a large number of build systems for latex in this question, but its slightly different in your case. I think you want rubber or latexmk. The latex-makefile seems a good idea, but only supports building via postscript, which might not be your build process.

In general, its a good idea to keep generated files outside of version control for just this reason. A good exception is when specialist build tools are not widely available, and your situation sounds similar. You might do better with a commit-hook to build automatically upon commit.

I guess I should also point out that committing something without first building it and checking it is a deadly sin, so a better solution might be to stamp that out.

Paul Biggar