Skip to content

Gradle LaTeX plugin - connect & watch multiple TeX and resource files

Notifications You must be signed in to change notification settings

csabasulyok/gradle-latex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Gradle LaTeX plugin - connect & watch multiple TeX and resource files

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages