[Tex/LaTex] How to customize citation and bibliography style

biblatexbibliographiesbibtexcitingnatbib

I would like my citations to look like this:

Unmitigated carbon emissions will lead to global warming of several degrees Celsius by 2100 [STOC13, p. 119].

(Four custom upper case letters (usually author's last name) and two year numbers)

while my bibliography shows:

[STOC13] Stocker T.; Qin D.: IPCC Climate Change 2013:
The Physical Science Basis. Cambridge University Press, 2013

(Using the same custom citation tag ([STOC13]) as first entry in the bibliography – you know – the one in the left column, plus: last names first, no use of 'and', no italic article titles……)

I have tried the makebst custom bib but to no avail and my current best bet is this:

sample

with

\documentclass[
,11pt
]{scrartcl}

\usepackage[
backend=bibtex
,citestyle=alphabetic
,bibstyle=alphabetic
]{biblatex}

\bibliography{testbibfile}

\begin{document}    

Unmitigated carbon emissions will lead to global warming of several
degrees Celsius by 2100 \citefield[119]{STOCKER}{[STOC13], }.

\printbibliography
\end{document}

and

@BOOK{STOCKER,
    author = {T. Stocker and D. Qin},
    title = {IPCC Climate Change 2013: The Physical Science Basis},
    year = {2013},
    publisher = {Cambridge University Press},
}

\citefield feels a bit like cheating. plus it makes my custom string bold which I didn't intend to do. also my custom citation obviously does not in the least transfer the left column in the bibliography.

So my question is: how can I completely customize my citation and bibliography style?

Thanks

Best Answer

With Biber you can fully customise the generation of the label for style=alphabetic.

The options are almost self-explanatory: With the load-time options minalphanames=1, maxalphanames=1 we make sure to only use one name for the label generation. strwidth=4 takes four letters counting from the left (strside=left) of the family name, converts them to all upper case (uppercase=true). noalphaothers=true ignores the fact that the label was truncated from a longer list and does not insert a marker to show this (as is usually done with \labelalphaothers, which would give "STOC+" here).

\documentclass{scrartcl}

\usepackage[backend=biber, style=alphabetic, minalphanames=1, maxalphanames=1]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@BOOK{STOCKER,
    author = {T. Stocker and D. Qin},
    title = {IPCC Climate Change 2013: The Physical Science Basis},
    year = {2013},
    publisher = {Cambridge University Press},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\DeclareLabelalphaTemplate{
  \labelelement{
    \field[final]{shorthand}
    \field{label}
    \field[strwidth=4,strside=left,uppercase=true,noalphaothers=true]{labelname}
  }
  \labelelement{
    \field[strwidth=2,strside=right]{year}
  }
}

\begin{document}    
Unmitigated carbon emissions will lead to global warming of several
degrees Celsius by 2100 \autocite[119]{STOCKER}.

\printbibliography
\end{document}

enter image description here

See Biblatex with Biber: Configuring my editor to avoid undefined citations for help on how to switch from BibTeX to Biber. See also bibtex vs. biber and biblatex vs. natbib.