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 am trying to adapt keys to my bibliography section, but Latex still generates its own ones.

My main file:

\documentclass[12pt,a4paper, abstract=on, fleqn]{scrreprt}
\usepackage{scrhack}
\usepackage[latin1]{inputenc}
\usepackage{cite}
\bibliographystyle{alpha}
\usepackage[justification=justified,singlelinecheck=false]{caption}
\usepackage[margin=2.5cm]{geometry}
\makeatletter

\begin{document}

This is a quote: 'bla bla!' from \cite{VDI2607}
\bibliography{literature} 
\bibliographystyle{plain}

\end{document}

literature.bib:

@Book{VDI2607,
author    = {Lamport, Leslie},
title     = {\LaTeX: A Document Preparation System},
year      = {1994},
isbn      = {0-021-52983-1},
publisher = {Addison\,\textendash\,Wesley},

}

I want the link to my source to appear exactly as I defined it in key (VDI2607), but Latex still displays it as [Ing00]

How can I solve this? I want to freely define a key!

share|improve this question
    
According to the bibtex manual key is used to generate a label when the author is not present. –  Guido Feb 18 '13 at 8:45
    
How can I define my own key even though an author is listed? –  bogus Feb 18 '13 at 8:47

1 Answer 1

up vote 3 down vote accepted

copy the file alpha.bst to myalpha.bst and modify the function output.bibitem to

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

for a test put the file myalpha.bst into your documents directory. Then you'll get the key as label:

\RequirePackage{filecontents}
\begin{filecontents}{myrefs.bib}

@Book{VDI2607,
    author    = {Lamport, Leslie},
    title     = {\LaTeX: A Document Preparation System},
    year      = {1994},
    isbn      = {0-021-52983-1},
    publisher = {Addison\,\textendash\,Wesley},
}
\end{filecontents}

\documentclass{scrreprt}

\usepackage{cite}

\begin{document}

This is a quote: 'bla bla!' from \cite{VDI2607}

\bibliographystyle{myalpha}
\bibliography{myrefs} 

\end{document}

enter image description here

share|improve this answer
    
Thanks, that's what I was looking for. Just one follow-up question: How can I turn the citation into a link, i.e. make it clickable? –  bogus Feb 18 '13 at 9:34
    
use package hyperref –  Herbert Feb 18 '13 at 9:43
    
How can the entry keys be ordered alphabetically in the reference list? –  bogus Mar 19 '13 at 22:44
    
the sorting is done by bibtex or biber –  Herbert Mar 20 '13 at 6:22
    
How can apply bibtex here? All my source entries are in a file \begin{filecontents}{myrefs.bib} ... \end{filecontents}, I am using \bibliography{literature} \bibliographystyle{myalpha} for my bibliography –  bogus Mar 20 '13 at 10:04

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.