Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Is there latex/pdflatex build support in Pipelines feature?

trusira December 10, 2016

I want to integrate a continuous building tool for .tex files in my bitbucket repository. Is there a way I can run 'pdflatex' with pipelines?

4 answers

1 vote
botenvouwer February 14, 2019

I wanted to do just this, right now I got this solution:

image: botenvouwer/latex-pipeline-builder
pipelines:
tags: '*':
-
step:
name: Compile tex file and commit to repo
script:
-
latex-builder "${BITBUCKET_TAG}"
-
git add -f '*.pdf'
-
git commit -m "Auto publish ${BITBUCKET_TAG}"
- git push origin HEAD:master

It builds for every tag you make. You need to provide a tag name like this:

[filename]-[version]


Example:

mythesis-v1.3

The `latex-builder` will look for "./mythesis.tex" and "./mythesis/mythesis.tex". In the above example I passed the tag automatically with:

latex-builder "${BITBUCKET_TAG}" 

If you just want to build on every push use `latex-builder` like this:

latex-builder "mytheses-latest"
1 vote
Virag Varga July 28, 2017

I've created a docker image (latex4bitbucket) with which you can easily compile latex, as well as automate the copy of the generated files to a Google Drive folder.

Description with example pipeline configuration is available here.

0 votes
adujardin_private April 26, 2017

Hi,

In case someone is interested, I made a simple pipeline file which can build latex document easily. The build is triggered manually (replace 'custom' by 'default' to change that), and handle complex document with bibliography as well as simple one. If a package is missing, the simplest solution is to put it in your repo.

The main file should be named "Main.tex".

It should be noted that the artifacts are lost as mentioned by @ Thomas Bradshaw. However, you could upload it to a third-party storage service (such as an SFTP server).

image: fermiumlabs/latex-docker:latest

pipelines:
  custom: # Manually only
    build_full:
      - step:
          script:
            - pdflatex Main.tex && bibtex Main && pdflatex Main.tex && pdflatex Main.tex
    build_fast:
      - step:
          script:
            - pdflatex Main.tex

 

0 votes
Tom Bradshaw
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 19, 2016

Hi @Tharindu Rusira,

There are three ways you can do this. The first is to use a docker image published already as the image you use to build the pipeline. e.g.

image: sharelatex/sharelatex
pipelines:
  default:
    - step:
       script:
        - latex <fileName>

There is a list of possibilities at https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q=latex&starCount=0 and https://store.docker.com/search?q=latex&source=community . From here you will need to run the latex commands in the script. The second way is to build your own latex image, push it to a private repository or dockerhub and then pull it just as you would for a public image in the previous method. The final way is to install latex as part of the build. e.g.

pipelines:
  default:
    - step:
       script:
		- apt-get install texlive-full --assume-yes
        - latex <fileName>

However this will take a long time to complete and you'll have to run it every time. It is important to point out that we don't have support for artifacts yet so your pdf will be inaccessible after the pipeline has finished running.

Cheers,
Tom

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events