Open longborough opened 8 years ago
Maybe When/How should a class load biblatex over at TeX.SX can give you some pointers.
One problem is that once you start rolling your own .bbx
/.cbx
style and use that, the user cannot chose their own preferred style with style=...
or bibstyle=...
/citestyle=...
.
In your case one could probably work around that by simply not writing a new .bbx
and putting your definitions into the .sty
.
(Further) Clashes can be avoided by not using the standard environment bibliography
, but instead something like \defbibenvironment{gitbib}
, you then need \printbibliography[env=gitbib]
to use that environment.
Also you can give your macros such as date+author
a prefix: gitlog:date+author
to make sure they don't clash with other standard macros.
The \DeclareFieldFormat
s can be made type-specific using the optional argument: \DeclareFieldFormat[gitcommit]{entrykey}{\ttfamily[#1]}
.
Note that normally one would write \setunit*{\addcomma\space}
instead of \setunit*{, }
.
Thank you so much for your valuable contribution. For the moment, I'm a bit overpowered with Real Work, and all this is going to need some study, but I promise I'll take all these ideas on board. Happy New Year!
I'm working on this problem by trying to implement @moewew suggestions.
The only issue I'm encountering is a way to get bibLaTeX to load the .dbx
file.
Any ideas on how to use an existing Entrytype? Or how to tell bibLaTeX to load a .dbx
?
I switched to using @customa
for the entry type and usera
for storing the commit hash.
You should be able to load a .dbx
file with the datamodel
option. One can however only load one datamodel file (besides the standard and the style's .dbx
), if you want to allow the user to do more, you could have a look at biblatex-multiple-dm
(the package is inspired by TeX.SX: Datamodel distribution with biblatex).
@moewew Well I think the way I ended up implementing it should work, but I'll look through the webpages you linked.
Yep, I think it should work, too. But it looks nicer if you have customise type names and such (especially since a user now wouldn't be able to use usera
), although since most of the stuff is created automatically that might not be that big an issue.
@moewew disregard my now-deleted comment, I hadn't seen you're latest comment. The user can still usera
, just not in customa
. usera
is the field. However your criticism is valid against the customa
, though I've never seen it used.
Oh yes I got the two mixed up.
I agree that I haven't seen customa
out in the wild (luckily nowadays people are advised to roll their own datamodel). But it could be that some older biblatex
styles use this internally (not sure, I certainly know of styles that use usera
and stuff, but I'm not sure if they define new entrytypes).
I have merged the pull request, and then reverted it. This is only temporary, as I wanted to make it into a feature branch, and am suffering from a bit of github incompetence. I'll sort this out properly in the next few days, I hope. Thank you for the contribution.
Any idea when this will be pushed to CTAN?
Anything I can do to help get this feature on CTAN?
How do we allow for the git change log to inhabit the same document as other, more conventional bibliographies?