summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi')
-rw-r--r--Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi1156
1 files changed, 1156 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi b/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi
new file mode 100644
index 00000000000..3bc2a1d2184
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/publ-imp-aps.mkvi
@@ -0,0 +1,1156 @@
+%D \module
+%D [ file=publ-imp-aps,
+%D version=2015.03.22,
+%D title=APS bibliography style,
+%D subtitle=Publications,
+%D author=Alan Braslau and Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is therefore copyrighted
+%D by \PRAGMA. See mreadme.pdf for details.
+
+\startbtxrenderingdefinitions[aps]
+
+%D Reference:
+%D \startTEX
+%D @Book{APS2011,
+%D title ={Physical Review Style and Notation Guide}
+%D year ={2011},
+%D month ={June}
+%D edition ={Revised},
+%D editor ={Waldron, A and Judd, P. and Miller, V.},
+%D address ={Ridge, NY},
+%D publisher={American Physical Society},
+%D pages ={26},
+%D url ={http://journals.aps.org/files/styleguide-pr.pdf}
+%D }
+%D \stopTEX
+
+% set ALL specific APS compliant values
+
+\definebtx
+ [aps]
+ [\c!default=default,
+ \c!specification=aps,
+ \c!otherstext={\space\btxlabeltext{aps:others}},
+ \c!etallimit=10,
+ \c!etaldisplay=\btxparameter\c!etallimit,
+ %c!journalconversion=\v!normal,
+ \c!monthconversion=\v!month,
+ optionaltitle=\v!yes,
+ \c!separator:names:2={,\space},
+ \c!separator:names:3={,\space\btxlabeltext{aps:and}\space}, % not \textampersand
+ \c!separator:names:4= {\space\btxlabeltext{aps:and}\space}] % not \textampersand
+
+% First, define and set list and rendering parameters
+
+\definebtxrendering
+ [aps]
+ [\c!specification=aps]
+
+\definebtx
+ [aps:list]
+ [aps]
+ [\c!authorconversion=normalshort]
+
+\definebtx
+ [aps:list:author]
+ [aps:list]
+
+\definebtx
+ [aps:list:editor]
+ [aps:list:author]
+
+\definebtx
+ [aps:list:suffix]
+ [aps:list]
+
+\definebtx
+ [aps:list:url]
+ [aps:list]
+
+\definebtx
+ [aps:list:doi]
+ [aps:list]
+
+\definebtx
+ [aps:list:invertedshort]
+ [aps:list]
+
+% This is for numbering=num
+
+\definebtx
+ [aps:list:num]
+ [aps:list]
+ [left={[},
+ right={]}]
+
+% This is for numbering=yes
+
+\definebtx
+ [aps:list:yes]
+ [aps:list:num]
+
+% This is for numbering=short
+
+\definebtx
+ [aps:list:short]
+ [aps:list:num]
+
+% This is for numbering=bib
+
+\definebtx
+ [aps:list:bib]
+ [aps:list:num]
+
+%D In order to be able to get journals expanded (or normalized or abbreviated) you need
+%D to load a list:
+%D
+%D \starttyping
+%D \btxloadjournallist[journals.txt] % the jabref list
+%D \stoptyping
+
+% TODO
+
+\definebtx
+ [aps:list:journal]
+ [\c!style=\v!italic]
+ %command=\btxexpandedjournal] % btxabbreviatedjournal
+
+\definebtx
+ [aps:list:volume]
+ [\c!style=\v!bold]
+
+\definebtx
+ [aps:list:title]
+ [\c!style=\v!italic,
+ \c!command=\Word]
+
+\definebtx
+ [aps:list:title:article]
+ [aps:list:title]
+ [\c!style=] % journal is set in italics
+
+\definebtx
+ [aps:list:title:magazine]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:newspaper]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:periodical]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:standard]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:book]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:inbook]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:incollection]
+ [aps:list:title]
+ [\c!style=] % booktitle is set in italics
+
+\definebtx
+ [aps:list:title:proceedings]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:inproceedings]
+ [aps:list:title]
+ [\c!style=] % booktitle is set in italics
+
+\definebtx
+ [aps:list:title:conference]
+ [aps:list:title]
+ [\c!style=] % booktitle is set in italics
+
+\definebtx
+ [aps:list:title:thesis]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:phdthesis]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:mastersthesis]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:booklet]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:manual]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:techreport]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:unpublished]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:patent]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:electronic]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:other]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:misc]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:title:literal]
+ [aps:list:title]
+
+\definebtx
+ [aps:list:type]
+ [\c!command=\Word]
+
+% We define [page] settings in the aps namespace, inheriting the root
+% settings, in order to eventually allow for modifications without touching
+% root.
+
+\definebtx
+ [aps:page]
+ [\s!page]
+
+\definebtx
+ [aps:page:list]
+ [aps:page]
+ [\c!command={\wordright}]
+
+% Then define and set all cite parameters
+
+\definebtx
+ [aps:cite]
+ [aps]
+ [\c!authorconversion=\v!name]
+
+\definebtx
+ [aps:cite:author]
+ [aps:cite]
+
+\definebtx
+ [aps:cite:authoryear]
+ [aps:cite:author]
+ [\c!left={(},
+ \c!right={)},
+ \c!inbetween={,\space}]
+
+\definebtx
+ [aps:cite:authoryears]
+ [aps:cite:authoryear]
+ [\c!left=,
+ \c!right=,
+ \c!inbetween={\space}]
+
+\definebtx
+ [aps:cite:authornum]
+ [aps:cite:author]
+ [\c!left={(},
+ \c!right={)},
+ \c!sorttype=authornum]
+
+\definebtx
+ [aps:cite:authorref]
+ [aps:cite:authornum]
+
+\definebtx
+ [aps:cite:author:num] % todo
+ [aps:cite:authornum]
+ [\c!left={[},
+ \c!right={]}]
+
+\definebtx
+ [aps:cite:author:year] % todo
+ [aps:cite:authoryear]
+ [\c!left=,
+ \c!right=]
+
+\definebtx
+ [aps:cite:author:years] % todo
+ [aps:cite:authoryears]
+ [\c!inbetween=,
+ \c!left=(,
+ \c!right=)]
+
+\definebtx
+ [aps:cite:year]
+ [aps:cite]
+ [\c!compress=\v!yes,
+ \c!sorttype=year]
+
+\definebtx
+ [aps:cite:title]
+ [aps:cite]
+ [\c!command={\language[\currentbtxlanguage]}, % BAH
+ \c!style=\v!italic]
+
+\definebtx
+ [aps:cite:booktitle]
+ [aps:cite:title]
+
+\definebtx
+ [aps:cite:tag]
+ [aps:cite]
+ [\c!left={[},
+ \c!right={]}]
+
+\definebtx
+ [aps:cite:key]
+ [aps:cite:tag]
+
+\definebtx
+ [aps:cite:serial]
+ [aps:cite]
+ [\c!left={[},
+ \c!right={]}]
+
+\definebtx
+ [aps:cite:page]
+ [aps:cite]
+ [\c!left=,
+ \c!right=,
+ [\c!separator:2={,\space}, % :0 and :1 - between items of a list
+ \c!separator:3={,\space\btxlabeltext{aps:and}\space}, % not \textampersand
+ \c!separator:4= {\space\btxlabeltext{aps:and}\space}] % not \textampersand
+
+\definebtx
+ [aps:cite:pages]
+ [aps:cite:page]
+
+\definebtx
+ [aps:cite:keywords]
+ [aps:cite]
+ [\c!left={(},
+ \c!right={)}]
+
+\definebtx
+ [aps:cite:invertedshort]
+ [aps:cite]
+
+\definebtx
+ [aps:cite:short]
+ [aps:cite]
+ [\c!left={[},
+ \c!right={]}]
+
+\definebtx
+ [aps:cite:category]
+ [aps:cite]
+ [\c!left={[},
+ \c!right={]}]
+
+\definebtx
+ [aps:cite:type]
+ [aps:cite:category]
+
+\definebtx
+ [aps:cite:url]
+ [aps:cite]
+ [\c!left={[},
+ \c!right={]}]
+
+\definebtx
+ [aps:cite:doi]
+ [aps:cite:url]
+
+\definebtx
+ [aps:cite:num]
+ [aps:cite]
+ [\c!compress=\v!yes,
+ \c!left={[},
+ \c!right={]},
+ %\c!left=, % TODO: PRB uses superscript references...
+ %\c!right=, % and after punctuation, PRA, C, D, E, and L are before!
+ %\c!command={\high},
+ \c!separator:2={,}, % no space
+ \c!separator:3=\btxparameter{\c!separator:2},
+ \c!separator:4=\btxparameter{\c!separator:2}]
+
+\definebtx
+ [aps:cite:default]
+ [aps:cite:num]
+
+\definebtx
+ [aps:cite:textnum]
+ [aps:cite:num]
+ [\c!left={Ref.\nbsp},
+ \c!command=,
+ \c!separator:2={,\space},
+ \c!separator:3={\space\btxlabeltext{aps:and}\space},
+ \c!separator:4={\space\btxlabeltext{aps:and}\space}]
+
+\definebtx
+ [aps:cite:entry]
+ [aps:cite]
+ [\c!left=,
+ \c!right=,
+ \c!inbetween={\space},
+ \c!separator:2={;\space},
+ \c!separator:3=\btxparameter{\c!separator:2},
+ \c!separator:4=\btxparameter{\c!separator:2}]
+
+%D Sometimes we have verbose injections in an entry and these can be language
+%D dependent, so we use labels.
+%D
+%D Because we want to mix rendering (in the manual) we need a namespace in label
+%D texts:
+
+\setupbtxlabeltext
+ [en]
+ [aps:and=and,
+ aps:number={no.},
+ aps:edition={ed.},
+ aps:Editor={Ed.},
+ aps:Editors={Eds.},
+ aps:Volume={Vol.},
+ aps:Volumes={Vols.},
+ aps:others={et al.},
+ aps:page={p.},
+ aps:pages={pp.},
+ aps:mastersthesis={Master's thesis},
+ aps:phdthesis={Doctoral dissertation},
+ aps:technicalreport={Tech. Rep.}, % Technical report
+ aps:supplement={Suppl.}, % Supplement (not used?)
+ aps:patent=Patent,
+ aps:inpress={in press},
+ aps:tobe={to be published},
+ aps:unpublished={unpublished},
+ aps:In=In]
+
+% Check this (google translate!!):
+
+\setupbtxlabeltext
+ [nl]
+ [aps:and=en,
+ aps:number={nr.},
+ aps:edition={ed.}, % editie
+ aps:Editor=Editor, % Ed./Eds.
+ aps:Editors=Editors,
+ aps:Volume={Vol.},
+ aps:Volumes={Vols.},
+ aps:others={et al.},
+ aps:page={p.},
+ aps:pages={pp.},
+ aps:mastersthesis=Masterproef,
+ aps:phdthesis=Proefschrift,
+ aps:technicalreport={Technisch rapport}, % Technical report
+ aps:supplement=Supplement,
+ aps:patent=Octrooi,
+ aps:inpress={in press}, % CHECK THESE!
+ aps:tobe={worden gepubliceerd},
+ aps:unpublished={onuitgegeven},
+ aps:In=In]
+
+\setupbtxlabeltext
+ [fr]
+ [aps:and=et,
+ aps:others={et al.},
+ aps:number={n\high{o}},
+ aps:edition={édition},
+ aps:Editor=Éditeur,
+ aps:Editors=Éditeurs,
+ aps:Volume=Volume,
+ aps:Volumes=Volumes,
+ aps:others={et al.},
+ aps:page={p.},
+ aps:pages={pp.},
+ aps:mastersthesis={Thèse de master (DEA, DESS, master)},
+ aps:phdthesis={Thèse de doctorat},
+ aps:technicalreport={Rapport technique},
+ aps:supplement=Supplément,
+ aps:patent=Brevet,
+ aps:inpress={sous impression},
+ aps:tobe={à paraître},
+ aps:unpublished={inédit}, % pour un livre
+ aps:In=Dans]
+
+\setupbtxlabeltext
+ [de]
+ [aps:and=und,
+ aps:number={nr.},
+ aps:edition=Auf\/lage,
+ aps:Editor=Herausgeber, % Hrsg./Hg.
+ aps:Editors=Herausgeber,
+ aps:Volume=Band, % Bd.
+ aps:Volumes={Bände},
+ aps:others={et al.},
+ aps:page={S.},
+ aps:pages={S.},
+ aps:mastersthesis={Masterarbeit},
+ aps:phdthesis={Dissertation},
+ aps:technicalreport={Technischer Bericht},
+ aps:supplement={Beilage}, % Supplement
+ aps:patent=Patent,
+ aps:inpress={in der Presse}, % CHECK THESE!
+ aps:tobe={veröffentlicht werden},
+ aps:unpublished={unveröffentlicht},
+ aps:In=In]
+
+% thanks: Andrea Valle
+
+\setupbtxlabeltext
+ [it]
+ [aps:and=e,
+ aps:number={nº},
+ aps:edition={ed.}, % edizione
+ aps:Editor={A cura di},
+ aps:Editors={A cura di},
+ aps:Volume={Vol.}, % Volume
+ aps:Volumes={Vol.}, % Volumi
+ aps:others={et al.},
+ aps:page={p.},
+ aps:pages={pp.},
+ aps:mastersthesis={Tesi di laurea},
+ aps:phdthesis={Tesi di dottorato},
+ aps:technicalreport={Relazione tecnica},
+ aps:supplement={Supplemento},
+ aps:patent=Brevetto,
+ aps:inpress={in press}, % CHECK THESE!
+ aps:tobe={da pubblicare},
+ aps:unpublished={inedito},
+ aps:In=In]
+
+\setupbtxlabeltext
+ [es]
+ [aps:and=y,
+ aps:number={nº},
+ aps:edition={ed.}, % edición
+ aps:Editor=Editor, % Ed./Eds.
+ aps:Editors=Editores,
+ aps:Volume={Vol.}, % Volumen
+ aps:Volumes={Vols.}, % Volúmenes
+ aps:others={et al.},
+ aps:page={p.},
+ aps:pages={pp.},
+ aps:mastersthesis={Tesis de maestría},
+ aps:phdthesis={Tesis doctoral},
+ aps:technicalreport={Informe técnico},
+ aps:supplement=Suplemento,
+ aps:patent=Patente,
+ aps:inpress={en prensa}, % CHECK THESE!
+ aps:tobe={que se publicará},
+ aps:unpublished={inédito},
+ aps:In=En]
+
+% cite setups
+
+\startsetups btx:aps:nd
+ \doifelse {\currentbtxcategory} {article} {
+ \btxlabeltext{aps:tobe}
+ } {
+ \doifelse {\currentbtxcategory} {book} {
+ \btxlabeltext{aps:inpress}
+ } {
+ \btxlabeltext{aps:unpublished}
+ }
+ }
+\stopsetups
+
+\startsetups btx:aps:cite:author:year
+ \texdefinition{\s!btx:\s!cite:concat}
+ \ifx\currentbtxfirst\empty
+ \fastsetup{btx:aps:nd}
+ \else
+ \texdefinition {\s!btx:\s!cite:inject} {
+ \btxcitereference
+ \currentbtxfirst
+ }
+ \ifx\currentbtxsecond\empty \else
+ \btxparameter\v!inbetween
+ \texdefinition {\s!btx:\s!cite:inject} {
+ \currentbtxsecond
+ }
+ \fi
+ \ifx\currentbtxthird\empty \else
+ \texdefinition {\s!btx:\s!cite:inject} {
+ \currentbtxthird
+ }
+ \fi
+ \fi
+\stopsetups
+
+\startsetups btx:aps:cite:author:years
+ \fastsetup{btx:aps:cite:author:year}
+\stopsetups
+
+\startsetups [btx:aps:page:list]
+ \fastsetup{\s!btx:\s!page:concat}
+ \ifx\currentbtxlastpage\empty
+ \btxlabeltext{aps:page}
+ \else
+ \btxlabeltext{aps:pages}
+ \fi
+ \btxnbsp
+ \ifconditional\btxinteractive
+ \goto {
+ \currentbtxfirstpage
+ } [
+ internal(\currentbtxfirstinternal)
+ ]
+ \ifx\currentbtxlastpage\empty \else
+ \btxparameter\c!pageconnector
+ \goto {
+ \currentbtxlastpage
+ } [
+ internal(\currentbtxlastinternal)
+ ]
+ \fi
+ \else
+ \currentbtxfirstpage
+ \ifx\currentbtxlastpage\empty \else
+ \btxparameter\c!pageconnector
+ \currentbtxlastpage
+ \fi
+ \fi
+\stopsetups
+
+%D Instead of texdefinitions without arguments, we could have used setups but in my
+%D editor (hh, scite) the commands stand out better. It also saves an additional
+%D component in the name (e.g. common:) because commands and setups have a different
+%D namespace, so similar calls don't clash. Performance of definitions is somewhat
+%D better.
+
+%D We use "texdefinitions" (with eventual arguments) for helpers that are used
+%D in the rendering "setups" defined for each category below.
+
+%D Note that \btxdoif... and \btxflush rely on the definitions in
+%D publ-imp-aps.lua: fields that are not listed as required nor optional are
+%D IGNORED. We also make heavy use of the notion of sets - comma-separated lists
+%D of alternative fields to be used in hierarchal order. For example:
+%D author = { "author", "editor", "publisher", "title" }, will return the
+%D author field if it exists; if not, the editor field will be returned, if it
+%D exists; if not, the publisher field will be returned, if it exists; if not,
+%D the title field will be returned, it it exists; if not, nothing will be
+%D returned. In lua syntax, it can be understood as
+%D author or editor or publisher or title or ""
+
+\starttexdefinition btx:aps:composed-title #title
+ \begingroup
+ \language[\currentbtxlanguage]
+ \btxusecommand[aps:list:title:\currentbtxcategory] {
+ \btxflush{#title}
+ \btxdoif {sub#title} {
+ \btxcolon
+ \btxflush{sub#title}
+ }
+ }
+ \endgroup
+\stoptexdefinition
+
+\starttexdefinition btx:aps:title
+ \btxdoif {title} {
+ % we make the title active, opening file
+ \btxdoifelse {file} {
+ \texdefinition{btx:format:inject}
+ {url(file:\btxflush{file})}
+ {
+ \btxstartstyleandcolor [aps:list:title:\currentbtxcategory]
+ \texdefinition{btx:aps:composed-title}{title}
+ \btxstopstyleandcolor
+ }
+ } {
+ \btxstartstyleandcolor [aps:list:title:\currentbtxcategory]
+ \texdefinition{btx:aps:composed-title}{title}
+ \btxstopstyleandcolor
+ }
+ \btxcomma
+ }
+\stoptexdefinition
+
+\starttexdefinition btx:aps:optional-title
+ \doif{\btxparameter{optionaltitle}}\v!yes {
+ \texdefinition {btx:aps:title}
+ }
+\stoptexdefinition
+
+\starttexdefinition btx:aps:year
+ \btxdoifelse {year} {
+ \btxflush{year}
+ } {
+ \fastsetup{btx:aps:nd}
+ }
+\stoptexdefinition
+
+% #author may be author(set) or editor
+
+\starttexdefinition btx:aps:author-or-editor #author
+ \btxdoif {#author} {
+ \btxflush{#author}
+ \doifelse {\btxfoundname{#author}} {editor} {
+ \btxleftparenthesis
+ \btxsingularorplural {editor} {
+ \btxlabeltext{aps:Editor}
+ } {
+ \btxlabeltext{aps:Editors}
+ }
+ \btxrightparenthesis
+ } {
+ \btxdoif {collaboration} {
+ \btxleftparenthesis
+ \btxflush{collaboration}
+ \btxrightparenthesis
+ }
+ }
+ }
+\stoptexdefinition
+
+\starttexdefinition btx:aps:author
+ \btxflush{author}
+ \btxcomma
+\stoptexdefinition
+
+\starttexdefinition btx:aps:editor-in
+ \btxdoif {booktitle} {
+ \btxlabeltext{aps:In}
+ \doifnot {\btxfoundname{author}} {editor} {
+ \btxspace
+ \texdefinition{btx:aps:author-or-editor} {editor}
+ }
+ \btxspace
+ \btxstartstyleandcolor[aps:list:title]
+ \texdefinition{btx:aps:composed-title} {booktitle}
+ \btxstopstyleandcolor
+ \btxcomma
+ }
+\stoptexdefinition
+
+\starttexdefinition btx:aps:editionset
+ \doif {\currentbtxcategory} {techreport} {
+ \btxdoifelse {type} {
+ \btxusecommand[\currentbtx:type] {
+ \btxflush{type}
+ }
+ } {
+ \btxlabeltext{aps:technicalreport}
+ }
+ \btxcomma
+ }
+ \btxdoif {volume} {
+ \btxoneorrange {volume} {
+ \btxlabeltext{aps:Volume}
+ } {
+ \btxlabeltext{aps:Volumes}
+ }
+ \btxspace
+ \btxflush{volume}
+ \btxcomma
+ }
+ \btxdoif {number} {
+ \btxlabeltext{aps:number}
+ \btxspace
+ \btxflush{number}
+ \btxcomma
+ }
+ \btxdoif {edition} {
+ \btxflush{edition}
+ \btxspace
+ \btxlabeltext{aps:edition}
+ \btxcomma
+ }
+ \btxdoif {pages} {
+ \btxoneorrange {pages} {
+ \btxlabeltext{aps:page}
+ } {
+ \btxlabeltext{aps:pages}
+ }
+ \btxnbsp
+ \btxflush{pages}
+ \btxcomma
+ }
+\stoptexdefinition
+
+\starttexdefinition btx:aps:journal-volume-year
+ \btxdoif {journal} {
+ % expandedjournal abbreviatedjournal
+ \btxflush{expandedjournal -> journal}
+ \btxdoifelse {volume} {
+ \btxspace
+ \btxstartstyleandcolor [aps:list:volume]
+ \btxflush{volume}
+ \btxstopstyleandcolor
+ \btxdoif {number} {
+ \removeunwantedspaces(
+ \btxflush{number}
+ \btxrightparenthesiscomma
+ }
+ } {
+ \btxdoif {number} {
+ \btxspace
+ \btxflush{number}
+ \btxcomma
+ }
+ }
+ \btxdoif {pages} {
+ \btxspace
+ \btxflush{pages}
+ }
+ \btxleftparenthesis
+ \texdefinition{btx:aps:year}
+ \btxrightparenthesis
+ }
+\stoptexdefinition
+
+\starttexdefinition btx:aps:publisher-wherefrom-year
+ \removeunwantedspaces
+ \removepunctuation
+ \btxleftparenthesis
+ \btxflush{publisher}
+ \btxdoifelse {address} {
+ \btxdoif {publisher} {
+ \btxcomma
+ }
+ \btxflush{address}
+ \btxdoif {country} {
+ \btxcomma
+ \btxflush{country}
+ }
+ \btxcomma
+ } {
+ \btxdoif {publisher} {
+ \btxcomma
+ }
+ }
+ \texdefinition{btx:aps:year}
+ \btxrightparenthesis
+\stoptexdefinition
+
+\starttexdefinition btx:aps:note
+ \btxperiod
+ \btxdoif {note} {
+ \btxleftparenthesis
+ \btxflush{note}
+ \btxrightparenthesis
+ }
+\stoptexdefinition
+
+\starttexdefinition btx:aps:doi-url #text
+ \ifconditional\btxinteractive
+ \btxdoifelse {doi} {
+ \goto {#text} [url(http://dx.doi.org/\btxflush{doi})]
+ } {
+ \btxdoifelse {url} {
+ \goto {#text} [url(\btxflush{url})]
+ } {
+ #text
+ }
+ }
+ \else
+ #text
+ \fi
+
+\stoptexdefinition
+
+% Then setups, by category
+
+% An article from a journal
+% Required fields: author or editor or title, journal, (year).
+% Optional fields: volume, number, pages, type, doi, url, note.
+% Note that bibtex (and tools) do not include editor (e.g. special issue or section)
+
+\startsetups btx:aps:list:article
+ \texdefinition{btx:aps:author}
+ \texdefinition{btx:aps:optional-title}
+ \texdefinition{btx:aps:doi-url} {\texdefinition{btx:aps:journal-volume-year}}
+ \texdefinition{btx:aps:note}
+\stopsetups
+
+% An article from a magazine.
+% Required fields: author or title, journal, (year).
+% Optional fields: number, pages, type, month, day, doi, url, note.
+
+\startsetups btx:aps:list:magazine
+ \fastsetup{btx:aps:list:article}
+\stopsetups
+
+% An article from a newspaper.
+% Required fields: author or title, journal, (year).
+% Optional fields: number, pages, type, month, day, doi, url, note.
+
+\startsetups btx:aps:list:newspaper
+ \fastsetup{btx:aps:list:article}
+\stopsetups
+
+% A complete issue of a periodical, such as a special issue of a journal.
+% Required fields: title, year
+% Optional fields: editor, publisher, subtitle, series, volume, number, month, organization, doi, url, issn, note
+
+% needs to be tuned...
+\startsetups btx:aps:list:periodical
+ \fastsetup{btx:aps:list:article}
+\stopsetups
+
+% National and international standards issued by a standards body
+% Required fields: author, institution, or organization, year, title
+% Optional fields: subtitle, doi, url, note
+
+\startsetups btx:aps:list:standard
+ \texdefinition{btx:aps:author}
+ \texdefinition{btx:aps:title}
+ \texdefinition{btx:aps:note}
+\stopsetups
+% year?
+
+% A book with an explicit publisher.
+% Required fields: author or editor or publisher, title, (year).
+% Optional fields: volume or number, series, address, edition, month, day, note.
+% APS? ignores: month, day
+
+% todo: series?
+
+\startsetups btx:aps:list:book
+ \texdefinition{btx:aps:author}
+ \texdefinition{btx:aps:title}
+ \texdefinition{btx:aps:editionset}
+ \texdefinition{btx:aps:doi-url} {\texdefinition{btx:aps:publisher-wherefrom-year}}
+ \texdefinition{btx:aps:note}
+\stopsetups
+
+% There is some debate about how inbook should differ from incollection
+
+% A part of a book, which may be a chapter (or section or whatever) and/or a range of pages.
+% (note that inbook is handled differently by bibtex and biblatex)
+% Required fields: author or editor, title, chapter and/or pages, publisher, year.
+% Optional fields: volume or number, series, type, address, edition, month, note.
+% We add optional: booktitle.
+% APS? ignores: chapter, month
+
+\startsetups btx:aps:list:inbook
+ \texdefinition{btx:aps:author}
+ \texdefinition{btx:aps:title}
+ \texdefinition{btx:aps:editor-in}
+ \texdefinition{btx:aps:editionset}
+ \texdefinition{btx:aps:doi-url} {\texdefinition{btx:aps:publisher-wherefrom-year}}
+ \texdefinition{btx:aps:note}
+\stopsetups
+% chapter?
+
+% A part of a book having its own title.
+% Required fields: author, title, booktitle, publisher, year.
+% Optional fields: editor, volume or number, series, type, chapter, pages, address, edition, month, note.
+% APS? ignores: chapter, month
+
+\startsetups btx:aps:list:incollection
+ \fastsetup{btx:aps:list:inbook}
+\stopsetups
+
+% The proceedings of a conference.
+% Required fields: title, year.
+% Optional fields: editor, volume or number, series, address, month, organization, publisher, note.
+% todo: series?
+
+\startsetups btx:aps:list:proceedings
+ \fastsetup{btx:aps:list:book}
+\stopsetups
+
+% An article in a conference proceedings.
+% Required fields: author, title, booktitle, year.
+% Optional fields: editor, volume or number, series, pages, address, month, organization, publisher, note.
+
+\startsetups btx:aps:list:inproceedings
+ \texdefinition{btx:aps:author}
+ \texdefinition{btx:aps:title}
+ \texdefinition{btx:aps:editor-in}
+ \texdefinition{btx:aps:editionset}
+ \btxdoif {organization} {
+ \btxspace
+ \btxflush{organization}
+ \btxcomma
+ }
+ \texdefinition{btx:aps:doi-url} {\texdefinition{btx:aps:publisher-wherefrom-year}}
+ \texdefinition{btx:aps:note}
+\stopsetups
+
+\startsetups btx:aps:list:conference
+ \fastsetup{btx:aps:list:inproceedings}
+\stopsetups
+
+% A thesis.
+% Required fields: author, title, school, year.
+% Optional fields: type, address, month, note.
+
+\startsetups btx:aps:list:thesis
+ \texdefinition{btx:aps:author}
+ \texdefinition{btx:aps:title}
+ \btxleftparenthesis
+ \btxdoifelse {type} {
+ \btxusecommand[aps:list:type] {
+ \btxflush{type}
+ }
+ } {
+ \btxlabeltext{aps:\currentbtxcategory}
+ }
+ \btxrightparenthesis
+ \btxdoif {school} {
+ \btxperiod
+ \btxflush{school}
+ }
+ \btxdoif {address} {
+ \btxdoifelse {school} {
+ \btxcomma
+ } {
+ \btxperiod
+ }
+ \btxflush{address}
+ \btxdoif {country} {
+ \btxcomma
+ \btxflush{country}
+ }
+ }
+ \btxperiod
+ \texdefinition{btx:aps:note}
+\stopsetups
+
+\startsetups btx:aps:list:phdthesis
+ \fastsetup{btx:aps:list:thesis}
+\stopsetups
+
+\startsetups btx:aps:list:mastersthesis
+ \fastsetup{btx:aps:list:thesis}
+\stopsetups
+
+% A work that is printed and bound, but without a named publisher or sponsoring institution.
+% Required field: title.
+% Optional fields: author, howpublished, address, month, year, note.
+
+\startsetups btx:aps:list:booklet
+ \fastsetup{btx:aps:list:book}
+\stopsetups
+
+% Technical documentation.
+% Required field: title.
+% Optional fields: author, organization, address, edition, month, year, note.
+
+\startsetups btx:aps:list:manual
+ \fastsetup{btx:aps:list:book}
+\stopsetups
+
+% A report published by a school or other institution, usually numbered within a series.
+% Required fields: author, title, institution, year.
+% Optional fields: type, number, address, month, note.
+
+\startsetups btx:aps:list:techreport
+ \fastsetup{btx:aps:list:book}
+\stopsetups
+
+% A document having an author and title, but not formally published.
+% Required fields: author, title, note.
+% Optional fields: month, year.
+
+\startsetups btx:aps:list:unpublished
+ \fastsetup{btx:aps:list:book}
+\stopsetups
+
+% A patent. Note that this category was not defined with BIBTEX. Below from JabRef:
+% Required fields: nationality, number, year, yearfiled
+% Optional fields: author, title, assignee, address, type, number, day, dayfiled, month, monthfiled, note, url
+% Also optional: publisher
+
+% todo: yearfiled, monthfiled, dayfiled
+
+\startsetups btx:aps:list:patent
+ \texdefinition{btx:aps:author}
+ \texdefinition{btx:aps:title}
+ \begingroup
+ \it
+ \btxdoif {nationality} {
+ \btxspace
+ \btxflush{nationality}
+ }
+ \btxspace
+ \btxlabeltext{aps:patent}
+ \btxdoif {number} {
+ \btxspace
+ \btxlabeltext{aps:number}
+ \btxspace
+ \btxflush{number}
+ }
+ \btxperiod
+ \italiccorrection
+ \endgroup
+ \texdefinition{btx:aps:doi-url} {\texdefinition{btx:aps:publisher-wherefrom-year}}
+ \texdefinition{btx:aps:url}
+ \texdefinition{btx:aps:note}
+\stopsetups
+
+% Electronic. Note that this category was not defined with BIBTEX. Below from JabRef:
+% Required fields: title
+% Optional fields: address, author, howpublished, month, note, organization, url, year, doi
+% Also optional: type
+
+% Like Misc below but includes organization.
+
+\startsetups btx:aps:list:electronic
+ \texdefinition{btx:aps:author}
+ \texdefinition{btx:aps:title}
+ \btxdoif {organization} {
+ \btxspace
+ \btxflush{organization}
+ \btxperiod
+ }
+ \btxdoif {howpublished} {
+ \btxspace
+ \btxflush{howpublished}
+ \btxperiod
+ }
+ \texdefinition{btx:aps:note}
+\stopsetups
+
+% Other. Note that this category was not defined with BIBTEX. Below from JabRef:
+% Required fields: author or title, year
+% Optional fields: note, doi, url
+
+\startsetups btx:aps:list:other
+ \fastsetup{btx:aps:list:book}
+\stopsetups
+
+% Use this type when nothing else fits.
+% Required fields: none.
+% Optional fields: author, title, howpublished, month, year, note.
+
+\startsetups btx:aps:list:misc
+ \texdefinition{btx:aps:author}
+ \texdefinition{btx:aps:title}
+ \btxdoif {howpublished} {
+ \btxspace
+ \btxflush{howpublished}
+ \btxperiod
+ }
+ \texdefinition{btx:aps:note}
+\stopsetups
+
+% If all else fails to match:
+
+\startsetups btx:aps:list:literal
+ %\btxleftparenthesis
+ \removeunwantedspaces(
+ \btxflush{key}
+ \btxrightparenthesis
+ \btxdoif {text} {
+ \btxflush{text}
+ }
+\stopsetups
+
+\stopbtxrenderingdefinitions