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}
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}
You can use \unpacklipsum
:
\documentclass{article}
\usepackage{lipsum}
\newwrite\lipsum
\immediate\openout\lipsum=\jobname.txt
\unpacklipsum[1]
\immediate\write\lipsum{\lipsumexp}
\stop
The generated file will be
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. Donec vehicula augue eu neque. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris ut leo. Cras viverra metus rhoncus sem. Nulla et lectus vestibulum urna fringilla ultrices. Phasellus eu tellus sit amet tortor gravida placerat. Integer sapien est, iaculis in, pretium quis, viverra ac, nunc. Praesent eget sem vel leo ultrices bibendum. Aenean faucibus. Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Curabitur auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu, accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim rutrum.
Best Answer
One of the problems I had found with
lipsum
was that\lipsum
provides formatting for its paragraphs (\par
s, etc.). For a number of applications where you want to test a macro that manipulates plain text, it would be nice to be able to get lipsum text without the formatting.So I contacted the author, and he was gracious enough to provide me with the following code (
\singlelipsum{}
), which provides just the text of a singlelipsum
paragraph, without any paragraph formatting.Perhaps this would satisy your particular need, which was unstated in your question.
As noted in the comments to this answer, there is a
\lipsum*
macro (or alternately a[nopar]
package option) which will suppress the terminating\par
on lipsum paragraph outputs. HOWEVER,\lipsum*
and\singlelipsum
are not identical. Here is an MWE which shows it:As it is given, it compiles. But if you uncomment the second to last line, which is nominally similar to the third to last line, it breaks the code.