0

This question already has an answer here:

I am currently using Texworks + Linux. To compile the PDF I hit pdflatex + bibtex + pdflatex + pdflatex. Is there a way so that I create a new typeset that does that in one click?

Found the easy answer:

1- add a new typeset tool, (Edit > Preferences > Typesetting > Add Processing tools)

typeseting

2- And use Browse to add your simple bash code:

#!/bin/bash                                                                 

filename=$1                                                                 
filename_bib=$2                                                             

pdflatex $filename                                                          
bibtex $filename_bib                                                        
pdflatex $filename                                                          
pdflatex $filename 

marked as duplicate by cfr, Sean Allred, Mico, Werner, Svend Tveskæg Apr 8 '15 at 2:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

If you're looking for a solution to the problem rather than an answer to the question (as I understand it), I'd recommend using arara.

There's very good integration documentation available in arara's critically-acclaimed manual, chapter 4.

Essentially, you place a few lines at the top of your TeX document like this:

% arara: pdflatex
% arara: bibtex
% arara: pdflatex
% arara: pdflatex
\documentclass{…

and then run

$ arara my-file.tex

and arara will understand those first few lines and do what you want. Those first few lines come with options, too, but that's for the documentation to explain :)


As @cfr points out, it's also extensible! You can add your own rules to arara and share them if you can't find what you're looking for. (I believe those types of questions would be on-topic here, but I'm not certain.)

  • 1
    And you can add custom thingies. Also for the documentation to explain. But neat. – cfr Apr 8 '15 at 1:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.