August 31, 2011

Why DRM is Terrible


DRM stands for Digital Rights Management and it is a way of limiting access to multiple devices for software, music, eBooks, and other digital goods. If DRM is enabled on a digital item that is sold to a customer, there are restrictions on where they can copy it and who they can give it to. While the schemes have varied throughout the years, the consensus from consumers of digital goods seems to be unanimous: DRM is hated by buyers of MP3s, hated by gamers, and it is most definitely hated by eBook readers.

Large corporations tend to make the argument that DRM prevents piracy. This is nonsense, because you can log onto any torrent site and find software, eBooks, and anything else that has been stripped of its DRM. Hackers have been designing cracks for every piece of software ever since the Commodore 64 came around. The DRM scheme is simply a way for honest people (like your Grandmother who just got a Kindle) to have to either pay for multiple copies of the same product or go through the technical hassle of validation when they change devices.

Another flaw is that DRM assumes people are criminals when they buy a digital product by putting pre-emptive restrictions on it. Do you really have that much disdain for your readers? If your own Grandmother loaned a print book to her neighbor, would that make her a criminal? The suits at the RIAA seem to think so. However, they have a strange view of what "theft" constitutes. If someone comes into your house and steals your wallet, that is undoubtedly theft, because you lose money and property. However, if someone downloads a copy of your eBook without paying, do you really lose money or property? It's an argument that is worth contemplating. However, to paraphrase David Gaughran, for indie authors the enemy is obscurity, not piracy.

Additionally, in places like Thailand, piracy is rampant and open. You can walk down the street or even go to malls where DVDs that come in little plastic jackets are being sold for approximately 2 to 3 dollars. This is not because Thai people are bad, it is because the country has a lower GDP than its Western cousins and cannot afford the 10-20 dollars that DVD distributors like to charge. If anything, you should explore a pricing strategy that is proportional to GDP. In Thailand, the Asiabooks eBook store is new, and you can explore different eBook outlets in countries around the world to try various prices. Hopefully, more will come online in the future (particularly in countries with huge amounts of English-language speakers like India and the Philippines). As indie authors, it is important to not think like the corporate stiff who only worries about return on investment for shareholders, you need to think like the small businessman (or businesswoman of course) that is 100% dedicated to customer satisfaction.

Smashwords is philosophically opposed to DRM and does not allow it for any of the eBooks sold on their website. When you upload to the Amazon.com Kindle store and Barnes & Noble NOOK, you have the option to use or not use DRM. You should strongly consider not utilizing DRM in your eBooks, as a courtesy to your readers. Instead of creating unnecessary hassles for the customer and fretting about someone downloading a torrent of your eBook, which will happen whether or not you use DRM, you should focus on impressing your customer and using a pricing strategy that maximizes distribution. Try spending your energy on what's really important and challenging, which is writing stories that readers enjoy.
Share/Bookmark

August 29, 2011

Bangkok and Pattaya Crime - A Smorgasbord of Ideas for the Writer

Another Drug Bust (courtesy Pattaya Daily News)

It was most humbling for my flash fiction piece Raid on Soi 5 to get accepted at the Flash Fiction Offensive, especially since there is always a lot of kickass stories on the site. It's a tale of a drug deal gone bad amidst the sleazy underbelly of Bangkok's Sukhumvit Road (where I work). The only reason I can fathom that my story was up to par is because there is no shortage of fodder for the crime/thriller author in Bangkok and Pattaya. There's a steady stream of news about ladyboys robbing short-timers, massive drug busts, and even crazies pulling a gun at one of the Embassies. Writer's block for crime writers is virtually impossible if you live in this maelstrom, just ask Jake Needham.

Here's a wild story descibed in the The Nation that happened recently down in Pattaya:

A former Syrian Army commando has been arrested in connection with the murder of Charles Edmund Jones, late president of the World Croquet Federation, in Jones's rented condominium in Chon Buri's Jomtien area on Monday night.

The New Zealander's body was discovered in the condominium with multiple stab wounds on Tuesday.
Provincial Police Region 2 chief Lt-General Thangai Prasajaksatru and Pattaya Police superintendent Col Nanthawut Suwanla-ong yesterday presented the suspect, 21-year-old Mohamad Shanar Ryad, at a press conference along with the victim's notebook, cell phones and wristwatch, which were reportedly stolen, as well as a pocket knife they alleged was the murder weapon.


