Niall Murphy <[email protected]> writes:
>> What about doing it in the other direction, that is, giving the
>> responsibility of inserting the "revision numbers" into your documents
>> to the build process, instead of darcs ?
>> The idea would be to use a Makefile that inserts in all your .tex
>> documents, a header based on the result of "darcs changes --last 1"
>> for instance. Would it solve the problem for you ?
>
> This has the same downside as my posthook script, namely:
> - that the source file only contains the correct patch number after a commit
> (if i want to check out the version with patches up to 135, but
> then open the file and see "Patch Num: 112" which upon compiling, gets
> corrected)
> and more irritatingly (dangerously?)
> - the files are left modified but unrecorded after a commit.
I think the canonic solution to this, at least in program repos (as
opposed to document repos) is to extract version information into a
separate header that is included in the main source (instead of inline
version info in the version-controlled data).
You could possibly achieve something similar with \input, where you
would say something like:
\input{version.tex}
in your document.tex, and in Makefile:
.PHONY: version.tex
version.tex:
darcs ... | texify > version.tex
document.pdf: version.tex ...
(texify being an imaginary command here that you would need to supply to
convert darcs info into something suitable for TeX to process).
(Another option that would possibly work better would be to replace
.PHONY: version.tex with version.tex: _darcs/hashed_inventory or so.)
Yours,
Petr.
_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users