[Tex/LaTex] Cite software/libraries using bibtex

bibtexciting

I would like to cite some sofware libraries I am using in a program using bibtex, but I can't quite figure out how to make that work properly. An entry might look like this:

@misc{CGAL,
  key   = "CGAL",
  title = "\textsc{Cgal}, {C}omputational {G}eometry {A}lgorithms {L}ibrary",
  note  = "http://www.cgal.org"
}

The problem is that @misc is not working optimally for me: Specifically the key (using \bibliographystyle{alpha}) is "CGA" instead of "CGAL", and I don't know how to fix that. Can I define my own style for citing software or can I at least change the key that is used for referencing?

Best Answer

You may want to load the natbib citation management package and use that package's \defcitealias macro to define, you guessed it, a "citation alias" of the form "CGAL". Then, use \citetalias{CGAL} instead of \cite{CGAL} to generate a citation call-out that uses the alias.

enter image description here

\RequirePackage{filecontents}
\begin{filecontents}{mybib.bib}
@misc{CGAL,
  key   = "CGAL",
  title = {{CGAL, Computational Geometry Algorithms Library}},
  note  = "\url{http://www.cgal.org}",
}
\end{filecontents}

\documentclass{article}
\usepackage{natbib}
\defcitealias{CGAL}{CGAL}
\bibliographystyle{alpha}

\usepackage{geometry}
\usepackage{url,hyperref}
\hypersetup{colorlinks,citecolor=blue,urlcolor=red} % just for this example

\begin{document}
\noindent
\cite{CGAL} or \citetalias{CGAL} or [\citetalias{CGAL}]

\bibliography{mybib}
\end{document}