2

I'm using Peter Flynn's bookshelf document class to produce a pdf "bookshelf", consisting of graphic representations of book spines with titles from my .bib file.

I followed the docs, and during the final XeLaTeX runs encounter this error:

Package fontspec Info: Font family 'Arial(0)' created for font 'Arial' with
(fontspec)             options [BoldFont={},ItalicFont={},SmallCapsFont={}].
(fontspec)              
(fontspec)              This font family consists of the following NFSS
(fontspec)             series/shapes:
(fontspec)              
(fontspec)             - 'normal' (m/n) with NFSS spec.:
(fontspec)             <->"Arial/OT:script=latn;language=dflt;"
(fontspec)             - 'small caps'  (m/sc) with NFSS spec.: 



./fontsel/8.tex:2: LaTeX3 Error: Command '\SILmfont' already defined!

For immediate help type H <return>.
 ...                                              
                                                  
l.2 \def
        \SILmfontname{Arial}

Processing of my .bib file by the prepdata.sh script accompanying the documentclass produced, among other files, a subdirectory fontsel of my working directory containg files 1.tex, 2.tex, ..., 109.tex.

Each of those nnn.tex files includes a line of the form \def\SILmfontname{}.

What's wrong?

Here's the test.tex I'm using with my .bib file:

% !TEX TS-program = xelatex
% !TEX encoding = UTF-8 Unicode
% !BIB TS-program = biber
\documentclass[a0paper,landscape]{bookshelf}
\addbibresource{books.bib}
\begin{document}\raggedright
%%\immediate\write18{./prepdata.sh}
\input{entries.tex}
\nocite{*}
\par\vfill\clearpage
\printbibliography
\end{document}

This is the same as the distributed file except that I've used the name of my own .bib file and, per the docs, before the final two runs of xelatex uncommented the line \input{entries.tex} there.

I presume that any properly-formatted .bib file should do here, as for now I'd rather not share my own (which is for a book in preparation). But I'll post it if really needed.

11
  • I can't reproduce the issue.
    – egreg
    Sep 24, 2020 at 17:45
  • Thanks for posting this. You say: >> Each of those nnn.tex files includes a line of the form \def\SILmfontname{}. << That's correct. See the PDF documentation, section 1.2.3 on p.6, bottom. The reason for using \def is because that command changes every time one of the numbered files is executed. Whereabouts in your .bib file is this happening? Can you see from the log file if this is happening on the first entry to be processed, or the second, or which? Sep 24, 2020 at 19:45
  • @PeterFlynn: The first error occurs during the first of the final 2 XeLaTeX runs when it gets to the first entry to be processed (where it's trying to use .fontsel/108.tex, with the error there on the 2nd line \def\SILmfontname{Verdana}).
    – murray
    Sep 24, 2020 at 20:49
  • @PeterFlynn I can confirm this report. Note that the error is not caused by the \def line but by the repeated use of \newfontface with the same first argument.
    – Robert
    Sep 24, 2020 at 22:50
  • Thank you. As the fonts are assigned at random on each run, the same font may by chance reoccur or not reoccur in some runs. Sep 26, 2020 at 21:13

1 Answer 1

1

Enclosing the content of the \makebook macro in an additional group (braces) appears to fix the problem. Thanks to @Robert for the suggestion and @murray for the groundwork.

A new version will be released shortly.

1
  • A better idea would be to use \setfontface or \renewfontface instead of \newfontface which as the name implies is for a new font command. Sep 28, 2020 at 6:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .