0

I am trying to compile correctly a text that relies on an external .bib file using bibtex-chicago on a Windows machine through TeXstudio. I get bold bibliography labels instead of the references. I get, for example banfield1967moral as a output.

MWE:

\documentclass[12pt]{article}\usepackage[]{graphicx}
\usepackage[american]{babel}
\usepackage[autostyle]{csquotes}
\usepackage[authordate, backend=biber, bibencoding=utf8, natbib, isbn=false,safeinputenc]{biblatex-chicago}

\bibliography{BIBLIO}

\begin{document}

\cite{banfield1967moral}
\printbibliography
\newpage

\end{document}

BIBLIO.bib:

@article{banfield1967moral,
title={The moral basis of a backward society},
author={Banfield, Edward C.},
year={1967},
publisher={Free Press}
}

and TEX_FILE.tex are in the same folder. The default bibliography tool is Biber and

To compile I call txs:///latex | txs:///biber | txs:///latex | txs:///latex.

The .blg file is not created.

The .log file suggest no .bbl file can be created and finds this additional error:

("C:\Users\...\MiKTeX 2.9\tex\latex\biblatex\blx-dm.def" File: blx-dm.def 2018/03/04 v3.11 biblatex localization (PK/MW))
Package biblatex Info: Trying to load biblatex style data model...
Package biblatex Info: ... file 'chicago-authordate.dbx' not found.
Package biblatex Info: Trying to load biblatex custom data model...
Package biblatex Info: ... file 'biblatex-dm.cfg' not found.

Whilst compiling i get in the 'Messages' section:

Process started: biber.exe "document"

Error unlinking file C:\Windows\TEMP\bkLU5r9bip using unlink0 at C:\Windows\TEMP\par-4361737469676c696f6e69\cache-9d6b46fefde4bd584f892f8159e8daefd64788a3\inc\lib/IPC/Run3.pm line 128.

Process exited with error(s)

On TeXstudio I compile with "Bild and View" (double green arrow); it calls LaTeX, Bieber, and LaTex in the order.

enter image description here

moewe
  • 175,683
