Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have two problems with bibliography using ConTeXt ver: 2013.01.10 01:04 MKIV.

  1. I would like to get \citet like behaviour Author name [1]. However, presently the MWE produces only the numbers.

  2. Secondly, a list of publications is not being produced at all either \placepublications or \completepublications.

MWE

\setupbibtex[database={bib}]
%\setuppublications[alternative=]

\starttext
  I am refering to \cite{me13}.
  \placepublications[criterium=text]
\stoptext

bib.bib

@article{me13,
        title = {This bibliography in context},
        author = {Convert, Recent},
        journal = {Tex SX},
        volume = {1},
        number = {1},
        pages = {1-11},
        year = {2013},
}
share|improve this question
2  
The scheme Author [number] is not supported by default. But alternative=apa is quite close. It displays the author name(s) and the year. I get a list of publications with \placepublications[criterium=text] and with \completepublications[criterium=text] –  Marco Jan 14 '13 at 11:53
    
@Marco Did you get the list of publications for this MWE? The workflow is: context main.tex. As I understand it, I do not have to run bibtex. –  devendra Jan 14 '13 at 13:16
    
@Marco Issue resolved. However, could you point me a direction on how to go about writing a new bibliography style? –  devendra Jan 14 '13 at 13:27

1 Answer 1

up vote 5 down vote accepted

You need to change the refcommand to authornum, i.e.,

\setuppublications[alternative=num, refcommand=authornum]

A complete MWE:

\setupbibtex[database={bib}]
\setuppublications[alternative=num, refcommand=authornum]

\starttext
I am refering to \cite{me13}.

\placepublications[criterium=text]
\stoptext

gives

enter image description here

EDIT: There is a bug with authornum due to which it does not work when the citation contains more than three authors. Here is a bug fix.

\setupbibtex[database={bib}]
\setuppublications[alternative=num, refcommand=authornum]

\unprotected\def\dobibauthornumref#1%
 {\bibinsertrefsep
  \doifbibreferencefoundelse{#1}
    {\begingroup
     \cite[left=,right=,alternative=author][#1]%
     \bibalternative\c!inbetween
     \cite[num][#1]%
     \endgroup}
    {}}

\starttext
\startTEXpage[offset=3mm]
I am refering to \cite[me13]. I can also refer to \cite[me13a,me13b].

\placepublications[criterium=text]
\stopTEXpage
\stoptext

where the bib.bib file is

@article{me13,
        title = {This bibliography in context},
        author = {Convert, Recent and User, Latex and Guru, Old},
        journal = {Tex SX},
        volume = {1},
        number = {1},
        pages = {1-11},
        year = {2013},
}

@article{me13a,
        title = {This bibliography in context},
        author = {Convert, Recent and Guru, Old},
        journal = {Tex SX},
        volume = {1},
        number = {2},
        pages = {12-16},
        year = {2013},
}

@article{me13b,
        title = {This bibliography in context},
        author = {Convert, Recent},
        journal = {Tex SX},
        volume = {1},
        number = {3},
        pages = {17-32},
        year = {2013},
}

which gives

enter image description here

share|improve this answer
    
If you add two more authors to the example, then et al. should be added in the citation. But it only gives Convert, [1]. –  devendra Jan 14 '13 at 13:45
    
I thought that the solution would involve some use of \setupcite. –  devendra Jan 14 '13 at 17:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.