Ryad reportedly told police he met Jones on August 19 in South Pattaya. He said Jones invited him to smoke marijuana with him in his room and paid him Bt400 to perform oral sex on him. Ryad claimed that on Monday night, Jones invited him to his room again, but the pair got into an argument, during which Jones pulled a knife on him and attempted to sexually assault him. According to police, Ryad admitted to using his pocket knife to stab the victim about 20 times before fleeing with Jones's valuables and hiding at the room of Ryad's Thai girlfriend in Soi Chalermphrakiat 19.
How can you not write a story about this? It would probably be difficult to keep it under 1,000 words. This was the same week that MP Chuvit exposed an alleged police-run illegal casino here in Bangkok. I might be a bit timid to write about the casino caper for fear of getting whacked by the poo yai of the place. Nevertheless, you can always adjust the names and locations to protect the guilty.

The excellent author Christopher Moore argued that Thailand may have a reputation for international fugitives, but it may be unjustified. However, the longer I stay here, the crazier things seem to get.
Share/Bookmark

August 26, 2011

The Lack of Culture Devoted to the Military Experience

Abandoned American Embassy - Baghdad
It's difficult to explain what it is like to be a veteran of the modern wars in Afghanistan and Iraq. There is currently a massive divide between military and civilian society in America, and going from the military world of big bases and routine deployments to the real world is like stepping onto another planet. Having spent over two years out of the military and over three years from being in Iraq, it's almost as if my time in the Navy was in a past life. I can still recall what being on a submarine is like: the smell of diesel, people pissed off at the stress and lack of sleep, the zombie-like mentality. However, the person I was back then is practically a stranger to me now. There is a bit of a language barrier between my Thai wife and myself, but even if there wasn't, I could never explain to her about what being in the Navy was like.

I believe a reason for not being able to comprehend my former life is the serious lack of popular culture that discusses the military experience. It can be challenging to reflect on your own experience if no one else is trying to do the same. No man is an island and all that.  Most of the media establishment tends to focus on veterans who have been traumatized by war, and even then, it was more prominent during the Bush era for political reasons. This is an important matter to discuss, but where are the interesting stories about life in the military (no, Stealth does not count)? Hopefully, more veterans will continue using the GI Bill to finish off film school and MFAs, and we will begin to see an emerging trend in mass media similar to what was seen in the great movies following Vietnam (e.g. Platoon, Hamburger Hill, etc.)

Of course, there are a few exceptions. David Bellavia has a great book on Fallujah in 2004. Also, I just finished with Chris Brownfield's book My Nuclear Family, which was an interesting exploration of life as junior officer on a boat in Iraq (I had a much more humble opinion of myself than he does). However, there aren't enough, and hopefully that trend will change over time.
Share/Bookmark

August 24, 2011

The Trouble with Tablets in Thailand

Does Video Game Violence Make Kids Weird? (pictured left: my son terrified of a booth babe)
I guess I don't know that much about Thailand, because when I heard that Prime Minister Yingluck was serious about the one tablet per child policy, I expected a different kind of criticism from Bangkok's elite. For example, I figured some astute observers would say things like, "How do we know the company that gets the contract won't be involved in dubious dealings with the Shinawatra family?", or "Why buy tablets when many kids in the impoverished schools in Isan don't even have a decent computer?", and perhaps "How are we going to pay for this shit?"

However, the criticism has been of a more culture warrior variety with critics arguing that children will have access to violent video games and porn. The Nation quotes from concerned citizens about tablets:

Not only do teachers of the target students have to be prepared for the use of the new technology, but parents should also learn how to use the tablets and understand the technology so they can monitor students' use of the tablets and prevent them from accessing improper websites and games.

"Office of Basic Education Commission secretary general Chinnapat Bhumirat said schools would have a screening system to block students' access to the Internet as they would have to use the schools' intranet. We want this screening plan to be practical, but people are worried that it won't be, because children learn about technology very quickly [so they may be able to avoid the screening system]," said the head of the Child Safety Promotion and Injury Prevention Research Centre, Adisak Plitponkarnpim.
Now, I may have been scolded once or ten times by my wife for allowing the boys to play Grand Theft Auto on my iPad. However, I believe that the concern over video game violence is misplaced. Bangkok itself is a pretty crazy city, where you can find prostitutes, meth dealers, and horrendous motorcycle accidents right outside your front door. Additionally, Bangkok is not like Western cities, where the violence is isolated into ghettos, barios, and other areas to steer clear of. In Bangkok, you will see new high-rise condos teeming with young professionals overlooking a slum made of aging wood and corrugated metal roofs. The humanity is pretty in your face no matter what socioeconomic bracket you fall into. So, I believe the getting upset about violent video games seems to be the least of the troubles.

