1

I'm working at a bibliography with biblatex. I have to format my cite keys to match some requirements. My current problem is that I found no option to change the horizontal spacing/alignment of the keys. That's my current setup:

citations and keys

I want it to have the keys spaced equally so that the brackets align like this (but only in the bibliography itself):

Text with citation [CD] and this [OBB]

Bibliography:
[  CD ] Some text
[ OBB ] Some text

The important aspect here is the alignment of the brackets. How can this be done? And further, is there a way to center the keys within the brackets?

\documentclass{scrartcl}

\usepackage[backend=biber,style=alphabetic,maxbibnames=1,maxcitenames=1,defernumbers,%
    doi=false,isbn=false,clearlang=false,backref=false]{biblatex}
\DeclareFieldFormat{labelalpha}{\textsc{#1}}

\begin{filecontents}{bib.bib}
@ONLINE{text:source,
    author={B. Obby},
    title={Sources today},
    url={http://www.example.com},
    urldate={2017-02-20},}
@ONLINE{text:src,
    author={Cicero, Marcus Tullius and Doe, John},
    title={Sources tomorrow},
    url={http://www.example.com},
    urldate={2017-02-20},}
\end{filecontents}

\bibliography{bib}
\nocite{*}

\begin{document}

Text with citation and no extended spacing: \autocite{text:src}\\
Text witch citation and ordinary spacing: \autocite{text:source}

\printbibliography

\end{document}
3
\documentclass{scrartcl}

\usepackage[backend=biber,style=alphabetic,maxbibnames=1,maxcitenames=1,defernumbers,%
    doi=false,isbn=false,clearlang=false,backref=false]{biblatex}
\DeclareFieldFormat{labelalpha}{\textsc{#1}}


\addbibresource{biblatex-examples.bib}
\nocite{*}

\DeclareFieldFormat{labelalphawidth}{\mkbibbrackets{\hfill#1\hfill}}

\begin{document}

Text with citation and no extended spacing: \autocite{doody}\\
Text witch citation and ordinary spacing: \autocite{herrmann}

\printbibliography

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.