3

I'm using latexmk for a long time now but since the last update to latexmk 4.70a (from 4.69a) one of my presentations doesn't compile anymore. There seems to be some problem with running bibtex.

This is a short extract from the faulty log:

bibtex: Not writing to /workspaces/Ngas_Inrec_Presentation/Main.blg (openout_any = p). I couldn't open file name `/workspaces/Ngas_Inrec_Presentation/Main.blg'

I created a small reproducible example:

Main.tex

\documentclass{article}

\usepackage[round]{natbib}
\bibliographystyle{abbrvnat}

\begin{document}

\cite{geng2017relationship}

\bibliography{lib}{}

\end{document}

lib.bib

@article{geng2017relationship,
  title={The relationship between regional natural gas markets and crude oil markets from a multi-scale nonlinear Granger causality perspective},
  author={Geng, Jiang-Bo and Ji, Qiang and Fan, Ying},
  journal={Energy Economics},
  volume={67},
  pages={98--110},
  year={2017},
  publisher={Elsevier}
}

The full logs (working and not working), as well as the 2 files above, are available in this github gist.

Does anyone have an idea? Thanks so much in advance.

Edit / Further Information.

After playing around with executing commands manually I found out the following: latexmk 4.70a executes

bibtex  "/workspaces/Ngas_Inrec_Presentation/Main.aux"

Which does not work.

latexmk 4.69a used

bibtex  "Main"

Which does work. So there seems to be a problem with specifying the full path. I also tried:

bibtex  "Main.aux"

To check if the file extension causes problems. It does not, it's working fine. The access rights also seem to be right since editing Main.aux with:

nano  "/workspaces/Ngas_Inrec_Presentation/Main.aux"

is also working fine.

  • Please specify which latex installation and operating system you are using – daleif Sep 29 at 7:46
  • 1
    I have no issue with the any of this on my fully up to date TeXLive 2020 on Linux. BTW: since latexmk just calls bibtexave you tried to see if bibtex runs if you run bibtex by hand (or through your editor). If it still fails, then it is not comming from latexmk. – daleif Sep 29 at 7:51
  • Are you redirecting the output to some build folder? – Ulrike Fischer Sep 29 at 7:54
  • 2
    You are redirecting the output, your log contains -output-directory="/workspaces/Ngas_Inrec_Presentation". It is not really surprising that this doesn't work under openout_any=p, it is more surprising that it worked before. – Ulrike Fischer Sep 29 at 8:20
  • 1
    well basically with openout_any=p you are not allowed to write to absolute pathes or parent directories. According to the version history personal.psu.edu/jcc8/latexmk/versions.html latexmk previously switched the directory for bibtex but doesn't do it now, and so probably the openout settings kicks in. You could ask the latexmk maintainer for details. – Ulrike Fischer Sep 29 at 8:56
4

I've fixed this problem for a new release of latexmk, v. 4.70b. Until you have it installed, set $bibtex_fudge to 1, as described in another answer. This can be done in one of the latexmkrc files, or from the command line with the -e option. Under linux and macOS, you'd use

-e '$bibtex_fudge=1'

Under MS-Windows, you probably should omit the single quotes.

That setting causes latexmk to change to the appropriate directory before running bibtex, with some other shenanigans on environment variables. This method also fails for some documents, which is why I changed the default in v. 4.70a.

Note The fix in the new version will work if the output directory is under the current working directory when the document is compiled.

| improve this answer | |
2

The cause of the Problem was that latexmk changed the default value of $bibtex_fudge from 0 to 1 in the latest release. Here is a description for that variable:

$bibtex_fudge [0]
         When using bibtex, whether to take special action to allow older versions of bibtex  to  work  when  $out_dir  or
        $aux_dir is specified.  With bibtex from about 2019, this special action is longer be required; hence the default
         is not to do it.

There are multiple solutions on how to set this variable back to 1 when using VS-Code and the Latex-Workshop extension. This was discussed on Github.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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