ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Help regarding IEEE citation style
Date: Thu, 27 Jan 2011 21:14:12 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.01.1101272109340.18710@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <AANLkTintF0WtfYoNW3i24wDhDnkFDECx7E-KEfbT_Svk@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 506 bytes --]

On Fri, 28 Jan 2011, Mojca Miklavec wrote:

> On Wed, Jan 26, 2011 at 16:10, Julius Canute wrote:
>> 
>> I wan to cite references in my ConTeXt document using IEEE citation 
>> style. Specifically for Web URL. How to do that using ConTeXt and 
>> BiBTeX?
>
> It is quite possible that nobody has used IEEE citation style in
> ConTeXt (I didn't check how it should look like).

I am attaching a file that I used a couple of years ago. I haven't checked 
it with the latest version of the bib module.

Aditya

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: TEXT/x-tex; name=bibl-ieee.tex, Size: 12396 bytes --]

%D \module
%D   [       file=bibl-ieee,
%D        version=2007.06.25,
%D          title=IEEE bibliography style,
%D       subtitle=IEEE Publications,
%D         author={Aditya Mahajan},
%D           date=\currentdate,
%D      copyright={Aditya Mahajan}]

\unprotect

%D The default mnemonics are not compatible with IEEE style.

\setuplabeltext [\s!en] [\v!january  :\s!mnem=Jan.]
\setuplabeltext [\s!en] [\v!february :\s!mnem=Feb.]
\setuplabeltext [\s!en] [\v!march    :\s!mnem=Mar.]
\setuplabeltext [\s!en] [\v!april    :\s!mnem=Apr.]
\setuplabeltext [\s!en] [\v!may      :\s!mnem=May]
\setuplabeltext [\s!en] [\v!june     :\s!mnem=Jun.]
\setuplabeltext [\s!en] [\v!july     :\s!mnem=Jul.]
\setuplabeltext [\s!en] [\v!august   :\s!mnem=Aug.]
\setuplabeltext [\s!en] [\v!september:\s!mnem=Sep.]
\setuplabeltext [\s!en] [\v!october  :\s!mnem=Oct.]
\setuplabeltext [\s!en] [\v!november :\s!mnem=Nov.]
\setuplabeltext [\s!en] [\v!december :\s!mnem=Dec.]

\setupbibtex          [sort=author]
\setuppublicationlist [maybeyear=off]

\setuplistalternative
  [ieee]
  [\c!distance=1em,
      \c!width=2em,
    \c!stretch=0em,
    \c!command=,
  ]

\setuppublicationlist 
  [\c!numbercommand=\!!ieee@brackets,
           \c!width=2em,
     \c!alternative=ieee,
      \c!samplesize={99},
  ]


%D This should probably go into the core.