Additionally, businesses in Thailand always complain about the lack of IT skills in the Thai workforce. While just handing a kid a tablet certainly isn't going to solve the problem overnight, investment in IT education isn't a bad bet for the future. Crazies and weirdos were around before video games, so it's probably better to invest in things like training for law enforcement to deter crime rather than fearing the occasional scheisse porn site that pops up on some kid's tablet. Besides, if these kids don't have access to digital media, they'll be stuck reading the ridiculously bizarre magazines that populate Bangkok's newsstands for their entire childhood.
Share/Bookmark

August 22, 2011

America Goes On: A Novella - Now on Sale for $0.99

After some thorough editing and formatting, I finally released my debut novella: America Goes On. You can pick up a copy for just $0.99 at the Amazon Kindle store, at Barnes & Noble NOOK, or at Smashwords. All proceeds go toward the Kotchakorn Monica Salvette foundation, at least until she's old enough to get a job and start taking care of me and the wife.

I came up with the idea for this novella when I saw a Marine looking down as he smoked in a plywood shack at Ali Al Salem Air Base, Kuwait, back in June 2007. This base is a logistics hub for military and civilian personnel traveling into and out of Iraq and Afghanistan. A lot of people and a lot of stories come through this purgatory in the desert. Everyone talks to each other in this environment, since there’s nothing to do but wait for your trip into the combat zone or flight back home. And then I thought about how many I’ve seen go through this hub but never make it back.

I actually wrote this story in 2008 just before I finished my time as a lieutenant in the Navy. A year earlier I was a staff weenie in the International Zone under the Individual Augmentee program. It was a good experience for me, and I was fortunate enough to come away from the sandbox with all my fingers and toes. I have tremendous respect for the troops who’re patrolling outside the wire day in day out. It’s a very stressful environment where something bad and unexpected can happen 24/7.

When I got back from Iraq, like most veterans, I was disappointed that no one seemed to care about the young men and women who never came home. We’re creating a separate class of servicemen in America where the concept of civic duty is now a joke. I hope our politicians will think more rationally before sending off a small percentage of Americans to fight a long-term war on the entire nation‘s behalf. Even the New York Times has taken notice that there is too much a separation between the military and the civilian world

The reason I took so long to publish this novella is because I wrote it just for myself and a few friends. They gave me nice feedback, but it didn’t blow them away. Then, however, came the self-publishing revolution of 2011, and my wife was pregnant with our daughter. Seeing how a few extra bucks (or baht in my case) could go a long way, I decided to throw my hat into the ring.

I dug up the manuscript on my computer and re-read it. The grammar was awful, the dialogue was stilted, and the story didn’t make sense. Using the powers of editing, both mine and my brother’s, we polished the manuscript into the version before you today. I hope that you enjoy it.

Here's the blurb:
A young veteran of the Iraq war drives across America while struggling to find his place in the country he just defended. Confronted with complacent attitudes and narrow minds, he realizes his fellow citizens don’t even understand America is at war, let alone respect his sacrifice. At least he has his fellow Marines from his second tour of duty, along with a mysterious girl who is waiting for him on the East Coast. Or so he thinks. Travel with this veteran through the barren desert of California all the way to New York City as he learns about modern America, as well as himself.

America Goes On is a 15,000-word (~65-page) novella about the 21st century reality of war in America.

Share/Bookmark

August 21, 2011

eBook Formatting Tutorial Series


Thank you for visiting this eBook design tutorial. We now have an eBook design startup—BB eBooks—dedicated to helping independent authors and small presses get their eBooks formatted, converted, and ready for sale at all the major online retailers (e.g. Amazon's Kindle Store, Barnes & Noble's Nook, iBookstore, Smashwords, etc.) Please contact us for a no-obligation quote. For those writers, editors, and publishers looking to go the DIY route for eBook production (you probably are if you visited this page), we offer free online tutorials and apps to help you professionally design your eBook. Please visit our Developers page and let’s work together to improve the overall standards of eBooks. Also, please sign up for the mailing list for promotions, design & marketing tips, plus eBook industry news.

