6

I'd like the output of BibTeX or BibLaTeX to be a inline bibliography (with entries separated e.g. just with bullets, see example below) avoiding the common list-based format. This is needed for posters. Usually I just copy-paste and then adapt the whole bibliography, but that's painstaking and error-prone. Any ideas?

Here's some MWE:

\documentclass{article}
\usepackage[
    natbib=true,
    style=numeric,
    backend=biber,
    ]{biblatex}
\addbibresource{references.bib}

\begin{filecontents}{references.bib}
@article{Smith:01,
  author = {Smith, John},
  year = {2001},
  title = {Article title},
  journal = {Journal title},
  volume = {13},
  pages = {1--2}
}
@book{Mueller:02,
  author = {M{\"u}ller, Hans},
  year = {2002},
  title = {Book title},
  publisher = {Publisher},
  address = {Address}
}
\end{filecontents}

\begin{document}    
\cite{Smith:01}, \cite{Mueller:02}   
\section*{``Flat'' bibliography}  
Hans M\"uller. \textit{Book title}. Address: Publisher, 2002. \raisebox{0.2ex}{$\bullet$} John Smith. ``Article title'' . In: Journal title 13 (2001), pp. 1--2.
\printbibliography 
\end{document}

enter image description here

Edit: Note that the "flat"/inline bibliography should also contain the numeric labels.

Timm
  • 899
  • Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Jun 14 '15 at 13:53
  • 3
    What's a "flat bibliography"? What's "the common list-based format"? This is the kind of question that would benefit from: (1) an image showing what you hope for; (2) at least some idea of (in biblatex terms) what bibliography style you require; and (3) some code to save people from needing to make assumptions that may be incorrect and/or uncalled for. – jon Jun 14 '15 at 14:43
  • @jon: I imagine that flat means inline, one short reference after another one? Actually, I wondered too –  Jun 14 '15 at 15:00
  • @jon: I've edited my question. Sorry for the terminology being ad hoc. biblatex defines bibliography styles with \list in \defbibenvironment{bibliography}. That's why I called it list-based. As for "flat", I'd be grateful to learn the proper biblatex term. I don't like "flat" very much either. – Timm Jun 14 '15 at 15:51
  • 1
    Related: https://tex.stackexchange.com/q/140787/35864 – moewe Mar 20 '18 at 19:44

1 Answers1

12

For the answer to your edited question see here (the old version with explanations is left below).

Our bibliography environment can be even more mundane now

\defbibenvironment{bibliography}
  {\noindent}
  {\unspace}
  {}

The work is now done by begentry which prints the label

\renewbibmacro*{begentry}{%
  \printtext[labelnumberwidth]{%
    \printfield{labelprefix}%
    \printfield{labelnumber}}%
  \setunit{\addspace}}

and \finentrypunct for the proper separation

\renewcommand*{\finentrypunct}{\addperiod\space}

There is no need for additional packages.

MWE

\documentclass{article}
\usepackage[
    natbib=true,
    style=numeric,
    backend=biber,
    ]{biblatex}
\addbibresource{biblatex-examples.bib}

\defbibenvironment{bibliography}
  {\noindent}
  {\unspace}
  {}

\renewbibmacro*{begentry}{%
  \printtext[labelnumberwidth]{%
    \printfield{labelprefix}%
    \printfield{labelnumber}}%
  \setunit{\addspace}}

\renewcommand*{\finentrypunct}{\addperiod\space}

\begin{document}    
\cite{geer}, \cite{worman}

\printbibliography
\end{document}

enter image description here


With \defbibenvironment we can define how the bibliography is set ourselves. See also the biblatex documentation §3.6.8 Bibliography Headings and Environments, p. 80 and §4.2.2 Bibliography Environments pp. 127-128.

In our case, paralist's inparaitem environment seems fit, so we go with

\defbibenvironment{bibliography}
  {\inparaitem}
  {\unspace\endinparaitem}
  {\item}

To make sure we don't get into trouble with the spacing at the end we redefine \finentrypunct

\renewcommand*{\finentrypunct}{\addperiod\quad}

of course, \renewcommand*{\finentrypunct}{\addperiod\space} is even more compact.

MWE

\documentclass{article}
\usepackage[
    natbib=true,
    style=numeric,
    backend=biber,
    ]{biblatex}
\usepackage{paralist}
\addbibresource{biblatex-examples.bib}

\defbibenvironment{bibliography}
  {\inparaitem}
  {\unspace\endinparaitem}
  {\item}

\renewcommand*{\finentrypunct}{\addperiod\quad}

\begin{document}    
\cite{geer}, \cite{worman}
\printbibliography 
\end{document}

enter image description here

moewe
  • 175,683
  • Unfortunately enumitem's itemize* environment did not like being used in \defbibenvironment, so I went with paralist in the above. – moewe Jun 14 '15 at 16:22
  • @Timm You could change the {\item} line to read {\item \cite{\thefield{entrykey}} } or better to {\item\space\printtext[labelnumberwidth]{\printfield{prefixnumber}\printfield{labelnumber}}\space}. – moewe Jun 14 '15 at 17:17
  • Thanks!! That's almost what I'm looking for. Two questions remain: how to add the numeric label and how to remove the first bullet? – Timm Jun 14 '15 at 17:18
  • You see, your image was slightly confusing me there, I will edit the question in a moment and find a more concise solution. – moewe Jun 14 '15 at 17:20
  • @Timm See the updated answer please, that seems to be the cleanest solution. – moewe Jun 14 '15 at 17:48
  • I was also trying with enumitems inline list but was not successfull, do you have any idea why that would not work, @moewe? – MaxNoe Jun 14 '15 at 18:26
  • @MaxNoe Not really, no. I suppose it has to do with the way itemize* and friends are defined in enumitem.sty that the normal approach does not work. But I cannot really find the reason for this. I was hoping someone might come along and explain it if I added this observation. – moewe Jun 14 '15 at 19:51
  • 1
    I would replace the \addspace with \addnbspace, so that a label is not the last thing in a line. – MaxNoe Jul 04 '15 at 10:55
  • @MaxNoe Fair point. Just for future reference, Max would replace \setunit{\addspace} in \renewbibmacro*{begentry} by \setunit{\addnbspace}. – moewe Jul 05 '15 at 11:31