Sexy eBooks
eBook Formatting Workflow
H2NH ePub
by David Barron
Objective * Workflow * Files * Programs * TEMPLATE * MACRO
Objective
TXT to:
*DOC - PDF
*HTML - EPUB, MOBI
Workflow
Wndows - Mac - GNU/Linux*
*with LibreOffice
TXT
-- for em dash
produces “Title.txt”
Create story folder “Title”
DOC & PDF
edit in Word, save as “Title.doc”
[create a 600x900 cover, using GIMP]
use three styles
Word Styles (3)
Normal • Chapter • §
apply styles, run eBook macro
Save as “Title.doc”
Word Templates (2)
Save as “TitleDOC.doc”
Make columns, place cover in front of book, as in the screenshot
Word PDF Template (screenshot)
Save as “TitlePDF.doc”
Save as PDF “Title - Author.pdf”
Word Macro (2)
eBook (and eBookI)
HTML
return to “Title.doc”
run eBookI macro
open jEdit, new window.
copy and paste Title.doc text into the new window
run eBook.bsh macro
save as “Title”
jEdit macro (1)
eBook.bsh
jEdit Templates (2)
Copy and paste “Title” text into the appropriate template
Short Story template
Book template
apply chapter tags as appropriate
run jTidy plugin (optional)
Save as “Title.html”
EPUB & MOBI
open calibre, drag and drop “Title.html” into main window
edit metadata, insert cover
Convert to EPUB
Table of Contents
Level 1 TOC (XPath Expression) = //h:p[re:test(@class, "chapter", "i")]
EPUB Output
check box 'Preserve cover aspect ratio'
produces “Title - Author.epub”
scroll through EPUB file in calibre for entity errors
use epubcheck
Convert to MOBI
Page Setup
margins = 0”
produces “Title - Author.mobi”
check MOBI file in Kindle Previewer.
UPLOAD EVERYWHERE
fin
This is the bare-bones, no explanation workflow that H2NH ePub uses to produce an eBook in various formats. If you want a detailed overview and step-by-step walk-through, please consult Paul Salvette's excellent eBook Formatting Guide: Details
Files
Title folder
13 files
A FocusWriter
01 “Title.txt” (plain text)
02 “Title.rtf” (edited copy, with italics)
B GIMP
03 “Title.xcf” (raw)
04 “Title(cover).jpg” (final eBook cover)
C Microsoft Word 2007
05 “Title.doc” (Master, with styles)
06 “TitleDOC.doc” (Meatgrinder-ready)
(Smashwords to Kobo, Diesel, Apple, Sony et al)
07 “TitlePDF.doc” (PDF backup)
08 “Title – Author.pdf” (PDF)
(DriveThruFiction; ARC)
09 “TitleHTML.doc” (with <i></i>)
D jEdit
10 “Title” (for entities)
11 “Title.html” (clean HTML)
E calibre
12 “Title – Author.epub” (checked EPUB)
(B&N et al)
13 “Title – Author.mobi” (checked MOBI)
(Amazon)
Programs
for TXT
-features: convenient timer and word count
-option for RTF format
-multi-platform
-full-screen text editor
for DOC and PDF
add-in: Microsoft Save as PDF or XPS
-for Smashwords
-*for other platforms, use OpenOffice
for HTML
plugins: JTidy, Minimap, XML, Ancestor
-robust, convenient
-multi-platform
for EPUB and MOBI
-easy conversion, table of contents creation
-also useful for managing eBook library
Cover Art
GIMP for cover art
plugins:
-works fine for journeyman editing
-more cost-effective than Photoshop
-multi-platform
-free software
TEMPLATE
Word Smashwords Template
blurb Garamond 8
Title Garamond 36
Subtitle Garamond 18
Author Garamond 18
Copyright © Garamond 8
Smashwords Edition, License Notes
This ebook is licensed for your personal enjoyment only. This ebook may not be re-sold or given away to other people. If you would like to share this book with another person, please purchase an additional copy for each recipient. If you’re reading this book and did not purchase it, or it was not purchased for your use only, then please return to Smashwords.com and purchase your own copy. Thank you for respecting the hard work of this author.
Title Garamond 36
Author Garamond 18
Body Text Garamond 11
Garamond 11
*** Garamond 8
Garamond 11
Garamond 11
*** Garamond 8
Garamond 11
Garamond 11
THE END Garamond 18
fin Garamond 8
PDF Template
(Screenshot)
jEdit Short Story Template
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<head>
<style type="text/css">
html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, pre, table, th, td, tr { margin: 0; padding: 0em; }
p
{
text-indent: 1.5em;
margin-bottom: 0.2em;
}
p.noindent
{
text-indent: 0em;
margin-bottom: 0.2em;
}
p.preview
{
margin-top: 5em;
margin-bottom: 2em;
}
p.title
{
page-break-before: always;
font-size: 3em;
font-weight: bold;
margin-top: 5em;
}
p.subtitle
{
text-indent: 3em;
font-size: 2em;
font-weight: bold;
}
p.author
{
text-indent: 3em;
font-size: 2em;
}
p.matter
{
text-indent: 3em;
font-size: 1.5em;
}
p.chapter
{
page-break-before: always;
text-indent: 1.5em;
font-weight: bold;
font-size: 2em;
margin-top: 5em;
margin-bottom: 2em;
}
p.story
{
text-indent: 1.5em;
font-size: 1em;
margin-top: 5em;
margin-bottom: 0.2em;
}
p.centered
{
text-indent: 0em;
text-align: center;
}
span.centered
{
text-indent: 0em;
text-align: center;
}
</style>
</head>
<body>
<p class="preview"><i>The Preview Goes Here</i></p>
<p class="title">The Title Goes Here</p>
<p class="subtitle"><i>The Subtitle Goes Here</i></p>
<p class="author">by David Barron</p>
<p class="matter">Copyright © 2012 David Barron</p>
<p class="matter">Published by H2NH ePub</p>
<p class="chapter" style="display:none">The Title Goes Here</p>
<p class="story">The first paragraph was good.</p>
<p>The next paragraph was better.</p>
<p>Then the scene ended.</p>
<p class="centered"><span class="centered">¤</span></p>
<p>The last scene was the best.</p>
<p class="noindent"><strong>THE END</strong></p>
<p><i>fin</i></p>
</body>
MACRO
Word eBook Macro
(put in NewMacros)
Sub eBookI()
'
' eBook Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "'"
.Replacement.Text = "'"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = """"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "--"
.Replacement.Text = "^+"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "..."
.Replacement.Text = "^i"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Font.Italic = True
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = "<i>^&</i>"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
Sub eBook()
'
' eBook Macro
'
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "'"
.Replacement.Text = "'"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = """"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "--"
.Replacement.Text = "^+"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "..."
.Replacement.Text = "^i"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchByte = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.MatchFuzzy = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
jEdit “eBook.bsh” macro
//H2NH ePub
//by David Barron
///right double quotes
SearchAndReplace.setSearchString("”");
SearchAndReplace.setReplaceString("”");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///left double quotes
SearchAndReplace.setSearchString("“");
SearchAndReplace.setReplaceString("“");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///left single quotes
SearchAndReplace.setSearchString("‘");
SearchAndReplace.setReplaceString("‘");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///right single quotes
SearchAndReplace.setSearchString("’");
SearchAndReplace.setReplaceString("’");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///ellipses
SearchAndReplace.setSearchString("…");
SearchAndReplace.setReplaceString("…");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///non-converted ellipses
SearchAndReplace.setSearchString("...");
SearchAndReplace.setReplaceString("…");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///em dashes
SearchAndReplace.setSearchString("—");
SearchAndReplace.setReplaceString("—");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///non-converted em dashes
SearchAndReplace.setSearchString("--");
SearchAndReplace.setReplaceString("—");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///en dashes
SearchAndReplace.setSearchString("–");
SearchAndReplace.setReplaceString("–");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///è
SearchAndReplace.setSearchString("è");
SearchAndReplace.setReplaceString("è");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///é
SearchAndReplace.setSearchString("é");
SearchAndReplace.setReplaceString("é");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///copyright symbol
SearchAndReplace.setSearchString("©");
SearchAndReplace.setReplaceString("©");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///section symbol
SearchAndReplace.setSearchString("§");
SearchAndReplace.setReplaceString("§");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///section stars
SearchAndReplace.setSearchString("¤");
SearchAndReplace.setReplaceString("¤");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(false);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///class
SearchAndReplace.setSearchString("^(.+)$");
SearchAndReplace.setReplaceString("<p>$1</p>");
SearchAndReplace.setBeanShellReplace(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(true);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.replaceAll(view);
///section centered
//SearchAndReplace.setSearchString("<p>¤</p>");
//SearchAndReplace.setReplaceString("<p class="centered"><span class="centered">¤</span></p>");
//SearchAndReplace.setBeanShellReplace(false);
//SearchAndReplace.setIgnoreCase(false);
//SearchAndReplace.setRegexp(false);
//SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
//SearchAndReplace.replaceAll(view);
///fix italics
//SearchAndReplace.setSearchString("</p><p></i></p>")
//SearchAndReplace.setReplaceString("</i></p>")
///autochapter
//TBD
...