\def\doverysimplebibnumref#1#2%
   {\refsep
    \ifcase#1\relax \unknownreference{#1}\else
      \def\tempa{#2}\ifx\empty\tempa#1\else#1\docommaordash{#1}{#2}#2\fi
    \fi}%

\def\docommaordash#1#2%
   {\doifelse{\the\numexpr#1+1-#2\relax}{0}%
     {\bibalternative\c!pubsep}%
     {\bibalternative\c!inbetween}}%

\setupcite
       [author,year]
       [\c!andtext={ and },
        \c!otherstext={ et al.},
        \c!pubsep={, },
        \c!lastpubsep={ and },
        \c!compress=\v!no,
        \c!inbetween={ },
        \c!left={(},
        \c!right={)}]

\setupcite
       [authoryear]
       [\c!andtext={ and },
        \c!otherstext={ et al.},
        \c!pubsep={, },
        \c!lastpubsep={ and },
        \c!compress=\v!no,
        \c!inbetween={ },
        \c!left={(},
        \c!right={)}]

\setupcite
       [authoryears]
       [\c!andtext={ and },
        \c!otherstext={ et al.},
        \c!pubsep={, },
        \c!lastpubsep={ and },
        \c!compress=\v!no,
        \c!inbetween={, },
        \c!left={(},
        \c!right={)}]

\setupcite
       [key,serial,authornum,page,short,type,doi,url]
       [\c!andtext={ and },
        \c!otherstext={ et al.},
        \c!pubsep={, },
        \c!lastpubsep={ and },
        \c!compress=\v!no,
        \c!inbetween={ },
        \c!left={[},
        \c!right={]}]

\setupcite
       [num]
       [\c!andtext={ and },
        \c!otherstext={ et al.},
        \c!pubsep={, },
        \c!lastpubsep={ and },
        \c!compress=\v!yes,
        \c!inbetween={]--[},
        \c!left={[},
        \c!right={]}]

%D This is the ugliest way to make sure that the number is right justified.
%D The trouble is that \filename{core-lst.tex} contains an explicit
%D \type|\hfill|.

\def\!!ieee@brackets#1%
  {\hbox \ifdim\!!widtha>\zeropoint to \!!widtha \fi
   {\hss[#1]\hskip 0.5em}}

\setuppublications
   [\c!sorttype=cite,
    \c!criterium=,
    \c!refcommand=num,
    \c!numbering=\v!yes,
    \c!numbercommand=\!!ieee@brackets,
    monthconversion=month:mnem]

\setuppublicationlist
   [\c!artauthor=\normalshortauthor,
    \c!editor=\normalshortauthor,
    \c!author=\normalshortauthor,
    \c!namesep={, },
    \c!lastnamesep={ and },
    \c!finalnamesep={, and },
    \c!firstnamesep={ },
    \c!juniorsep={ },
    \c!vonsep={ },
    \c!surnamesep={ },
    \c!authoretallimit=5,
    \c!editoretallimit=5,
    \c!artauthoretallimit=5,
    \c!authoretaldisplay=5,
    \c!editoretaldisplay=5,
    \c!artauthoretaldisplay=5,
    \c!authoretaltext={ et al.},
    \c!editoretaltext={ et al.},
    \c!artauthoretaltext={ et al.},
    artauthorcommand=\!!ieee@repeatedauthors,
    authorcommand=\!!ieee@repeatedauthors,
]

%D Just to be sure

\def\maybeyear#1{}
\def\etalchar#1{#1}

%D Show repeated authors by ------

\def\!!ieee@oldauthors{}

\def\!!ieee@repeatedauthors#1#2#3%
    {\xdef\!!ieee@newauthors{#3}%
      \ifx\!!ieee@oldauthors\!!ieee@newauthors
          ------%
       \else
         \dospecialbibinsert{#1}{#2}{#3}%
         \global\let\!!ieee@oldauthors\!!ieee@newauthors
       \fi}

\setuppublicationlayout[article]%
 {\insertartauthors {}                 {,} {\insertthekey{}{,}{}}%
  \insertarttitle   {\space\quotation\bgroup}
                                 {,\egroup} {}%
  \insertjournal    {\space\bgroup \it}
                        {\unskip\/\egroup} {}%
  \insertvolume     {,\space vol.~} 
        {\insertissue {,\space no.~} {} {}} {}%
  \insertpages      {,\space pp.\space}       {} {}%
  \insertpubyear    {,\space\insertmonth{}{\space}{}} 
                                         {} {}%
  \insertnote       {.\space}            {.} {.}}

%TODO. Add edition to book and inbook

\setuppublicationlayout[book]
 {\insertauthors    {}           {,} {\insertthekey{}{,}{}}%
  \inserttitle      {\space\bgroup\it}
                                 {\/\egroup} {}%
  \insertvolume     {,\space vol.~}  
           {\insertissue{,\space no.~}{}{}} {}%
  \insertseries     {,\space ser.\space} {} {}%
  \inserteditors    {,\space} {,\space Ed%
           \ifnum\getvalue{editor@num}>1 s\fi.\space} {}%
  \insertpubname    {,\space} 
                 {\insertcity{,\space}{}{}} {}%
  \insertpubyear    {,\space\insertmonth{}{,\space}{}}
                                         {} {}%
  \insertnote       {.\space}            {.} {.}}

\setuppublicationlayout[inbook]%
 {\insertauthors    {}           {,} {\insertthekey{}{,}{}}%
  \insertchapter    {\space\bgroup\it}
                                 {\/\egroup} {}%
  \inserttitle      {,\space in}          {} {}%
  \insertvolume     {,\space vol.~}  
           {\insertissue{,\space no.~}{}{}} {}%
  \insertseries     {,\space ser.\space} {} {}%
  \inserteditors    {,\space} {,\space Ed%
           \ifnum\getvalue{editor@num}>1 s\fi.\space} {}%
  \insertpubname    {,\space} 
                 {\insertcity{,\space}{}{}} {}%
  \insertpubyear    {,\space\insertmonth{}{,\space}{}}
                                         {} {}%
  \insertpages      {,\space pp.\space}  {} {}%
  \insertnote       {.\space}            {.} {.}}

% TODO. Booklet, manual

\setuppublicationlayout[incollection]%
 {\insertartauthors {}           {,} {\insertthekey{}{,}{}}%
  \insertarttitle   {\space\quotation\bgroup}
                                 {,\egroup} {}%
  \inserttitle      {\space in\space\bgroup\it} 
                                {\/\egroup} {}%
  \insertseries     {,\space ser.\space} {} {}%
  \inserteditors    {,\space} {,\space Ed%
           \ifnum\getvalue{editor@num}>1 s\fi.\space} {}%
  \insertpubyear    {,\space\insertmonth{}{,\space}{}}
                                         {} {}%
  \insertpublisher  {,\space}            {} {}%
  \insertcity       {,\space}            {} {}%
  \insertpages      {,\space pp.\space}       {}  {}%
  \insertnote       {.\space}           {.} {.}}


\setuppublicationlayout[conference]%
 {\insertauthors    {}           {,} {\insertthekey{}{,}{}}%
  \insertarttitle   {\space\quotation\bgroup}
                                 {,\egroup} {}%
  \inserttitle      {\space in \bgroup \it}
                        {\unskip\/\egroup}  {}% 
  \insertseries     {,\space ser.\space} {} {}%
  \inserteditors    {,\space} {,\space Ed%
           \ifnum\getvalue{editor@num}>1 s\fi.\space} {}%
  \insertvolume     {,\space vol.~}  
           {\insertissue{,\space no.~}{}{}} {}%
  \insertpubyear    {,\space\insertmonth{}{,\space}{}}
                                         {} {}%
  \insertcity       {,\space}            {} {}%
  \insertpages      {,\space pp.\space}       {} {}%
  \insertnote       {.\space}            {.} {.}}


\setuppublicationlayout[inproceedings]%
 {\insertauthors    {}           {,} {\insertthekey{}{,}{}}%
  \insertarttitle   {\space\quotation\bgroup}
                                 {,\egroup} {}%
  \inserttitle      {\space in \bgroup \it}
                        {\unskip\/\egroup}  {}%
  \insertseries     {,\space ser.\space} {} {}%
  \inserteditors    {,\space} {,\space Ed%
           \ifnum\getvalue{editor@num}>1 s\fi.\space} {}%
  \insertvolume     {,\space vol.~}  
           {\insertissue{,\space no.~}{}{}} {}%
  \insertpubyear    {,\space\insertmonth{}{,\space}{}}
                                         {} {}%
  \insertcity       {,\space}            {} {}%
  \insertpages      {,\space pp.\space}       {} {}%
  \insertnote       {.\space}            {.} {.}}

\setuppublicationlayout[proceedings]%
  {\inserteditors    {}           {,Ed%
           \ifnum\getvalue{editor@num}>1 s\fi.\space} {\insertthekey{}{,}{}}%
   \inserttitle      {\space\quotation\bgroup}
                                 {,\egroup} {}%
  \insertseries     {,\space ser.\space} {} {}%
  \insertvolume     {,\space vol.~}  
           {\insertissue{,\space no.~}{}{}} {}%
  \insertpubyear    {,\space\insertmonth{}{,\space}{}}
                                         {} {}%
  \insertcity       {,\space}            {} {}%
  \insertpages      {,\space pp.\space}       {} {}%
  \insertnote       {.\space}            {.} {.}}

\setuppublicationlayout[mastersthesis]%
  {\insertauthors    {}           {,} {\insertthekey{}{,}{}}%
   \inserttitle      {\space\quotation\bgroup}
                                 {,\egroup} {}%
   \inserttype       {\space}            {} { Master's Thesis}%
   \insertpubname    {,\space}           {} {}%
   \insertcity       {,\space}           {} {}%
   \insertpubyear    {,\space\insertmonth{}{,\space}{}}
                                         {} {}%
   \insertnote       {.\space}           {.} {.}}


\setuppublicationlayout[phdthesis]%
  {\insertauthors    {}           {,} {\insertthekey{}{,}{}}%
   \inserttitle      {\space\quotation\bgroup}
                                 {,\egroup} {}%
   \inserttype       {\space}            {} { Ph.D.\ Thesis}%
   \insertpubname    {,\space}           {} {}%
   \insertcity       {,\space}           {} {}%
   \insertpubyear    {,\space\insertmonth{}{,\space}{}}
                                         {} {}%
   \insertnote       {.\space}           {.} {.}}


\setuppublicationlayout[techreport]%
 {\insertauthors {}                 {,} {\insertthekey{}{,}{}}%
  \inserttitle   {\space\quotation\bgroup}
                                 {,\egroup} {}%
  \insertbibtype    {\space}           {\insertvolume{,\space}{}{},} {}%
  \insertpubname    {,\space} 
                 {\insertcity{,\space}{}{}} {}%
  \insertpubyear    {,\space\insertmonth{}{,\space}{}}
                                         {} {}%
  \insertnote       {.\space}            {.} {.}}

\setuppublicationlayout[misc]%
 {\insertauthors    {}           {,} {\insertthekey{}{,}{}}%
  \inserttitle   {\space\quotation\bgroup}
                                 {,\egroup} {}%
  \insertseries     {,\space ser.\space} {} {}%
  \insertpubyear    {,\space\insertmonth{}{,\space}{}}
                                         {} {}%
  \insertcity       {,\space}            {} {}%
  \insertpages      {,\space pp.\space}       {} {}%
  \insertnote       {.\space}            {.} {.}}

\setuppublicationlayout[unpublished]%
 {\insertauthors {}                 {,} {\insertthekey{}{,}{}}%
  \inserttitle   {\space\quotation\bgroup}
                                 {,\egroup} {}%
  \insertpubyear    {\space\insertmonth{}{\space}{}} 
                                         {.} {}%
  \insertnote       {\space}            {.} {.}}


\protect

[-- Attachment #3: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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:[~2011-01-28  2:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-26 15:10 Julius Canute
2011-01-28  1:57 ` Mojca Miklavec
2011-01-28  2:14   ` Aditya Mahajan [this message]

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=alpine.LNX.2.01.1101272109340.18710@ybpnyubfg.ybpnyqbznva \
    --to=adityam@umich.edu \
    --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).