5

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.

  • 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}. – user31729 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 – user31729 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: tex.stackexchange.com/q/140787/35864 – moewe Mar 20 '18 at 19:44
11

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

| improve this answer | |
  • 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
  • 1
    I would replace the \addspace with \addnbspace, so that a label is not the last thing in a line. – MaxNoe Jul 4 '15 at 10:55

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.