1

Is it possible, using biblatex, to output the bibliography of a document as a standard itemized list that could then be copied and used in another document in a straightforward way? Thus, one would like to produce output that is something like, depending on the bib style,

\begin{description}
  \item Smith, J. and Jones, A., 2004. A theory of everything. \textit{J. All Results}, 24, 23--23.
  \item Another bib entry
\end{description}

The bbl files from biblatex are very convoluted (more so than when using bibtex) and don't lend themselves to extraction and use elsewhere. Thanks.

GeoffV
  • 834
  • 7
  • 20
  • Have you tried \defbibenvironment{bibliography}{\itemize}{\enditemize}{\item}? – Ingmar Dec 02 '21 at 10:24
  • @Ingmar Your suggestion does print out the bibliography as an itemised list. But I don't see any latex code that contains the bibliography in a simple list environment. The bbl file, for example, is still very long and complicated. – GeoffV Dec 02 '21 at 13:24
  • So what exactly are you trying to achieve? I thought you were looking for an itemized list in your output. You can always copy & paste from there. – Ingmar Dec 02 '21 at 13:39
  • I'm looking for the latex code itself that would provides the output in the form of an itemised list (e.g. as in my original question). I would then be able to copy that code into another document without all the machinery of bibfiles etc. It would make it easier to share, manually edit etc. – GeoffV Dec 02 '21 at 13:45

2 Answers2

3

This isn't really possible natively due to the way biblatex works. The .bbl file contains just LaTeX-readable entry data and not a printable bibliography (as it does with BibTeX). The entries are only processed more or less dynamically on the LaTeX side and this happens in dynamic and fundamentally unexpandable a way that does not allow for an easy extraction of 'printable code'.

The closest I can offer you is biblatex2bibitem. That package essentially adapts all field formats and related biblatex commands so that they print as paste-able LaTeX code in the PDF. (There may be some rough edges where you have to manually fix some things.)

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=numeric, backend=biber]{biblatex} \usepackage{biblatex2bibitem}

\addbibresource{biblatex-examples.bib}

\begin{document} \autocite{sigfridsson,worman,geer}

\printbibitembibliography \end{document}

\begin{thebibliography}{99}
{}
\bibitem{geer}
Ingrid de Geer. ‘Earl, Saint, Bishop, Skald~– and Music. The {Orkney
Earldom} of the Twelfth Century. {A} Musicological Study’. PhD thesis.
Uppsala: Uppsala Universitet, 1985.
{}
\bibitem{sigfridsson}
Emma Sigfridsson and Ulf Ryde. ‘Comparison of methods for deriving
atomic charges from the electrostatic potential and moments’. In:
\emph{Journal of Computational Chemistry} 19.4 (1998), pp. 377–395.
\textsc{doi}: \nolinkurl
{10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P}.
{}
\bibitem{worman}
Nancy Worman. \emph{The Cast of Character. Style in {Greek}
Literature}. Austin: University of Texas Press, 2002.
\end{thebibliography}

moewe
  • 175,683
  • Well, that is not the kind of solution that I had expected! But it works well enough, and thanks for the explanation. – GeoffV Dec 04 '21 at 09:00
  • The answers to question also have some relevant information:

    link
    It would be nice if the package wrote the generated bibliography to a separate text file, but evidently this is not possible at the moment? I suppose it is easy enough to convert a PDF to plain text, or just select it with the mouse and copy it.

    – GeoffV Dec 04 '21 at 10:53
  • @GeoffV Is distributing the .bib file an option? – Cicada Dec 07 '21 at 06:42
0

The bibliography is already a list (so pastes into a text file OK, say).

To produce output that will run as code, output the commands as text so they can be picked up when copying.

the bib copied

Similarly for HTML code, etc.

MWE

\begin{filecontents*}[overwrite]{\jobname.bib}
 @misc{test,  
    author={AuthorB},
    date={1921},
    title = {Test Title},  
    howpublished = {\url{https://test.com}},  
    journal={ABC Journal}  ,
    }
 @misc{test2,  
    author={Author},
    date={2021},
    title = {Test Title2},  
    howpublished = {\url{https://test.com}},  
    journal={ABC Journal}  ,
}

\end{filecontents*}

\documentclass{article}
\usepackage[style=authoryear]{biblatex}
\addbibresource{\jobname.bib} \AtEveryBibitem{\textbackslash item[]} \defbibnote{mystartlistcode}{\textbackslash begin{itemize}} \defbibnote{myendlistcode}{\textbackslash end{itemize}} \begin{document}
\cite{test}; \cite{test2}.

\printbibliography[ prenote={mystartlistcode}, postnote={myendlistcode}, title={Copyable List}, ]

\bigskip Copied list:

\begin{itemize} \item[]Author (2021). Test Title2. https://test.com. \item[]AuthorB (1921). Test Title. https://test.com. \end{itemize} \end{document}

Cicada
  • 10,129