MCS
  • 103
  • 1
    Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – DG' Sep 28 '18 at 13:13
  • Try \addbibresource{BIB_FILE.bib} instead of \bibliography{BIB_FILE}. You could follow the instructions here to check, if your editor is configured properly: https://tex.stackexchange.com/questions/154751/biblatex-with-biber-configuring-my-editor-to-avoid-undefined-citations/154754#154754 – DG' Sep 28 '18 at 13:18
  • 1
    If you have completed a full LaTeX, Biber, LaTeX, LaTeX build cycle you should be able to find a .log file (produced by LaTeX) and a .blg file (produced by Biber, on Windows machines that file may be classified as a 'performance monitor file' that is misleading, it is a normal text file you can open with your favourite text editor). Those files should tell you about warnings or errors. What do they say? Double check your configuration with https://tex.stackexchange.com/q/154751/35864, post a complete MWE and an excerpt of the .log and .blg file. – moewe Sep 28 '18 at 13:19
  • The code looks OK so far and actually works for me (I suggest you remove the full stop at the end of the the title field, since titles are not usually styled with a sentence end marker in papers or on book covers and let biblatex-chicago decide whether or not to place a full stop or a comma; on the other hand I would suggest to add a . to the author field to mark the C. as an initial). Since the code is OK we need to know what LaTeX and Biber complain about: Please show us the relevant parts of the .log and the full .blg file. See also https://tex.stackexchange.com/q/286706/35864 – moewe Sep 29 '18 at 11:01
  • Forgive my ignorance for not knowing what an OS machine is, but that probably does not really matter. We need to see the full contents of Biber's log file - the .blg file. It should tell us why no .bbl could be produced. edit: The quoted messages are entirely non-critical and do not even show that a .bbl was not found. – moewe Sep 29 '18 at 11:58
  • If you can find neither a .bbl nor a .blg there are two possibilities: (1) Biber was not actually run. (2) Biber was started but aborted with an unexpected error so early that it even failed to write a .blg error log. I'm not saying (2) is impossible, but I have reasons to believe that it would be incredibly rare. Can you run Biber from the command line? What does biber --version report? – moewe Sep 29 '18 at 12:06
  • Thanks for the patience. on the command line I get biber version: 2.11 – MCS Sep 29 '18 at 12:08
  • Good. That means that Biber works and that it is compatible with your biblatex version. All this strongly suggests that your editor does not call Biber correctly. Double check your settings with https://tex.stackexchange.com/q/154751/35864. Can you post a screenshot of your configurations? How exactly do you compile your document? (I.e. what buttons do you press? And what actions are set up for those buttons?) – moewe Sep 29 '18 at 12:13
  • Aha! That error message is quite interesting. I have never seen it before and I thought message similar to that one died out a while ago (https://tex.stackexchange.com/q/140814/35864). Can you compile your document from the command line. I.e. can you run pdflatex mydoc, biber mydoc, pdflatex mydoc, pdflatex mydoc (assuming your test document is called mydoc.tex)? – moewe Sep 29 '18 at 12:30
  • Running biber mydoc i get the following error:

    Error unlinking file C:\Windows\TEMP\7uBwmyXN2b using unlink0 at C:\Windows\TEMP\par-4361737469676c696f6e69\cache-9d6b46fefde4bd584f892f8159e8daefd64788a3\inc\lib/IPC/Run3.pm line 128.

    Running all the sequence I arrive at the same result as if compiling through TeXstudio.

    – MCS Sep 29 '18 at 12:38
  • OK. What makes me suspicious about the error message is the path of the problematic file C:\Windows\TEMP. This seems to suggest that your Biber cache is located in C:\Windows\TEMP, on my machine that would be in C:\Users\<User>\AppData\Local\Temp. I suspect that you have no write permission in C:\Windows\TEMP when you run Biber as a normal user and not as an administrator. I suggest you remove the directory C:\Windows\TEMP\par-4361737469676c696f6e69 (probably as administrator) and then run biber --version again (make sure you run Biber not as administrator, you must be a user) – moewe Sep 29 '18 at 12:46
  • Related: https://github.com/plk/biber/issues/70. If you type set in your command line what are the values of TMP and TEMP. (You can also type set TMP and set TEMP directly to only query those variables.) – moewe Sep 29 '18 at 12:54
  • TMP=C:\Windows\TEMP TEMP=C:\Windows\TEMP – MCS Sep 29 '18 at 12:58
  • No no no, that link is outdated and contains a prominent warning at the top. Its six years later now and Biber comes with both 32 and 64 bit MikTeX. It is installed on your machine already. The problem is just the cache. The TMP variable settings are odd. They should point to a directory that is actually writable by a normal non-admin process. Have a look at https://github.com/plk/biber/issues/70. Is the Windows machine your PC or is it a work machine where you only have restricted access? I'm sorry I have to go now, but I will be back later and see what I can do. – moewe Sep 29 '18 at 13:03
  • It is my office machine, and I have restricted access - to a point, meaning I generally have writing capabilities. – MCS Sep 29 '18 at 13:06
  • Do let me know if the answer worked for you, please. – moewe Oct 01 '18 at 12:40

1 Answers1

1

The error message

Process started: biber.exe "document"

Error unlinking file C:\Windows\TEMP\bkLU5r9bip using unlink0 at
C:\Windows\TEMP\par-4361737469676c696f6e69\
cache-9d6b46fefde4bd584f892f8159e8daefd64788a3\inc\lib/IPC/Run3.pm
line 128.

Process exited with error(s)

(my line breaks) shows the root cause of the problem.

Biber is a self-extracting binary that needs to unpack itself into a cache location to run properly. Normally this happens on the first Biber run. Biber then creates a cache in a location suitable for temporary files and operates from there. If the cache is deleted it is simply recreated. But to work properly Biber needs full read and write access to the location of the cache. You can read more about this in chapter 4 of the Biber manual.

You can find out where your cache lives if you type

biber --cache

into your command line.

The underlying library that Biber uses to perform the packing an unpacking (PAR::Packer/pp) usually chooses the location of the temporary/cache folder based on the environment variables TMPDIR, TEMPDIR, TEMP and TMP.

As established in the comments (using set TEMP and set TMP) your environment variables are set up in a way that they direct Biber to unpack its cache into C:\Windows\TEMP\. But it seems that due to security reasons your operation system does not give Biber full read and write access to this directory. That means that Biber can not work properly.

You could ask your sysadmin to somehow whitelist Biber and give it full read and write access to its cache location. If that is not possible, you can try to tell Biber to write to a different location where you have full read and write access. To do that you need to set the value of the environment variable PAR_GLOBAL_TEMP.

  1. Find a directory you have full read and write access to (a directory within your user directory seems like a good guess C:\Users\<User>\...).
  2. Now set PAR_GLOBAL_TEMP to point to that directory. Open a command line and type

    set PAR_GLOBAL_TEMP=<your-writeable-directory>
    
  3. Run Biber and let it unpack itself to the new directory

    biber --version
    

    Wait for the process to finish, it may take a while.

  4. Verify the location of the cache

    biber --cache
    

    The output should show a folder name in the directory you passed to PAR_GLOBAL_TEMP.

  5. If possible clean up the old Biber caches from C:\Windows\TEMP. Of course that only works if you have write access to those files.

A relevant and related discussion can be found in https://github.com/plk/biber/issues/70.

moewe
  • 175,683
  • Despite the complete answer, it does not seem to solve my issue. By setting PAR_GLOBAL_TEMP now a .bbl file is generated but it is empty. I tried multiple combination of compiler with no result. – MCS Oct 02 '18 at 16:16
  • @MCS Is the file completely empty or does it contain at least a framework? If a .bbl is produced at all that means that Biber works at least to some extent. Do you get any useful messages in the Biber output when you run it or in the .blg file? (I don't know if I said this before, but on the off chance that I didn't: on Windows machines .blg files may be classified as "Performance monitor files", you may only be able to find them if you decide to unhide file extensions, despite Windows' claim to the contrary, the file is actually a simple text file that you can open with any text editor) – moewe Oct 02 '18 at 16:21
  • Out of sheer frustration I re-installed, both MikTeX and TeXstudio and set the PAR_GLOBAL_TEMP.

    Everything now works. Thanks for the patience and the support.

    – MCS Oct 02 '18 at 18:10