-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Biber reruncheck #12
Biber reruncheck #12
Conversation
Supposed to fix minoki#3 if biber is used. Not quite sure about the absolute/relative way of handling paths.
d0975f8
to
a8b766e
Compare
Tested this for Below is an example showing when what rebuild is triggered (and this is how I expect it) Running some example casesI used a long name for the # clean start (due to removing everything in the tex-aux folder)
$ rm -r tex-aux/* && cluttex --max-iterations=20 --output-directory="tex-aux" --change-directory --biber -e pdflatex "main.tex" > log
[EXEC] pdflatex -recorder -halt-on-error -interaction=nonstopmode -file-line-error -jobname='main' '\input"main.tex"'
[INFO] looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong.bib is newer than aux
[EXEC] biber --output-directory '.' main.bcf
[INFO] New auxiliary file 'main.aux'.
[EXEC] pdflatex -recorder -halt-on-error -interaction=nonstopmode -file-line-error -jobname='main' '\input"main.tex"'
[INFO] File 'main.aux' was modified (size: 321 -> 389).
[EXEC] pdflatex -recorder -halt-on-error -interaction=nonstopmode -file-line-error -jobname='main' '\input"main.tex"'
[INFO] File 'main.run.xml' was modified (md5: ad3731e961a59b0834d1c04860e7a055 -> d473f1fbcd04cc7d2b127917cf618dc6). # here this run is not necessary, but the .run.xml changes (checked this) so we need to rerun in general
[EXEC] pdflatex -recorder -halt-on-error -interaction=nonstopmode -file-line-error -jobname='main' '\input"main.tex"'
[EXEC] cp './main.pdf' '../main.pdf'
# just change the timestamp of the bib file
$ touch looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong.bib
$ cluttex --max-iterations=20 --output-directory="tex-aux" --change-directory --biber -e pdflatex "main.tex" > log
[EXEC] pdflatex -recorder -halt-on-error -interaction=nonstopmode -file-line-error -jobname='main' '\input"main.tex"'
[INFO] looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong.bib is newer than aux
[EXEC] biber --output-directory '.' main.bcf
[EXEC] cp './main.pdf' '../main.pdf'
# bbl wasn't changed -> no rerun necessary
# change the contents of the bib file
$ vim looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong.bib
$ cluttex --max-iterations=20 --output-directory="tex-aux" --change-directory --biber -e pdflatex "main.tex" > log
[EXEC] pdflatex -recorder -halt-on-error -interaction=nonstopmode -file-line-error -jobname='main' '\input"main.tex"'
[INFO] looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong.bib is newer than aux
[EXEC] biber --output-directory '.' main.bcf
[INFO] File 'main.bbl' was modified (md5: ba1c78dc6fdfaf8c19ed24b06cdb2478 -> 3573a4eb35b598b72e8a2d1b0338386b).
[EXEC] pdflatex -recorder -halt-on-error -interaction=nonstopmode -file-line-error -jobname='main' '\input"main.tex"'
[INFO] File 'main.aux' was modified (md5: c553687ab70ef781212220a1e9a140a3 -> d658b8cebf4f8b2e89840beb41662cba).
[EXEC] pdflatex -recorder -halt-on-error -interaction=nonstopmode -file-line-error -jobname='main' '\input"main.tex"'
[EXEC] cp './main.pdf' '../main.pdf'
# change biblography unrelated things in the tex file
$ vim main.tex
$ cluttex --max-iterations=20 --output-directory="tex-aux" --change-directory --biber -e pdflatex "main.tex" > log
[EXEC] pdflatex -recorder -halt-on-error -interaction=nonstopmode -file-line-error -jobname='main' '\input"main.tex"'
# no biber rerun or so
[EXEC] cp './main.pdf' '../main.pdf' If you've see any issue with this behavior and/or the changes, please let me know. EDIT: And I did not work on bibtex further as I'm not that familiar with the workflow with bibtex (I only use biber) |
local updated_dot_bib = false | ||
-- get the .bib files, the bcf uses as input | ||
for l in io.lines(file.abspath) do | ||
local bib = l:match("<bcf:datasource .*>(.*)</bcf:datasource>") -- might be unstable if biblatex adds e.g. a linebreak |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this might be unstable. But if the output is different, in 99% of the cases, no match is being found. Thus nothing bad happens, only the additional rerun might not be triggered.
Oh I just saw, I included the |
Except for Anything you can say about the mentioned |
@atticus-sullivan Thank you for contribution and sorry for late reply. As for I noticed |
Fixed the What shall we do about the |
I would like to fix the path in the |
Done 👍 |
I'll tidy up the history a bit and merge this. |
Rerun biber if .bib file was modified.
Supposed to fix #3 if biber is used.
To discussion:
original_wd.."/"..bib
always work? (I'm not quite sure what kind of paths we can encounter in.bcf
files, but as long as they are relative to the directory where the user invokedcluttex
it should work)original_wd.."/"..bib
is actually a real file (and print a warning if not), since I'm not sure ifbcf:datasource
is surely always a file. This way we also could somehow warn iforiginal_wd.."/"..bib
failed in some way.@minoki Any thoughts on these points? (made this a draft as I'd like to discuss this before merging)
Still to be done is the bibtex support, but as I'm not using bibtex I'm not quite confident in testing this with a common setup. And there is no
bcf
file from where we'd get the.bib
file(s) used (there has to be another way, as bibtex has to find these files as well somehow, but I just don't know it).@minoki do you use BibTeX and can do this for the BibTeX option?
Also a small note:
reruncheck.comparefiletime(mainauxfile, output_bbl, auxstatus)
is being used in thebibtex
option path (cluttex.lua:383
). As far as I tested (tried to use an adapted version of this for thebiber
option), this will always returnfalse
asauxstatus
works with absolute paths andmainauxfile
appears to be relative. So in effect thebibtex
option only uses the mechanism of comparing the hashes.