[Tex/LaTex] How to add an APA-style citation with no author in ConTeXt

apa-stylebibliographiesbibtexcontextcontext-mkiv

I need to cite some articles which were created by some professional organizations, so no authors or editors are listed:

@Article{noname2012,
    author = {},
    title = {This is the title},
    publisher = {This is the publisher},
    year = {2012},
    address = {Miami}
}

I am using the APA style in ConTeXT, setup as follows:

\setupbibtex[database={Bibliography}, sort=author]
\setuppublications[alternative=apa]

Whenever I place a citation, \cite{noname2012} it displays like this:

(noname2012, 2012)

How can I the bibliography display the title instead of the name, when the name and editor fields are empty?

Best Answer

Here's a minimum working example. It's a slight compromise because it requires you to add the title to your .tex file.

\setupbibtex[database={Bibliography}, sort=author]
\setuppublications[alternative=apa]

\def\citeTitle{\dosingleempty\dociteTitle}
\def\dociteTitle[#1]#2{%
 \iffirstargument\cite[inbetween=,left={(#1,\ },right=)][#2]\else
 \cite[inbetween=,left=(,right=)][#2]\fi}

\starttext

The Bib\TeX\ file needs to have the nameless author as a nested pair of
empty braces.
\starttyping
@Article{noname2012,
    author = {{}},
    title = {This is the title},
    publisher = {This is the publisher},
    year = {2012},
    address = {Miami}
}
\stoptyping

Now, whenever I place a citation, \type{\cite{noname2012}} it displays like
this: \cite{noname2012} which is still unsatisfactory.  If I add an
optional argument and put the label in square brackets,

\type{\cite[inbetween=][noname2012]}

it displays like this: \cite[inbetween=][noname2012]. Still not quite
right, but I can add the title manually,

\type{\cite[inbetween=,left={(This is the title,\ }][noname2012]}

so that it displays like this:
\cite[inbetween=,left={(This is the title,\ }][noname2012].

With the user||defined command \type{\citeTitle}, it looks like this
\citeTitle{noname2012} or like this
\citeTitle[This is the title]{noname2012}

\stoptext
Related Question