Escolar Documentos
Profissional Documentos
Cultura Documentos
John McDevitt
Introduction viii
3 Setting up LyX 12
Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Look & Feel . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Identity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
ii
Contents iii
Document Settings . . . . . . . . . . . . . . . . . . . . . . . . . 14
Document Classes . . . . . . . . . . . . . . . . . . . . . . 15
Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Text Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Page Layout . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Page Margins . . . . . . . . . . . . . . . . . . . . . . . . . 19
Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Numbering & TOC . . . . . . . . . . . . . . . . . . . . . . 19
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . 19
PDF Properties . . . . . . . . . . . . . . . . . . . . . . . . 20
Math Options . . . . . . . . . . . . . . . . . . . . . . . . . 20
Float Placement . . . . . . . . . . . . . . . . . . . . . . . . 20
Bullets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Branches . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
LAT
EX Preamble . . . . . . . . . . . . . . . . . . . . . . . . . 21
Document Settings Used for This Book . . . . . . . . . . . . . 21
4 LyX Environments 24
Paragraph Environment Pull-Down Box . . . . . . . . . . 25
Front Matter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Title Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Copyright Page . . . . . . . . . . . . . . . . . . . . . . . . 27
Dedication . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Table of Contents (TOC) . . . . . . . . . . . . . . . . . . . 28
Lists of Figures or Tables . . . . . . . . . . . . . . . . . . 28
Back Matter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Endnotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Headings: Structural Hierarchy . . . . . . . . . . . . . . . . . 31
Headings: Default Classes . . . . . . . . . . . . . . . . . 31
Extra Headings: KOMA-Script Classes . . . . . . . . . . 32
Contents iv
7 A Professional Cover 56
Assembling the Ingredients . . . . . . . . . . . . . . . . . . . . 56
Cooking the Meal . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Setting Up Your Page . . . . . . . . . . . . . . . . . . . . . 57
Create the Base Cover Object . . . . . . . . . . . . . . . 58
Contents v
Bibliography 85
List of Figures
vi
List of Tables
vii
Introduction
No more. The power of the PC and the Internet combine to wipe the
smile off the doubter’s faces and put the power of the press directly
into your hands. You don’t need to wait for a publisher to “choose”
your book as worthy of publication. You don’t need a “gatekeeper”
because you can publish your book yourself. It’s a lot easier than
you might have thought.
You won’t need to go out and buy expensive software. If you have
a reasonably current PC and are willing to install the key software
yourself, you’ll have the tools you need to publish your book on your
own. Well, not quite on your own because this book will be here to
guide you.
Think of this book as your laboratory. It’s the finished product that
shows you what can be done. As we go through the book together,
I’ll explain everything I did step-by-step. By the time you finish the
book, you’ll understand the how, the why and you’ll have the skills
you need to produce a professionally formatted bestseller on your
own.
viii
ix
You’ll discover the magic of LyX, how to set it up and how to get LyX
working for you. Good software should support your writing and
stay out of your way. LyX does just that.
We’ll get into graphics, how easy it is to include links within your
text, how much better your E-Book will be and how much your
readers will appreciate the extras. You’ll discover how to create a
professional looking cover. It’s not difficult at all and is the finishing
touch that says “professionally done.”
What of the alternatives? I’ll get into a few other options in Appendix
C. Let’s get started then.
1 Software: The Free Tools
Software Freedom
All of the software tools recommended here were used to create this
book. All have been released under the terms of the GNU General
Public License (GPL) and are freely available for download over an
Internet connection at no cost.
1
CHAPTER 1. SOFTWARE: THE FREE TOOLS 2
LyX, the document processor, will be the program you use for writing.
But LyX needs a TEX / LATEX, “backend” typesetting system to work
properly.
LyX is the main actor, your primary tool for both creating and
publishing your book. The other programs play an important but
supporting role. Don’t worry. LyX is easy to install. The LyX
installers will set up a complete LyX environment for you.
• Lyx Home Page
• Direct link to the Lyx download site
Other Helpers
These helper programs are icing on the cake. You don’t “need” them
but they will allow you to do some sophisticated manipulations of
your PDF files. With pdftk, you’ll have the ability to combine PDF
files, add attachments and much more. pdfjam2 includes pdfjoin, an
alternative method for joining PDF files. Both packages run from
the command line.
2 pdfjam is not available for the Windows operating systems
2 Planning Your Book
You must have a good title if you expect people to buy your book.
A good title attracts people to your book the way high curb appeal
welcomes house hunters to stop, knock on the door and ask to come
in for a look around. A good title arouses a reader’s curiosity and
invites them to pick up your book and take it to the cash register.
Informative
The title tells people searching the web for information what to
expect when they read your book – a promise of what’s to come.
More importantly, a good title helps them decide to buy your book
in the first place.
5
CHAPTER 2. PLANNING YOUR BOOK 6
Think like a person browsing the web for answers: How would nor-
mal people phrase their questions? Would you say embellishing your
nails or making your nails shine? More likely, you’d say something
like painting your nails. The closer your keyword phrases come to a
typical web query, the higher in the search engine list your title will
appear.
Precise
If you mean fingernails (or toenails) then say so. The average
carpenter probably won’t paint their nails, but you never know. Be
specific enough to avoid confusion. You’ll almost always get a better
ranking with a narrower search phrase.
Keyword modifiers help you sneak in under the radar of your com-
petitors. It’s true that the highest volume keywords are on the head
of the Internet dragon. It’s also true that’s where your competitors
are likely to be mining their keywords.
Sure, when you move out onto The Long Tail[1], results fall off,
but not as fast as you might think. And you’ll capture a different
audience. The Internet dragon has two ends. Why not target both?
Engaging
When the web search gets a list of hits, grab the reader’s attention
and make your title stand out from the crowd. Suppose a web surfer
posts a question like painting nails? Your title could be:
S.U.I.T.
Let’s put all this together with an easy to remember S.U.I.T. acronym. . .
Follow these guidelines and you’ll be sure your title "suits" your
goals.
Search
Take off your writer’s hat and think like a person searching the web
for information. Get into the mind of your intended audience of
readers. What phrases are they likely to use? SEO or search engine
optimization is critical for getting titles listed high on search lists.
Weave that vital keyword phrase into your title.
Unambiguous
Interesting
When people searching for info find your title, you want to tweak
their interest enough to stop and explore. An interesting title will:
People want books about timely, topical subjects. The best titles
stand the test of time and do not become obsolete.
Grammar? Wait — come back! I didn’t mean to scare you off like
that. This isn’t your stern English teacher talking. Grammar just
happens to have a few neat analogies for explaining how to craft an
effective Internet title.
It’s not too much of a stretch to describe an SEO title using the
same terminology. The subject of the title is the keyword phrase, the
predicate explains and completes the thought. The keyword phrase
CHAPTER 2. PLANNING YOUR BOOK 9
as the subject of the title should come first. The title’s predicate
assures a complete title that can stand on its own.
When a person searches the Internet using any of the search engines,
the search engine returns the results of the search in a search engine
results page (SERP). The first line of each hit, the blue text with
the embedded link, is the title and the first thing the person doing
the search sees. Google truncates titles that exceed 65 characters
CHAPTER 2. PLANNING YOUR BOOK 10
(or ten words). Keep your titles at or below this threshold and
the reader will see exactly what you intended. Long titles will be
incomplete, and may not even make sense to the searcher – not
good.
Title Challenge
What do you think of the two titles listed below? They’re illustrations
of how you might combine SEO with reader interest with an almost
complete thought. Almost, because you want your audience to buy
your book to discover the answers for themselves.
Crafting a good title isn’t easy. In fact, the best copywriters will
write dozens, even hundreds of headlines to find the right one. Play
a bit. Write a dozen titles of your own on the topic of title writing. I
think you’ll be pleasantly surprised.
You don’t need FreeMind to create your book. You could scribble
your notes on pieces of paper or index cards, keep track of your
research in a text file or you may already have a favorite outline
program. I suggest FreeMind because it works, it’s free and it’s
easy to learn. Brainstorming for good book titles is a great way to
get started.
CHAPTER 2. PLANNING YOUR BOOK 11
Brainstorming
When you create a new file, FreeMind places your cursor in the
center node. Enter your central idea here and press enter. All nodes
connecting to the center are child nodes. Press the insert key or
choose new child node from the insert menu to begin.
Organizing
This book was written using LyX. I’ll walk you though LyX and how
you can produce a professional looking book like this one easily, but
first let’s get your LyX preferences set up.
Preferences
When you fire up LyX for the first time, go to the Tools . Preferences
menu where you can tailor LyX to your liking from the Preferences
dialog. Accept most of the defaults. The settings you’ll want to look
12
CHAPTER 3. SETTING UP LyX 13
at and change are listed below. When in doubt, leave the default.
You can always come back later.
• User interface
Editing
• Control
Identity
Enter your name and email address. LyX uses the information you
enter here to identify you in the Track Changes feature when you
collaborate with others.
Document Settings
LyX uses LATEX ( pronounced La-tek) as it’s back end. The Intro-
duction available from the LyX help menu gives you the complete
story of how and why LATEX was developed. LATEX 2ε is the current
incarnation of a program that has been helping people produce
professionally typeset documents for 25 years, a quality that even
the best word processors can’t match.
No, you won’t need to worry about embedded commands, LyX takes
care of all of this for you. Go to Document . Settings. . . to bring up
the Document Settings Dialog and enter your document settings.
Then all you need worry about is your writing.
Document Classes
Document Classes extend LATEX with a set of macros that define new
document types. The standard types are:
You probably won’t need any of these special classes, but there is
a special KOMA-script class for articles, reports, books and letters
that are far more powerful than the standard classes. In fact, the
KOMA-script book class was used to prepare this book. I recommend
you try KOMA-script.
All you need to do to harness the power of a class is select the one
you need from the pull down menu.
Modules
Unless you need a special module (I didn’t) you can ignore this
option.
Fonts
Choose the fonts for your document from this dialog. You’ll be asked
to choose the default family from Roman (serif) fonts, san serif fonts,
and typewriter (fixed width) fonts. You also choose the base font
size (usually 10, 11 or 12 point). LyX uses the font families you
choose throughout the document and will increase or decrease the
size depending on the environment you are in at the time. Don’t
worry. Environments are easy to use, are the heart of LyX and will
be explained in great detail in chapter 4.
The fonts you’ll be using are type 1 fonts designed for Postscript
and PDF documents. These fonts are supplied with your TEX/ LATEX
installation and are not your system fonts. There are two types:
CHAPTER 3. SETTING UP LyX 17
Aa
I suggest you change your defaults from the older Computer Modern
bit mapped fonts to the newer Latin Modern (LM) fonts because
LM is a vector font that works well with PDF files. Latin Modern
prints beautifully, but I chose Bera Serif as my Roman font instead
of Latin Modern because Bera is larger and heavier. This makes
Bera a better font for on screen reading.
CHAPTER 3. SETTING UP LyX 18
Experiment a bit, LyX makes it easy. Simply click a few buttons and
in seconds all the fonts in your entire document have changed.
Text Layout
You also choose line spacing here. The default is single. I used
OneHalf because Bera is a larger and heavier font and 1.5 spacing
is easier to read. Page through a few books and pay attention to the
vertical spacing between each line. You’ll find that most will have
extra spacing. This is another global setting that can be changed in
a matter of seconds.
Page Layout
Choose the format from typical sizes like US letter, US legal, etc.
The default orientation is portrait and can be changed to landscape
on this screen.
This book uses fancy with a few special settings in the LATEX pream-
ble:
CHAPTER 3. SETTING UP LyX 19
\rhead{\thepage}
\lhead{\leftmark}
\cfoot{}
The first line puts the current page number flush right in the heading.
The second line puts the chapter flush left. The third line takes the
page number out of the footer.
Page Margins
The default page margins are designed for printed documents. The
KOMA-script classes calculate everything automatically based on
the font sizes and paper format for a truly professional look. You
might want to reduce the margins for an E-Book that’s designed for
on screen viewing. Table 3.2 on page 23 shows the margin settings
used for this book.
Language
You can skip this because the defaults will be set according to your
system settings.
This dialog (Figure 3.3 on page 22) has a pair of sliders for number-
ing and TOC, global settings that can be changed anytime.:
• Numbering: Move the slider to indicate how deep LyX should
number your Parts, Chapters, Sections, etc.
• TOC: This slider tells LyX which elements to include in the
table of contents.
Bibliography
PDF Properties
Math Options
Float Placement
Floats are the figures and tables you see in this document. This
dialog is a global setting that’s best left to the end. These figures
and tables are called floats because they will move depending on
where they fit best. You won’t know that until the end. Each float
has the identical dialog for setting individually.
Bullets
Leave the default unless you don’t like the looks of your bullets. You
can change the appearance of bullets at all levels.
Branches
See the LyX user guide for a detailed explanation. Branches allow
you to hide certain text from some users. For example, a teacher
may include the answers to a quiz in the branches so they can hide
it from students, yet activate and print out as needed.
CHAPTER 3. SETTING UP LyX 21
LATEX Preamble
This is a special field for entering special commands that load pack-
ages and instructions. Be careful here. The commands I suggest
have all been tested and work. I’ll explain more of what they do in
Appendix B on page 76.
• Figure 3.3 on the next page shows the TOC numbering and
depth settings
CHAPTER 3. SETTING UP LyX 22
Name Setting
Document Class book(KOMA-Script)
Fonts (Default Family) Roman
Fonts (Base Size) 10 pt
Fonts (Roman) Bera Serif
Text Layout Indentation
Text Layout One-half spacing
Page Layout 5.5 X 8.5
Page Layout Fancy Heading
Numbering Depth to Chapter
TOC Depth to Subsection
PDF Properties Use hyperref
PDF Properties No Frames
PDF Properties Color Links
PDF Properties Generate Bookmarks
PDF Properties See fig: 3.2 on page 21
All Other Settings Default
24
CHAPTER 4. LyX ENVIRONMENTS 25
The partial screen shot shows two views of the paragraph environ-
ment pull-down box at the far left end of the LyX toolbar (Figure 4.1).
The paragraph is the basic unit of composition. Choose from this
menu to tell LyX what kind of environment to use for each para-
graph.
Books are divided into front matter (preliminaries), text (the heart
of the book) and back matter (references). The environment menu
is arranged logically to mimic this typical book organization:
CHAPTER 4. LyX ENVIRONMENTS 26
• List
• Section
• Unnumbered
• Front Matter
• Back Matter
• Main Text
Front Matter
The front matter of a typical book contains the title, author, publisher,
copyright page, dedication, the table of contents (TOC) and lists of
figures & tables if there are any. LyX provides an environment for
each of these paragraph types. Follow along with me and I’ll show
you how I used each of these environments to create the structure
of this book.
Title Page
Title
Simply enter your title and choose Title from the environment menu.
LyX will format and display your title in a large font centered on
screen. If your title is longer than a single line, you can control how
it wraps by using Ctrl + Enter. When you’re satisfied press enter
and you’re finished. Easy.
Author
Enter your name (or names for multiple authors). Use Ctrl + Enter
to put multiple authors on separate lines. Press Enter and you’re
finished.
CHAPTER 4. LyX ENVIRONMENTS 27
Date
If you want a specific date on your title page, enter it here. If you
don’t enter a date here, LyX will default to today’s date. If you
prefer not to have a date on your title page, you must put this code
snippet in your LATEX preamble:
\date{}
Subject
LyX will place a subject paragraph at the top of your title page.
As of this writing, the newest version of KOMA-script has a new
environment for subtitles. Unfortunately it’s not available in the
Linux repositories so I used the Subject environment instead.
Publishers
Enter the publisher and any graphic you want here. LyX will put
this information at the bottom of the title page. We’ll cover graphics
in a later chapter.
Copyright Page
Once you have entered some text at the top of the copyright page,
you can put additional information at the bottom of the page, just in-
sert vertical fill (vfill) from the Insert . Formatting . Vertical space. . .
menu.
CHAPTER 4. LyX ENVIRONMENTS 28
Dedication
If you have figures or tables and want to list them in the front of
your book, you can add them from these main menu choices.
You must have the Table of Contents slider set to the Section depth
for your list entries to show up on either the Lists of Figures or Lists
of Tables pages.
Back Matter
Appendices
Endnotes
Bibliography
Glossary
Index
Refer to section 6.6 in the LyX User Guide for detailed help on such
subtopics as index grouping, page ranges, cross-referencing, index
order entry and index layout tweaks.
CHAPTER 4. LyX ENVIRONMENTS 31
You can select the type of heading you want either before you enter
your title or you can enter your title first. No need to highlight your
text. As long as the cursor is in the paragraph, LyX will understand.
Here’s a real time saver to use in the beginning when you’re setting
up the structure of your book. Enter all of your chapter titles
pressing enter after each one in turn. Then highlight the entire
group, select Chapter from the paragraph environment menu and
all of your chapters are done with a single keystroke. You can always
change, rearrange or add later.
Table 4.1: Headings for default article, book and report classes
The choice is yours. See page 19 for the numbering and TOC dialog
details. Just move the sliders and let LyX take care of managing the
details for you:
• Addpart
• Addchap
• Addsec
• Addchap*
• Addsec*
Addpart, Addchap and Addsec will add a new Part, Chapter or Sec-
tion. This is a very useful feature. Unlike the standard unnumbered
CHAPTER 4. LyX ENVIRONMENTS 33
In other words, Chapter* and Section* don’t clear the heading and
will show the heading of the previous chapter or section. Not good.
Addchap* and Addsec* avoid the problem by clearing the previous
chapter or section heading and showing a blank heading instead.
Labeling
You can nest lists. In fact, you can mix different list environments
this way if you like. The Increase depth and Decrease depth toolbar
buttons are a convenient way to change the nesting level. Please
refer to Help . User’s Guide for a detailed discussion of nesting.
Numbered Lists
Are called Enumerate in the menu. The labels on these lists are
either numbers or letters depending on the nesting depth. To illus-
trate, here are the four standard list environments presented in a
numbered list in the order they appear in the menu:
1. Itemize
2. Enumerate
a) As you can see here, this item is nested and LyX changes
the numbers to lower case letters in parentheses.
i. Each level changes the label to make your list / outline
easy to read and understand.
A. You can go four deep with your nesting
ii. Use the toolbar buttons to either increase or decrease
nesting depth
b) LyX keeps count for you while you’re in the Enumerate list
environment
CHAPTER 4. LyX ENVIRONMENTS 36
3. Description
4. Labeling
Itemized Lists
Labeling
Description
Poetry or Verse
You’ll find this environment listed as Verse in the Main text group on
the paragraph environment menu. LyX widens the left margin and
puts extra space between each stanza. You must use Crtl + Enter
for each new line and use Enter to create a new stanza. Here’s an
example:
Lover’s escape
Fine fabric woven, bound
Together and strong
Threads unraveled, free, unbound
Lost on the wind
If you need more space between stanzas, you can insert additional
vertical space by choosing Insert . Formatting . Vertical Space from
the main menu.
• Minisec
CHAPTER 4. LyX ENVIRONMENTS 39
• Captionabove
• Captionbelow
• Dictum
WYSIWYM
You’ve already seen how LyX departs from the usual WYSISYG
paradigm in the way you are able to set up your document, choose
your paragraph environments and let LyX worry about the type-
setting. WYSIWYM or What You See Is What You Mean takes the
paradigm a step further with the on screen display.
LyX uses the system fonts you choose when you set up your pref-
erences. The on screen fonts will use the same family you choose
for your printed output. For example, the KOMA-script class default
uses a serif font for your text but switches to a non serif font for
titles and headings. LyX mirrors this with on screen system fonts.
What you won’t see are margins, tab stops, pages, etc. LyX wraps
your text automatically at the right of the window. You have the
option of setting a zoom factor for better readability on screen.
LyX has an outline window that you can pop up on the left portion
of your screen that will show you your TOC, Lists of Tables, Labels
and References, Graphics, etc. Simply put your cursor anywhere on
the outline list, click with your mouse and you’ll go there instantly.
When you’re in the Table of Contents, you can easily change the
order of chapters, promote or demote any headings, etc.
5 Graphics = Punch + Clarity
41
CHAPTER 5. GRAPHICS = PUNCH + CLARITY 42
possible with bit mapped images. Vector graphics are the right
choice for drawings where lines matter. The sharpest text fonts are
rendered with vectors.
Scaling images
Most of the screen shots used in this book are in the neighborhood of
635 pixels wide. A full size image (using my monitor as an example)
would be 1280 x 1024 pixels. It’s easy to scale using Gimp. Load
your image, then select Image . Scale Image from the main menu.
Simply enter the desired width (Gimp will preserve the proportions),
click Scale and save.
CHAPTER 5. GRAPHICS = PUNCH + CLARITY 43
Cropping an image
Enhance photos
You can download Gimp plug-ins from the Gimp home page that can
save you a lot of work. I use two:
Watermark inserts your copyright or other text you want to use into
a photo or drawing to identify and give you some measure
of protection when you post an image on the web. The code
for this is included as an attachment to this book. Here’s an
example where I used Gimp to transform a photo to look like a
pen and ink drawing and put my copyright watermark in the
lower right corner.
CHAPTER 5. GRAPHICS = PUNCH + CLARITY 44
Frames are a series of new menu items that allow you to add mats
and/or virtual frames to an image. The author provides a good
tutorial, Creating Virtual Mats and Frames with The GIMP.
There is a link for the script you need included in the tutorial.
Original drawings
Alternatives to Gimp
If you don’t plan on using a lot of graphics or your needs are simple,
you can probably use a good photo manager (usually included with
your system) to scale and crop images instead. I use my gThumb
photo manager on occasion, but I prefer the power of Gimp.
Insert . Graphics
To add a graphic, select Insert . Graphics from the main menu brings
up the graphics dialog.
Insert . Table
Take a look at the table I created for the default headings on page 32.
It’s a good example of how you can pack a lot of information into a
small, easy to read space.
Floats
Floats are the way LATEX (and LyX) handles images and tables that
can’t be broken over a page break. Floats don’t have a fixed location
in the text. They can move forward or backward in your text to find
the best fit. This avoids large stretches of white space and gives
your document a more professional look.
It makes no sense to worry about the final position until your doc-
ument is finished because floats are processed when the output
document is processed. LATEX will move each float to the closest
location where the entire image will fit onto a single page and back
fill the empty space with text. You can fine tune the location of
any float by choosing Advanced Placement Options from the float
settings dialog when you’re ready.
Float figures and tables are numbered and captioned. They are
linked from the list of figures or tables in the front of your document
and can be cross referenced from any location within the docu-
ment to maintain context. Cross references are covered in detail in
chapter 6.
CHAPTER 5. GRAPHICS = PUNCH + CLARITY 49
While LyX will produce a PDF file that gives you truly professional
printed output, links can turbocharge your E-Book in ways no
printed document can ever hope to match. Links power the In-
ternet. In fact, the Internet is made up of and completely dependent
on links. And like the Internet, links can power your E-Book and
take the reading experience to levels unheard of in the print age.
A printed book is linear. The reader must page back and forth
looking for information. When a reader encounters a reference in
an E-Book, they can jump to the reference instantly with a single
mouse click and return to where they left off just as easily.
LyX excels at linked cross references, gives you and your reader
the power of a table of contents and other listings that link directly
to the text they reference, and straightforward ways to embed live
URLs and hyperlinks in your document.
Cross referencing is a two step process. Once you create a label for
any reference, you can use that label anywhere in your document to
create a linked cross reference. It’s easy.
Labels
Position the cursor on the text you want to reference, then select
Insert . Label from the menu or click on the Insert Label toolbar
50
CHAPTER 6. THE POWER OF LINKS 51
By the way. I used the Gimp to crop the image I included in Fig-
ure 6.1. I took a screen shot of the entire LyX screen, then cropped
to what I needed for my image. It only took me a minute. I also
inserted three cross references in this subsection.
Inserting Cross-References
Place the cursor in the location where you want a cross reference to
appear, then select Insert . Cross-Reference from the menu or click
on the Insert Cross-Reference toolbar button. Scroll through the
list of references shown in the pop up dialog (see Figure 6.2 on the
following page for an example), select the label to reference, choose
from one of the formats explained below and click OK.
You can tap the power of cross references by simply typing the name
(Figure, Chapter, Table, etc.) in front of the inserted reference.
CHAPTER 6. THE POWER OF LINKS 53
That’s what I did. It’s easier and gives you complete control of the
text.
Cross references are the way LyX keeps floats in context. For exam-
ple, if you are referencing a Figure and use <reference> on page <page>,
just type the word Figure followed by a space in front of the refer-
ence. LyX prints a different cross reference depending on where
the referenced float is located.
When you click on a figure reference in the PDF file, the cursor
jumps to the Label by default. This always bugged me because it
makes you scroll up in the document to show the image. I discovered
this code while digging around in the LyX manuals:
• \usepackage[figure]{hypcap}
If you put this line in your preamble, the referenced figure appears
at the top of the screen when you click the cross reference. It’s
simple and it works great. This will only work for figures. The
manual cautions against using it for tables.
Every entry in the Table of Contents (TOC), the List of Figures and
the List of Tables is dynamically linked to a page number, figure
number or table number. LyX handles these links automatically.
CHAPTER 6. THE POWER OF LINKS 54
Footnotes
Footnotes are incredibly easy with LyX. Just click the Insert Footnote
toolbar button or pick Insert . Footnote from the main menu and
enter the text for your footnote in the box that pops up at the cursor
location. The footnote box shows as a gray shaded “foot x” with
an expanding area to the right for your text. Click on the shaded
portion to show or hide your text.
Citations
Each citation is marked in the text (at the cursor position) with
the number of the bibliography entry and is enclosed in square
brackets. Each citation is linked so a click on the citation jumps to
the corresponding bibliography entry.
Hyperlinks
• Cover size = page size: If you haven’t chosen a final size for
your book, do it before you begin designing your cover.
• Cover graphics: Do you have an image you’d like to include
on your cover? Scale the image using your bitmap editor if
necessary. Make the image a little larger than you’ll need so
you can fine tune the size in Inkscape. The same width or
slightly smaller than your cover is a good starting point. An 8
1/2 X 11 letter size cover is 765 pixels wide.
• Final title: Or your final draft(s). You can play with font sizes
and titles while you work in Inkscape.
• Subtitle: Same deal with your subtitle. Have it or a few draft
ideas ready before you begin.
56
CHAPTER 7. A PROFESSIONAL COVER 57
Let’s fire up Inkscape and get that cover designed and exported as
a PDF file. When Inkscape loads you’ll see a blank window with a
page outlined in the center.
Page size
Leave Show page border checked so you can see your page on the
screen. If you like the default border shadow, leave Show border
shadow checked as well. It will show in your final cover. I left it
checked because I like it. I think it adds an extra dimension to a
cover.
Click on the Snap tab in the Document Properties window All you
need to do here is make sure that Enable snapping is checked.
The default Grid units are pixels, so you’ll need to change them.
Use the same units you used for your page size. Leave the X and Y
origins set at zero. Enter a number for X and Y spacing. Use the
same number for both so you get a square grid. Use a number that
will put each corner of your page on a grid intersection. Since this
book is 5.5 X 8.5, I used 0.5 inches.
Select Create rectangles and squares from the toolbar on the left
side of the screen (or press F4). Position your mouse on the upper
left corner of the page, press and hold the left mouse button and
drag the rectangle to the lower right corner of the page and let go.
Your cover will be the exact size of the page because the grid will
force the cursor to snap to the corners.
Go back to the toolbar and select the Select and transform objects
tool. It’s the arrow at the top. You can also press F1 to select this
tool.
It’s easy to add color to your cover. When you grabbed the arrow
tool, the cover object was selected automatically because it was the
last thing you worked on. Whenever an object is selected, you’ll
see arrows at the corners and four sides. Clicking anywhere on an
object with the arrow tool will select it.
Select Object . Fill and stroke from the main menu. This will bring
up the Color Dialog. The dialog should default to the Fill tab with
Flat color and the color wheel selected.
Play with the color wheel until you’re satisfied with the color. Leave
the blur setting at the default zero. Fine tune color tones with the
color wheel if you use the Opacity slider to fine tune color tones your
tones may not translate properly. Set the Opacity slider to 100%.
The easiest and fastest way to add an image to your cover is to pull
up your file browser in a separate window, select the graphics file
with your mouse and drop it onto the base cover.
CHAPTER 7. A PROFESSIONAL COVER 59
You’ll probably want to tweak the size of your image. Select Object .
Transform from the main menu (it’s near the bottom of the pop up).
This will bring up a new dialog where you can scale your image to
fit.
Click the Scale tab, check the Scale proportionally box and enter
the numbers for width. The default values are percentages, but you
can choose inches (or any other unit) if you like. Each time you click
the Apply button, you will see the changes on screen. When you’re
happy with the image size, dismiss the Transform window.
Select the arrow tool from the toolbar, click on the image and drag
it into position. If you want to eyeball your image without snapping
to the grid, just go to the main menu, select View . Snap to toggle
Snap off. For more precision, change the grid settings to a smaller
fraction from Document Properties.
Select the text tool from the toolbar on the left. The icon is an upper
case A. Position the cursor on the base cover and enter your text.
You can select the font and size from the window on the main menu
or once you begin typing, click on Text . Text and Font from the main
menu to pop up a floating window as shown in Figure 7.1 on the
next page.
Choose the Font Family, Style, Font size, Layout (default is centered)
and Line spacing from the Font tab in the window. Use the Text tab
to enter / edit your text in the text window. Click the apply button
when you’re finished.
CHAPTER 7. A PROFESSIONAL COVER 60
This window puts everything at your fingertips but you can just as
easily enter the text directly on the cover and choose fonts, etc.
from the toolbar at the top of the main window. Your choice.
Text is an object and can be manipulated easily with the arrow tool.
Select the arrow tool from the toolbar, click on the text and move it
around on the cover until you are satisfied. When any block of text
is selected, you can also pull up the Text and Font window to make
changes.
When you’re satisfied with your cover, use the Select and transform
objects tool (the arrow) to put a rectangle around the outside of the
entire cover. Select Object . Group from the main menu. This will
group the base cover, image and text objects as a single object. You
can always reverse this with ungroup.
Now go to the file menu, choose save as then scroll through the
file types and click on PDF. Save the file and you’re done. When
you quit, Inkscape will ask if you want to save the Inkscape (SVG)
CHAPTER 7. A PROFESSIONAL COVER 61
file. Say yes because you’ll need that file if you ever want to make
changes to your cover.
* pages=-
– LyX will show the cover in LyX by default. Uncheck the
Show in LyX box in LATEX and LyX options to turn this off.
That’s all you need to do. LyX takes care of the rest. Each time
you view or export to PDF, your cover will be included as the first
(unnumbered) page in the file.
Adding the cover in LyX is the simplest method and will preserve
your PDF index. However, it’s always a good idea to have fallback
alternatives. Choice is a good thing.
CHAPTER 7. A PROFESSIONAL COVER 62
• You can use either of the helper programs to join two or more
PDF files. See on page 4 for the download links. Run either
of these programs from the command line. For example type
pdftk –help for detailed instructions.
• http://www.mergepdf.net is a free online service that will merge
two or more PDF files. The service is quick and easy to use.
Follow the on screen instructions to upload your PDF files, then
simply download the merged document.
8 Putting it all Together
So far we’ve been talking about how to gather and set up the tools
you’ll need to write your book – how they tick and what they can do
for you. By now, you should have a basic understanding of how LyX
works and what’s possible. But the best teacher is doing. Yes, it’s
time to pull all of this technical stuff together, get busy and start
writing.
But first (there’s always something else to do) I’d like to share
some insights, explain how I put this book together and why I made
certain decisions so your journey might be a bit easier.
All books are structured. They begin on the first page and continue
to the last in sequence. A narrative story line only makes sense
when read in sequence. Other books, especially reference books,
are meant for page flipping. Some books need a detailed table
of contents while others are better without one. Words alone are
sufficient for many books, but others benefit from illustrations and
examples that help the reader’s understanding. A book’s structure
should suit the topic. This book is highly structured for a few good
reasons:
• Sequence is important. Understanding depends on lessons
introduced in progression.
• It’s much easier for a reader to understand the operation of
unfamiliar software and concepts when the words are supple-
mented with images to illustrate those concepts.
63
CHAPTER 8. PUTTING IT ALL TOGETHER 64
I probably could have used fewer figures (or none at all) and gotten
my points across, but I used as many of the powerful tools as I could
to enrich your understanding.
None of these would have been possible without the right format.
Why PDF?
Two of the major self-publishers like PDF. I think PDF gives you
advantages you won’t find with other formats. Even if your book is
pure text, PDF can be the best option.
But when you use LyX to create your book, you aren’t locked into
PDF, you have the freedom to export to other file formats if necessary.
For instance, you can export to RTF (see Appendix C for more on
alternative file formats) for uploading to a site like Smashwords,
a reasonable alternative if your book is in Smashword’s preferred
simple narrative text style without a TOC, tables or images.
I experimented with a few different page sizes for this book before I
settled on the 5.5 in. X 8.5 in. size. The secret is giving your readers
a balanced page that keeps the information in context.
The 5.5 X 8.5 page size, together with the small margins, used for
this book gives the reader:
Font Selection
A font like Latin Modern will print beautifully but be hard to read
on screen. I used the Bera font family for this book. Bera is the type
1 (postscript and PDF font) derived from Bitstream Vera. The font is
beefier and was designed for on screen reading while still giving a
decent printed output.
Experiment a bit and you can see for yourself. It only takes a few
keystrokes to change your fonts.
CHAPTER 8. PUTTING IT ALL TOGETHER 67
Font Size
Using links wisely taps the power of digital publishing and gives you
and the reader navigation options not possible with a printed book.
TOC
Cross References
Cross referencing helps you and your readers. When you touch on a
topic that you’ve covered in detail earlier in the book, it’s a simple
CHAPTER 8. PUTTING IT ALL TOGETHER 68
The converse is true as well. When you know you’ll cover a topic
in detail in a later chapter, you can touch on the subject, tell your
reader that you go into detail later, then give them the live link so
they can see for themselves.
Whenever you move a chapter, section, figure, etc. that’s been cross
referenced, the link updates automatically to the new location so
the information is always available for instant reference.
External Links
I could have included an index and would have if the book was des-
tined for printing. An index in a printed book gives the reader a way
to search for and find important terms. A good index compliments
the tree based table of contents with an alternative, keyword based
search tool. An index is useful because it collects and references
the most important terms in the book. But the traditional index is
limited because it’s a static view imposed by the author’s judgment.
CHAPTER 8. PUTTING IT ALL TOGETHER 69
You may decide that using LyX is overkill. If you are writing a short
narrative piece, especially if the source needs to be .doc or .rtf, why
add an additional layer of complexity when it makes more sense to
use a word processor? Word, Open Office Writer or AbiWord, to
name a few, are all up to the task. They can also export or save as a
PDF file.
saved version of your book. If you want to make major changes, use
save as to preserve your original until you’re sure.
And creating and publishing your own book won’t cost you a dime.
There’s plenty of quality software available from the Open Source
community and books like this one can help you get started.
A few months ago, I had no idea I’d write this book. After publishing
two newsletters for more than half a year and helping a friend
format and publish her book, I realized that I’ve learned much. I
had to write this book.
I learned so much writing this one that I’m ready for another. One
with a fresh approach to self-publishing. This main message of this
book is “here’s some great free software and here’s how it works.”
Much of the book focused on the power of LyX and LATEX, but there’s
more.
Feel free to stop by and visit my blog, The Aware Writer to see what
I’m up to. I’ll be posting progress on the new book from time to
time. If something I’ve written puzzles you, contact me via email at
awarewriter@gmail.com and I’ll answer as best I can.
But if you need extensive help or would rather have someone edit
or format your book for publishing, contact me. We can work out a
very reasonable fee structure for any of my services.
A LyX: Main Menu Highlights
I’ve highlighted the more frequently used LyX menu choices along
with my own advice and comments. The LyX User’s Guide, available
from the help menu has a complete explanation of all available menu
choices in Appendix A, The User Interface.
File
Import LyX gives you quite a few import options here. The easiest
and quickest import is usually from a clean, plain text file.
Sorting the imported file into LyX environments goes quickly. If
you must import a Word file, copy and paste the Word file into a
plain text editor to get rid of any embedded control codes then
recreate the formatting in LyX using the Word file as a guide. I
tried importing Word directly. The text option is cleaner and
faster. You’ll be surprised how quickly you can put the elements
in a text file into the proper LyX environments.
Export Use PDF (pdflatex) to export your finished book directly to
PDF. See Appendix C on page 79 for more info on alternative
file formats.
Edit
The Edit menu gives you undo, redo, typical cut, copy and paste
functions and search and replace. Most of the functions on this
72
APPENDIX A. LyX: MAIN MENU HIGHLIGHTS 73
menu have Ctrl key shortcuts. I use them extensively. You’ll also
find a menu choice for paragraph settings. You can bring up a
context menu and access many of these choices with a right mouse
click.
View
Open or Close all Insets Footnotes, notes, figures are examples of in-
sets. Open insets show the text or graphics. You can close any
inset so only the “marker” shows on screen. Use this option to
open or close all insets in your document.
View Source This option opens a new window at the bottom of the
screen to view the LyX/LATEX source file.
Update or View When you make changes to your document, and you
have an active PDF, update will generate a new PDF file. View
generates a new PDF (or other doc type). I never use the menu
because the tool bar buttons are more convenient.
Split View Will split the main window either vertically or horizontally
so you can work on different areas of your document at the
same time. Use the next option Close Tab Group to return to a
single screen.
Close Tab Group Close a split view.
Fullscreen (F11) Puts LyX in full screen mode. Press F11 again to
exit.
Toolbars Select or hide the different toolbars.
Insert
• LyX Notes: Add these notes in a box with bright yellow back-
ground. They won’t appear in the final output. Add reminders
to yourself or exchange notes with others when you collaborate
using LyX.
• Comments: These notes will appear in the LATEX source file as
comments but won’t show in the final output.
• Greyed out: These notes will appear in your final output as
grey text.
You can easily navigate any of these notes from the list window.
Tex Code (aka ERT or Evil Red Text) is a powerful tool but use with
care. “Evil Red Text” allows you to insert LATEX commands
directly in your text. I used it in two locations in this document.
It’s how I changed the page numbers to lower case Roman
numerals for the front matter pages. Here’s how I did it:
Navigate
Document
Tools
Help
Open the tutorial and try out LyX using the examples before you
dive into your first document. The tutorial is well done and takes
you step-by-step through a few common examples.
B The LATEX Preamble
Access the LATEX Preamble from the Document Settings Dialog. The
LATEX Preamble lets you load special LATEX packages or define LATEX
commands. The LyX users manual cautions that the preamble is for
LATEX experts, that you shouldn’t fool around unless you know what
you’re doing.
I’m certainly not a LATEX expert, but I’m a good researcher, and all
the special LATEX packages have manuals. I searched the Internet,
downloaded and studied the manuals for the packages I thought
would be useful to me. I also looked at the preambles for the LyX
manuals (available from the help menu). Some of the things I tried
didn’t work, but others did. The secret? Research carefully and
keep the preamble as simple as possible.
LATEX is a markup language that tells TEX what to do. This typesetting
engine runs behind the scenes. LyX takes care of nearly everything
so you won’t have to learn LATEX. Sometimes though, you need a
special package or LATEX command and this is why the preamble is
there. When LyX processes the file through LATEX, LyX inserts the
commands from the preamble and they become part of the LATEX
markup. No need to be afraid to use the preamble, just take care.
If you add a line and get an error message, just go back to the
preamble and comment out the line with a leading % symbol.
I’ve tested everything I added to the LATEX Preamble for this book.
The two packages I added and the commands I used all work prop-
erly. Here’s what I did and why. I’ll explain each code segment then
list the entire preamble I used at the end.
76
APPENDIX B. THE LATEX PREAMBLE 77
One of the reasons LATEX has been in use for a quarter century is
because of the sophisticated kerning techniques it uses to produce
professionally typeset documents. The microtype package takes
this kerning up a notch by introducing margin kerning and font
expansion. Margin kerning tweaks the characters at the margins
for more precise optical alignment of the margins. Font expansion
uses a wider or narrower font variant to get more even inter-word
spacing. The effects are subtle but they do make a noticeable
improvement. All it takes to use microtype is this single line of code
in the LATEX Preamble:
• \usepackage{microtype}
I discovered this gem while digging through the LyX manuals one
day. Hypcap can do more tricks, but I was only interested in “fixing”
the click to a figure. Figure labels are normally anchored to the
caption. When a person clicks on a reference when reading a PDF,
the caption pops to the top of the screen obscuring the figure itself.
This line of code fixes the problem so the figure appears at the top
of the screen instead of the caption:
• \usepackage[figure]{hypcap}
LyX will put a date on the title page unless you tell it not to. This
line of code simply tells LyX the date is null. Put this in your LATEX
Preamble if you don’t want the date on your title page:
• \date{}
Fancy headings
PDF bookmarks
Odds are you won’t need this next one at all. PDF bookmarks don’t
understand the extended character set used for some words. LyX
happens to be one of them. Until I found this last piece of code, I
got strange characters instead of LyX. The code simply tells LATEX to
use the literal word and not the extended characters. It works. This
one drove me nuts and it took me hours of digging to find a solution.
As I said, odds are you won’t run into a situation like this one. But if
you do, this code will come in handy.
• \def\LyX{\texorpdfstring{LyX}{LyX }}
\usepackage[figure]{hypcap}
\date{}
\rhead{\thepage}
\lhead{\leftmark}
\cfoot{}
\setkomafont{captionlabel}{\bfseries}
• HTML
• Rich Text Format (RTF)
• Plain text
HTML
79
APPENDIX C. ALTERNATIVE FILE FORMATS 80
Graphics
Will work fine on full pages in HTML but they won’t scale. If a user
reduces the browser window, they will need to use the horizontal
scroll bar to view large graphics. Smaller graphics are fine and
work best if they are flush left. Images are saved in separate files,
not the HTML file. If your book includes graphics, you are much
better off using PDF instead of HTML.
Tables
Will scale, but large tables that work well on a defined page may
not work as expected when translated to HTML. Again, if you use
tables in your document, stick with PDF.
HTML Advantage
Like HTML, rich text format is an intermediate file format for E-Book
creation. At least one self publishing web site, Smashwords.com,
will only accept MS Word or RTF files as source files. They use what
they affectionately call their “meatgrinder technology” to crunch
the Word or RTF source files and spit out multiple formats.
Plain Text
Any self respecting editor gives you the option to save your file as
plain text. It’s the ultimate insurance against disaster. Your precious
content, when saved as plain text can be read by any editor on any
APPENDIX C. ALTERNATIVE FILE FORMATS 82
operating system. If the worst happens and you lose your formatted
file, you never lose your content.
D How to Include Attachments
83
APPENDIX D. HOW TO INCLUDE ATTACHMENTS 84
[1] Chris Anderson. The Long Tail : Why the Future of Business is
Selling Less of More. New York : Hyperion, 2006. 6
[2] Margaret Shertzer. The Elements of Grammar. New York :
Macmillan, 1986. 8
[3] Sol Stein. Stein on Writing. New York : St. Martin’s Griffin,
1995. 5
85