[NTG-context] How to extend btx rendering?

Henri Menke henrimenke at gmail.com
Mon Jul 18 10:54:19 CEST 2016


Dear list,

It is common in physics (and probably mathematics) that papers are
uploaded to an electronic archive prior to publishing them in the
peer-review literature.  In physical sciences this is https://arxiv.org.

To cite such articles one usually uses the following format, here on the
example of the most recent contribution to the Condensed Matter section:

N.A. Kudryashov, A.A. Kutukov, and E.A. Mazur, Normal State of the
Metallic Hydrogen Sulfide, arXiv:1607.04624 (2016).

To reproduce this kind of format I tried to extend the APS rendering
(see the long example below, sorry).  Unfortunately, this does not work,
because apparently the `eprint` and `archivePrefix` fields are not read
in.  The combination `eprint` and `archivePrefix` is used, because this
is what the LaTeX package `biblatex` expects.

How do I extend the btx rendering by these additional fields?

Cheers,
Henri

---

\startbuffer [references]
  @article{Kudryashov2016,
    title = {Normal State of the Metallic Hydrogen Sulfide},
    author = {Kudryashov, Nikolay A. and Kutukov, Alexander A. and
Mazur, Evgeny A.},
    year = {2016},
    eprint = {1607.04624},
    archivePrefix = {arxiv}
  }
\stopbuffer

\usebtxdataset[references.buffer]
\usebtxdefinitions[aps]

\definebtx[aps:list:eprint][aps:list][style=\tt]

\starttexdefinition unexpanded btx:aps:eprints
    \btxdoif {eprint} {
        \btxstartstyleandcolor [aps:list:eprint]
            \btxdoif {archivePrefix} {
                \btxflush{archivePrefix}:
            }
            \btxflush{eprint}
        \btxstopstyleandcolor
    }
\stoptexdefinition

\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:eprint}% extension to APS style
    \texdefinition{btx:aps:note}
\stopsetups

\starttext

\cite{Kudryashov2016}
\placelistofpublications

\stoptext


More information about the ntg-context mailing list