Warning This Content is Out of Date. Please head on over to the BB eBooks Developers Page for the most up to date information on eBook creation.

The full tutorials for the eBook formatting series include a basic XHTML tutorial, a tutorial for converting your manuscript into XHTML, and a Calibre tutorial for converting XHTML into eBooks. For those looking for something more advanced, you can also peruse the Regular Expressions tutorial, as well as the EPUB and KindleGen tutorial. Templates for XHTML and EPUB are also available for your formatting arsenal. Additionally, there are some helpful hints for formatting for Smashwords in this tutorial.

Table of Contents for XHTML Tutorial
Introduction to XHTML
Basic XHTML structure
Paragraph and Break Tags
Styling Your Paragraphs
Italics/Bold/Underline in Paragraphs
Adjusting Font Sizes
Changing Margins around Paragraphs
Indenting
Text Alignment
Page Breaks
Altering Styles within a Paragraph
The <div>, <p>, and <span> Hierarchy
Adding a Cascading Style Sheet (CSS)
Bulleted and Numbered Lists
Adding Hyperlinks
Adding Anchors
Adding Images
Adding Comments
Special Characters
Using Non-breaking Spaces
XHTML Not Used in this Tutorial
XHTML and HTML Differences

Table of Contents for Turning a Manuscript into Clean XHTML
Introduction to Converting a Manuscript into XHTML
Prepping Your Word Processor's Document
Adding the Fancy Special Characters
Preserving Italics/Bold/Underline
Preserving Hyperlinks
Nuking Your Word Processor's Formatting
Cleaning the Raw Text
Dealing with Special Characters
Stopping Point for Formatting Both EPUB/MOBI and Smashwords
Converting Special Characters to HTML
Wrapping Text in Paragraph Tags
Coding XHTML around Italics/Bold/Underline
Adding Your Document to an XHTML Template
Styling Your eBook with CSS
Adjusting the Default Paragraph Style
Formatting the Title/Copyright Page
Formatting Chapter Headings
Formatting Section Breaks
Styling Material in the Back
Adding Unordered and Ordered Lists
Adding Images
Adding Hyperlinks and Prepping the Table of Contents
Adding External Hyperlinks
Anchors and Internal Hyperlinks
Discussion of the Table of Contents
Adding <div> Anchors for NCX and Traditional Tables of Contents
Establishing Anchors for a more Customized NCX (Optional)
Verifying your XHTML
Video Tutorials

Table of Contents for Calibre Tutorial
Introduction to Calibre
Adding XHTML Source Code to Calibre
Adding Metadata
Converting XHTML into EPUB and MOBI Formats
An Overview of Conversion Options
Creating your EPUB eBook
Verifying Your EPUB eBook
EPUB Verification Checklist
Troubleshooting EPUB
Verifying Your EPUB
Creating your MOBI eBook
Verifying Your MOBI Format
MOBI Verification Checklist
Troubleshooting MOBI
Verifying MOBI
Video Tutorial

Table of Contents for Regular Expressions Tutorial (Advanced)
Introduction to Regular Expressions
The Find Function
Multiplying Operators ?+*
Matching Non-standard Characters
Using Anchors
Using Substitutions
Useful Regular Expressions for eBook Formatting

Table of Contents for EPUB and KindleGen Tutorial (Advanced)
Introduction to Advanced Formatting
Prerequisites for Manually Coding EPUB and MOBI
EPUB Structure
The mimetype and container.xml Files
The content.opf File
The toc.ncx File
Compressing the EPUB File
Creating Your Own EPUB Files and Prepping for MOBI Conversion
Adding Embedded Fonts
Running KindleGen to Create MOBI
Troubleshooting KindleGen
Video Tutorials

Video Tutorials

Converting Your Manuscript into XHTML



Converting eBooks with Calibre


The EPUB File Structure and Working with KindleGen


Share/Bookmark

EPUB Template - eBook Formatting


