# How to create custom referencing style

For example I want to reference in the following way:

[FHK+2002] U. Fischer, M. Heinzler, R. Kilgus, F. Näher, S. Oesterle, H. Paetzold, W. Röhrer, A. Stephan, R. Winkow: Tabellenbuch Metall, Verlag Europa-Lehrmittel, 2002

[GHS2002] D. Gross, W. Hauger, W. Schnell: Technische Mechanik, Band2 Elastostatik, Springer-Verlag, Berlin, 2002

[MMWW2004] G. Merzinger, G. Mühlbach, D. Wille, T. Wirth: Formeln + Hilfen zur höheren Mathematik, Binomi Verlag, 2004

[QuSa2006] A. Quarteroni, F. Saleri: Wissenschaftliches Rechnen mit MATLAB, Springer-Verlag, Berlin, 2006

How do I do this in LaTeX? I tried using alpha and apa style it gives only the first author name. I do not want that way. Can someone help me out. I gave the examples above for multiple authors it takes first letters and single author first 4 letters in his name. Hoping for good answers...

• Are you OK with using biblatex? (Your question is tagged biblatex but you do not mention it and seem to have only tried BibTeX styles so far.) – moewe Apr 3 '14 at 13:44

biblatex's alphabetic style is very flexible when it comes to generating the label, which can be highly customised when using Biber; so in what follows we will have to use Biber.

The following seems to come very close to what you need.

You will have to load biblatex with the options style=alphabetic, maxnames=999, minalphanames=3, firstinits=true, backend=biber

\usepackage[style=alphabetic, maxnames=999, minalphanames=3, firstinits=true, backend=biber]{biblatex}


to use the alphabetic style with all names displayed in the bibliography, at least three names in the label (if available) and only initials.

The label format becomes

\DeclareLabelalphaTemplate{
\labelelement{
\field[final]{shorthand}
\field{label}
\field[strwidth=4,strside=left,ifnames=1]{labelname}
\field[strwidth=2,strside=left,ifnames=2]{labelname}
\field[strwidth=1,strside=left]{labelname}
}
\labelelement{
\field{year}
}
}


This will print the first four letters of a single name, the first two letters each of two names and the first letter of the last name if more names are present. The year will always be included in full.

\renewcommand*{\finalnamedelim}{\multinamedelim}


We also redefine the delimiters between names (no "and" or the like, just a simple comma for the last name in the list) and the punctuation between name and title in the bibliography as well as the order of publisher and location:

\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\printlist{location}%
\usebibmacro{date}%
\newunit}


MWE

\documentclass[ngerman]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{filecontents}
\usepackage{lmodern}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=alphabetic,maxnames=999,minalphanames=3,firstinits=true]{biblatex}
\usepackage{hyperref}
\begin{filecontents*}{\jobname.bib}
@book{tabmet,
author    = {Ulrich Fischer and Max Heinzler and Roland Kilgus and Friedrich Näher and Stefan Oesterle and Heinz Paetzold and Werner Röhrer and Andreas Stephan and Ralf Winkow},
title     = {Tabellenbuch Metall},
edition   = {42},
year      = {2002},
publisher = {Verlag Europa-Lehrmittel},
location  = {Haan-Gruiten},
}
@book{techmech:elast,
author    = {Walter Schnell and Dietmar Gross and Werner Hauger},
maintitle = {Technische Mechanik},
volume    = {2},
title     = {Elastostatik},
edition   = {4},
publisher = {Springer},
date      = {2002},
location  = {Berlin},
}
@book{fohi,
title     = {Formeln + Hilfen zur höheren Mathematik},
author    = {Gerhard Merziger and Günter Mühlbach and Detlef Wille and Thomas Wirth},
location  = {Springe},
publisher = {Binomi},
date      = {2004},
}
@book{matlab,
author      = {Alfio Quarteroni and Fausto Saleri},
title       = {Wissenschaftliches Rechnen mit MATLAB},
translator  = {Klaus Sapelza},
publisher   = {Springer},
date        = {2006},
location    = {Berlin},
}
\end{filecontents*}
\renewcommand*{\finalnamedelim}{\multinamedelim}

\DeclareLabelalphaTemplate{
\labelelement{
\field[final]{shorthand}
\field{label}
\field[strwidth=4,strside=left,ifnames=1]{labelname}
\field[strwidth=2,strside=left,ifnames=2]{labelname}
\field[strwidth=1,strside=left]{labelname}
}
\labelelement{
\field{year}
}
}

\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\printlist{location}%
\usebibmacro{date}%
\newunit}


• Is there any simple way to do this? other than using Biber? Because i am currently using texmaker. I don't actually know the process of using Biber + BibTex. Also have my bibliography files in separate .bib file. Bascically I am using the following template for my thesis: linkcode . I do not want to mess the whole Tex System by installing biber :( – walterhunk Apr 3 '14 at 18:41
• @user48432 Well, you can and should certainly use a .bib file (the filecontents stuff is just to make the example self-comtained). If you use your template, you will have to lose natbib (read What to do to switch to biblatex? and bibtex vs. biber and biblatex vs. natbib). Have also a look at biblatex for idiots. For biber in TeXmaker Biblatex with Biber: Configuring my editor to avoid undefined citations. – moewe Apr 3 '14 at 18:55
• @user48432 Plus, I actually think that this is the easiest way to get this kind of style. biblatex might be quite overwhelming at the start, but is quite flexible and customisable. – moewe Apr 3 '14 at 18:57