ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to extend btx rendering?
@ 2016-07-18  8:54 Henri Menke
  2016-07-18 13:06 ` Henri Menke
  0 siblings, 1 reply; 6+ messages in thread
From: Henri Menke @ 2016-07-18  8:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-07-18 19:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-18  8:54 How to extend btx rendering? Henri Menke
2016-07-18 13:06 ` Henri Menke
2016-07-18 15:40   ` Alan BRASLAU
2016-07-18 18:05     ` Henri Menke
2016-07-18 18:30       ` Henri Menke
2016-07-18 19:39       ` Alan BRASLAU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).