Skip to content

Writing a book on LyX

I've written six books on LyX previously but the last one was a few years ago. I've just done another and thought it would be worth making a few notes about the experience. I found that I'd forgotten how to do some things while others now work better than previously. Here are the main points. (I was using the Book class but I expect most of this would apply to other classes too.)

1. Settings
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

% Next line provides a latex command "\blankpage"
\newcommand{\blankpage}{\newpage \thispagestyle{empty} \mbox{} \newpage }

% Next line allows margin notes (see below for details of this)
\usepackage{marginnote}

% Reduce hyphenation
\hyphenpenalty=100

% next line for strike-through (if you want this) - use latex command "\st{word}"
\usepackage{soul}

% To improve end alignment of lines (see the next two links for details)
% http://www.latex-community.org/forum/viewtopic.php?f=19&t=21170&p=70341
% http://marc.info/?l=lyx-users&m=129071085416743
\usepackage{microtype}
\tolerance 1414
\hbadness 1414
\emergencystretch 1.5em
\hfuzz 0.3pt
\vfuzz \hfuzz


2. Margin notes
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 using the marginnote package and the following Latex entries in the text:
\marginnote{\includegraphics{foo.png}}


3. Notes

Index errors
When making the index I occasionally found that it wasn't appearing in the pdf. It took me some time to find out why. It happened because I'd accidentally made a blank index entry, by selecting /Insert/Index entry without actually making any entry. It can take quite a long time to track these bogus entries down, by cutting sections of the text and testing.. It's best to keep remaking the pdf while you are inserting index entries to make errors easier to spot.

Resolution of images in gimp
In the past I've had difficulty getting the images in my books to apear at a sufficiently high resolution. They kept ending up at 72px whatever I did. I'm not sure if this was my fault for missing the obvious or if gimp has improved, but anyway, it's easy now in version 0.2.0. Simply click on Image/Scale Image and you can set the size and resolution to whatever you want.

Trackbacks

No Trackbacks

Comments

Display comments as Linear | Threaded

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
How many legs do snakes have?
Form options