0

I'm trying to write my references as [Harp], instead of [1]. I've read the Bibliography Styles section on Wikibooks, but It's not clear what I should do.

8
  • 1
    In a document like \documentclass{article} \begin{document} \cite{IEEEexample:article_typical} \bibliographystyle{plain} \bibliography{IEEEexample} \end{document} change \bibliographystyle{plain} by \bibliographystyle{alpha}. That is all.
    – Fran
    Jan 7 '16 at 19:16
  • @Fran Yes, but where? I've put it anywhere and the document doesn't render.
    – Red Banana
    Jan 7 '16 at 19:24
  • 1
    It seems that you really need to read some basic introductory documents. There is some good basic information here: dickimaw-books.com/latex/thesis or see the following for bibtex specifically: math.utah.edu/faq/bibtex/bibtex.html. You may also want to consider starting with biblatex. On this see: biblatex for idiots
    – Alan Munn
    Jan 7 '16 at 19:25
  • If you still haven't settled with a particular bibliography package, I suggest biblatex because it's so versatile and customizable.
    – Alenanno
    Jan 7 '16 at 19:44
  • @Alenanno: biblatex can be really overwhelming, for a beginner
    – user31729
    Jan 7 '16 at 19:50
2

If you're using biblatex with bibtex, something like:

usepackage[backend=bibtex,sorting=anyt,style=alphabetic]{biblatex}

in the preamble (i.e. before \begin{document}, where you already have \usepackage[...]{biblatex}

If you're using bibtex, you should have somewhere in your document (i.e. after \begin{document})

\bibliography{<somefilename>}

specify the citation style just before:

\bibliographystyle{alpha}
\bibliography{dabib}

EDIT:

(cutting the original entry from the document server to get rid of greek letters, which are a matter on their own) mybib.bib:

@article{Aaij:2015tga,
  author         = "Aaij, Roel and others",
  title          = "{Observation of Letters}",
  collaboration  = "LHCb",
  journal        = "Phys. Rev. Lett.",
  volume         = "115",
  year           = "2015",
  pages          = "072001",
  doi            = "10.1103/PhysRevLett.115.072001",
  eprint         = "1507.03414",
  archivePrefix  = "arXiv",
  primaryClass   = "hep-ex",
  reportNumber   = "CERN-PH-EP-2015-153, LHCB-PAPER-2015-029",
  SLACcitation   = "%%CITATION = ARXIV:1507.03414;%%"
}

version 1: main.tex:

\documentclass{article}
\usepackage[sorting=anyt,style=alphabetic,backend=bibtex]{biblatex}
\bibliography{mybib}
\begin{document}
Here I cite \cite{Aaij:2015tga}.
\printbibliography
\end{document}

run with e.g. pdflatex main; bibtex main; pdflatex main; pdflatex main

version 2: main.tex

\documentclass{article}
\usepackage[sorting=anyt,style=alphabetic,backend=biber]{biblatex}
\bibliography{mybib}
\begin{document}
Here I cite \cite{Aaij:2015tga}.
\printbibliography
\end{document}

run with e.g. pdflatex main; biber main; pdflatex main; pdflatex main

version 3: main.tex

\documentclass{article}
\begin{document}
Here I cite \cite{Aaij:2015tga}.
\bibliographystyle{alpha}
\bibliography{mybib}
\end{document}

run with e.g. pdflatex main; bibtex main; pdflatex main; pdflatex main

I agree with the others that you should prefer the biblatex package over not using it (i.e. not version 3). As obvious from the initial version, I haven't migrated to biber myself, so cannot comment on its advantages.

I provided version 3 in case your document is not using biblatex so far and is too involved to migrate now.

2
  • 1
    Hi and welcome to TeX.sx. This answer kind of mixes up two systems since Bibtex is both a .bib file format and a program, and biblatex is a package. See bibtex vs. biber and biblatex vs. natbib. Also, so perhaps you want to specify minimal documents for each type, which would make the answer much clearer. Also, since biblatex increasingly relies on Biber as the backend, I would not recommend using bibtex as the backend for new users especially.
    – Alan Munn
    Jan 7 '16 at 20:00
  • +1 just one minor point: The \bibliography command in biblatex is deprecated (although still works) and should be replaced by \addbibresource{mybib.bib} (.bib extension required.)
    – Alan Munn
    Jan 7 '16 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.