3

Do you have any advices how to costumize the citestyle (analog: bibstyle) in biblatex? Namely I want to replace e.g. alphabetic by myAlphabetic which results for

author = {Mihalas, Dimitri and Weibel Mihalas, Barbara}

not in [MW84] but in [Mih1984] or [Mih84].

Always use 3 starting letters of 1st author; if its name is shorter, e.g. Lu, it should be something like [Lu84].

Thanks a lot!

matheburg
  • 1,279

1 Answers1

6

You don't need a new style. The modification can be done by \DeclareLabelalpha. It is explained in the documentation at page 153ff and the definition is done in biblatex.def.

Related to your needs the following should work:

\documentclass{article}
\usepackage[style=alphabetic]{biblatex}
\addbibresource{biblatex-examples.bib}
\renewcommand*{\labelalphaothers}{}
\renewcommand*{\sortalphaothers}{}
\DeclareLabelalphaTemplate{
  \labelelement{
    \field[final]{shorthand}
    \field{label}
    \field[strwidth=3,strside=left,names=1]{labelname}
  }
  \labelelement{
    \field[strwidth=4,strside=right]{year}    
  }
}
\usepackage{filecontents}
\begin{filecontents}{short.bib}
@book{short,
 author = { Lu, LongLong },
 title = {Title of book},
 year=2013,
}
\end{filecontents}
\addbibresource{short.bib}

\begin{document}
\cite{companion,short}
\printbibliography
\end{document}

enter image description here

Marco Daniel
  • 95,681
  • After switching to another PC (also MikTex 2.9) your version is throwing errors: \labelelement, \DeclareLabelalphaTemplate, \field would be undefined control sequences. Do you have any ideas where this comes from? Without the redeclaration everything is fine... – matheburg Jun 19 '13 at 06:10
  • 1
    @matheburg: you need an update. The version of MikTeX doesn't represent the version of any package. – Marco Daniel Jun 19 '13 at 06:45
  • Thanks - I guess you are right... my version is from 5/2012. Unfortunately, it seems to be unavoidable to reinstall full miktex distribution (which is not allowed here). Trying to upgrade just the biblatex package gives me a number of version conflicts and in turn a number of errors... – matheburg Jun 19 '13 at 07:57
  • @matheburg: why is it unavoidable? Normally you can update all packages. – Marco Daniel Jun 19 '13 at 08:50
  • Which way you would prefer? Manually replacing the biblatex files by latest files from ctan and refreshing FNDB threw a bunch of errors and conflicts. On the other hand the package manager seems to be neither designed to update single packages nor it would be allowed to update in the case it would use its own connection to the server. Do you see different ways or did I miss something? Thanks again! – matheburg Jun 19 '13 at 09:36
  • I don't work with windows. Maybe this can help you http://tex.stackexchange.com/questions/108447/how-should-one-maintain-and-update-a-miktex-installation – Marco Daniel Jun 19 '13 at 15:18