all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Nobis <snobis@gmx.de>
To: help-gnu-emacs@gnu.org
Subject: Re: changing from \cite{1} to \cite{MacRae,2002}
Date: Sat, 17 May 2014 11:10:48 +0200	[thread overview]
Message-ID: <m1zjig6a93.fsf@nobis-it.eu> (raw)
In-Reply-To: mailman.1498.1400264694.1147.help-gnu-emacs@gnu.org

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.

By the way: Maybe you should have a look at newsgroup comp.text.tex or
at http://tex.stackexchange.com/. There are questions about TeX/LaTeX
more appropriate.

Crosspost & Followup-To: comp.text.tex
-- 
Stefan.


  parent reply	other threads:[~2014-05-17  9:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1413.1400181010.1147.help-gnu-emacs@gnu.org>
2014-05-16  1:45 ` changing from \cite{1} to \cite{MacRae,2002} Emanuel Berg
2014-05-16 14:45   ` Sharon Kimble
2014-05-16 16:21     ` Rasmus
2014-05-16 18:24       ` Sharon Kimble
2014-05-16 18:35         ` Rasmus
2014-05-17  9:00           ` Sharon Kimble
2014-05-17 17:02             ` Rasmus
     [not found]       ` <mailman.1498.1400264694.1147.help-gnu-emacs@gnu.org>
2014-05-17  9:06         ` Stefan Nobis
2014-05-17  9:10         ` Stefan Nobis [this message]
2014-05-16 15:20   ` Alberto Luaces
     [not found]   ` <mailman.1480.1400253690.1147.help-gnu-emacs@gnu.org>
2014-05-16 17:40     ` Emanuel Berg
2014-05-16 20:10       ` Thien-Thi Nguyen
     [not found]       ` <mailman.1503.1400270762.1147.help-gnu-emacs@gnu.org>
2014-05-16 23:00         ` Emanuel Berg
     [not found]   ` <mailman.1474.1400251548.1147.help-gnu-emacs@gnu.org>
2014-05-16 17:50     ` Emanuel Berg
2014-05-15 19:09 Sharon Kimble
2014-05-16  7:38 ` Eric S Fraga
2014-05-16 14:40   ` Sharon Kimble

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=m1zjig6a93.fsf@nobis-it.eu \
    --to=snobis@gmx.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=stefan@familie-nobis.de \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.