Saturday, January 26, 2013

A simple table of contents

<h2 id='toc'>Contents</h2>

<p class='center'><a href='#chapter01'>Chapter One</a></p>

<p class='center'><a href='#chapter02'>Chapter Two</a></p>

<p class='center'><a href='#chapter03'>Chapter Three</a></p>

<p class='center'><a href='#chapter04'>Chapter Four</a></p>

<p class='center'><a href='#chapter05'>Chapter Five</a></p>

<p class='center'><a href='#copy'>Copyright - About the Author</a></p>

You will of course add as many chapters as needed, advancing the link (#chapter06, #chapter07, etc.) with each addition. I like to number them as shown, but if you like you can give the link a descriptive name, as I have done for the final section (#copy) containing the copyright information and a brief biography of the author.

Update: If you work in Sigil, as I recommend, this task is simplified for you. First, you can actually build an "html table of contents" using the Tools option on the top menu. (Click on Tools > Table of Contents > Create HTML Table of Contents.) I don't do this because I prefer my own layout, and it's a chore to edit Sigil's version. Second, you don't have to put anchors in the chapter headings or even to use the href= instruction.. By breaking the large html file into separate chapters and sections, you can use the Insert > Link option on the top menu to quickly connect an item in the TOC to that chapter. Just swipe the mouse cursor over, say, Chapter Five, then link it to the appropriate file. The link will look something like this: <a href="../Text/Section0005.html">.

Wednesday, January 16, 2013

Plan B: The Ultimate Basic Template

Copy everything below this paragraph and paste it into a text editor like Notepad++. Paste in your book text as appropriate, preferably as clean html. Save the document with the extension *.htm and open it in Sigil.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">

<html xmlns="">

<title>Your Book Title Goes Here</title>

<!--First we have a basic style sheet, sufficient to format our book-->

<style type="text/css"> 

p { margin-top:0.0em; margin-bottom:0.0em; text-indent:1.5em; text-align:justify; }

p.first { margin-top:0.5em; margin-bottom: 0.0em; text-indent:0.0em; text-align:justify; } { margin-top:0.0em; margin-bottom:0.25em; text-indent:0.0em; text-align:center; }

h2 { margin-top:1em; font-size: 150%; text-indent: 0em; text-align:center; }

p.large { font-weight: bold; margin-top:1em; font-size: 200%; text-indent: 0em; text-align:center; }

p.medium { margin-top:1em; font-weight: bold; font-size: 150%;
margin-top:1.0em; text-indent: 0em; text-align:center; }

p.small { font-weight: bold; margin-top:1em; font-size: 125%; text-indent: 0em; text-align:center; }


<!--Next we have a title page with each line centered-->

<p class="large" id="start">Your Book Title</p>

<p class="medium">The Sub-title</p>

<p class="small">Author</p>

<p class="small">Publisher <a href="#copy">2018</a></p>

<!--Which is followed by the Table of Contents, also centered-->


<h2 id="toc">Contents</h2>

<p class="center">1 - <a href="#chapter01">Chapter One</a></p>

<p class="center">2 - <a href="#chapter02">Chapter Two</a></p>

<p class="center">3 - <a href="#chapter03">Chapter Three</a></p>

<p class="center"><a href="#copy">Copyright</a></p>

<!--And now the text chapters, as many as you like-->


<h2 id="chapter01">Chapter One</h2>

<p class="first">

<!--The first paragraph is flush left with a few words capitalized-->



<!--Following paragraphs are indented, and each ends with a closing tag-->



<h2 id="chapter02">Chapter Two</h2>

<p class="first"> </p>

<p> </p>


<h2 id="chapter03">Chapter Three</h2>

<p class="first"> </p>

<p> </p>

<!--Adapt for as many chapters as you have, then end with the copyright-->


<h2 id="copy">Copyright</h2>

<p class="first"> </p>


Wednesday, January 9, 2013

An html title page

Over the course of five years and nearly two dozen books, I have settled on this simple and (in my opinion) handsome format for the title page:

<p class="large">Title</p>

<p class="medium">Sub-title</p>

<p class="small">Author</p>

<p class="small">Publisher</p>

Just copy and paste it to a convenient file, where you can substitute your information for the rudimentary stuff here. With the style sheet posted earlier on this blog, your title will be displayed at twice the size of the text in your book, bold-faced, centered on the page, and dropped down just a small bit from the top of the page. The sub-title, author name, and publisher name will follow in the same format and in progressively smaller type.

If you want to get fancy, you can italicize the title, or put the entire title in capital letters, or both. You can also use a publisher's colophon or logo (a small symbol) to separate the author and publisher names. This is mine:

<div class="icon"><img src="njlogo.gif" alt="Image of book"></a></div>

Again, the style sheet specifies that the colophon will be centered on the page and dropped down a bit from the author name.