# Writing a book on LyX

I've written seven books on LyX and thought it would be worth making a few notes about the experience. (I use the Book class but I expect most of this would apply to other classes too.)

These are my current settings for the preamble, with comments. I'm grateful to people on the LyX mailing list and other lists for many of these settings.

% Include index
\makeindex

% This line provides a latex command, "\blankpage", which I find useful to do what it says.
\newcommand{\blankpage}{\newpage \thispagestyle{empty} \mbox{} \newpage}

% Reduce hyphenation
\hyphenpenalty=100

% This allows strike-through (if you want it), using "\st{word}"
\usepackage{soul}

% To improve end alignment of lines:
\usepackage{microtype}
\tolerance 1414
\emergencystretch 1.5em
\hfuzz 0.3pt
\vfuzz \hfuzz

In one book I wanted little pictures and notes in the margins. I tried using the LyX command "/Insert/Marginal Note" but it didn't work well. Sometimes the notes appeared on the wrong side of the page and there were difficulties using images. I solved this by setting the marginnote package in the preamble and latex commands in the text:
\usepackage{marginnote}
\marginnote{\includegraphics{foo.png}}

NB. For details of some of these commands see the following links:
http://www.latex-community.org/forum/viewtopic.php?f=19&t=21170&p=70341
http://marc.info/?l=lyx-users&m=129071085416743

HOME | BACK