Recently, I need to write letters. Get the formatting for addressee
and sender automatically done, I choose $\rm \LaTeX$. I cite a book
in my letter, and try to add a bibliography at the end of the letter.
Problem
During the compilation for the following letter, an error was thrown.
A failed $\rm \LaTeX$ letter (noltrbib.tex)download
\documentclass[12pt]{lettre}\usepackage{fontspec}\usepackage[frenchb]{babel}\usepackage[backend=biber]{biblatex}\addbibresource{ltrbib.bib}\usepackage{csquotes}\begin{document}\begin{letter}{ Nom de destinataire \\ 4, boulevard de la Paix, \\ 12345 Nom de ville
}\name{Votre NOM}\address{ Votre NOM\\ 23, rue à votre ville \\ 23456 Nom de votre ville
}\lieu{Votre ville}\telephone{01 02 03 04 05}\nofax\def\concname{Objet :~}\conc{Saisir votre objet}\opening{Madame, Monsieur,} Un exemple de citation dans un document $\rm\LaTeX$. \cite{serre} Le faux texte ci-dessous est généré par le plugin Lorem Ipsum pour
Vim.
% lorem{{{ Curabitur eget nisi at lectus placerat gravida. Vivamus nulla. Donec
luctus. Sed quis tellus. Quisque lobortis faucibus mi. Aenean vitae
risus ut arcu malesuada ornare. Maecenas.
Amet, rhoncus in, ipsum. Mauris rhoncus, lacus eu convallis sagittis,
quam magna placerat est, vitae imperdiet mauris arcu ac dui. In ac
urna non justo posuere mattis. Suspendisse egestas bibendum nulla. In
erat nunc, posuere sed, auctor quis, pulvinar quis, mi. Mauris at est.
Phasellus lacinia eros in arcu. Maecenas lobortis, tellus vel gravida
tincidunt, elit erat suscipit arcu, in varius erat risus vel magna.
Fusce nec ante quis dolor vestibulum bibendum. Pellentesque sit amet
urna.
% lorem}}}\closing{Veuillez d'agréer, Madame, Monsieur, mes salutations les
meilleures.}\printbibliography\end{letter}\end{document}
A sample Bib$\rm \LaTeX$ file (ltrbib.bib)download
123456789
@BOOK{serre,
author = {Serre, J. P.},
title = {Cours d'arithmétique},
publisher = {Presse Universitaire de France},
year = {1970},
edition = {1ère ed.},
address = {Paris, France},
pages = {103--106},
}
Here’s my compilation procedure.
$ xelatex noltrbib.tex
$ biber noltrbib
$ xelatex noltrbib.tex
This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian)
restricted \write18 enabled.
...
! Undefined control sequence.
\\blx@head@bibliography [#1]->\section
*{#1}\markboth {\MakeUppercase {#1}}{...
l.52 \end
{letter}
?
...
I type <Enter> at ?, and get a PDF that seems OK. You may
read the log file for this file to know more about this error.
However, each time I use $\rm \LaTeX$-Suite to compile the document
inside Vim, a quickfix window pops up. This is quite inconvenient: I
need to use <C-w>k to switch to the original buffer or ZQ to close
the quickfix window. Therefore, I am motivated to find out a solution
for this error.
Solution
Luckily, I find the thread
Environment thebibliography undefined when using letter in
$\rm \LaTeX$ Forum extremely useful. In my opinion, if one can
include inline code in a post in this forum, the file name
letterbib.sty and the command in the preamble can be shown in
monospaced font for readability.
A minimal working $\rm \LaTeX$ letter (ltrbib.tex)download
\documentclass[12pt]{lettre}\usepackage{fontspec}\usepackage[frenchb]{babel}\usepackage[backend=biber]{biblatex}\addbibresource{ltrbib.bib}\usepackage{csquotes}\usepackage{letterbib}\begin{document}\begin{letter}{ Nom de destinataire \\ 4, boulevard de la Paix, \\ 12345 Nom de ville
}\name{Votre NOM}\address{ Votre NOM\\ 23, rue à votre ville \\ 23456 Nom de votre ville
}\lieu{Votre ville}\telephone{01 02 03 04 05}\nofax\def\concname{Objet :~}\conc{Saisir votre objet}\opening{Madame, Monsieur,} Un exemple de citation dans un document $\rm\LaTeX$. \cite{serre} Le faux texte ci-dessous est généré par le plugin Lorem Ipsum pour
Vim.
% lorem{{{ Curabitur eget nisi at lectus placerat gravida. Vivamus nulla. Donec
luctus. Sed quis tellus. Quisque lobortis faucibus mi. Aenean vitae
risus ut arcu malesuada ornare. Maecenas.
Amet, rhoncus in, ipsum. Mauris rhoncus, lacus eu convallis sagittis,
quam magna placerat est, vitae imperdiet mauris arcu ac dui. In ac
urna non justo posuere mattis. Suspendisse egestas bibendum nulla. In
erat nunc, posuere sed, auctor quis, pulvinar quis, mi. Mauris at est.
Phasellus lacinia eros in arcu. Maecenas lobortis, tellus vel gravida
tincidunt, elit erat suscipit arcu, in varius erat risus vel magna.
Fusce nec ante quis dolor vestibulum bibendum. Pellentesque sit amet
urna.
% lorem}}}\closing{Veuillez d'agréer, Madame, Monsieur, mes salutations les
meilleures.}\printbibliography\end{letter}\end{document}
To install the above STY file, which isn’t found on CTAN, one needs
to manually download it to ~/texmf on *nix. (Search “~/texmf” for
the way to find “temxf” on Win*.) Searching “texmf
linux refresh”, I find the way for a
$\rm \TeX$ database update. I miss the first argument
in the command texhash ~/texmf, and then the installed STY file
can’t be found in ~/texmf/ls-R.