Thank you for visiting this eBook design tutorial. We now have an eBook design startup—BB eBooks—dedicated to helping independent authors and small presses get their eBooks formatted, converted, and ready for sale at all the major online retailers (e.g. Amazon's Kindle Store, Barnes & Noble's Nook, iBookstore, Smashwords, etc.) Please contact us for a no-obligation quote. For those writers, editors, and publishers looking to go the DIY route for eBook production (you probably are if you visited this page), we offer free online tutorials and apps to help you professionally design your eBook. Please visit our Developers page and let’s work together to improve the overall standards of eBooks. Also, please sign up for the mailing list for promotions, design & marketing tips, plus eBook industry news.



Looking for a complete guide on eBook design and development? Please consider The eBook Design and Development Guide, which contains everything you need to know about HTML, CSS, EPUB, and MOBI/KF8 to make an eBook like a pro. Pick it up at Amazon for $6.99 today.

Warning This Content is Out of Date. Please head on over to the BB eBooks Developers Page for the most up to date information on eBook creation.

The full tutorials for the eBook formatting series include a basic XHTML tutorial, a tutorial for converting your manuscript into XHTML, and a Calibre tutorial for converting XHTML into eBooks. For those looking for something more advanced, you can also peruse the Regular Expressions tutorial, as well as the EPUB and KindleGen tutorial. Templates for XHTML and EPUB are also available for your formatting arsenal. Additionally, there are some helpful hints for formatting for Smashwords in this tutorial.

These are standard templates for building an EPUB or MOBI. You can download an EPUB example here. The recommended directory structure is as follows:
mimetype (must be in the root folder)
META-INF/container.xml (must be in this folder)
OEPBS/content.opf (can be in any folder, but OEPBS is recommended)
OEPBS/toc.ncx
OEPBS/title.html
OEPBS/content.html files
OEPBS/image files
OEPBS/CSS stylesheets
mimetype
The mimetype file must be exactly 20 bytes. It is as follows:
application/epub+zip
container.xml
This file must be in the META-INF directory The only thing you ever need to alter is the full-path attribute in the <rootfile> tag:
<?xml version="1.0"?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
   <rootfiles>
      <rootfile full-path="OEPBS/content.opf" media-type="application/oebps-package+xml"/>
   </rootfiles>
</container>
content.opf

Sample is as follows:
<?xml version="1.0" ?>
<package version="2.0" xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookId">
  <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
    <!--Required metadata-->
    <dc:title>Your eBook's Title</dc:title>
    <dc:language>en-us</dc:language> <!--Other examples include "en-gb" for British English, "fr" for French-->
    <dc:identifier id="BookId" opf:scheme="uuid">urn:uuid:MUST OBTAIN</dc:identifier> <!--Can generate at http://www.famkruithof.net/uuid/uuidgen-->
    <dc:creator>Your Name Here</dc:creator> <!--The Author-->
    <dc:publisher>Publisher here</dc:publisher> <!--Name of Publisher or yourself if self-published-->
    <dc:date>2000-01-01</dc:date> <!--Published Date in YYYY-MM-DD-->
    <meta name="cover" content="My_Cover_ID" /> <!--Required for KindleGen-->
    <!--Add extra metadata here (recommended)-->
    <dc:description>Book's Description</dc:description> <!--Backjacket description-->
    <dc:subject>Keyword 1</dc:subject>
    <dc:subject>Keyword 2</dc:subject>
    <dc:subject>Keyword 3</dc:subject>
    <dc:contributor opf:role="edt">Editor's Name</dc:contributor>
  </metadata>
  <!--Declarations for media-types in the Manifest Section
    "application/xhtml+xml" - XHTML content files
    "application/x-dtbncx+xml" - NCX table of contents
    "text/css" - CSS files
    "image/jpeg" - JPEG image
    "image/gif" - GIF image
    "image/png" - PNG Image -->
  <manifest>
    <!--Required in manifest-->
    <item href="cover.jpg" id="My_Cover_ID" media-type="image/jpeg" />
    <item href="toc.ncx" id="ncx" media-type="application/x-dtbncx+xml" />
    <item href="content1.html" id="html1" media-type="application/xhtml+xml" />
    <item href="content2.html" id="html2" media-type="application/xhtml+xml" />
    <!--Optional but recommended in Manifest-->
    <item href="extra.jpg" id="extraimg" media-type="image/jpeg" />
    <item href="mystylesheet.css" id="mycss" media-type="text/css" />
    <item href="coverpage.html" id="coverpg" media-type="application/xhtml+xml" />
    <item href="titlepage.html" id="titlepg" media-type="application/xhtml+xml" />
    <item href="toc.html" id="htmltoc" media-type="application/xhtml+xml" />
  </manifest>
  <spine toc="ncx">
    <itemref idref="coverpg" />
    <itemref idref="titlepg" />
    <itemref idref="html1" />
    <itemref idref="html2" />
    <itemref idref="htmltoc" />
  </spine>
  <guide>
    <reference href="coverpage.html" type="cover" title="Cover" />
    <reference href="toc.html" type="toc" title="Table of Contents" />
    <reference href="content1.html" type="text" title="Beginning" />
  </guide>
