Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I customized the numeric style of biblatex, in order to reduce the \newblock commands for entry types of inproceedings. The next step is that long titles of inproceedings, which create a second line, should be indented, so that the second line starts aligned with the start of the title in the first line. The indentation is necessary (I think), because of the "In:" label in the first line.

So on the one hand I need to know the length of the "In:" label and on the other hand want to indent the second and following lines by this length.

Here is what I have:

enter image description here

And what I want:

enter image description here

Edit: I forgot to mention, that there are several different labels like "In:". For example "doi:" and "URL:". Furthermore, not all blocks, which have a second line should be indented. Instead only special chosen ones should. Sorry, that I forgot that.

share|improve this question
add comment

1 Answer

You could modify the definition of the list used by the bibliography bibenvironment and use \widthof (provided by the calc package) to calculate the necessary indentation.

\documentclass{article}

\usepackage[block=par]{biblatex}

\usepackage{calc}

\newlength{\longblockindent}
\setlength{\longblockindent}{\widthof{In:~}}

\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{%
    \printfield{prefixnumber}%
    \printfield{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \addtolength{\leftmargin}{\longblockindent}% NEW
      \setlength{\itemindent}{-\longblockindent}% NEW
      \setlength{\listparindent}{-\longblockindent}% NEW
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item}

\newcommand*{\sometext}{Lorem ipsum dolor sit amet, consectetuer
    adipiscing elit. Ut purus elit, vestibulum ut, placerat ac,
    adipiscing vitae, felis. Curabitur dictum gravida mauris. Nam arcu
    libero, nonummy eget, consectetuer id, vulputate a, magna.}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@inproceedings{A01,
  author = {Author, A.},
  editor = {Buthor, B.},
  year = {2001},
  title = {Alpha},
  booktitle = {\sometext},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography

\end{document}

enter image description here

share|improve this answer
    
This is a good start and now I understand the definition of the length in the bibliography environment a little bit more. Your solution indents every block, which have several lines. Another thing, that I did not mention, is that there are also other labels like doi and url. They have a different length. How to handle them separately? –  user18316 Sep 3 '12 at 15:08
    
@user18316 I'm afraid that changing the indentation in the middle of an entry is beyond my abilities. –  lockstep Sep 3 '12 at 15:39
    
The "funny" thing is, that it is the default behavior of the original natbib package. Unfortunately, I don't understand the tex programming language, so that I have no idea how to adapt the behavior of natbib to a custom biblatex style. –  user18316 Sep 3 '12 at 17:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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