This plugin allows automation of compiling PDFs using LaTeX and BiBTeX. It offers the following:
- compile multiple
tex
andbib
files with dependencies in-between them; - use Gradle's continuous build feature to watch for changing sources
- watch auxiliary files (images, extra tex files, etc.)
- use Inkscape to convert images in unsupported formats like
svg
oremf
- LaTeX compiler:
pdflatex
andbibtex
onPATH
(tested using MikTeX on Windows and TeXLive on Linux) - Java version 1.8+
- Gradle 2.0+
- if using automatic image conversion, also
inkscape
onPATH
Check the examples for further information.
The plugin can be used by including the following in your build.gradle
:
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath group: 'com.github.csabasulyok', name: 'gradle-latex', version: '1.0'
}
}
apply plugin: 'latex'
Specify inputs in build.gradle
:
latex {
// doc1.tex -> doc1.pdf
tex 'doc1.tex'
// doc2.tex -> customDoc1.pdf
tex tex:'doc2.tex', pdf:'customDoc1'
// doc3.tex, refs.bib -> doc3.pdf
tex tex:'doc3.tex', bib:'refs.bib'
// img.svg -> img.pdf, doc4.tex -> doc4.pdf
tex tex:'doc4.pdf', img:['img.svg']
}
Build all PDFs:
>gradle pdfLatex
Clean output and auxiliary files:
>gradle cleanLatex
Use continuous build (will block and watch file changes):
>gradle -t pdfLatex