</package>
toc.ncx
Here is an example of a toc.ncx file:

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="en">
  <head>
    <meta content="urn:uuid:da032e40-c65b-11e0-9572-0800200c9a66" name="dtb:uid" /> <!--Must be exactly the same as dtb:uid in content.opf-->
    <meta content="1" name="dtb:depth" />
    <meta content="0" name="dtb:totalPageCount" />
    <meta content="0" name="dtb:maxPageNumber" />
  </head>
  <docTitle>
    <text>Title</text>
  </docTitle>
  <docAuthor>
    <text>Author Name</text>
  </docAuthor>
  <navMap>
    <navPoint id="NCX_Cover" playOrder="1">
      <navLabel>
        <text>Cover</text>
      </navLabel>
      <content src="coverpage.html" />
    </navPoint>
    <navPoint id="NCX_Title" playOrder="2">
      <navLabel>
        <text>Title Page</text>
      </navLabel>
      <content src="titlepage.html" />
    </navPoint>
    <navPoint id="NCX_Chapter1" playOrder="3">
      <navLabel>
        <text>Chapter 1 - The Beginning</text>
      </navLabel>
      <content src="content1.html" />
    </navPoint>
    <navPoint id="NCX_Chapter2" playOrder="4">
      <navLabel>
        <text>Chapter 2 - The Climax</text>
      </navLabel>
      <content src="content1.html#c2" />
    </navPoint>
    <navPoint id="NCX_Chapter3" playOrder="5">
      <navLabel>
        <text>Chapter 3 - The Ending</text>
      </navLabel>
      <content src="content2.html" />
    </navPoint>
    <navPoint id="NCX_AuthorNotes" playOrder="6">
      <navLabel>
        <text>Author's Notes</text>
      </navLabel>
      <content src="content2.html#a1" />
    </navPoint>
    <navPoint id="NCX_HTMLTOC" playOrder="7">
      <navLabel>
        <text>Table of Contents</text>
      </navLabel>
      <content src="toc.html" />
    </navPoint>
  </navMap>
</ncx>
Content Files:
Here is an example of a content file. You can have as many of these as you want:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>Title Here</title>
<!-- Visit http://paulsalvette.com for more details and tutorials -->
<link type="text/css" rel="stylesheet" href="mystylesheet.css" />
</head>
<body class="epub_margins">
<!-- Paste content here -->
</body>
</html>
Table of Contents (HTML)
Here is an example of an HTML Table of Contents inside the EPUB. Note that this is NOT the NCX:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>Title Here</title>
<!-- Visit http://paulsalvette.com for more details and tutorials -->
<link type="text/css" rel="stylesheet" href="mystylesheet.css" />
</head>
<body class="epub_margins">
<p class="headline">The Traditional HTML Table Of Contents (Not the NCX!)</p>
<p><a href="coverpage.html">Cover</a></p>
<p><a href="titlepage.html">Title</a></p>
<p><a href="content1.html#c1">Chapter 1</a></p>
<p><a href="content1.html#c2">Chapter 2</a></p>
<p><a href="content2.html#c3">Chapter 3</a></p>
<p><a href="content2.html#a1">Some Author Notes</a></p>
</body>
</html>
Cover Page
This is an example of a cover page if you prefer to have it in the XHTML and the meta:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
        <title>Cover</title>
        <style type="text/css">
            @page {padding: 0pt; margin:0pt;} <!--Remove for MOBI-->
            body {text-align: center; padding:0pt; margin: 0pt;}
            div {padding:0pt; margin: 0pt;}
            img {padding:0pt; margin: 0pt;}
        </style>
    </head>
    <body>
        <div>
            <img src="cover.jpg" alt="The Book's Cover" style="height: 100%;" />
        </div>
    </body>
