Closed sudotac closed 3 years ago
Thanks for your suggestion. In the programs.bibtex
table of llmk, a bib database should be specified for the target rather than an aux file. That is, for instance in your case, the desired configuration in terms of the program design is the following.
% +++
% sequence = ["latex", "bibtex", "dvipdf"]
% latex = "uplatex"
% dvipdf = "dvipdfmx"
%
% [programs.bibtex]
% target = "testref.bib"
% +++
Specifying an aux file does work in some cases including yours, but llmk should know which is the bib database for your document. At this point, this is indeed not that much important, but I have a plan to persistence the internal file database (fdb) of llmk by writing its content to an external file, which is similar to \jobname.fdb
for latexmk. With the permanent fdb feature, the bibtex program should be run only if the database is updated; for this purpose, llmk should recognize a bib database as a target.
Another problem with making the aux file (%B.aux
) as the default target is that it will result in an error if an author does not intend to use the bibliography feature of LaTeX. As a concrete example, with your proposing default configuration (#10), it will result in an error to run it over the default.tex:
$ llmk -v default.tex
...
llmk info: Running command: bibtex "default"
This is BibTeX, Version 0.99d (TeX Live 2020)
The top-level auxiliary file: default.aux
I found no \citation commands---while reading file default.aux
I found no \bibdata command---while reading file default.aux
I found no \bibstyle command---while reading file default.aux
(There were 3 error messages)
llmk error: Fail running bibtex "default" (exit code: 512)
Obviously, the default configuration should not try to run a command that results in an error in typical valid LaTeX documents.
In summary, the llmk users should explicitly specify bib databases for the target in the programs.bibtex
table if they want to use a filename other than %B.bib
.
Thanks for the detailed description!
First, I should apologize that I didn't notice some errors in CI tests, and I didn't think of example documents. I will close the PR(#10) later.
I have a plan to persistence the internal file database (fdb) of llmk
It looks good to me, and I understand why llmk needs a path of a bib database, not that of an aux file.
A possible problem with this approach is the lack of support for multiple bib databases.
llmk can only accept a bib database in programs.bibtex.target
for now while \bibliography
can accept multiple arguments.
To my knowledge, the aux file is always a single file, but the specified bib database(s) in a LaTeX document may be multiple.
I think it would be better programs.bibtex.target
is an array of strings, not a string.
Yes, that is also my concern. Not only for BibTeX but in general, there should be cases that multiple target
s are desired. I will think about how to address this demand either by making a breaking change on the target
key or with a better solution.
In summary, the llmk users should explicitly specify bib databases for the target in the
programs.bibtex
table if they want to use a filename other than%B.bib
.
For me, llmk
is a tool with very little configuration. As usual, when leaving the path of convention one needs to configure it. - In my concrete case, there is \bibliography{bib/literature}
, which is not recognized automatically. Using the configuration works.
In case there was no bib "found" by llmk, could it output that at the end of the run? In that way, new users wondering why bibliography references are undefined, could be supported.
With -drun
flag, it will show that information.
llmk debug-run: Preparing for program "bibtex"
llmk debug-run: Skiping "bibtex" because target (test.bib) does not exist
I don't want to show this type of information by default because it will be too noisy.
Thank you for the hint!
I see hundreds of lines of pdflatex output when using "llmk". Thus, I thought two (IMHO important) lines of llmk would cause no harm. -- I just wanted to ensure that users new to llmk and "just want" to compile their (existing) latex documents can do that without consulting a manual, GitHub issues, ... Maybe, latexmk or ltx2any fit better in my view of usage of latex build tools. - Nevertheless, I will try to have latex templates generated by me supporting (latex-template-generator) a "good" llmk config.
Summary
When .bib has different basename from .tex, bibtex does not run.
Environment
TeX distribution : TeX Live 2020/Arch Linux llmk : master (916c6bd) (
llmk.lua
is symlinked asllmk
.)How to Reproduce
Here is a small example.
test.tex
testref.bib
is located in the same directory.bibtex
doesn't run.Possible Solution
bibtex
processes .aux and produces .bbl, so the default value ofprograms.bibtex.target
should be%B.aux
. (Currently the default value is set as%B.bib
in this line : https://github.com/wtsnjp/llmk/blob/916c6bd/llmk.lua#L90 )For your information, if
programs.bibtex.target
is set manually like this, then it works.test2.tex
testref.bib
is located in the same directory.bibtex
runs correctly.I usually use only
bibtex
andupbibtex
so I'm not sure about other environments... but I think otherbibtex
-like programs also expect .aux files.