21

I have MikTeX 2.9, 32-bit, Windows 7, all the latest updates are there. I'm using TeXworks ( pdflatex + makeindex + bibtex).

When I use biblatex package with option [backend=biber] I have no bibliography printed at all. If I run biber.exe over my file manually, then everything works fine.

My question is: How can I set up TeXworks, so it uses biber.exe when needed (i.e. I would like to havepdflatex + makeindex + biber typesetting)? I did not find any manual regarding the case. If there is such manual, could anybody point me out to it?

Speravir
  • 19,491
Oleksandr
  • 967
  • 1
    @percusse I guess the point is the MiKTeX adds 'pdfLaTeX + MakeIndex + BibTeX' to the 'Typeset' menu of TeXworks. – Joseph Wright Sep 01 '12 at 17:54
  • @percusse MiKTeX isn't an editor, it's a TeX distribution on Windows. It includes the command texify which runs (pdf)LaTeX, BibTeX and MakeIndex in a single command. – Joseph Wright Sep 01 '12 at 18:01
  • MikTeX is a project. It includes TeXWorks, and adds pdfLaTeX + MakeIndex + BibTeX typesetting. When I use this typesetting in connection to backend=biber option of biblatex, then the bibliography is not printed until manual run of biber.exe over my file. How shall I "tell" TeXWorks to run biber automatically when needed? – Oleksandr Sep 01 '12 at 18:04
  • @JosephWright I don't know what I'm saying nevermind. I was thinking about TeXnicCenter for some reason, – percusse Sep 01 '12 at 18:06
  • 5
    texify needs to have a update to be able to process biber instead of bibtex. But you can build a batch file calling pdflatex, biber etc. Then you can add the call of this batch in TeXworks, for example pdfLaTeX+Makeindex+biber. – Mensch Sep 01 '12 at 19:12

5 Answers5

13

Let me suggest an other tool.

Every document has its own requirements regarding the compilation. As you wrote you need pdflatex, makeindex and biber. My recommended tool allows the setting of the compilation out of the tex file. The tool is named arara

Next to the short online introduction the author Paulo Cereda provides a complete manual which can be downloaded here: arara at github (download part)

arara provided and installer with some predefined rules. Based on your requirement you can setup you main tex file header as follows:

% arara: pdflatex: { draft: true }
% arara: makeindex: {  style: stylefile.ist }
% arara: biber
% arara: pdflatex: { synctex: true }
% arara: pdflatex: { synctex: true }

If you need only one compilation e.g. pdflatex you can comment the other assignments with a previous !:

% !arara: pdflatex: { draft: true }
% !arara: makeindex: {  style: stylefile.ist }
% !arara: biber
% !arara: pdflatex: { synctex: true }
% arara: pdflatex: { synctex: true }

The different compilation rules have more options and can be modified for your specification easily.

The integration and usage of the tool arara in TeXworks is described in the manual in section 4.1.

Marco Daniel
  • 95,681
  • 2
    The suggested order of execution could lead to incorrect results. makeindex should be called after the result of biber has been compiled by (pdf)LaTeX, and in general one should not run makeindex after the first run of LaTeX (e.g., the table of contents should be longer than 1 page. – Guido Nov 15 '12 at 21:12
  • @Guido: In general I agree with you. In your case we need two draft runs before and after makeindex. – Marco Daniel Nov 16 '12 at 15:53
12

A little bit late, and the solution has been mentioned before in this thread, but I had just the same problem. A quick solution to use pdfLaTeX with biber in TeXworks is to use a batch file.

Create the file pdflatex+biber.bat in your MiKTeX directory, in the subfolder /miktex/bin/, with the following content:

miktex-pdftex.exe -synctex=1 -undump=pdflatex "%1"
biber.exe "%2"
miktex-pdftex.exe -synctex=1 -undump=pdflatex "%1"

Now open the typesetting editor of TeXworks and add a new setting. Name it appropriate (e.g. "pdfLatex+Biber") and give the path to your batchfile (.../miktex/bin/pdflatex+biber.bat). Add two arguments: $fullname and $basename.

That's it, works fine for me and I think, the solution can be adopted to other situations, where more/other programs have to be involved in the typesetting process.

Mensch
  • 65,388
benne08
  • 121
7

In the pdflatex + makeindex + bibtex-typesetting-configuration that you describe, TeXworks relies on texify. You can tell texify to run biber instead of bibtex via the environment variable BIBTEX (texify documentation).

Normally you can set the Variable here: Control Panel --> System --> Advanced system settings --> Advanced --> Environment Variables --> New. However, I would not recommend doing that, as it will break any legacy project you might be using with bibtex.

Instead, I'd recommand setting up a Batch-File:

@set BIBTEX=biber
@texify %*

Then you set up a new typesetting in TeXworks. It should get the same Arguments as the pdflatex + makeindex + bibtex-Typesetting and the Batch-File as a command.

But there is another caveat: With texify might not reliably detect that it needs to re-run after biber changed things. You can re-run the whole thing manually, when in doubt. There is also this workaround that relies on inserting some code into your main TeX-File.

As you can see, this seems to be quite experimental the other solutions with different tools or editors might be more easy.

Vincent
  • 261
  • I tried set BIBTEX=biber and set BIBTEX=full/path/to/biber.exe, as suggested here, but none seem to work. – Foad Jan 20 '24 at 19:33
5

Compiling a *TeX document can be involved - for example, if you wish to produce an index you have to run something more but the simple pdflatex, bibtex, pdflatex (or biber in your case). Therefore, I chose eventually to use latexmk which takes care of all this automatically - so far it didn't let down!

I'm not familiar with the windows setting, but I guess you could set the editor to use latexmk for the compilation of a document.

Dror
  • 22,613
0

@benne08 solution worked perfectly from the texmf-local as instructed by @speravir and is the easiest option to use I found from all sources. The following is more obvious and simpler to set up for one off testing.

Add Biber using |TeXworks|Edit>Preferences…>|[Typesetting]| finding .../miktex/bin/biber.exe

Add $basename as an argument. You can add –U and –u if you want it to input and the output in utf8 encoding (These utf8 arguments I haven’t checked personally).

Then run the individual steps e.g.: PdfLaTex -> Biber -> PdfLaTex from the typesetting bar.

Jethro Belle
  • 138
  • 6