1

I have the same problem with the vertical alignment of square brackets as described in this question. However, the only square brackets I have are the ones used for citations by the biblatex numeric style. Thus I think I don't need an automatic adjustment, but maybe only an adjustment of \printtext[brackets] from biblatex.

However, I have no good idea how to start and adjust the above command. Any ideas?

1 Answer 1

2

We can redefine only the brackets used by biblatex to change as follows

\setbox0=\hbox{0}
\newlength\htz\newlength\dpz
\htz=\ht0\relax
\dpz=\dp0\relax
\let\svlb[
\let\svrb]
\def\shftlb{\setbox0=\hbox{\svlb}\raisebox{%
  \dimexpr-.5\ht0+.5\htz+.5\dp0-.5\dpz}{\svlb}}
\def\shftrb{\setbox0=\hbox{\svrb}\raisebox{%
  \dimexpr-.5\ht0+.5\htz+.5\dp0-.5\dpz}{\svrb}}

\makeatletter
\renewcommand*{\bibleftbracket}{\blx@postpunct\shftlb}
\renewcommand*{\bibrightbracket}{\blx@postpunct\shftrb\midsentence}
\makeatother

The "new" brackets are \shftlb as drop-in for [ and \shftrb for ] in biblatex contexts.

MWE

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[
backend=biber,
style=numeric
]{biblatex}

\setbox0=\hbox{0}
\newlength\htz\newlength\dpz
\htz=\ht0\relax
\dpz=\dp0\relax
\let\svlb[
\let\svrb]
\def\shftlb{\setbox0=\hbox{\svlb}\raisebox{%
  \dimexpr-.5\ht0+.5\htz+.5\dp0-.5\dpz}{\svlb}}
\def\shftrb{\setbox0=\hbox{\svrb}\raisebox{%
  \dimexpr-.5\ht0+.5\htz+.5\dp0-.5\dpz}{\svrb}}

\makeatletter
\renewcommand*{\bibleftbracket}{\blx@postpunct\shftlb}
\renewcommand*{\bibrightbracket}{\blx@postpunct\shftrb\midsentence}
\makeatother

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson}
\printbibliography
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .