ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henri Menke <henrimenke@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: How to extend btx rendering?
Date: Mon, 18 Jul 2016 15:06:06 +0200	[thread overview]
Message-ID: <578CD43E.9030101@gmail.com> (raw)
In-Reply-To: <578C993B.3050806@gmail.com>

Okay, I have partly found out myself.  One has to add the field `eprint`
and `archivePrefix` to `categories.article.optional` in the file
base/mkiv/publ-imp-aps.lua.

But I don't want to edit any system files, because this is not portable.
 Also I don't want to have a copy of this file in my project directory,
because this is just redundant.

How can I add the two fields `eprint` and `archivePrefix` to
`categories.article.optional` from the document level?

Cheers,
Henri

N.B.:  In my original post there was a typo.  It should read

\starttexdefinition unexpanded btx:aps:eprint

(It was btx:aps:eprints in the original post)


On 07/18/2016 10:54 AM, Henri Menke wrote:
> 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
___________________________________________________________________________________

  reply	other threads:[~2016-07-18 13:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18  8:54 Henri Menke
2016-07-18 13:06 ` Henri Menke [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=578CD43E.9030101@gmail.com \
    --to=henrimenke@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).