TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Normally, I'm basically OK with BibTeX's choice of citation key (by which I mean, the short symbol it shows in the final document, like [2] or [Hil05], not the one one types in the tex file), but every once in a while there's a paper that cries out for a particular key (such as the paper of Freyd, Hoste, Lickorish, Millet, Ocneano and Yetter in which the HOMFLY polynomial is defined clearly should have the key [HOMFLY], not [FHL+95]), or BibTeX picks a particularly bad one.

In these cases, is there a field one can insert into the bibtex entry to override the key choice, or something one can do other than editing the .bbl file?

share|improve this question

Using biblatex, you may add the shorthand field:

\documentclass{article}

\usepackage[style=alphabetic]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
  shorthand = {Author},
  author = {Author, A.},
  year = {2001},
  title = {Alpha},
}
@misc{B02,
  author = {Buthor, B.},
  year = {2002},
  title = {Bravo},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography

\end{document}

enter image description here

share|improve this answer

If you use the natbib package, you can declare an "alias" or alternative citation for a source:

For example, the following .bib entry:

@techreport{caltrans2002,
    Author = {{California Department of Transportation}},
    Title = {{Humboldt Bay Bridges Seismic Substructure Retrofit Environmental  Assessment/Finding of No Significant Impact (EA/FONSI)}},
    Year = {2002}}

Produces the following output when \citep{caltrans2002} used in a document:


Example citation without alias.


Having a citation that spans most of a line can be pretty bothersome- especially when the full name has to appear in the bibliography but there is a nice shorthand that should be used when citing in the text. By including \usepackage{natbib} in your preamble, you have access to citation aliases:

\defcitealias{caltrans2002}{\scshape CalTrans, 2002}

Then using \citepalias{caltrans2002} instead of \citep{caltrans2002} produces the following output:


Example citation using an alias.


In both cases, the associated entry in the bibliography looks like this:


Example bibliography text.


The LaTeX and BibTeX source I used to create this example can be obtained from GitHub.

share|improve this answer

There's actually a pretty good answer over at Stack Overflow: Is there a way to override a bibtex style file for a particular entry?.

The fact that the programming language BibTeX style files (.bst) are written in is called BAFLL may alert you to the fact that this sort of problem is a pain to deal with.

share|improve this answer

Alternatively, you can modify your .bbl file by hand. You could even use sed to automatically make the desired change after each time you regenerate the .bbl file using BibTeX --- I can show you the details if you like (ask a new question?).

share|improve this answer
5  
Just edit the sed-fu into this answer. – Novelocrat Jul 27 '10 at 1:03
    
I don't see how this is possible; a bibtex produced .bbl file contains nothing at all about (shorthand) cite labels; see e.g. tex.stackexchange.com/questions/154215/… ... if you meant changes in the .bst, that is something else altogether. – sdaau Sep 5 '14 at 20:26

If you want to avoid using natbib and biblatex (sometimes I have compilation issues with these packages), you can simple use the abstract style, as it uses they bibtex keys as cite keys. This was pointed out by this answer.


Alternatively, this is also addressed by this alternative_answer, however it involves more steps:

1) download this style: http://ftp.math.utah.edu/pub/tex/bibtex/alpha.bst

2) place it in your project's directory, preferentially under a different name (e.g. keystyle.bst).

3) in the file, replace the output.bibitem entry to:

FUNCTION {output.bibitem}
{ newline$
  "\bibitem[" write$
   cite$ write$
%  label write$
  "]{" write$
  cite$ write$
  "}" write$
  newline$
  ""
  before.all 'output.state :=
}

This answer

share|improve this answer
1  
With biblatex you use no bst file. Can you add an MWE please (best!) or explain with own words how that should work? – Kurt Jan 30 at 14:18
    
I know that biblatex does not use bst file. The solution that I presented is for NOT using biblatex nor natbib. Maybe I should edit the answer to make it more clear. Do you wish a MWE for the proposed solution? – João Matos Jan 30 at 14:24
    
Sorry, I didn't saw that you commented. Write my username with a @ in front of to ping me. For answers it is best to add an MWE for a fast proof for the op and other readers. And with a compiling code one can see what is needed for a solution (often not mentioned packages or oprtions are important for a solution; in the MWE one can see them). – Kurt Jan 31 at 13:40

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.