3

Consider this MWE:

\RequirePackage{snapshot}
\documentclass{scrbook}
\usepackage{filecontents,biblatex}
\begin{filecontents}{\jobname.bib}
  @misc{anything,
  author={A. Anyone}}
\end{filecontents}
\addbibresource{\jobname.bib}


\begin{document}
 \chapter{My document}
This is my text
\end{document}

›Collecting‹ the bib-file I can use:

bundledoc --include="*.bib" bundledocbib.dep

But as soon as I use it with --keepdirs as in

bundledoc --keepdirs  --include="*.bib" bundledocbib.dep

the bib-files are omitted.

lukascbossert
  • 3,015
  • 1
  • 16
  • 37
  • 1
    I didn't know of the existence of bundledoc. It's nice to know. – gusbrs Feb 24 '18 at 22:21
  • It is great! But has some strange behaviours, see as well: https://tex.stackexchange.com/questions/416928/how-to-archive-a-tex-project-by-gathering-e-g-all-figures-and-used-packages – lukascbossert Feb 24 '18 at 22:25
  • Nice indeed! I gave thought of this before, on how to store a document for long term. And I thought the only way to assure an identical build would be to store all files, packages and executables involved. Glad to see it is already "bundled". :) – gusbrs Feb 24 '18 at 22:37
  • 1
    Write the author and ask him. – Ulrike Fischer May 24 '18 at 20:52
  • Does anyone know why the .bbl file is included by biblatex but the .bib file is not? I would say that the .bib file is the original source (and therefore clearly a dependency) and was quite astonished that it is not in the .dep file in the first place. – carlosvalderrama May 29 '18 at 06:37
  • Note: Your MWE is not a good MWE as the .bib file is not required to build the final document (the first compilation autogenerates the .bib file). – Paul Gaborit May 29 '18 at 06:38
  • You are right, but the example serves the purpose showing that the .bib file is not collected by bundledoc. The author of the package/script has been informed about this issue. – lukascbossert May 29 '18 at 07:35
  • @LukasCB Are the workarounds sufficient? If yes, accepting the answer would be nice. Otherwise, let me know whether the problems persist. – carlosvalderrama May 31 '18 at 09:10
  • It works as a workaround but I am still looking for a rather clean solution. Till then I accept(ed) your answer. – lukascbossert May 31 '18 at 09:12

1 Answers1

1

1) Workaround that addresses the bug in bundledoc

I could reproduce the behavior using TeXlive 2016 on Debian. Apparently there is a bug in the bundledoc script that does not expand the relative path to an absolute path, which is required for the keepdirs option.

When I provided the absolute path, the bib file was included with and without the keepdirsoption.

bundledoc --include=`pwd`/*.bib ...

I believe this is a reasonable workaround. But Ulrike is right, the package developers should know about this.

2) Workaround that adds the *.bib file to *.dep

Also, I found that adding a line

*{file} {test.bib} {0000/00/00 v0.0}

to the *.dep file lead to correct behavior, i.e., the *.bib file was added to the archive with and without --keepdirs. Of course, doing this manually is unconvenient, so one may consider including

\makeatletter
\@addtofilelist{test.bib}
\makeatletter

in the preamble of the document. Then, the extra option --include=*.bib is not required anymore.