5

I know the lorem ipsum, lipsum, blindtext and other packages for generating nonsense text in a LaTeX document. I also know there are a lot of alternatives.

And I know you can use \nocite{*} to just cite all your references to generate a bibliography. But I may not have a bibliography yet/no entries in there.

But is there actually a way to generate a (nonsense/“fake”) bibliography e.g. in the style of lorem ipsum, i.e. with “dummy text”? Possibly even the lorem ipsum text in the document randomly citing these entries of the bibliography?

Use case: This may be useful e.g. for demonstrating problems on Stackexchange Tex or in bug reports that involves the bibliography.

It does not have to be fancy. It should just be somewhat realistic, i.e. include some common fields (date, URL, title), maybe different bibliography entry types etc. The text and dates etc. might be totally random and do not have to make any sense whatsoever. (Except of being in a valid format/have the correct type, i.e. no 2020-01-42 as a date, of course.)

2
  • 5
    there are several fake example bibliographies you can use in texlive, even if they don't have lipsum text, eg you can use \addbibresource{biblatex-examples.bib} with biblatex – David Carlisle Jun 16 '20 at 10:38
  • While interesting, this suggestion does not cover many bibliography questions where the user-specific contents of the bibliography items is important (why are uppercase characters/accented characters not printed, why is the sort order wrong, where do I put an url, etc) or are about problems with the procedure (the bibliography does not appear, there is an error with a specific citation), or in another way would benefit from actually seeing the contents of the .bib file which has the problem that a predefined .bib file may be hard to find and open in an editor. – Marijn Jun 16 '20 at 11:54
9

For biblatex the first choice is most definitely biblatex-examples.bib, which David Carlisle already pointed out in the comments. The file is installed in a place where both BibTeX and Biber can find it and comes bundled with biblatex, so is usable without intervention on any system that runs biblatex (at least if biblatex is installed correctly).

biblatex-examples.bib contains a variety of entries demonstrating a wide range of standard biblatex features. For many common use cases there should be an entry in that file.

I generally try to avoid \nocite{*}ing the whole file since that results in about six pages of bibliography output that probably drowns out the point I am trying to make, so there are several entries like sigfridsson (@article), nussbaum, worman (@book), geer (@thesis), westfahl:space (@incollection) that I turn to quite often and know by heart already.

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

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

\addbibresource{biblatex-examples.bib}

\begin{document}
Lorem \autocite{sigfridsson}
ipsum \autocite{worman}
dolor \autocite{nussbaum}
sit \autocite{sigfridsson}
amet \autocite{geer}

\printbibliography
\end{document}

Example bib entries, e.g. "Sigfridsson, Emma and Ulf Ryde (1998). ‘Comparison of methods  for deriving atomic charges from the electrostatic potential and moments’. In: Journal of Computational Chemistry 19.4, pp. 377–395. doi: 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P."

Note that most entries in biblatex-examples.bib use date (instead of year even if the date consists only of a year) and journaltitle instead of journal. The file is therefore usually not that great of a resource for BibTeX styles.


For BibTeX there is xampl.bib, which comes with the standard BibTeX installation. I can't quite put my finger on the exact reasons, but somehow many entries from that file feel a bit clunky to me.


apacite comes with a very comprehensive apa5ex.bib.


As Marijn rightfully points out in the comments, sometimes a question really depends on some specific feature of your .bib entries, which pre-made example files might not have. In that case filecontents comes in extremely handy to make your example self-contained. (Recall that the default filecontents environment does not overwrite existing files. In newer versions one uses the optional keyword force or overwrite, i.e. \begin{filecontents}{\jobname.bib}, in older LaTeX versions one would load the filecontents package, i.e. \usepackage{filecontents}, to allow overwriting of existing files.)

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

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

\begin{filecontents}{\jobname.bib}
@book{appleby,
  author  = {Humphrey Appleby},
  title   = {On the Importance of the Civil Service},
  date    = {1980},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson,appleby}
\printbibliography
\end{document}

Appleby, Humphrey (1980). On the Importance of the Civil Service.

2

AFAIK, there are not something like a fake reference generator, but as stated by others, there are many bibliography databases examples (or that can be used for this purpose) in the distros. However, an example database is more or less suitable depending on the type of document that you are using. You have to find the right one for your purposes.

To know about that, the best is check the path to the database and if there are comments in the bib file or some associated documentation. For instance, if you search the path in Linux of some of these files:

$ locate comment.bib
/usr/local/texlive/2019/texmf-dist/bibtex/bib/jurabib/comment.bib

Show that come with jurabib package. To be sure:

$ cd /usr/local/texlive/2019/texmf-dist/bibtex/bib/jurabib/
$ head comment.bib 
%%
%% This is file `comment.bib',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% jurabib.dtx  (with options: `comment')
%% ----------------------------------------
%% Example BibTeX file for the documentation
%%         of the jurabib package v0.6

But if you see the complete comment.bib, you will notice that there are not usual references as @article, nor some common fields like journal or url, so definitively is not a good example database except for some legal documents. Runing texdoc jurabib will inform about its proper use, if you are interested in the use of @commented references.

Fortunately, many other databases have more common example references. For the shake of the completeness, in TeX Live 2019 I found the following, in alphabetic order:

IEEEabrv.bib
IEEEexample.bib
IEEEfull.bib
abntex2-options.bib
acompat.bib
amsj.bib
apssamp.bib
archaeologie-bibancient.bib
archaeologie-bibcorpora.bib
archaeologie-examples.bib
archaeologie-lstabbrv.bib
archaeologie-lstlocations.bib
archaeologie-lstpublishers.bib
attachfile.bib
biblatex-examples.bib
biblio.bib
book.bib
business.bib
cnltx.bib
comment.bib
epodd.bib
example-glossaries-acronym-desc.bib
example-glossaries-acronym.bib
example-glossaries-acronyms-lang.bib
example-glossaries-brief.bib
example-glossaries-childnoname.bib
example-glossaries-cite.bib
example-glossaries-images.bib
example-glossaries-long.bib
example-glossaries-multipar.bib
example-glossaries-parent.bib
example-glossaries-symbolnames.bib
example-glossaries-symbols.bib
example-glossaries-url.bib
example-glossaries-xr.bib
family.bib
font.bib
frankenstein.bib
glsbase.bib
harvard.bib
jbtest.bib
jbtesthu.bib
jourabbr.bib
jourfull.bib
litteratur.bib
lsc.bib
nostarch.bib
oberdiek-bundle.bib
oberdiek-source.bib
plbib.bib
printing-history.bib
report.bib
sample.bib
serif.bib
texbook1.bib
texbook2.bib
texbook3.bib
texgraph.bib
texjourn.bib
texnique.bib
tugboat.bib
type.bib
typeset.bib
xampl.bib

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.