I managed to add all bibfiles in a bib/ directory to my default resource list by using \write18 and pdflatex -shell-escape.
Is there a less cumbersome way to do add all bibfiles in a directory to the resource list?
\RequirePackage{filecontents}
\begin{filecontents}{bib/1.bib}
@book{key1, title="title1", author="author1", year="2001"}
\end{filecontents}
\begin{filecontents}{bib/2.bib}
@book{key2, title="title2", author="author2", year="2002"}
\end{filecontents}
\begin{filecontents}{bib/3.bib}
@book{key3, title="title3", author="author3", year="2003"}
\end{filecontents}
\documentclass{article}
\usepackage[backend=biber]{biblatex}
\immediate\write18
{for i in bib/*; do echo "\string\\\string\\addbibresource\string{$i\string}"; done >bibresources.tex}
\input{bibresources}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
echoto work just now), I think that is a very good solution. And it is not very cumbersome in the end, do you think? Without\write18, LaTeX has no way of knowing about the files in the./bibfolder without resorting to some way to scour the folder. – moewe Aug 27 '15 at 17:12pdflatexwith a-shell-escapeflag. Correct me if I'm wrong: not evenbiblatexitself would be able to list abibdirectory for bibfiles if the user didn't pass-shell-escapetopdflatex? – n.r. Aug 27 '15 at 17:19kpsewhich. If you don't specify a name, we need a way to obtain the name and that is what we need the shell-escape for; you need access to the entire file system. See also Inputting multiple files in LaTeX, How to iterate through the name of files in a folder. – moewe Aug 27 '15 at 17:29pdflatexwith-shell-escapedoes not appear more cumbersome that running it without (you could probably have your favourite editor create a new build tool with shell escape, or have a sot of shortcut in your command line). Fundamentally,biblatexcannot do more than LaTeX in finding files (it is a LaTeX package after all; if you leave out Biber, there could be a way using Biber, but that would then require - if at all possible - a much higher number of compiler passes.) I would like to mention though that there appears to be a LuaTeX solution. – moewe Aug 27 '15 at 17:32