Gradle and LaTeX

Dear Community,

did any of you try, or, even successfully, build LaTeX-documents using gradle? I myself use LaTeX regularly, and I’d like to see my LaTeX-output being rendered by a more sexy solution than “make” :wink:

Kind regards, Stefan

I guess if your suggestion raises enough ‘me toos’ and we have enough time we’ll help out :slight_smile:

I think this would be great. I think it will take a bit of thinking about how best to organize the extension to support multiple compilation paths: pdftex, pdflatex, latex + conversion, etc.

In general, I don’t think there’s a clear best practice for developing plugins with multiple compilation options.

Hi,

With scripts obtained from the internet I did sucessfully build LaTeX documents using Gradle. The gradle script it’s a bit messy as I’m just learning to use Gradle myself, but it worked for me.

You can get it here: http://pastebin.com/dzWvyZsP

Hope this helps.

Best regards, António http://linkd.in/ajcin

My approach is using a general build file in a common location containing all the build logic and a project specific build file in the project directory.

The ‘common.build.gradle’, which could be rewritten as a real Gradle plugin, rests under http://pastebin.com/N0STPp5j

The project specific script then boils down to

apply from: '../common.build.gradle'
ext.jobname = 'Document Name'

Hello,

our solution looks like this: http://pastebin.com/e1inid1G

Björn

I use SCons which has excellent support for building LaTeX (indeed XeLaTeX) documents.

Hi!

I have tried ‘rubber’ and this is really good. https://launchpad.net/rubber/

In our CI (jenkins) this is just another shell-command:

rubber --module index,graphics --pdf Manual.tex

‘rubber’ and ‘latexmk’ are both good options.

I have started working on a Gradle LaTeX plugin, in the ‘gradle-science’ module of my Gradle plugins.

apply plugin: ‘latex’

task latex(type: LaTeX) {

master ‘mydocument’

}

It auto-detects a lot of input files (in a kinda messy way), re-runs, and also handles both BibTeX and BibLaTeX. Contributions to clean it up, document it, and debug it are more than welcome.