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.

Alenanno
  • 37,338
  • 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 07 '16 at 19:16
  • @Fran Yes, but where? I've put it anywhere and the document doesn't render. – Red Banana Jan 07 '16 at 19:24
  • 1
    It seems that you really need to read some basic introductory documents. There is some good basic information here: http://dickimaw-books.com/latex/thesis/ or see the following for bibtex specifically: http://www.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 07 '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 07 '16 at 19:44
  • @Alenanno: biblatex can be really overwhelming, for a beginner –  Jan 07 '16 at 19:50
  • @ChristianHupfer I think biblatex only appears overwhelming because there is so much older information online. Basic use of biblatex really just involves getting biber to run in your IDE and choosing an appropriate style. And then if you do need changes, there are quite a few of us here who can help quite quickly with customization. – Alan Munn Jan 07 '16 at 19:54
  • @AlanMunn: IDE? I don't use an IDE ;-) –  Jan 07 '16 at 19:57
  • @ChristianHupfer I used natbib only for a short time, until it felt insufficient and switched to biblatex. Whatever I don't know, I search on here or the internet. :P – Alenanno Jan 07 '16 at 20:00

1 Answers1

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.

pseyfert
  • 237
  • 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 07 '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 07 '16 at 20:55