# Using Biber with MiKTeX from command line

I am trying to set up Notepad++ on Windows so that I can compile LaTeX documents from it, using this excellent solution, using a batch file to compile my documents.
However, the example given uses bibtex while I prefer to use biber.

I tried simply replacing all references to bibtex in the batch file with biber, but upon compiling I get errors such as

LaTeX Warning: Empty bibliography on input line 19.

LaTeX Warning: There were undefined references.

Package biblatex Warning: Please (re)run Biber on the file:
(main)                main
(main)                and rerun LaTeX afterwards.


The document compiles correctly apart from the bibliography, which is not found and does not compile. I know the problem must lie with the batch file, as my MWE compiles fine with TeXStudio and by compiling manually via cmd using the commands

cd [path to directory]
pdflatex main.tex
biber main
pdflatex main.tex


MWE:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage[backend=biber, style=ieee, sorting=ynt]{biblatex}

\title{A Minimum Working Example}
\date{}

\begin{document}

\maketitle
\tableofcontents

\section{Citing a Thing}
\cite{QuackQuack}

\nocite{*}

\end{document}


bibliography:

@article{QuackQuack,
author = {A. Author},
title = {Quack quack quack},
journaltitle = {Journal of Ducks},
volume = {1},
pages = {1},
year = {2016}
}


batch file:

::I don't know what the next line does
%~d1
::sets working directory
cd %1
::calls pdflatex and biber on my file
pdflatex %2
biber %2
pdflatex %2
pdflatex %2
::opens/refreshes the pdf in SumatraPDF
START "" "C:\Program Files\SumatraPDF\SumatraPDF.exe" %3 -reuse-instance


I have checked this question, and have made sure my MiKTeX installation and all packages are up-to-date

I can't find any other solutions to my problem online, and this problem stumps everyone I have asked - any help would be greatly appreciated

• Your batch script calls bibtex not biber! Jan 17, 2017 at 18:37
• @josephwright - I know it does, this is the original batch file. I modified it to call biber and got the errors detailed in the question Jan 17, 2017 at 18:51
• Can you run Biber from the command line directly? What does biber --version give? If you edit your script and replace all bibtexs with biber what exactly is the problem? Do you get a .blg file? What does it say? Jan 18, 2017 at 15:42
• @moewe biber v2.7, biblatex v3.7. I can run biber from command line manually and it works fine, references generate perfectly, including being added to contents. I cannot see any .blg files being generated Jan 18, 2017 at 17:02
• If you don't get a .blg that means that your script failed to run Biber. Is there some way you can check that the script actually runs the commands it claims to run? Jan 19, 2017 at 8:35

I have found the solution to my problem:

The batch script I was running took three parameters-

"$CURRENT_DIRECTORY", represented in the script as %1, "$(NAME_PART).tex", represented by %2 and

"$(NAME_PART).pdf", represented by %3 This was passing the parameter "main.tex" to biber, which was causing the issue to appear. I edited the script to take 4 parameters, now %3 is passed "$NAME_PART", this is now given to biber, and %4 is now passed the value that was previously passed to %3

%~d1

This successfully compiles the bibliography and all references. I conclude that biber does not like being given a filename with the .tex extension, and prefers instead to simply be given the filename without extension