</html>
Stylesheet:
This is an example of an external CSS:
/* Below is the Guido Henkel Method to reset everything in an eReader device */
   html, body, div, h1, h2, h3, h4, h5, h6, ol, dl, ul, li, dt, dd, p, blockquote, pre, form, fieldset, table, th, td, tr { margin: 0; padding: 0.01em; }

   /* MOBI Does Not Recognize the @page style */
@page { margin-bottom: 5.0pt; margin-top: 5.0pt; }
 
body.epub_margins /* Force left/right page margins on EPUB */
{
margin-left: 5.0pt;
margin-right: 5.0pt;
text-align: justify;
}
 
body.mobi_margins /* Force 0 page margins on MOBI, you should delete the @page from the stylesheet for MOBI too */
{
margin-left: 0pt;
margin-right: 0pt;
text-align: justify;
}
 
p  /* First Line Indent type, good for fiction */
{
text-indent: 1.25em;
margin-top: 0em;
margin-bottom: 0em;
}

p.notes /* Block Indent type, good for non-fiction, author's notes, about the author, front matter not centered, etc. */
{
text-indent: 0em;
margin-top: 0em;
margin-bottom: 1.0em;
}
 
p.front /* For Front Matter Material */
{
text-indent: 0em;
margin-top: 0em;
margin-bottom: 1.0em;
text-align: center;
}
 
p.title /*Use for the title on the first page*/
{
text-indent: 0em;
font-size: 2.0em;
font-weight: bold;
margin-top: 1.5em;
margin-bottom: 1.0em;
text-align: center;
page-break-before: always;
}

p.headline /*Use for Author's Notes, Excerpts, etc. headings*/
{
text-indent: 0em;
font-size: 1.5em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 1.5em;
text-align: center;
page-break-before: always;
}

p.chapter /*Use for Chapter headings*/
{
text-indent: 0em;
font-size: 1.5em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 1.5em;
text-align: center;
page-break-before: always;
}

p.centered /* Use for section breaks */
{
text-indent: 0em;
margin-top: 1.0em;
margin-bottom: 1.0em;
text-align: center;
}
 
p.centeredimg /* Use for images */
{
text-indent: 0em;
margin-top: 1.0em;
margin-bottom: 1.0em;
text-align: center;
}

/* Span tags are for when you want to change a few words within a paragraph rather than the entire paragraph */
span.i
{
font-style: italic;
}

span.b
{
font-weight: bold;
}
 
span.u
{
text-decoration: underline;
}

ul /* Defines an unordered list (bullet points) */
{
text-align: left;
margin-left: 3.0em;
margin-top: 0em;
margin-bottom: 0em;
}

ol /* defines an ordered list (1,2,3,etc.) */
{
text-align: left;
margin-left: 3.0em;
margin-top: 0em;
margin-bottom: 0em;
}

Share/Bookmark

XHTML Template - eBook Formatting


Thank you for visiting this eBook design tutorial. We now have an eBook design startup—BB eBooks—dedicated to helping independent authors and small presses get their eBooks formatted, converted, and ready for sale at all the major online retailers (e.g. Amazon's Kindle Store, Barnes & Noble's Nook, iBookstore, Smashwords, etc.) Please contact us for a no-obligation quote. For those writers, editors, and publishers looking to go the DIY route for eBook production (you probably are if you visited this page), we offer free online tutorials and apps to help you professionally design your eBook. Please visit our Developers page and let’s work together to improve the overall standards of eBooks. Also, please sign up for the mailing list for promotions, design & marketing tips, plus eBook industry news.

Warning This Content is Out of Date. Please head on over to the BB eBooks Developers Page for the most up to date information on eBook creation.

These are templates you can copy and paste into a text editor to get started on your eBook formatting. You can also download them (fiction template and non-fiction template), just make sure to right-click and save the file in your web browser. Beware of your anti-virus software adding strange javascript code into the <head> section when you download the file. This problem is discussed here.

The following is a suitable XHTML template for fiction, because it uses First Line Indent type.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>Your Title Here</title>

<!-- Visit http://paulsalvette.com for more details and tutorials -->

<style type="text/css">

/* Below is the Guido Henkel Method to reset everything in an eReader device */
html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, blockquote, pre, form, fieldset, table, th, td, tr { margin: 0; padding: 0.01em; }

p  /* First Line Indent type, good for fiction */
{
text-indent: 1.25em;
margin-top: 0em;
margin-bottom: 0em;
}

