From bf587c17edfdc46c03e91570278a8faa0c4285a0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 14 Jun 2015 22:13:38 +0000 Subject: bookdb (4jun15) git-svn-id: svn://tug.org/texlive/trunk@37536 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/bibtex/bst/bookdb/bookdb.bst | 1759 ++++++++++++++++++++++++ Master/texmf-dist/doc/bibtex/bookdb/README | 41 + Master/texmf-dist/doc/bibtex/bookdb/bookdb.pdf | Bin 0 -> 202980 bytes Master/texmf-dist/doc/bibtex/bookdb/bookdb.tex | 530 +++++++ 4 files changed, 2330 insertions(+) create mode 100644 Master/texmf-dist/bibtex/bst/bookdb/bookdb.bst create mode 100644 Master/texmf-dist/doc/bibtex/bookdb/README create mode 100644 Master/texmf-dist/doc/bibtex/bookdb/bookdb.pdf create mode 100644 Master/texmf-dist/doc/bibtex/bookdb/bookdb.tex (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/bibtex/bst/bookdb/bookdb.bst b/Master/texmf-dist/bibtex/bst/bookdb/bookdb.bst new file mode 100644 index 00000000000..d76b6ae6549 --- /dev/null +++ b/Master/texmf-dist/bibtex/bst/bookdb/bookdb.bst @@ -0,0 +1,1759 @@ +%% This is file `bookdb.bst' version 0.2, +%% as modified by Peter Wilson (herries.press@earthlink.net) in June 2015 from +%% `bookdb.bst' generated with the docstrip utility. +%% +%% It is intended for use in catalogueing a home library. +%% +%% The original source files were: +%% +%% merlin.mbs (with options: `ay,nat,ed-au,keyxyr,dt-end,yr-com,note-yr,tit-it,atit-u,num-xser,pg-bk,pub-date,isbn,edparxc,pp,ed,xedn,nfss,') +%% ---------------------------------------- +%% +%% Copyright 1994-2011 Patrick W Daly + % =============================================================== + % IMPORTANT NOTICE: + % This bibliographic style (bst) file has been generated from one or + % more master bibliographic style (mbs) files, listed above. + % + % This generated file can be redistributed and/or modified under the terms + % of the LaTeX Project Public License Distributed from CTAN + % archives in directory macros/latex/base/lppl.txt; either + % version 1 of the License, or any later version. + % + % The originally generated file was modified by Peter Wilson in 2015 + % to better suit his purposes. + % =============================================================== + % Name and version information of the main mbs file: + % \ProvidesFile{merlin.mbs}[2011/11/18 4.33 (PWD, AO, DPC)] + % For use with BibTeX version 0.99a or later + %------------------------------------------------------------------- + % This bibliography style file is intended for texts in ENGLISH + % This is an author-year citation style bibliography. As such, it is + % non-standard LaTeX, and requires a special package file to function properly. + % Such a package is natbib.sty by Patrick W. Daly + % The form of the \bibitem entries is + % \bibitem[Jones et al.(1990)]{key}... + % \bibitem[Jones et al.(1990)Jones, Baker, and Smith]{key}... + % The essential feature is that the label (the part in brackets) consists + % of the author names, as they should appear in the citation, with the year + % in parentheses following. There must be no space before the opening + % parenthesis! + % With natbib v5.3, a full list of authors may also follow the year. + % In natbib.sty, it is possible to define the type of enclosures that is + % really wanted (brackets or parentheses), but in either case, there must + % be parentheses in the label. + % The \cite command functions as follows: + % \citet{key} ==>> Jones et al. (1990) + % \citet*{key} ==>> Jones, Baker, and Smith (1990) + % \citep{key} ==>> (Jones et al., 1990) + % \citep*{key} ==>> (Jones, Baker, and Smith, 1990) + % \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2) + % \citep[e.g.][]{key} ==>> (e.g. Jones et al., 1990) + % \citep[e.g.][p. 32]{key} ==>> (e.g. Jones et al., 1990, p. 32) + % \citeauthor{key} ==>> Jones et al. + % \citeauthor*{key} ==>> Jones, Baker, and Smith + % \citeyear{key} ==>> 1990 + %--------------------------------------------------------------------- + % + % PW added entries for: binding, category, collator, condition, copy, + % foreword, illustrations, introduction, + % location, preface,translator, size, value, + % volumes, + +ENTRY + { address + author + binding + booktitle + category + chapter + collator + condition + copy + edition + editor + eid + foreword + howpublished + illustrations + institution + introduction + isbn + journal + key + location + month + normal + note + number + organization + pages + preface + publisher + school + series + size + title + translator + type + value + volume + volumes + year + } + {} + { label extra.label sort.label short.list } +INTEGERS { output.state before.all mid.sentence after.sentence after.block } +FUNCTION {init.state.consts} +{ #0 'before.all := + #1 'mid.sentence := + #2 'after.sentence := + #3 'after.block := +} +STRINGS { s t} +FUNCTION {output.nonnull} +{ 's := + output.state mid.sentence = + { ", " * write$ } + { output.state after.block = + { add.period$ write$ + newline$ + "\newblock " write$ + } + { output.state before.all = + 'write$ + { add.period$ " " * write$ } + if$ + } + if$ + mid.sentence 'output.state := + } + if$ + s +} +FUNCTION {output} +{ duplicate$ empty$ + 'pop$ + 'output.nonnull + if$ +} +FUNCTION {output.check} +{ 't := + duplicate$ empty$ + { pop$ "empty " t * " in " * cite$ * warning$ } + 'output.nonnull + if$ +} +FUNCTION {fin.entry} +{ add.period$ + write$ + newline$ +} + +FUNCTION {new.block} +{ output.state before.all = + 'skip$ + { after.block 'output.state := } + if$ +} +FUNCTION {new.sentence} +{ output.state after.block = + 'skip$ + { output.state before.all = + 'skip$ + { after.sentence 'output.state := } + if$ + } + if$ +} +FUNCTION {add.blank} +{ " " * before.all 'output.state := +} + +FUNCTION {date.block} +{ + new.block +} + +FUNCTION {not} +{ { #0 } + { #1 } + if$ +} +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "\emph{" swap$ * "}" * } + if$ +} + +%% PW added this for a bold font +FUNCTION {bold} +{ duplicate$ empty$ + { pop$ "" } + { "\textbf{" swap$ * "}" * } + if$ +} +%% and this +FUNCTION {boldcat} +{ duplicate$ empty$ + { pop$ "" } + { "Category: \textbf{" swap$ * "}" * } + if$ +} +FUNCTION {boldval} +{ duplicate$ empty$ + { pop$ "" } + { "Value: \textbf{" swap$ * "}" * } + if$ +} + +FUNCTION {tie.or.space.prefix} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ +} + +FUNCTION {capitalize} +{ "u" change.case$ "t" change.case$ } + +FUNCTION {space.word} +{ " " swap$ * " " * } + % Here are the language-specific definitions for explicit words. + % Each function has a name bbl.xxx where xxx is the English word. + % The language selected here is ENGLISH +FUNCTION {bbl.and} +{ "and"} + +FUNCTION {bbl.etal} +{ "et~al." } + +FUNCTION {bbl.editors} +{ "eds." } + +FUNCTION {bbl.editor} +{ "ed." } + +FUNCTION {bbl.edby} +{ "edited by" } + +FUNCTION {bbl.edition} +{ "edition" } + +FUNCTION {bbl.volume} +{ "volume" } + +FUNCTION {bbl.of} +{ "of" } + +FUNCTION {bbl.number} +{ "number" } + +FUNCTION {bbl.nr} +{ "no." } + +FUNCTION {bbl.in} +{ "in" } + +FUNCTION {bbl.pages} +{ "pp." } + +FUNCTION {bbl.page} +{ "p." } + +FUNCTION {bbl.chapter} +{ "chapter" } + +FUNCTION {bbl.collator} +{ "collator" } + +FUNCTION {bbl.collators} +{ "collators" } + +FUNCTION {bbl.techrep} +{ "Technical Report" } + +FUNCTION {bbl.mthesis} +{ "Master's thesis" } + +FUNCTION {bbl.phdthesis} +{ "Ph.D. thesis" } + +FUNCTION {bbl.translator} +{ "translator" } + +FUNCTION {bbl.translators} +{ "translators" } + +FUNCTION {bbl.foreword} +{ "foreword by " } + +FUNCTION {bbl.introduction} +{ "introduction by " } + +FUNCTION {bbl.preface} +{ "preface by " } + +MACRO {jan} {"January"} + +MACRO {feb} {"February"} + +MACRO {mar} {"March"} + +MACRO {apr} {"April"} + +MACRO {may} {"May"} + +MACRO {jun} {"June"} + +MACRO {jul} {"July"} + +MACRO {aug} {"August"} + +MACRO {sep} {"September"} + +MACRO {oct} {"October"} + +MACRO {nov} {"November"} + +MACRO {dec} {"December"} + +MACRO {acmcs} {"ACM Computing Surveys"} + +MACRO {acta} {"Acta Informatica"} + +MACRO {cacm} {"Communications of the ACM"} + +MACRO {ibmjrd} {"IBM Journal of Research and Development"} + +MACRO {ibmsj} {"IBM Systems Journal"} + +MACRO {ieeese} {"IEEE Transactions on Software Engineering"} + +MACRO {ieeetc} {"IEEE Transactions on Computers"} + +MACRO {ieeetcad} + {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} + +MACRO {ipl} {"Information Processing Letters"} + +MACRO {jacm} {"Journal of the ACM"} + +MACRO {jcss} {"Journal of Computer and System Sciences"} + +MACRO {scp} {"Science of Computer Programming"} + +MACRO {sicomp} {"SIAM Journal on Computing"} + +MACRO {tocs} {"ACM Transactions on Computer Systems"} + +MACRO {tods} {"ACM Transactions on Database Systems"} + +MACRO {tog} {"ACM Transactions on Graphics"} + +MACRO {toms} {"ACM Transactions on Mathematical Software"} + +MACRO {toois} {"ACM Transactions on Office Information Systems"} + +MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} + +MACRO {tcs} {"Theoretical Computer Science"} + +%% Publishers + +% MACRO {CUP} {"Cambridge University Press"} + +% MACRO {OUP} {"Oxford University Press"} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +FUNCTION {bibinfo.check} +{ swap$ + duplicate$ missing$ + { + pop$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ pop$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +FUNCTION {bibinfo.warn} +{ swap$ + duplicate$ missing$ + { + swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ + "" + } + { duplicate$ empty$ + { + swap$ "empty " swap$ * " in " * cite$ * warning$ + } + { swap$ + pop$ + } + if$ + } + if$ +} +INTEGERS { nameptr namesleft numnames } + + +STRINGS { bibinfo} + +FUNCTION {format.names} +{ 'bibinfo := + duplicate$ empty$ 'skip$ { + 's := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{ff~}{vv~}{ll}{, jj}" + format.name$ + bibinfo bibinfo.check + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + numnames #2 > + { "," * } + 'skip$ + if$ + t "others" = + { + " " * bbl.etal * + } + { + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + } if$ +} +FUNCTION {format.names.ed} +{ + format.names +} +FUNCTION {format.key} +{ empty$ + { key field.or.null } + { "" } + if$ +} + +FUNCTION {format.authors} +{ author "author" format.names +} +FUNCTION {get.bbl.editor} +{ editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } + +FUNCTION {format.editors} +{ editor "editor" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.editor + "(" swap$ * ")" * + * + } + if$ +} + +% PW added collator names +FUNCTION {get.bbl.collator} +{ collator num.names$ #1 > 'bbl.collators 'bbl.collator if$ } + +FUNCTION {format.collator} +{ collator "collator" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.collator + "(" swap$ * ")" * + * + } + if$ +} + +% PW added translator names +FUNCTION {get.bbl.translator} +{ translator num.names$ #1 > 'bbl.translators 'bbl.translator if$ } +FUNCTION {format.translator} +{ translator "translator" format.names duplicate$ empty$ 'skip$ + { + " " * + get.bbl.translator + "(" swap$ * ")" * + * + } + if$ +} + +% PW added foreword names +FUNCTION {get.bbl.foreword} +{foreword 'bbl.foreword } +FUNCTION {format.foreword} +{ foreword "foreword" format.names duplicate$ empty$ 'skip$ + { + "" * + bbl.foreword + swap$ * + } + if$ +} + +% PW added introduction names +FUNCTION {get.bbl.introduction} +{introduction 'bbl.introduction } +FUNCTION {format.introduction} +{ introduction "introduction" format.names duplicate$ empty$ 'skip$ + { + "" * + bbl.introduction + swap$ * + } + if$ +} + +% PW added preface names +FUNCTION {get.bbl.preface} +{preface 'bbl.preface } +FUNCTION {format.preface} +{ preface "preface" format.names duplicate$ empty$ 'skip$ + { + "" * + bbl.preface + swap$ * + } + if$ +} + + +FUNCTION {format.book.pages} +{ pages "pages" bibinfo.check + duplicate$ empty$ 'skip$ + { " " * bbl.pages * } + if$ +} +FUNCTION {format.isbn} +{ isbn "isbn" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "ISBN " swap$ * + } + if$ +} + +FUNCTION {format.note} +{ + note empty$ + { "" } + { note #1 #1 substring$ + duplicate$ "{" = + 'skip$ + { output.state mid.sentence = + { "l" } + { "u" } + if$ + change.case$ + } + if$ + note #2 global.max$ substring$ * "note" bibinfo.check + } + if$ +} + +FUNCTION {format.title} +{ title + "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + } + if$ +} +FUNCTION {format.full.names} +{'s := + "" 't := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv~}{ll}" format.name$ + 't := + nameptr #1 > + { + namesleft #1 > + { ", " * t * } + { + s nameptr "{ll}" format.name$ duplicate$ "others" = + { 't := } + { pop$ } + if$ + t "others" = + { + " " * bbl.etal * + } + { + numnames #2 > + { "," * } + 'skip$ + if$ + bbl.and + space.word * t * + } + if$ + } + if$ + } + 't + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {author.editor.key.full} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {author.key.full} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.full.names } + if$ +} + +FUNCTION {editor.key.full} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.full.names } + if$ +} + +FUNCTION {make.full.names} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.full + { type$ "proceedings" = + 'editor.key.full + 'author.key.full + if$ + } + if$ +} + +FUNCTION {output.bibitem} +{ newline$ + "\bibitem[{" write$ + label write$ + ")" make.full.names duplicate$ short.list = + { pop$ } + { * } + if$ + "}]{" * write$ + cite$ write$ + "}" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {n.dashify} +{ + 't := + "" + { t empty$ not } + { t #1 #1 substring$ "-" = + { t #1 #2 substring$ "--" = not + { "--" * + t #2 global.max$ substring$ 't := + } + { { t #1 #1 substring$ "-" = } + { "-" * + t #2 global.max$ substring$ 't := + } + while$ + } + if$ + } + { t #1 #1 substring$ * + t #2 global.max$ substring$ 't := + } + if$ + } + while$ +} + +FUNCTION {word.in} +{ bbl.in capitalize + " " * } + +FUNCTION {format.date} +{ year "year" bibinfo.check duplicate$ empty$ + { + "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" + } + 'skip$ + if$ + extra.label * + before.all 'output.state := + ", " swap$ * +} +FUNCTION {format.btitle} +{ title "title" bibinfo.check + duplicate$ empty$ 'skip$ + { + emphasize + } + if$ +} +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { bbl.volume volume tie.or.space.prefix + "volume" bibinfo.check * * + series "series" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ bbl.of space.word * swap$ + emphasize * } + if$ + "volume and number" number either.or.check + } + if$ +} +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ + { series field.or.null } + { series empty$ + { number "number" bibinfo.check } + { output.state mid.sentence = + { bbl.number } + { bbl.number capitalize } + if$ + number tie.or.space.prefix "number" bibinfo.check * * + bbl.in space.word * + series "series" bibinfo.check * + } + if$ + } + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition duplicate$ empty$ 'skip$ + { + output.state mid.sentence = + { "l" } + { "t" } + if$ change.case$ + "edition" bibinfo.check + " " * bbl.edition * + } + if$ +} +INTEGERS { multiresult } +FUNCTION {multi.page.check} +{ 't := + #0 'multiresult := + { multiresult not + t empty$ not + and + } + { t #1 #1 substring$ + duplicate$ "-" = + swap$ duplicate$ "," = + swap$ "+" = + or or + { #1 'multiresult := } + { t #2 global.max$ substring$ 't := } + if$ + } + while$ + multiresult +} +FUNCTION {format.pages} +{ pages duplicate$ empty$ 'skip$ + { duplicate$ multi.page.check + { + bbl.pages swap$ + n.dashify + } + { + bbl.page swap$ + } + if$ + tie.or.space.prefix + "pages" bibinfo.check + * * + } + if$ +} +FUNCTION {format.journal.pages} +{ pages duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ + { pop$ pop$ format.pages } + { + ":" * + swap$ + n.dashify + "pages" bibinfo.check + * + } + if$ + } + if$ +} +FUNCTION {format.journal.eid} +{ eid "eid" bibinfo.check + duplicate$ empty$ 'pop$ + { swap$ duplicate$ empty$ 'skip$ + { + ":" * + } + if$ + swap$ * + } + if$ +} +FUNCTION {format.vol.num.pages} +{ volume field.or.null + duplicate$ empty$ 'skip$ + { + "volume" bibinfo.check + } + if$ + number "number" bibinfo.check duplicate$ empty$ 'skip$ + { + swap$ duplicate$ empty$ + { "there's a number but no volume in " cite$ * warning$ } + 'skip$ + if$ + swap$ + "(" swap$ * ")" * + } + if$ * + eid empty$ + { format.journal.pages } + { format.journal.eid } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ + { bbl.chapter } + { type "l" change.case$ + "type" bibinfo.check + } + if$ + chapter tie.or.space.prefix + "chapter" bibinfo.check + * * + pages empty$ + 'skip$ + { ", " * format.pages * } + if$ + } + if$ +} + +FUNCTION {format.booktitle} +{ + booktitle "booktitle" bibinfo.check + emphasize +} +FUNCTION {format.in.ed.booktitle} +{ format.booktitle duplicate$ empty$ 'skip$ + { + editor "editor" format.names.ed duplicate$ empty$ 'pop$ + { + " " * + get.bbl.editor + "(" swap$ * ") " * + * swap$ + * } + if$ + word.in swap$ * + } + if$ +} +FUNCTION {format.thesis.type} +{ type duplicate$ empty$ + 'pop$ + { swap$ pop$ + "t" change.case$ "type" bibinfo.check + } + if$ +} +FUNCTION {format.tr.number} +{ number "number" bibinfo.check + type duplicate$ empty$ + { pop$ bbl.techrep } + 'skip$ + if$ + "type" bibinfo.check + swap$ duplicate$ empty$ + { pop$ "t" change.case$ } + { tie.or.space.prefix * * } + if$ +} +FUNCTION {format.article.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.book.crossref} +{ volume duplicate$ empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + pop$ word.in + } + { bbl.volume + capitalize + swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * + } + if$ + " \cite{" * crossref * "}" * +} +FUNCTION {format.incoll.inproc.crossref} +{ + word.in + " \cite{" * crossref * "}" * +} +FUNCTION {format.org.or.pub} +{ 't := + "" + add.blank "(" * + t empty$ + { address "address" bibinfo.check * + } + { t * + address empty$ + 'skip$ + { ", " * address "address" bibinfo.check * } + if$ + } + if$ + year duplicate$ empty$ + { "empty year in " cite$ * "; set to ????" * warning$ + pop$ "????" } + { "year" bibinfo.check extra.label * } + if$ + t empty$ address empty$ and + { * } + { ", " swap$ * * } + if$ + ")" * +} +FUNCTION {format.publisher.address} +{ publisher "publisher" bibinfo.warn format.org.or.pub +} + +FUNCTION {format.organization.address} +{ organization "organization" bibinfo.check format.org.or.pub +} + + %---------------------------------------------------------------- + % PW formatting added entry types + +FUNCTION {format.binding} +{ binding "binding" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "Binding: " swap$ * + } + if$ +} + +FUNCTION {format.category} +{ category "category" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + boldcat + } + if$ +} + + +FUNCTION {format.condition} +{ condition "condition" bibinfo.check + duplicate$ empty$ 'skip$ + { new.block + "Condition: " swap$ * + } + if$ +} + +FUNCTION {format.copy} +{ copy "copy" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "Copy: " swap$ * + } + if$ +} + +FUNCTION {format.illustrations} +{ illustrations "illustrations" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "Illustrations: " swap$ * + } + if$ +} + +FUNCTION {format.location} +{ location "location" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "Location: " swap$ * + } + if$ +} + +FUNCTION {format.size} +{ size "size" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "Size: " swap$ * + } + if$ +} + +FUNCTION {format.value} +{ value "value" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + boldval + } + if$ +} + +FUNCTION {format.volumes} +{ volumes "volumes" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "Volumes: " swap$ * + } + if$ +} + + %----------------------------------------------------------------- + +FUNCTION {article} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + crossref missing$ + { + journal + "journal" bibinfo.check + emphasize + "journal" output.check + format.vol.num.pages output + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.block + format.note output + new.block + format.date "year" output.check + fin.entry +} + +% --------------------------------------------------------- +% PW extended the book entry + +FUNCTION {book} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + add.blank + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + format.editors output + format.collator output + format.translator output + format.foreword output + format.preface output + format.introduction output + crossref missing$ + { format.bvolume output + new.block + format.number.series output + new.sentence + format.publisher.address output + } + { + new.block + format.book.crossref output.nonnull + } + if$ + format.book.pages output + format.edition output + format.isbn output + format.volumes output + format.illustrations output + format.binding output + format.size output + new.block + format.note output + new.block + format.condition output + format.copy output + format.location output + format.category output + format.value output + fin.entry +} + +% -------------------------------------------------------- + +FUNCTION {booklet} +{ output.bibitem + format.authors output + author format.key output + new.block + format.title "title" output.check + new.block + howpublished "howpublished" bibinfo.check output + address "address" bibinfo.check output + format.isbn output + format.book.pages output + new.block + format.note output + new.block + format.date "year" output.check + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + author empty$ + { format.editors "author and editor" output.check + editor format.key output + } + { format.authors output.nonnull + crossref missing$ + { "author and editor" editor either.or.check } + 'skip$ + if$ + } + if$ + new.block + format.btitle "title" output.check + crossref missing$ + { + format.bvolume output + format.chapter.pages "chapter and pages" output.check + new.block + format.number.series output + new.sentence + format.publisher.address output + } + { + format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + crossref missing$ + { format.isbn output } + 'skip$ + if$ + new.block + format.note output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.chapter.pages output + new.sentence + format.publisher.address output + format.edition output + format.isbn output + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + new.block + format.note output + fin.entry +} +FUNCTION {inproceedings} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages output + new.sentence + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.isbn output + } + { format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + new.block + format.note output + fin.entry +} +FUNCTION {conference} { inproceedings } +FUNCTION {manual} +{ output.bibitem + format.authors output + author format.key output + new.block + format.btitle "title" output.check + organization address new.block.checkb + organization "organization" bibinfo.check output + address "address" bibinfo.check output + format.edition output + new.block + format.note output + new.block + format.date "year" output.check + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.btitle + "title" output.check + new.block + bbl.mthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + new.block + format.note output + new.block + format.date "year" output.check + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + format.authors output + author format.key output + new.block + format.title output + new.block + howpublished "howpublished" bibinfo.check output + new.block + format.note output + new.block + format.date "year" output.check + fin.entry +} + +FUNCTION {heading} +{ output.bibitem + format.authors output + author format.key output + new.block + format.note output + fin.entry +} + + + +FUNCTION {phdthesis} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.btitle + "title" output.check + new.block + bbl.phdthesis format.thesis.type output.nonnull + school "school" bibinfo.warn output + address "address" bibinfo.check output + new.block + format.note output + new.block + format.date "year" output.check + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + format.editors output + editor format.key output + new.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + new.sentence + publisher empty$ + { format.organization.address output } + { organization "organization" bibinfo.check output + format.publisher.address output + } + if$ + format.isbn output + new.block + format.note output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title + "title" output.check + new.block + format.tr.number output.nonnull + institution "institution" bibinfo.warn output + address "address" bibinfo.check output + new.block + format.note output + new.block + format.date "year" output.check + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + format.authors "author" output.check + author format.key output + new.block + format.title "title" output.check + new.block + format.note "note" output.check + new.block + format.date output + fin.entry +} + +FUNCTION {default.type} { misc } +READ +FUNCTION {sortify} +{ purify$ + "l" change.case$ +} +INTEGERS { len } +FUNCTION {chop.word} +{ 's := + 'len := + s #1 len substring$ = + { s len #1 + global.max$ substring$ } + 's + if$ +} +FUNCTION {format.lab.names} +{ 's := + "" 't := + s #1 "{vv~}{ll}" format.name$ + s num.names$ duplicate$ + #2 > + { pop$ + " " * bbl.etal * + } + { #2 < + 'skip$ + { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = + { + " " * bbl.etal * + } + { bbl.and space.word * s #2 "{vv~}{ll}" format.name$ + * } + if$ + } + if$ + } + if$ +} + +FUNCTION {author.key.label} +{ author empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {author.editor.key.label} +{ author empty$ + { editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ + } + { author format.lab.names } + if$ +} + +FUNCTION {editor.key.label} +{ editor empty$ + { key empty$ + { cite$ #1 #3 substring$ } + 'key + if$ + } + { editor format.lab.names } + if$ +} + +FUNCTION {calc.short.authors} +{ type$ "book" = + type$ "inbook" = + or + 'author.editor.key.label + { type$ "proceedings" = + 'editor.key.label + 'author.key.label + if$ + } + if$ + 'short.list := +} + +FUNCTION {calc.label} +{ calc.short.authors + short.list + "(" + * + year duplicate$ empty$ + short.list key field.or.null = or + { pop$ "" } + 'skip$ + if$ + * + 'label := +} + +FUNCTION {sort.format.names} +{ 's := + #1 'nameptr := + "" + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { s nameptr + "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" + format.name$ 't := + nameptr #1 > + { + " " * + namesleft #1 = t "others" = and + { "zzzzz" 't := } + 'skip$ + if$ + t sortify * + } + { t sortify * } + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ +} + +FUNCTION {sort.format.title} +{ 't := + "A " #2 + "An " #3 + "The " #4 t chop.word + chop.word + chop.word + sortify + #1 global.max$ substring$ +} +FUNCTION {author.sort} +{ author empty$ + { key empty$ + { "to sort, need author or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {author.editor.sort} +{ author empty$ + { editor empty$ + { key empty$ + { "to sort, need author, editor, or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ + } + { author sort.format.names } + if$ +} +FUNCTION {editor.sort} +{ editor empty$ + { key empty$ + { "to sort, need editor or key in " cite$ * warning$ + "" + } + { key sortify } + if$ + } + { editor sort.format.names } + if$ +} +FUNCTION {presort} +{ calc.label + label sortify + " " + * + type$ "book" = + type$ "inbook" = + or + 'author.editor.sort + { type$ "proceedings" = + 'editor.sort + 'author.sort + if$ + } + if$ + #1 entry.max$ substring$ + 'sort.label := + sort.label + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} + +ITERATE {presort} +SORT +STRINGS { last.label next.extra } +INTEGERS { last.extra.num last.extra.num.extended last.extra.num.blank number.label } +FUNCTION {initialize.extra.label.stuff} +{ #0 int.to.chr$ 'last.label := + "" 'next.extra := + #0 'last.extra.num := + "a" chr.to.int$ #1 - 'last.extra.num.blank := + last.extra.num.blank 'last.extra.num.extended := + #0 'number.label := +} +FUNCTION {forward.pass} +{ last.label label = + { last.extra.num #1 + 'last.extra.num := + last.extra.num "z" chr.to.int$ > + { "a" chr.to.int$ 'last.extra.num := + last.extra.num.extended #1 + 'last.extra.num.extended := + } + 'skip$ + if$ + last.extra.num.extended last.extra.num.blank > + { last.extra.num.extended int.to.chr$ + last.extra.num int.to.chr$ + * 'extra.label := } + { last.extra.num int.to.chr$ 'extra.label := } + if$ + } + { "a" chr.to.int$ 'last.extra.num := + "" 'extra.label := + label 'last.label := + } + if$ + number.label #1 + 'number.label := +} +FUNCTION {reverse.pass} +{ next.extra "b" = + { "a" 'extra.label := } + 'skip$ + if$ + extra.label 'next.extra := + extra.label + duplicate$ empty$ + 'skip$ + { "{\natexlab{" swap$ * "}}" * } + if$ + 'extra.label := + label extra.label * 'label := +} +EXECUTE {initialize.extra.label.stuff} +ITERATE {forward.pass} +REVERSE {reverse.pass} +FUNCTION {bib.sort.order} +{ sort.label + " " + * + year field.or.null sortify + * + " " + * + title field.or.null + sort.format.title + * + #1 entry.max$ substring$ + 'sort.key$ := +} +ITERATE {bib.sort.order} +SORT +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ + "\begin{thebibliography}{" number.label int.to.str$ * "}" * + write$ newline$ + "\providecommand{\natexlab}[1]{#1}" + write$ newline$ +} +EXECUTE {begin.bib} +EXECUTE {init.state.consts} +ITERATE {call.type$} +FUNCTION {end.bib} +{ newline$ + "\end{thebibliography}" write$ newline$ +} +EXECUTE {end.bib} +%% End of customized bst file +%% +%% End of file `bookdb.bst'. diff --git a/Master/texmf-dist/doc/bibtex/bookdb/README b/Master/texmf-dist/doc/bibtex/bookdb/README new file mode 100644 index 00000000000..27553557cb6 --- /dev/null +++ b/Master/texmf-dist/doc/bibtex/bookdb/README @@ -0,0 +1,41 @@ + The bookdb BibTeX package provides an extended book entry for +use in catalogueing a home library. + + The extensions include fields for: +binding, category, collator, condition, copy, illustrations, introduction, +location, pages, size, value, volumes + + +Changes in version 0.1 (2015/06/01) +o First public release + +Changes in version 0.2 (2015/06/04) +o Added two fields: foreword and preface + +--------------------------------------------------------------- + Author: Peter Wilson (Herries Press) + + This work may be distributed and/or modified under the + conditions of the Latex Project Public License, either + version 1.3 of this license or (at your option) any + later version. + The latest version of the license is in + http://www.latex-project.org/lppl.txt + and version 1.3 or later is part of all distributions of + LaTeX version 2003/06/01 or later. + + This work has the LPPL maintenance status "author-maintained". + + This work and distribution consists of the files: + README (this file) + bookdb.bst + bookdb.tex + and the derived file + bookdb.pdf + +--------------------------------------------------------------- + +2015/06/01 +Peter Wilson +herries dot press at earthlink dot net + diff --git a/Master/texmf-dist/doc/bibtex/bookdb/bookdb.pdf b/Master/texmf-dist/doc/bibtex/bookdb/bookdb.pdf new file mode 100644 index 00000000000..7d24865f8a9 Binary files /dev/null and b/Master/texmf-dist/doc/bibtex/bookdb/bookdb.pdf differ diff --git a/Master/texmf-dist/doc/bibtex/bookdb/bookdb.tex b/Master/texmf-dist/doc/bibtex/bookdb/bookdb.tex new file mode 100644 index 00000000000..1775619aa69 --- /dev/null +++ b/Master/texmf-dist/doc/bibtex/bookdb/bookdb.tex @@ -0,0 +1,530 @@ +% bookdb.tex User manual for the bookdb.bst package +\begin{filecontents}{bookdb.bib} + +@misc{DALY, + author = {Patrick W. Daly}, + title = {Customizing Bibliograhic Style Files}, + note = "\url{http://mirror.ctan.org/macros/latex/contrib/custom-bib/makebst.pdf}", + month = aug, + year = 2003 +} + +@misc{NATBIB, + author = {Patrick W. Daly}, + title = {Natural Sciences Citations and References}, + note = "\url{http://mirror.ctan.org/macros/latex/contrib/natbib/natbib.pdf}", + month = sep, + year = 2010 +} + +@misc{LEHMAN, + author = {Philipp Lehman}, + title = {The biblatex package}, + note = "\url{http://mirror.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf}", + month = jul, + year = 2009 +} + +@misc{MARKEY, + author = {Nicolas Markey}, + title = {Tame the BeaST}, + note = "\url{http://mirror.ctan.org/info/bibtex/tamethebeast/ttb_en.pdf}", + month = oct, + year = 2009 +} + +@misc{PATASHNIK, + author = {Oren Patashnik}, + title = {Designing BibTeX Styles}, + note = "\url{http://mirror.ctan.org/biblio/bibtex/base/btxhak.pdf}", + month = feb, + year = 1988 +} + +\end{filecontents} + +\documentclass{article} +\fontencoding{T1} +\usepackage{booktabs} +%\usepackage{natbib} + +\bibliographystyle{plain} +\usepackage{url} +\usepackage{alltt} +\usepackage{lmodern} +\usepackage{comment} + +\addtolength{\topmargin}{-1in} +\addtolength{\textheight}{2in} +\addtolength{\oddsidemargin}{-0.75in} +\addtolength{\textwidth}{1.5in} +\addtolength{\evensidemargin}{-0.75in} + +\newenvironment{ttdesc}[1] + {\begin{list}{}% + {\renewcommand{\makelabel}[1]{\texttt{##1:}\hfil}% + \settowidth{\labelwidth}{\makelabel{#1}}% + \setlength{\leftmargin}{\labelwidth}% + \addtolength{\leftmargin}{\labelsep}}}% + {\end{list}} + +\newcommand{\BibTeX}{\texttt{BibTeX}} +\newcommand{\file}[1]{\texttt{#1}} +\newcommand{\field}[1]{\texttt{#1}} +\newcommand{\pack}[1]{\texttt{#1}} + +\title{\texttt{bookdb.bst} --- A Personal Book Catalogue} +\author{Peter Wilson} +\date{4 June 2015} + +\begin{document} +\maketitle + +\section{Introduction} + +For many years I have been collecting books. They are located in five rooms, as well as +two bookcases in my printing and binding workshop. But recently I found that I was buying +books that I already had. I decided that the best way to save money was to catalogue all +the books that I owned and where they were kept. + +I searched on the web for free database programs that would be appropriate. There were only +a few that would run under Linux, which is the operating system I am most comfortable with. +Of those, some I could not install, and the one that I could I couldn't get to work +for me. + +I contacted several booksellers that I +dealt with and asked them what they used for catalogueing their stock. They all replied +but most used proprietry and expensive software that included things like preparing +invoices that were +irrelevant as far as I was concerned. The two responses that grabbed my attention were +`use a card index' (but I needed space for books, not card indexes) and `try Bibtex', +which immediately appealed as I had used it for many years; why I hadn't thought of it myself +I'll never know. + +\section{Usage} + +The standard \BibTeX\ enries did not meet my needs so I looked at +\pack{biblatex}~\cite{LEHMAN} +but its entries also didn't match my requirements so I decided to tweak \BibTeX. +To that end I used Patrick Daly's \texttt{makebst} program~\cite{DALY} +for generating a \file{*.bst} +file that went someway towards meeting my needs. This required some hand-coded additions +later; I read the articles by Oren Patashnik~\cite{PATASHNIK}, the creator of \BibTeX, +and Nicolas Markey~\cite{MARKEY} which helped me on my way. +In the end I had a \BibTeX\ file called \file{bookdb.bst} that included all the +regular entries but a greatly expanded \texttt{book} entry, as follows: + +\vspace{0.5\baselineskip} +\noindent \begin{tabular}{lp{0.9\textwidth}} \toprule +\texttt{book} & A book with a publisher \\ + & \textit{Required:} \texttt{author} or {editor}, \texttt{title, publisher, year} \\ + & \textit{Optional:} \texttt{volume} or \texttt{number, series, address, edition, + month, note, collator, foreword, preface, introduction, volumes, pages, illustrations, + binding, size, condition, copy, location, category, value} \\ \bottomrule +\end{tabular} +\vspace{0.2\baselineskip} + +And also I created a new entry called \texttt{heading}, as follows: + +\vspace{0.5\baselineskip} +\noindent \begin{tabular}{lp{0.87\textwidth}} \toprule +\texttt{heading} & A heading in the bibliography \\ + & \textit{Required:} \texttt{key} \\ + & \textit{Optional:} \texttt{note} \\ \bottomrule +\end{tabular} +\vspace{0.5\baselineskip} + +The additional fields in the \texttt{book} entry are: +\begin{ttdesc}{condition} +\item[binding] Information about the book's binding. Output as: \\ + Binding: `binding.' +\item[category] The general theme of the book. Output as: \\ + Category: `\textbf{category.}' +\item[collator] The name(s) of those who collated the book contents. Output as: \\ + `collator' (collator(s)) +\item[condition] The book's condition. Output as: \\ + Condition: `condition.' +\item[copy] For a limited edition, the particular copy. Output as: \\ + Copy: `copy.' +\item[foreword] The name(s) of the author(s) of the Foreword, if not written by the + author(s) of the main text. Output as: \\ + foreword by `foreword' +\item[illustrations] \mbox{} \\ Information about the number and kind of any illustrations and + possibly who created them. Output as: \\ + Illustrations: `illustrations.' +\item[introduction] \mbox{} \\ The name(s) of the author(s) of the book's Introduction, if not + written by the author(s) of the main text. Output as: \\ + introduction by `introduction' +\item[location] Where the book is located. Output as: \\ + Location: `location.' +\item[pages] The total number of pages. Output as: \\ + `pages' pp., +\item[preface] The name(s) of the author(s) of the Preface, if not written by the + author(s) of the main text. Output as: \\ + preface by `preface' +\item[size] The book's physical dimensions. Output as: \\ + Size: `size.' +\item[value] The book's value. Output as: \\ + Value: `\textbf{value}.' +\item[volumes] The number of volumes. Output as: \\ + Volumes: `volumes.' +\end{ttdesc} + +I use the \texttt{heading} entry for putting a heading or division marker into +a bibliography. The \field{key} is required so that the \texttt{heading} is sorted +into the correct position in the bibliography (normally sorting is based on the author +or editor). The contents of the \field{note} +form the printed heading. For instance if you wanted a heading before each alphabetical +group of authors you could do something like: +\begin{verbatim} +@heading{A1, + key = {A1}, + note = {\ahead{AAAAAAAA...}} +} +@heading{B1, + key ={B1}, + note = {\ahead{BBBBBBBB...}} +} +etc +\end{verbatim} +where \verb!\ahead! might be defined as: +\begin{verbatim} +\providecommand{\ahead}[1]{% + \textbf{\large #1}} +\end{verbatim} + +To help clarify matters Figure~\ref{fig:data} shows a possible entry in a +\file{*.bib} file. The output after processing in a document using +\file{bookdb.bst} is illustrated in Figure~\ref{fig:result}. + +%\noindent +\begin{figure} +\centering +\begin{minipage}{0.75\columnwidth} +\rule{0.75\columnwidth}{0.4pt} +\begin{verbatim} +@book{ABOOK, + author = {A. N. Author and A. Nother}, + title = {A Book Entry}, + editor = {Smith and Jones}, + collator = {Jane and Tim}, + translator = {Jo and Mary}, + foreword = {Alpha}, + preface = {Zoe}, + introduction = {Bloggs and Friend}, + volume = 7, + publisher = {Herries Press}, + year = 2020, + pages = {xii + 278 + vi}, + edition = {Third}, + isbn = {0-201-36299-8}, + volumes = 9, + illustrations = {11 wood engravings}, + binding = {full red leather}, + size = {11 by 17 inches}, + note = {This is a note}, + condition = {Hot off the press}, + copy = {23 of 125}, + location = {my study}, + category = {private press}, + value = {\$270} +} +\end{verbatim} +\rule{0.75\columnwidth}{0.4pt} +\end{minipage} +\caption{An example entry for \texttt{bookdb} processing} \label{fig:data} +\end{figure} + +\begin{figure} +\rule{\textwidth}{0.4pt} \par +\hangindent=1.5em\hangafter=1 +\noindent A. N. Author and A. Nother. \textit{A Book Entry}, Smith and Jones (eds.), + Jane and Tim (collators), Jo and Mary (translators), foreword by Alpha, + preface by Zoe, introduction by + Bloggs and Friend, volume 7 (Herries Press, 2020), xii + 278 + vi pp., + third edition. ISBN 0-201-36299-8. Volumes: 9. Illustrations: 11 wood + engravings. Binding: full red leather. + Size: 11 by 17 inches. This is a note. Condition: Hot off the press. + Copy: 23 of 125. Location: my study. Category: \textbf{private press}. + Value: \textbf{\$270}. \par +\noindent\rule{\textwidth}{0.4pt} +\caption{The example's output} \label{fig:result} +\end{figure} + +\clearpage + +As an example this is a file that I use for printing a catalogue of my books, +where the book details are in file \file{mybooks.bib}. Note that using +\pack{bookdb} requires the use of the \pack{natbib} package ~\cite{NATBIB}. +\begin{verbatim} +% books.tex a catalogue of my books +\documentclass[11pt,a4paper]{memoir} +\usepackage[T1]{fontenc} +\usepackage{natbib} +\pagestyle{empty} +\begin{document} +\nocite{*} +\bibliographystyle{bookdb} +\bibliography{mybooks} +\end{document} +\end{verbatim} + + +\begin{comment} +\section{Implementation} + +As I said earlier I had to extend the \file{bookdb.bst} file produced by +the \texttt{makebst} program. I didn't really know how it all worked but after +much trial and many errors I got something that on the whole met my needs. My +basic process was to copy elements of the original \file{bst}, change some names, +and see what was produced. + +First of all I added the new \texttt{book} fields to the \file{bookdb.bst} \texttt{ENTRY} +command as: +\begin{verbatim} +ENTRY + { ... + binding + category + collator + condition + copy + illustrations + introduction + location + pages + size + translator + value + volumes + } +\end{verbatim} + +The next thing was to add the new entries in the correct order to the function that output +the \texttt{book} bibliography entries, together with how they should be formatted. This +was the final result after much try it, \BibTeX\ it, change it, and repeat +(the original code is in +a typewriter font and my additions are in an italic font). + +\begin{alltt} +{\ttfamily +FUNCTION \{book\} +\{ output.bibitem + author empty$ + \{ format.editors "author and editor" + output.check + editor format.key output + add.blank + \} + \{ format.authors output.nonnull + crossref missing$ + \{ "author and editor" editor + either.or.check \} + 'skip$ + if$ + \} + if$ + new.block + format.btitle "title" output.check }{\itshape + format.editors output + format.collator output + format.translator output + format.introduction output }{\ttfamily + crossref missing$ + \{ format.bvolume output + new.block + format.number.series output + new.sentence + format.publisher.address output + \} + \{ + new.block + format.book.crossref output.nonnull + \} + if$ + format.book.pages output + format.edition output + format.isbn output }{\itshape + format.volumes output + format.illustrations output + format.binding output + format.size output }{\ttfamily + new.block + format.note output }{\itshape + format.condition output + format.copy output + format.location output + format.category output + format.value output }{\ttfamily + fin.entry +\} } +\end{alltt} + +Effectively `all' I had left to do was to specify the formatting of my new fields. +I used three basic forms: +\begin{enumerate} +\item Some introductory text, like `introduction by' or `Illustrations:', followed by + the field data. +\item Like the first form but with the field data in a bold font. +\item Name(s) forming the field data followed by what their contribution was + in parentheses. +\end{enumerate} + +As an example of the first form here is the code for \field{binding}: + +\begin{verbatim} +FUNCTION {format.binding} +{ binding "binding" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + "Binding: " swap$ * + } + if$ +} +\end{verbatim} + +Life was a little more complicated for the second form. This is the code for the +\field{value} field which requires two functions, the first dealing with the +bolding and the second with the output. + +\begin{verbatim} +FUNCTION {boldval} +{ duplicate$ empty$ + { pop$ "" } + { "Value: \textbf{" swap$ * "}" * } + if$ +} +FUNCTION {format.value} +{ value "value" bibinfo.check + duplicate$ empty$ 'skip$ + { + new.block + boldval + } + if$ +} +\end{verbatim} + +The third form required several functions, as in the code for \field{collator}, where if there +is a single collator this is output as `Name (collator)' but if the are multiple collators +the output is `Name1 and Name2 ... (collators)'. + +\begin{verbatim} +FUNCTION {bbl.collator} +{ "collator" } +FUNCTION {bbl.collators} +{ "collators" } +FUNCTION {get.bbl.collator} +{ collator num.names$ #1 > + 'bbl.collators 'bbl.collator + if$ +} +FUNCTION {format.collator} +{ collator "collator" format.names + duplicate$ empty$ 'skip$ + { " " * + get.bbl.collator + "(" swap$ * ")" * + } + if$ +} +\end{verbatim} + +\end{comment} + +%\clearpage + +\section{My book database} + +The \file{*.bib} for my book catalogue looks somewhat like this: +\begin{verbatim} +%%% mybooks.bib 2015/04/22 + +%%% for formating headings +@preamble{ "\providecommand{\ahead}[1]{% + \textbf{\large #1}}" } + +%%% publishers +@string{CUP = + "Cambridge University Press"} +% etc +%%% categories +@string{science = + "science, mathematics, computers"} +% etc + +@heading{A1, + key = {A}, + note = {\ahead{AAAAAAAAAAA....} +} + +@book{A1KEY, +author = {First A. Author}, +% etc +} + +@book{A2KEY, +author = {Second A. Author}, +% etc +} + +% etc +\end{verbatim} + +I used the \BibTeX\ \verb!@preamble! command to provide a definition of the \verb!\ahead! +macro. This, if required, can be overridden by an existing definition in the +document used to print the bibliography. + +I added various \verb!@string! commands to provide shorthands for many of the +fields in the \file{.bib} file, such as publisher, location, category, that +would have the same value. This meant that I could have a shortened field entry +that looked like: +\begin{verbatim} +publisher = CUP, +\end{verbatim} +instead of: +\begin{verbatim} +publisher = {Cambridge University Press}, +\end{verbatim} + +\section{Infelicities} + + + \BibTeX\ uses a stack-based language which I find hard to understand. +%Many years ago I wrote an interpreter for a stack-based language whose name +%I have forgotten but even so I was unable to use the language itself. I think +%that it is a little like crosswords. I like doing `cryptic' crosswords but +%I find that with some setters I can follow their clues easily but with +%others I haven't a clue. + + My basic approach was to take an existing \file{*.bst} file, try and see what it did, +then copy and modify what seemed relevant to my needs. + + I did have a couple of infelicities that I did not manage to resolve. + + The first was that no matter what I tried I could not stop the \texttt{heading} +from outputting its \field{key}, so it should be made as short and unobtrusive as possible. + + The second was that I couldn't stop the warning message issued by \BibTeX\ if both +an \field{author} and \field{editor} were supplied although the output was printed +including both. + + In spite of these, if you are a collector then you may want to consider tweaking a +\file{*.bst} file to meet your particular needs. + + +\bibliography{bookdb} + +\end{document} + + + + + + + + + + + -- cgit v1.2.3