diff options
author | Karl Berry <karl@freefriends.org> | 2013-08-31 22:45:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-08-31 22:45:45 +0000 |
commit | 3327dfbc00f9422625c9a574826755a56a9cbee5 (patch) | |
tree | 9c374a829933d190cee9d576fb1c43cabbc495de | |
parent | 1483696754d202b1c75304be8bd6004c4349cd09 (diff) |
datatool (31aug13)
git-svn-id: svn://tug.org/texlive/trunk@31551 c570f23f-e606-0410-a88d-b1316a301751
21 files changed, 1629 insertions, 28 deletions
diff --git a/Master/texmf-dist/bibtex/bst/datatool/databib.bst b/Master/texmf-dist/bibtex/bst/datatool/databib.bst new file mode 100644 index 00000000000..cb63be2b675 --- /dev/null +++ b/Master/texmf-dist/bibtex/bst/datatool/databib.bst @@ -0,0 +1,1257 @@ +ENTRY + { address + author + booktitle + chapter + edition + editor + howpublished + institution + journal + key + month + note + number + organization + pages + publisher + school + series + title + type + volume + year + isbn + doi + pubmed + url + abstract + file + eprints + } + {} + { label } + +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 before.all = + { + "%" * write$ + newline$ + } + { newline$ + %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 {output.bibitem} +{ "\DTLnewbibrow" write$ + newline$ + "\DTLnewbibitem {CiteKey}{" write$ + cite$ write$ + "}%" write$ + newline$ + "" + before.all 'output.state := +} + +FUNCTION {fin.entry} +{ "%" * + 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 {not} +{ { #0 } + { #1 } + if$ +} + +FUNCTION {and} +{ 'skip$ + { pop$ #0 } + if$ +} + +FUNCTION {or} +{ { pop$ #1 } + 'skip$ + if$ +} + +FUNCTION {new.block.checka} +{ empty$ + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.block.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.block + if$ +} + +FUNCTION {new.sentence.checka} +{ empty$ + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {new.sentence.checkb} +{ empty$ + swap$ empty$ + and + 'skip$ + 'new.sentence + if$ +} + +FUNCTION {field.or.null} +{ duplicate$ empty$ + { pop$ "" } + 'skip$ + if$ +} + +FUNCTION {emphasize} +{ duplicate$ empty$ + { pop$ "" } + { "{\em " swap$ * "}" * } + if$ +} + +FUNCTION {group} +{ duplicate$ empty$ + { pop$ "" } + { "{" swap$ * "}" * } + if$ +} + +INTEGERS { nameptr namesleft numnames } + +FUNCTION {format.names} +{ + 's := + #1 'nameptr := + s num.names$ 'numnames := + numnames 'namesleft := + { namesleft #0 > } + { + %s nameptr "{vv,}{ll,}{jj,}{ff}" format.name$ 't := + "{" * + s nameptr "{vv}" format.name$ 't := + t * "}" * + "{" * + s nameptr "{ll}" format.name$ 't := + t * "}{" * + s nameptr "{jj}" format.name$ 't := + t * "}" * + "{" * + s nameptr "{ff}" format.name$ 't := + t * "}" * + s nameptr "" format.name$ 't := + namesleft #1 > + { "," * } + { } + if$ + nameptr #1 > +{ + t * +} +'t + if$ + nameptr #1 + 'nameptr := + namesleft #1 - 'namesleft := + } + while$ + "}" * +} + +FUNCTION {format.authors} +{ + author empty$ + { "" } + { author + "\DTLnewbibitem {Author}{" write$ + format.names } + if$ +} + +FUNCTION {format.editors} +{ editor empty$ + { "" } + { editor + "\DTLnewbibitem {Editor}{" write$ + format.names + } + if$ +} + +FUNCTION {format.title} +{ title empty$ + { "" } + { + "\DTLnewbibitem {Title}" + title "t" change.case$ group * + } + if$ +} + +FUNCTION {format.howpublished} +{ howpublished empty$ + { "" } + { + howpublished + "\DTLnewbibitem {HowPublished}" swap$ group * + } + if$ +} + +FUNCTION {format.organization} +{ organization empty$ + { "" } + { + organization + "\DTLnewbibitem {Organization}" swap$ group * + } + if$ +} + +FUNCTION {format.institution} +{ institution empty$ + { "" } + { + institution + "\DTLnewbibitem {Institution}" swap$ group * + } + if$ +} + +FUNCTION {format.key} +{ key empty$ + { "" } + { + key + "\DTLnewbibitem {Key}" swap$ group * + } + if$ +} + +FUNCTION {format.note} +{ note empty$ + { "" } + { + note + "\DTLnewbibitem {Note}" swap$ group * + } + if$ +} + +FUNCTION {format.isbn} +{ isbn empty$ + { "" } + { + isbn + "\DTLnewbibitem {ISBN}" swap$ group * + } + if$ +} + +FUNCTION {format.doi} +{ doi empty$ + { "" } + { + doi + "\DTLnewbibitem {DOI}" swap$ group * + } + if$ +} + +FUNCTION {format.pubmed} +{ pubmed empty$ + { "" } + { + pubmed + "\DTLnewbibitem {PubMed}" swap$ group * + } + if$ +} + +FUNCTION {format.abstract} +{ abstract empty$ + { "" } + { + abstract + "\DTLnewbibitem {Abstract}" swap$ group * + } + if$ +} + +FUNCTION {format.url} +{ url empty$ + { "" } + { + url + "\DTLnewbibitem {Url}" swap$ group * + } + if$ +} + +FUNCTION {format.file} +{ file empty$ + { "" } + { + file + "\DTLnewbibitem {File}" swap$ group * + } + if$ +} + +FUNCTION {format.eprints} +{ eprints empty$ + { "" } + { + eprints + "\DTLnewbibitem {Eprints}" swap$ group * + } + if$ +} + +FUNCTION {format.address} +{ address empty$ + { "" } + { + address + "\DTLnewbibitem {Address}" swap$ group * + } + if$ +} + +FUNCTION {format.school} +{ school empty$ + { "" } + { + school + "\DTLnewbibitem {School}" swap$ group * + } + if$ +} + +FUNCTION {format.publisher} +{ publisher empty$ + { "" } + { + publisher + "\DTLnewbibitem {Publisher}" swap$ group * + } + if$ +} + +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 {format.date} +{ year empty$ + { month empty$ +{ "" } +{ "there's a month but no year in " cite$ * warning$ + "\DTLnewbibitem {Month}" * + month group +} + if$ + } + { month empty$ +{ } +{ "\DTLnewbibitem {Month}{" * month * "}" * } + if$ + "\DTLnewbibitem {Year}{" * year * "}" + } + if$ +} + +FUNCTION {format.btitle} +{ title + "\DTLnewbibitem {Title}{" swap$ * + "}" * +} + +FUNCTION {tie.or.space.connect} +{ duplicate$ text.length$ #3 < + { "~" } + { " " } + if$ + swap$ * * +} + +FUNCTION {either.or.check} +{ empty$ + 'pop$ + { "can't use both " swap$ * " fields in " * cite$ * warning$ } + if$ +} + +FUNCTION {format.bvolume} +{ volume empty$ + { "" } + { + "\DTLnewbibitem {Volume}{" volume * "}" * + series empty$ +'skip$ +{ + "\DTLnewbibitem {Series}" * series group * + } + if$ + "volume and number" number either.or.check + } + if$ +} + +FUNCTION {format.number.series} +{ volume empty$ + { number empty$ +{ + %series field.or.null group + series empty$ + { "" } + { "\DTLnewbibitem {Series}" * series group } + if$ + } +{ + "\DTLnewbibitem {Number}" number group * + series empty$ + { "there's a number but no series in " cite$ * warning$ } + { "\DTLnewbibitem {Series}{" * series * "}" * } + if$ +} + if$ + } + { "" } + if$ +} + +FUNCTION {format.edition} +{ edition empty$ + { "" } + { + "\DTLnewbibitem {Edition}" + edition "l" change.case$ group * + } + 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 empty$ + { "" } + { pages multi.page.check +{ "\DTLnewbibitem {Pages}" pages n.dashify + group * } +{ "\DTLnewbibitem {Pages}" pages + group *} + if$ + } + if$ +} + +FUNCTION {format.vol.num.pages} +{ + volume empty$ + { "" } + { + "\DTLnewbibitem {Volume}{" volume * "}" * + } + if$ + number empty$ + 'skip$ + { "\DTLnewbibitem {Number}{" number * "}\relax " * * + volume empty$ +{ "there's a number but no volume in " cite$ * warning$ } +'skip$ + if$ + } + if$ + pages empty$ + 'skip$ + { duplicate$ empty$ +{ pop$ format.pages } +{ "\DTLnewbibitem {Pages}" * pages n.dashify group * } + if$ + } + if$ +} + +FUNCTION {format.chapter.pages} +{ chapter empty$ + 'format.pages + { type empty$ +{ "\DTLnewbibitem {Type}{chapter}" } +{ "\DTLnewbibitem {Type}" type "l" change.case$ group *} + if$ + "\DTLnewbibitem {Chapter}{" * chapter * "}" * + pages empty$ +'skip$ +{ format.pages * } + if$ + } + if$ +} + +FUNCTION {format.in.ed.booktitle} +{ booktitle empty$ + { "" } + { + "\DTLnewbibitem {BookTitle}" booktitle group * + editor empty$ + {} + { + "\DTLnewbibitem {Editor}{" * + editor format.names * + } + if$ + } + if$ +} + +FUNCTION {empty.misc.check} +{ author empty$ title empty$ howpublished empty$ + month empty$ year empty$ note empty$ + and and and and and + { "all relevant fields are empty in " cite$ * warning$ } + 'skip$ + if$ +} + +FUNCTION {format.thesis.type} +{ type empty$ + 'skip$ + { pop$ + type "t" change.case$ + "\DTLnewbibitem {Type}" swap$ group * + } + if$ +} + +FUNCTION {format.tr.number} +{ + type empty$ + { "\techreportname " } + 'type + if$ + number empty$ + { "t" change.case$ "\DTLnewbibitem {Type}" swap$ group *} + { "\DTLnewbibitem {Type}" swap$ group * + "\DTLnewbibitem {Number}" * + number group * } + if$ +} + +FUNCTION {format.article.crossref} +{ key empty$ + { journal empty$ +{ "need key or journal for " cite$ * " to crossref " * crossref * + warning$ + "" +} +{ + "\DTLnewbibitem {Journal}" journal group * + } + if$ + } + { + "" + } + if$ + "\DTLnewbibitem {CrossRef}{" * crossref * "}" * +} + +FUNCTION {format.crossref.editor} +{ format.editors +} + +FUNCTION {format.book.crossref} +{ volume empty$ + { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ + } + { + "\DTLnewbibitem {Volume}" + volume group * + } + if$ + editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ +{ series empty$ + { "need editor, key, or series for " cite$ * " to crossref " * + crossref * warning$ + "" * + } + { + "\DTLnewbibitem {Series}{" * series * + "}" * + } + if$ +} +{ "" + } + if$ + } + { + format.crossref.editor * + } + if$ + "\DTLnewbibitem {CrossRef}{" * crossref * "}" * +} + +FUNCTION {format.incoll.inproc.crossref} +{ editor empty$ + editor field.or.null author field.or.null = + or + { key empty$ +{ booktitle empty$ + { "need editor, key, or booktitle for " cite$ * " to crossref " * + crossref * warning$ + "" + } + { "\DTLnewbibitem {BookTitle}{" booktitle * "}" * } + if$ +} +{ "" } + if$ + } + { + "\DTLnewbibitem {Editor}{" * + editor format.names + } + if$ + "\DTLnewbibitem {CrossRef}{" * crossref * "}" * +} + +FUNCTION {article} +{ output.bibitem + "\DTLnewbibitem {EntryType}{article}%" write$ + newline$ + format.authors "author" + output.check + format.title "title" output.check + new.block + crossref missing$ + { + "\DTLnewbibitem {Journal}" * + journal group "journal" output.check + format.vol.num.pages output + format.date "year" output.check + } + { format.article.crossref output.nonnull + format.pages output + } + if$ + new.block + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry +} + +FUNCTION {book} +{ output.bibitem + "\DTLnewbibitem {EntryType}{book}%" write$ + newline$ + author empty$ + { format.editors "author and editor" output.check } + { 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 + new.block + format.number.series output + %new.sentence + format.publisher "publisher" output.check + format.address output + } + { new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.date "year" output.check + new.block + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry +} + +FUNCTION {booklet} +{ output.bibitem + "\DTLnewbibitem {EntryType}{booklet}%" write$ + newline$ + format.authors output + new.block + format.title "title" output.check + howpublished address new.block.checkb + format.howpublished output + format.address output + format.date output + new.block + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry +} + +FUNCTION {inbook} +{ output.bibitem + "\DTLnewbibitem {EntryType}{inbook}%" write$ + newline$ + author empty$ + { format.editors "author and editor" output.check } + { 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 "publisher" output.check + format.address output + } + { format.chapter.pages "chapter and pages" output.check + new.block + format.book.crossref output.nonnull + } + if$ + format.edition output + format.date "year" output.check + new.block + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry +} + +FUNCTION {incollection} +{ output.bibitem + "\DTLnewbibitem {EntryType}{incollection}%" write$ + newline$ + format.authors "author" output.check + format.title "title" output.check + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.chapter.pages output + new.sentence + format.publisher "publisher" output.check + format.address output + format.edition output + format.date "year" output.check + } + { format.incoll.inproc.crossref output.nonnull + format.chapter.pages output + } + if$ + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry +} + +FUNCTION {inproceedings} +{ output.bibitem + "\DTLnewbibitem {EntryType}{inproceedings}%" write$ + newline$ + format.authors "author" output.check + format.title "title" output.check + crossref missing$ + { format.in.ed.booktitle "booktitle" output.check + format.bvolume output + format.number.series output + format.pages output + address empty$ +{ %organization publisher new.sentence.checkb + format.organization write$ + format.publisher output +} +{ format.address write$ + new.sentence + format.organization output + format.publisher output +} + if$ + format.date "year" output.check + } + { + format.incoll.inproc.crossref output.nonnull + format.pages output + } + if$ + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry +} + +FUNCTION {conference} { inproceedings } + +FUNCTION {manual} +{ output.bibitem + "\DTLnewbibitem {EntryType}{manual}%" write$ + newline$ + author empty$ + { organization empty$ +'skip$ +{ format.organization output + format.address output +} + if$ + } + { format.authors output } + if$ + new.block + format.btitle "title" output.check + author empty$ + { organization empty$ +{ address new.block.checka + address output +} +'skip$ + if$ + } + { %organization address new.block.checkb + format.organization output + format.address output + } + if$ + format.edition output + format.date output + new.block + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry +} + +FUNCTION {mastersthesis} +{ output.bibitem + "\DTLnewbibitem {EntryType}{mastersthesis}%" write$ + newline$ + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + "\DTLnewbibitem {Type}{\mscthesisname }" + format.thesis.type output.nonnull + format.school "school" output.check + format.address output + format.date "year" output.check + new.block + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry +} + +FUNCTION {misc} +{ output.bibitem + "\DTLnewbibitem {EntryType}{misc}%" write$ + newline$ + format.authors output + title howpublished new.block.checkb + format.title output + %howpublished new.block.checka + format.howpublished output + format.date output + new.block + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry + empty.misc.check +} + +FUNCTION {phdthesis} +{ output.bibitem + "\DTLnewbibitem {EntryType}{phdthesis}%" write$ + newline$ + format.authors "author" output.check + new.block + format.btitle "title" output.check + new.block + "\DTLnewbibitem {Type}{\phdthesisname }" + format.thesis.type output.nonnull + format.school "school" output.check + format.address output + format.date "year" output.check + new.block + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry +} + +FUNCTION {proceedings} +{ output.bibitem + "\DTLnewbibitem {EntryType}{proceedings}%" write$ + newline$ + editor empty$ + { format.organization output } + { format.editors output.nonnull } + if$ + new.block + format.btitle "title" output.check + format.bvolume output + format.number.series output + address empty$ + { editor empty$ +{ publisher new.sentence.checka } +{ organization publisher new.sentence.checkb + format.organization output +} + if$ + format.publisher output + format.date "year" output.check + } + { format.address output + format.date "year" output.check + new.sentence + editor empty$ +'skip$ +{ format.organization output } + if$ + format.publisher output + } + if$ + new.block + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry +} + +FUNCTION {techreport} +{ output.bibitem + "\DTLnewbibitem {EntryType}{techreport}%" write$ + newline$ + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.tr.number output.nonnull + format.institution "institution" output.check + format.address output + format.date "year" output.check + new.block + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + fin.entry +} + +FUNCTION {unpublished} +{ output.bibitem + "\DTLnewbibitem {EntryType}{unpublished}%" write$ + newline$ + format.authors "author" output.check + new.block + format.title "title" output.check + new.block + format.key output + format.note output + format.isbn output + format.doi output + format.pubmed output + format.url output + format.abstract output + format.file output + format.date output + fin.entry +} + +FUNCTION {default.type} { misc } + +MACRO {jan} {"\DTLmonthname{01}"} + +MACRO {feb} {"\DTLmonthname{02}"} + +MACRO {mar} {"\DTLmonthname{03}"} + +MACRO {apr} {"\DTLmonthname{04}"} + +MACRO {may} {"\DTLmonthname{05}"} + +MACRO {jun} {"\DTLmonthname{06}"} + +MACRO {jul} {"\DTLmonthname{07}"} + +MACRO {aug} {"\DTLmonthname{08}"} + +MACRO {sep} {"\DTLmonthname{09}"} + +MACRO {oct} {"\DTLmonthname{10}"} + +MACRO {nov} {"\DTLmonthname{11}"} + +MACRO {dec} {"\DTLmonthname{12}"} + +MACRO {acmcs} {"\DTLacmcs "} + +MACRO {acta} {"\DTLacta "} + +MACRO {cacm} {"\DTLcacm "} + +MACRO {ibmjrd} {"\DTLibmjrd "} + +MACRO {ibmsj} {"\DTLibmsj "} + +MACRO {ieeese} {"\DTLieeese "} + +MACRO {ieeetc} {"\DTLieeetc "} + +MACRO {ieeetcad} {"\DTLieeetcad "} + +MACRO {ipl} {"\DTLipl "} + +MACRO {jacm} {"\DTLjacm "} + +MACRO {jcss} {"\DTLjcss "} + +MACRO {scp} {"\DTLscp "} + +MACRO {sicomp} {"\DTLsicomp "} + +MACRO {tocs} {"\DTLtocs "} + +MACRO {tods} {"\DTLtods "} + +MACRO {tog} {"\DTLtog "} + +MACRO {toms} {"\DTLtoms "} + +MACRO {toois} {"\DTLtoois "} + +MACRO {toplas} {"\DTLtoplas "} + +MACRO {tcs} {"\DTLtcs "} + +READ + +STRINGS { longest.label } + +INTEGERS { number.label longest.label.width } + +FUNCTION {initialize.longest.label} +{ "" 'longest.label := + #1 'number.label := + #0 'longest.label.width := +} + +FUNCTION {longest.label.pass} +{ number.label int.to.str$ 'label := + number.label #1 + 'number.label := + label width$ longest.label.width > + { label 'longest.label := + label width$ 'longest.label.width := + } + 'skip$ + if$ +} + +EXECUTE {initialize.longest.label} + +ITERATE {longest.label.pass} + +FUNCTION {begin.bib} +{ preamble$ empty$ + 'skip$ + { preamble$ write$ newline$ } + if$ +} + +EXECUTE {begin.bib} + +EXECUTE {init.state.consts} + +ITERATE {call.type$} + +FUNCTION {end.bib} +{ +} + +EXECUTE {end.bib} diff --git a/Master/texmf-dist/doc/latex/datatool/CHANGES b/Master/texmf-dist/doc/latex/datatool/CHANGES index 2621cba5d8e..ebf870514c8 100644 --- a/Master/texmf-dist/doc/latex/datatool/CHANGES +++ b/Master/texmf-dist/doc/latex/datatool/CHANGES @@ -1,3 +1,15 @@ +v2.17: + + * datatool: + + - added \edtlgetrowforvalue and \DTLfetch + + - added joining two databases in a single table example to user manual + + * databib: + + - fixed packaging of databib.bst + v2.16: * datatool: diff --git a/Master/texmf-dist/doc/latex/datatool/README b/Master/texmf-dist/doc/latex/datatool/README index 9e39650fbea..e13a8ecc48b 100644 --- a/Master/texmf-dist/doc/latex/datatool/README +++ b/Master/texmf-dist/doc/latex/datatool/README @@ -1,6 +1,6 @@ -LaTeX Bundle : datatool v2.16 +LaTeX Bundle : datatool v2.17 -Last Modified : 2013-08-16 +Last Modified : 2013-08-29 Author : Nicola Talbot diff --git a/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf b/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf Binary files differindex 657be69514f..1994ba47f93 100644 --- a/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf +++ b/Master/texmf-dist/doc/latex/datatool/datatool-code.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf b/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf Binary files differindex 27c4682aeae..343f339834d 100644 --- a/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf +++ b/Master/texmf-dist/doc/latex/datatool/datatool-user.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex index fbc7cad8a99..07da5dd87a8 100644 --- a/Master/texmf-dist/doc/latex/datatool/datatool-user.tex +++ b/Master/texmf-dist/doc/latex/datatool/datatool-user.tex @@ -91,11 +91,11 @@ \MakeShortVerb{"} \DeleteShortVerb{\|} - \title{User Manual for datatool bundle version~2.16} + \title{User Manual for datatool bundle version~2.17} \author{Nicola L.C. Talbot\\ \url{http://www.dickimaw-books.com/}} - \date{2013-08-16} + \date{2013-08-29} \maketitle \pagenumbering{roman} @@ -110,7 +110,7 @@ The \styfmt{datatool} bundle comes with the following documentation: \item[\url{datatool-code.pdf}] Advanced users wishing to know more about the inner workings of all the packages provided in the \styfmt{datatool} bundle should - read \qt{Documented Code for datatool v2.16} + read \qt{Documented Code for datatool v2.17} \item[INSTALL] Installation instructions. @@ -130,11 +130,15 @@ The \styfmt{datatool} bundle is provided to help perform repetitive commands, such as mail merging, but since \TeX\ is designed as a typesetting language, don't expect this bundle to perform as efficiently as custom database systems or a dedicated mathematical -or scripting language. If the provided packages take a frustratingly +or scripting language. \textbf{If the provided packages take a frustratingly long time to compile your document, use another language to perform your calculations or data manipulation and save the results in a -file that can be input into your document. - +file that can be input into your document.} For large amounts of +data that need to be sorted or filtered or joined, consider storing your data +in an~SQL database and use +\app{datatooltk}\footnote{\url{http://www.dickimaw-books.com/apps/datatooltk/}} to import the data, +using SQL syntax to filter, sort and otherwise +manipulate the values. \end{important} This bundle consists of the following packages: @@ -329,8 +333,10 @@ and decimal characters may be changed using \begin{definition}[\DescribeMacro{\DTLsetnumberchars}]% \cs{DTLsetnumberchars}\marg{number group character}\marg{decimal character} \end{definition} +\begin{important} Note that scientific notation is not supported, and the number group character may not be used after the decimal character. +\end{important} \item[Currency] A currency symbol followed by an integer or real number is considered to be the currency data type. @@ -2031,10 +2037,10 @@ as efficient as, say, using a SQL database, so don't expect too much from this package. \label{datatooltk}% -I'm working on a Java helper application to accompany \sty{datatool} -called \app{datatooltk}. The source code is available on GitHub at -\url{https://github.com/nlct/datatooltk}. I'll upload it to CTAN -when it's ready for release. The application will allow you to edit +I've written a Java helper application to accompany \sty{datatool} +called \app{datatooltk}. The installer is available +on CTAN at +\url{http://mirrors.ctan.org/support/datatooltk/datatooltk-installer.jar}. The application will allow you to edit files saved using \ics{DTLsaverawdb} or \ics{DTLprotectedsaverawdb} in a~graphical interface or import data from a~SQL database, a~CSV file or a~\sty{probsoln} dataset. @@ -5001,6 +5007,22 @@ value of the key specified by \meta{key} in the first row of the database called \meta{db name} which contains the key \meta{ref key} which has the value \meta{value}. +\begin{definition}[\DescribeMacro{\DTLfetch}] +\cs{DTLfetch}\marg{db name}\marg{column1 name}\marg{column1 +value}\marg{column2 name} +\end{definition} +This fetches and displays the value for \meta{column2 name} in the +first row where the value of \meta{column1 name} is \meta{column1 +value}. (Note that all arguments are expanded.) So, for example, if +you have a column labelled ``regnum'' and a column labelled +``tutor'', then to fetch and display the value of the tutor in the +row where ``regnum'' is ``12345'' from the database called +``students'' you can do: +\begin{verbatim} +\DTLfetch{students}{regnum}{12345}{tutor} +\end{verbatim} +See \autoref{ex:join} on page~\pageref{ex:join}. + \begin{definition}[\DescribeMacro{\DTLassign}] \cs{DTLassign}\marg{db name}\marg{row idx}\marg{assign list} \end{definition} @@ -5166,7 +5188,11 @@ argument} error if you specify a row index that is out of range. Like \cs{dtlgetrow}, but this gets the row where the entry in column \meta{column index} matches \meta{value}. This command produces an error if no match is found. \textbf{Note that no expansion is -performed when matching \meta{value}.} +performed when matching \meta{value}.} If you want \meta{value} +expanded before comparison, use: +\begin{definition}[\DescribeMacro{\edtlgetrowforvalue}] +\cs{edtlgetrowforvalue}\marg{db name}\marg{column index}\marg{value} +\end{definition} You can use the commands below to access or edit \cs{dtlcurrentrow}, but they won't change the database. Instead, once you've finished @@ -5235,6 +5261,265 @@ Behaves like \cs{dtlappendentrytocurrentrow} if the current row doesn't contain an entry for the column given by \meta{key}, otherwise behaves like \cs{dtlreplaceentryincurrentrow}. +\begin{example}{Joining Two Databases in a Single Table}{ex:join} +\DTLnewdb{cmp101}\DTLnewrow{cmp101}\relax +\DTLnewdbentry{cmp101}{regnum}{12345}\relax +\DTLnewdbentry{cmp101}{Autumn Marks}{80}\relax +\DTLnewdbentry{cmp101}{Spring Marks}{85}\relax +\DTLnewrow{cmp101}\relax +\DTLnewdbentry{cmp101}{regnum}{12346}\relax +\DTLnewdbentry{cmp101}{Autumn Marks}{70}\relax +\DTLnewdbentry{cmp101}{Spring Marks}{90}\relax +\DTLnewrow{cmp101}\relax +\DTLnewdbentry{cmp101}{regnum}{12347}\relax +\DTLnewdbentry{cmp101}{Autumn Marks}{75}\relax +\DTLnewdbentry{cmp101}{Spring Marks}{60}\relax +\DTLnewdb{students}\relax +\DTLnewrow{students}\relax +\DTLnewdbentry{students}{regnum}{12344}\relax +\DTLnewdbentry{students}{name}{Mary Brown}\relax +\DTLnewrow{students}\relax +\DTLnewdbentry{students}{regnum}{12345}\relax +\DTLnewdbentry{students}{name}{Joe Bloggs}\relax +\DTLnewrow{students}\relax +\DTLnewdbentry{students}{regnum}{12346}\relax +\DTLnewdbentry{students}{name}{Jane Doe}\relax +\DTLnewrow{students}\relax +\DTLnewdbentry{students}{regnum}{12347}\relax +\DTLnewdbentry{students}{name}{John Smith}\relax +\DTLnewrow{students}\relax +\DTLnewdbentry{students}{regnum}{12348}\relax +\DTLnewdbentry{students}{name}{Alice Jones}\relax +Suppose a lecturer has a CSV file for a particular course that +contains student registration numbers and marks for the Autumn and +Spring semesters. The file is called, say, \texttt{cmp101.csv} and +contains the following: + +\vskip\baselineskip +\begin{ttfamily}\par +regnum,Autumn Marks,Spring Marks\par +\DTLforeach*{cmp101}{\RegNum=regnum,\Autumn=Autumn Marks,\Spring=Spring Marks} +{\RegNum,\Autumn,\Spring\par} +\end{ttfamily} +\vskip\baselineskip\noindent + +This only contains the student registration numbers, not their +names, but suppose there's another CSV file that contains the +registration numbers and names for all students at the department +(or university). This file called, say, \texttt{students.csv} may +look something like: + +\vskip\baselineskip +\begin{ttfamily}\par +regnum,name\par +\DTLforeach*{students}{\RegNum=regnum,\Name=name} +{\RegNum,\Name\par} +\end{ttfamily} +\vskip\baselineskip\noindent + +Now suppose the lecturer wants a table of all the students on course +CMP101 listing each student's name and marks. Here's the code: +\begin{verbatim} +\DTLloaddb{cmp101}{cmp101.csv}% load course data +\DTLloaddb{students}{students.csv}% load student data + +\begin{table}[htbp] + \caption{Student Marks (Joining Databases)} + \centering + \begin{tabular}{lrr} + \bfseries Name & \bfseries Autumn Marks & \bfseries Spring Marks% + \DTLforeach*{cmp101}% + {\RegNum=regnum,\Autumn=Autumn Marks,\Spring=Spring Marks}% + {\\\DTLfetch{students}{regnum}{\RegNum}{name} & \Autumn & \Spring}% + \end{tabular} +\end{table} +\end{verbatim} + +The result is shown in \autoref{tab:join}. + +\begin{table}[htbp] + \caption{Student Marks (Joining Databases)}\label{tab:join} + \centering + \begin{tabular}{lrr} + \bfseries Name & \bfseries Autumn Marks & \bfseries Spring Marks% + \DTLforeach*{cmp101}{\RegNum=regnum,\Autumn=Autumn Marks,\Spring=Spring Marks} + {\\\DTLfetch{students}{regnum}{\RegNum}{name} & \Autumn & \Spring}% + \end{tabular} +\end{table} + +Let's suppose now that the \texttt{students.csv} file has the first +name and surname in separate columns rather than single columns. So +the CSV file looks like: +\DTLcleardb{students}\relax +\DTLnewrow{students}\relax +\DTLnewdbentry{students}{regnum}{12344}\relax +\DTLnewdbentry{students}{forename}{Mary}\relax +\DTLnewdbentry{students}{surname}{Brown}\relax +\DTLnewrow{students}\relax +\DTLnewdbentry{students}{regnum}{12345}\relax +\DTLnewdbentry{students}{forename}{Joe}\relax +\DTLnewdbentry{students}{surname}{Bloggs}\relax +\DTLnewrow{students}\relax +\DTLnewdbentry{students}{regnum}{12346}\relax +\DTLnewdbentry{students}{forename}{Jane}\relax +\DTLnewdbentry{students}{surname}{Doe}\relax +\DTLnewrow{students}\relax +\DTLnewdbentry{students}{regnum}{12347}\relax +\DTLnewdbentry{students}{forename}{John}\relax +\DTLnewdbentry{students}{surname}{Smith}\relax +\DTLnewrow{students}\relax +\DTLnewdbentry{students}{regnum}{12348}\relax +\DTLnewdbentry{students}{forename}{Alice}\relax +\DTLnewdbentry{students}{surname}{Jones}\relax + +\vskip\baselineskip +\begin{ttfamily}\par +regnum,forename,surname\par +\DTLforeach*{students}{\RegNum=regnum,\Forename=forename,\Surname=surname} +{\RegNum,\Forename,\Surname\par} +\end{ttfamily} +\vskip\baselineskip\noindent + +You may be tempted to replace +\begin{verbatim} +\DTLfetch{students}{regnum}{\RegNum}{name} +\end{verbatim} +with +\begin{verbatim} +\DTLfetch{students}{regnum}{\RegNum}{forename}\space +\DTLfetch{students}{regnum}{\RegNum}{surname} +\end{verbatim} +in the above code, but this is inefficient as it requires two +searches for the same row. Instead, you can do: +\begin{verbatim} +\DTLfetch{students}{regnum}{\RegNum}{forename}\space +\dtlgetentryfromcurrentrow{\Surname}{\dtlcolumnindex{students}{surname}}% +\Surname +\end{verbatim} +This can be done because +\begin{verbatim} +\DTLfetch{students}{regnum}{\RegNum}{forename} +\end{verbatim} +is equivalent to +\begin{verbatim} +\edtlgetrowforvalue{students}{\dtlcolumnindex{students}{regnum}}{\RegNum}% +\dtlgetentryfromcurrentrow + {\dtlcurrentvalue}{\dtlcolumnindex{students}{forename}}% +\dtlcurrentvalue +\end{verbatim} +This means that \cs{dtlcurrentrow} has already been set by +\cs{DTLfetch} so we can just do another +\cs{dtlgetentryfromcurrentrow} for the surname field. +The new code for the table is now: + +\begin{verbatim} +\DTLloaddb{cmp101}{cmp101.csv}% load course data +\DTLloaddb{students}{students.csv}% load student data + +\begin{table}[htbp] + \caption{Student Marks (Joining Databases)} + \centering + \begin{tabular}{lrr} + \bfseries Name & \bfseries Autumn Marks & \bfseries Spring Marks% + \DTLforeach*{cmp101}% + {\RegNum=regnum,\Autumn=Autumn Marks,\Spring=Spring Marks}% + {\\% + \DTLfetch{students}{regnum}{\RegNum}{forename}\space + \dtlgetentryfromcurrentrow{\Surname}{\dtlcolumnindex{students}{surname}}% + \Surname + & \Autumn & \Spring}% + \end{tabular} +\end{table} +\end{verbatim} + +The result is shown in \autoref{tab:join2}. + +\begin{table}[htbp] + \caption{Student Marks (Joining Databases)}\label{tab:join2} + \centering + \begin{tabular}{lrr} + \bfseries Name & \bfseries Autumn Marks & \bfseries Spring Marks% + \DTLforeach*{cmp101}% + {\RegNum=regnum,\Autumn=Autumn Marks,\Spring=Spring Marks}% + {\\% + \DTLfetch{students}{regnum}{\RegNum}{forename}\space + \dtlgetentryfromcurrentrow{\Surname}{\dtlcolumnindex{students}{surname}}% + \Surname + & \Autumn & \Spring}% + \end{tabular} +\end{table} + +\textbf{Caveat:} be careful of scoping issues. Suppose you want the +first name and surname in separate columns, you may consider doing: +\begin{verbatim} + \DTLfetch{students}{regnum}{\RegNum}{forename}% + & + \dtlgetentryfromcurrentrow{\Surname}{\dtlcolumnindex{students}{surname}}% + \Surname +\end{verbatim} +(and adding an extra column to the \env{tabular} environment). +However this will result in undefined values for \cs{Surname} as +\cs{dtlcurrentrow} is only locally set. After the \verb|&| special +character \cs{dtlcurrentrow} has lost its value as it's no longer in the same +scope. You can fix this problem in a~number of ways. Firstly you can +make \cs{dtlcurrentrow} global after \cs{DTLfetch} via +\begin{verbatim} +\global\dtlcurrentrow=\dtlcurrentrow +\end{verbatim} +or you could move the column break to just before \cs{Surname} and +make \cs{Surname} global: +\begin{verbatim} + \DTLfetch{students}{regnum}{\RegNum}{forename}% + \dtlgetentryfromcurrentrow{\Surname}{\dtlcolumnindex{students}{surname}}% + \global\let\Surname\Surname + & + \Surname +\end{verbatim} +There are other possibilities as well, but the first method is +probably the best, especially if you have multiple columns you want +to fetch. + +Here's the updated code: +\begin{verbatim} +\begin{table}[htbp] + \caption{Student Marks (Joining Databases)} + \centering + \begin{tabular}{llrr} + \bfseries Forename & \bfseries Surname & + \bfseries Autumn Marks & \bfseries Spring Marks% + \DTLforeach*{cmp101}% + {\RegNum=regnum,\Autumn=Autumn Marks,\Spring=Spring Marks}% + {\\% + \DTLfetch{students}{regnum}{\RegNum}{forename}% + \global\dtlcurrentrow=\dtlcurrentrow + & + \dtlgetentryfromcurrentrow{\Surname}{\dtlcolumnindex{students}{surname}}% + \Surname + & \Autumn & \Spring}% + \end{tabular} +\end{table} +\end{verbatim} +The result is shown in \autoref{tab:join3}. + +\begin{table}[htbp] + \caption{Student Marks (Joining Databases)}\label{tab:join3} + \centering + \begin{tabular}{llrr} + \bfseries Forename & \bfseries Surname & + \bfseries Autumn Marks & \bfseries Spring Marks% + \DTLforeach*{cmp101}% + {\RegNum=regnum,\Autumn=Autumn Marks,\Spring=Spring Marks}% + {\\% + \DTLfetch{students}{regnum}{\RegNum}{forename}% + \global\dtlcurrentrow=\dtlcurrentrow + & + \dtlgetentryfromcurrentrow{\Surname}{\dtlcolumnindex{students}{surname}}% + \Surname + & \Autumn & \Spring}% + \end{tabular} +\end{table} +\end{example} + \chapter{Creating an index, glossary or list of acronyms (\texorpdfstring{\sty{datagidx}}{datagidx} package)} \label{sec:datagidx} diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf Binary files differindex bdb343e3dc5..62314cbc6bd 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-barchart.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf Binary files differindex 9899148d876..2741b9732f1 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-dict.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf Binary files differindex 20cc564ac16..9899165d244 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-gidx.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf Binary files differindex c54a75176af..2672317ae55 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-glossary.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf Binary files differindex 80060752d9d..ebc16da0672 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-index.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf Binary files differindex da04184da04..43a32ddde60 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-mail-merge.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf Binary files differindex 7c503175ca9..66e135f9b5d 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-piechart.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf Binary files differindex 5061df422ce..e9691d084a4 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-student-scores.pdf diff --git a/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf b/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf Binary files differindex ac91bad3ee2..c892444e75b 100644 --- a/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf +++ b/Master/texmf-dist/doc/latex/datatool/samples/sample-two-per-row.pdf diff --git a/Master/texmf-dist/source/latex/datatool/datatool.dtx b/Master/texmf-dist/source/latex/datatool/datatool.dtx index bab6974643b..109413ab6c6 100644 --- a/Master/texmf-dist/source/latex/datatool/datatool.dtx +++ b/Master/texmf-dist/source/latex/datatool/datatool.dtx @@ -2,6 +2,8 @@ % datatool.dtx generated using makedtx version 0.94b (c) Nicola Talbot % Command line args: % -macrocode "databib\.bst" +% -setambles "databib\.bst=>\nopreamble\nopostamble" +% -comment "databib\.bst" % -src "datatool-base.sty\Z=>datatool-base.sty" % -src "datatool-fp.sty\Z=>datatool-fp.sty" % -src "datatool-pgfmath.sty\Z=>datatool-pgfmath.sty" @@ -17,7 +19,7 @@ % -author "Nicola Talbot" % -codetitle "" % datatool -% Created on 2013/8/16 12:48 +% Created on 2013/8/29 23:06 %\fi %\iffalse %<*package> @@ -64,7 +66,7 @@ datatool.dtx \doxitem{Counter}{counter}{counters} \doxitem{Option}{option}{package options} -\CheckSum{22987} +\CheckSum{22897} \RecordChanges \PageIndex @@ -77,11 +79,11 @@ datatool.dtx %\fi %\MakeShortVerb{"} % -%\title{Documented Code for datatool v2.16} +%\title{Documented Code for datatool v2.17} %\author{Nicola L. C. Talbot\\ %\url{http://www.dickimaw-books.com/}} % -%\date{2013-08-16} +%\date{2013-08-29} %\maketitle % %\pagenumbering{roman} @@ -116,7 +118,7 @@ datatool.dtx % % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-base}[2013/08/16 v2.16 (NLCT)] +\ProvidesPackage{datatool-base}[2013/08/29 v2.17 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -5161,7 +5163,7 @@ datatool.dtx % Definitions of fixed-point commands that use the \sty{fp} package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-fp}[2013/06/28 v2.14 (NLCT)] +\ProvidesPackage{datatool-fp}[2013/08/29 v2.17 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -5450,7 +5452,7 @@ datatool.dtx % Definitions of fixed-point commands that use the \sty{pgfmath} package. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-pgfmath}[2013/06/28 v2.14 (NLCT)] +\ProvidesPackage{datatool-pgfmath}[2013/08/29 v2.17 (NLCT)] % \end{macrocode} % Required packages: % \begin{macrocode} @@ -5707,7 +5709,7 @@ datatool.dtx %\section{Package Declaration} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool}[2013/08/16 v2.16 (NLCT)] +\ProvidesPackage{datatool}[2013/08/29 v2.17 (NLCT)] % \end{macrocode} % Load required packages: % \begin{macrocode} @@ -7488,6 +7490,40 @@ datatool.dtx } % \end{macrocode} %\end{macro} +% +%\begin{macro}{\edtlgetrowforvalue} +%\changes{2.17}{2013-08-29}{new} +%\begin{definition} +%\cs{edtlgetrowforvalue}\marg{db}\marg{column idx}\marg{value} +%\end{definition} +% A version of \cs{dtlgetrowforvalue} that expands its arguments. +% \begin{macrocode} +\newcommand{\edtlgetrowforvalue}[3]{% + \protected@edef\@dtl@dogetrowforvalue{% + \noexpand\dtlgetrowforvalue{#1}{#2}{#3}}% + \@dtl@dogetrowforvalue +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTLfetch} +%\changes{2.17}{2013-08-29}{new} +%\begin{definition} +%\cs{DTLfetch}\marg{db name}\marg{column1 name}\marg{column1 +%value}\marg{column2 name} +%\end{definition} +% Fetches and displays the value for \meta{column2 name} in the +% first row where the value of \meta{column1 name} is \meta{column1 +% value}. Note that all arguments are expanded. +% \begin{macrocode} +\newcommand{\DTLfetch}[4]{% + \edtlgetrowforvalue{#1}{\dtlcolumnindex{#1}{#2}}{#3}% + \dtlgetentryfromcurrentrow{\dtlcurrentvalue}{\dtlcolumnindex{#1}{#4}}% + \dtlcurrentvalue +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\dtlgetrowforvalue} %\begin{definition} %\cs{dtlgetrowforvalue}\marg{db}\marg{column idx}\marg{value} @@ -26364,6 +26400,7 @@ east,southeast,south,southwest,west,northwest}[northeast]{% %<*databib.bst> % \end{macrocode} %\fi +%\iffalse % \begin{macrocode} ENTRY { address @@ -27623,6 +27660,7 @@ FUNCTION {end.bib} EXECUTE {end.bib} % \end{macrocode} +%\fi %\iffalse % \begin{macrocode} %</databib.bst> diff --git a/Master/texmf-dist/source/latex/datatool/datatool.ins b/Master/texmf-dist/source/latex/datatool/datatool.ins index 1e77888877b..df96e9f5aeb 100644 --- a/Master/texmf-dist/source/latex/datatool/datatool.ins +++ b/Master/texmf-dist/source/latex/datatool/datatool.ins @@ -1,4 +1,4 @@ -% datatool.ins generated using makedtx version 0.94b 2013/8/16 12:48 +% datatool.ins generated using makedtx version 0.94b 2013/8/29 23:06 \input docstrip \preamble @@ -44,8 +44,7 @@ \usepostamble\defaultpostamble\from{datatool.dtx}{dataplot.sty,package}} \file{person.sty}{\usepreamble\defaultpreamble \usepostamble\defaultpostamble\from{datatool.dtx}{person.sty,package}} -\file{databib.bst}{\usepreamble\defaultpreamble -\usepostamble\defaultpostamble\from{datatool.dtx}{databib.bst,package}} +\file{databib.bst}{\nopreamble\nopostamble\from{datatool.dtx}{databib.bst}} } \endbatchfile diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty index dc786fc4414..65be692efb1 100644 --- a/Master/texmf-dist/tex/latex/datatool/datatool-base.sty +++ b/Master/texmf-dist/tex/latex/datatool/datatool-base.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-base}[2013/08/16 v2.16 (NLCT)] +\ProvidesPackage{datatool-base}[2013/08/29 v2.17 (NLCT)] \RequirePackage{etoolbox} \RequirePackage{amsmath} \RequirePackage{xkeyval} diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty b/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty index 787053268c7..19fb072f8f2 100644 --- a/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty +++ b/Master/texmf-dist/tex/latex/datatool/datatool-fp.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-fp}[2013/06/28 v2.14 (NLCT)] +\ProvidesPackage{datatool-fp}[2013/08/29 v2.17 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{fp} \RequirePackage{datatool-base} diff --git a/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty b/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty index 2daeb4c6fa1..c2dc4a70488 100644 --- a/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty +++ b/Master/texmf-dist/tex/latex/datatool/datatool-pgfmath.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool-pgfmath}[2013/06/28 v2.14 (NLCT)] +\ProvidesPackage{datatool-pgfmath}[2013/08/29 v2.17 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{pgfrcs,pgfkeys,pgfmath} \ProcessOptionsX diff --git a/Master/texmf-dist/tex/latex/datatool/datatool.sty b/Master/texmf-dist/tex/latex/datatool/datatool.sty index 351ae3e2a41..7b65fd06807 100644 --- a/Master/texmf-dist/tex/latex/datatool/datatool.sty +++ b/Master/texmf-dist/tex/latex/datatool/datatool.sty @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datatool}[2013/08/16 v2.16 (NLCT)] +\ProvidesPackage{datatool}[2013/08/29 v2.17 (NLCT)] \RequirePackage{xkeyval} \RequirePackage{ifthen} \RequirePackage{xfor} @@ -735,6 +735,16 @@ \edef\@dtl@dogetrow{\noexpand\@dtlgetrow{\the\toks@}{\number#2}}% \@dtl@dogetrow } +\newcommand{\edtlgetrowforvalue}[3]{% + \protected@edef\@dtl@dogetrowforvalue{% + \noexpand\dtlgetrowforvalue{#1}{#2}{#3}}% + \@dtl@dogetrowforvalue +} +\newcommand{\DTLfetch}[4]{% + \edtlgetrowforvalue{#1}{\dtlcolumnindex{#1}{#2}}{#3}% + \dtlgetentryfromcurrentrow{\dtlcurrentvalue}{\dtlcolumnindex{#1}{#4}}% + \dtlcurrentvalue +} \newcommand*{\dtlgetrowforvalue}[3]{% \dtlgetrowindex{\dtl@rowidx}{#1}{#2}{#3}% \ifx\dtl@rowidx\dtlnovalue |