p.notes /* Block Indent type, good for non-fiction, author's notes, about the author, front matter not centered, etc. */
{
text-indent: 0em;
margin-top: 0em;
margin-bottom: 1.0em;
}
 
p.front /* For Front Matter Material */
{
text-indent: 0em;
margin-top: 0em;
margin-bottom: 1.0em;
text-align: center;
}
 
p.title /*Use for the title on the first page*/
{
text-indent: 0em;
font-size: 2.0em;
font-weight: bold;
margin-top: 1.5em;
margin-bottom: 1.0em;
text-align: center;
page-break-before: always;
}

p.headline /*Use for Author's Notes, Excerpts, etc. headings*/
{
text-indent: 0em;
font-size: 1.5em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 1.5em;
text-align: center;
page-break-before: always;
}

p.chapter /*Use for Chapter headings*/
{
text-indent: 0em;
font-size: 1.5em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 1.5em;
text-align: center;
page-break-before: always;
}

p.centered /* Use for section breaks */
{
text-indent: 0em;
margin-top: 1.0em;
margin-bottom: 1.0em;
text-align: center;
}
 
p.centeredimg /* Use for images */
{
text-indent: 0em;
margin-top: 1.0em;
margin-bottom: 1.0em;
text-align: center;
}

/* Span tags are for when you want to change a few words within a paragraph rather than the entire paragraph */
span.i
{
font-style: italic;
}

span.b
{
font-weight: bold;
}
 
span.u
{
text-decoration: underline;
}

ul /* Defines an unordered list (bullet points) */
{
text-align: left;
margin-left: 3.0em;
margin-top: 0em;
margin-bottom: 0em;
}

ol /* defines an ordered list (1,2,3,etc.) */
{
text-align: left;
margin-left: 3.0em;
margin-top: 0em;
margin-bottom: 0em;


</style>
</head>
<body>
<!--Insert Entire Manuscript from word processor here-->
</body>
</html>
The following is a suitable XHTML template for non-fiction, because it uses Block Indent type.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>Your Title Here</title>

<!-- Visit http://paulsalvette.com for more details and tutorials -->

<style type="text/css">

/* Below is the Guido Henkel Method to reset everything in an eReader device */
html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, blockquote, pre, form, fieldset, table, th, td, tr { margin: 0; padding: 0.01em; }

p /* Block Indent type, good for non-fiction, author's notes, about the author, front matter not centered, etc. */
{
text-indent: 0em;
margin-top: 0em;
margin-bottom: 1.0em;
}
 
p.front /* For Front Matter Material */
{
text-indent: 0em;
margin-top: 0em;
margin-bottom: 1.0em;
text-align: center;
}
 
p.title /*Use for the title on the first page*/
{
text-indent: 0em;
font-size: 2.0em;
font-weight: bold;
margin-top: 1.5em;
margin-bottom: 1.0em;
text-align: center;
page-break-before: always;
}

p.headline /*Use for Author's Notes, Excerpts, etc. headings*/
{
text-indent: 0em;
font-size: 1.5em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 1.5em;
text-align: center;
page-break-before: always;
}

p.chapter /*Use for Chapter headings*/
{
text-indent: 0em;
font-size: 1.5em;
font-weight: bold;
margin-top: 1.0em;
margin-bottom: 1.5em;
text-align: center;
page-break-before: always;
}

p.centered /* Use for section breaks */
{
text-indent: 0em;
margin-top: 1.0em;
margin-bottom: 1.0em;
text-align: center;
}
 
p.centeredimg /* Use for images */
{
text-indent: 0em;
margin-top: 1.0em;
margin-bottom: 1.0em;
text-align: center;
}

/* Span tags are for when you want to change a few words within a paragraph rather than the entire paragraph */
span.i
{
font-style: italic;
}

span.b
{
font-weight: bold;
}
 
span.u
{
text-decoration: underline;
}

ul /* Defines an unordered list (bullet points) */
{
text-align: left;
margin-left: 3.0em;
margin-top: 0em;
margin-bottom: 0em;
}

ol /* defines an ordered list (1,2,3,etc.) */
{
text-align: left;
margin-left: 3.0em;
margin-top: 0em;
margin-bottom: 0em;


</style>
</head>
<body>
<!--Insert Entire Manuscript from word processor here-->
</body>
</html>

Share/Bookmark