help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing from \cite{1} to \cite{MacRae,2002}


From: Stefan Nobis
Subject: Re: changing from \cite{1} to \cite{MacRae,2002}
Date: Sat, 17 May 2014 11:06:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin)

Sharon Kimble <boudiccas@skimble.plus.com> writes:

> Thanks for this, using your "\usepackage" above, but which do I use
> for the bib database?

I think you misunderstand the cite command. When you type "\cite{foo}"
in your TeX source, the text inside the cite command (here: foo;
called the bibtex-key or cite-key) is just an arbitrary text that is
solely used to find the matching entry in the BIB-file and has nothing
to do with how the citation is formatted in the resulting document.

The cite-key is the first part in each entry in the BIB-file, so in
this example

> @Article{MacRae2002,
>   author = {MacRae K. Pattison J.},
>   title = {Home chemotherapy.},
>   journaltitle = {Nursing Times},
>   year = {2002},
>   key = {MacRae2002},
>   volume = {98},
>   number = {35},
>   pages = {34-35},
> }

the cite-key is MacRae2002. Besides the field key inside the entry is
a sort-key and has nothing to do with the cite-key to find this entry
and is solely used to sort this entry in the bibliography list (only
needed if you want to manually influence the sorting).

The presentation of the citation (what will be printed in the place of
"\cite{foo}") is controlled by the citation style (see biblatex
reference). So if you choose a numeric citation style, even \cite{foo}
will generate a number like "[123]", if you choose an author-year
citation style something like "First Author, 2014" will be generated
for \cite{foo}.

If you absolutley must use the cite-key in the generated document you
can achieve this with biblatex in the following way (see also
http://tex.stackexchange.com/questions/8428/use-bibtex-key-as-the-cite-key):

--8<---------------cut here---------------start------------->8---
\usepackage[style=alphabetic,sorting=debug]{biblatex}

\DeclareFieldFormat{labelalpha}{\thefield{entrykey}}
\DeclareFieldFormat{extraalpha}{}
--8<---------------cut here---------------end--------------->8---

The option "sorting=debug" sorts based on the cite-key (instead of the
default sorting sequence). The default citation style is set to
alphabetic, but the two DeclareFieldFormat commands change the
generated text, so that instead of something based on author and year
the pure cite-key will show up.

-- 
Stefan.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]