5

I'm using BibLaTeX for bibliography management with bibstyle=gost-numeric which is not that common, but the problem is the same with more common bibstyle=numeric. I want a list produced with \printbibliography to have following property: text of each list entry should appear with the specific (fixed) horizontal shift. I need this to align it with bibliography title.

At the current point it fails to aligh a little bit, as you can see here:

enter image description here

(I'm using custom parindent). Any ideas how to achieve this?

The MWE is as follows

\documentclass [fontsize=14pt, paper=a4, pagesize, DIV=calc] {scrartcl}

\usepackage[english,russian]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}

\usepackage{paratype}
\usepackage{indentfirst}

\usepackage{csquotes}
\usepackage[
  backend=biber,
  hyperref=auto,
  language=auto,
  citestyle=numeric,
  bibstyle=numeric,
]{biblatex}
\addbibresource{biblio.bib}

\newlength\MyIndent
\setlength\MyIndent{1.25cm}
\setlength{\parindent}{\MyIndent}
\addtokomafont{sectioning}{\hspace{\MyIndent}}

\begin{document}

\addsec{Заключение}
We hope you find write\LaTeX\ useful, and please let us know if you have any feedback using the help menu above.

Помните, что на все пункты списка литературы должны быть ссылки. \LaTeX\ просто не добавит информацию об издании из bib-файла, если на это издание нет ссылки в тексте.

Для дальнейшего изучения \LaTeX\ рекомендуем книгу Львовского~\autocite{Lvo2003}.%~\autocite{BrPi2005}

\printbibliography
\end{document}

biblio.bib:

@MVBOOK{Lvo2003,
  author = {Львовский, Сергей Михайлович},
  title = {Набор и вёрстка в системе \LaTeX},
  year = {2006},
  language = {russian},
  publisher = {МЦНМО},
  location = {М.},
  hyphenation = {russian},
  url = {http://www.mccme.ru/free-books/llang/newllang.pdf}
}
  • 1
    \RedeclareSectionCommand[indent={1.25cm}]{section} Doesn't solve the problem though. – Johannes_B Feb 13 '15 at 20:53
  • @Johannes_B great facility, didn't know about it, because I'm using a version of KOMA from my distr's (Ubuntu) repo, which is quite outdated. Though I'm working on a project which will be used by students who better stick to default packages from repos. – Artem Pelenitsyn Feb 14 '15 at 7:07
  • Doesn't my answer work for you? – karlkoeller Feb 14 '15 at 17:11
  • @karlkoeller sorry, I've just came back home from my work. I'll write you back as I check it. – Artem Pelenitsyn Feb 14 '15 at 17:24
9

You need to redefine the bibliography environment to achieve what you want.

So, add the following lines in your preamble

\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{%
    \printfield{prefixnumber}%
    \printfield{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\dimexpr1.25cm-\labelwidth\relax}% <----- default is \biblabelsep
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}

It works both with the numeric bibstyle and with the gost-numeric one, since both have the same original definition.

MWE (note that babel has to be loaded after fontenc)

\documentclass [fontsize=14pt, paper=a4, pagesize, DIV=calc] {scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[english,russian]{babel}

\usepackage{paratype}
\usepackage{indentfirst}

\usepackage{csquotes}
\usepackage[
  backend=biber,
  hyperref=auto,
  language=auto,
  citestyle=numeric,
  bibstyle=numeric,
]{biblatex}
\addbibresource{biblio.bib}

\newlength\MyIndent
\setlength\MyIndent{1.25cm}
\setlength{\parindent}{\MyIndent}
\addtokomafont{sectioning}{\hspace{\MyIndent}}

\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{%
    \printfield{prefixnumber}%
    \printfield{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\dimexpr1.25cm-\labelwidth\relax}% <----- default is \biblabelsep
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}

\begin{document}

\addsec{Заключение}
We hope you find write\LaTeX\ useful, and please let us know if you have any feedback using the help menu above.

Помните, что на все пункты списка литературы должны быть ссылки. \LaTeX\ просто не добавит информацию об издании из bib-файла, если на это издание нет ссылки в тексте.

Для дальнейшего изучения \LaTeX\ рекомендуем книгу Львовского~\autocite{Lvo2003}.%~\autocite{BrPi2005}

\printbibliography
\end{document} 

Output

enter image description here

  • 1
    @ArtemPelenitsyn you're welcome. – karlkoeller Feb 14 '15 at 18:34

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.