Skip to content

Latest commit

 

History

History
77 lines (60 loc) · 2.28 KB

README.md

File metadata and controls

77 lines (60 loc) · 2.28 KB

Gradle LaTeX plugin

Build Status Stable version

This plugin allows automation of compiling PDFs using LaTeX and BiBTeX. It offers the following:

  • compile multiple tex and bib 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 or emf

Requirements

  • LaTeX compiler: pdflatex and bibtex on PATH (tested using MikTeX on Windows and TeXLive on Linux)
  • Java version 1.8+
  • Gradle 2.0+
  • if using automatic image conversion, also inkscape on PATH

Gradle usage

Check the examples for further information.

1. Including plugin

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'

2. Specifying inputs

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']
}

3. Calling LaTeX tasks

Build all PDFs:

>gradle pdfLatex

Clean output and auxiliary files:

>gradle cleanLatex

Use continuous build (will block and watch file changes):

>gradle -t pdfLatex