Tag: XHTML

  • Create Clean EPUBs using Calibre

    There are several reasons to generate a clean EPUB.

    • Consistency. Consistent styles to maintain the same look and feel across platforms.
    • Simplicity. With fewer interactions between CSS styles, changes are easier to implement and track.
    • Human readable. Easy to find chapters, sections and styles.
    • Convertible. Simple styles lend to consistent conversions between formats. Creates Microsoft Word documents with fewer embedded Styles.

    Of course, there are disadvantages.

    • Investment. Generating documents requires time and effort. However, since the the styles are reusable, the level of effort for future releases is reduced.
    • Technical knowledge. This requires more than a passing familiarity with Markdown, XHTML, CSS, and Calibre. However, there is pleny of documentation available online to help.

    While the disadvantages can dissuade people from experimenting with this capability, I found it simplified my eBook submission process. I can target Draft2Digital, Google Play, and Amazon Kindle, using one EPUB, and maintain advanced formatting like realistic text messaging throughout.

    This tutorial focuses on features Calibre offers to make EPUB management easier. These tips and tricks may prove invaluable for debugging an eBook in the future.

    (more…)

  • Clean Manuscripts Using Markdown

    Modern word processors work with the What You See is What You Get paradigm. While that’s mostly true for simple documents, inconsistencies are often introduced into complex documents. This includes but is not limited to:

    • Formatting differences introduced by Copy and Paste operations.
    • Different styles applied throughout. E.g. Some paragraphs are 1.2 line spaces, while others are set to 1.15 line spaces.
    • Selection errors. E.g. The user selected more than expected while formatting text, such as Italics.

    Some of these examples may go undetected until the work is published. These inconsistencies further complicate fault finding an EPUB, as they lead to additional styles and tags being introduced into the code.

    Markdown is a human markup language that permits users to use formatting like Bold, Italics, Monospace, and Strike Through without any knowledge of the underlying code. This simple syntax can be leveraged to generate clean manuscripts.

    Sample Markdown Text

    # Clean Manuscripts Using Markdown
    
    Modern word processors often subscribe to the [What You See is
    What You Get](http://en.wikipedia.org/wiki/WYSIWYG) paradigm.
    While true for simple documents, inconsistencies are easy to
    find in complex documents. These include but are not limited to:
    
    * Formatting differences introduced by _Copy_ and _Paste_
      operations.
    * Different styles applied throughout. E.g. Some paragraphs are
      1.2 line spaces, while others are set to 1.15 line spaces.
    * Selection errors. E.g. The user selected more than expected
      prior to formatting text, such as _Italics_.
    
    [Markdown](http://en.wikipedia.org/wiki/Markdown) is a human
    markup language that permits users to use formatting like
    **Bold**, _Italics_, `Monospace`, and ~~Strike Through~~ without
    any knowledge of the underlying code. The simple Markdown’s
    syntax can be leveraged to generate _clean_ manuscripts.
    

    Fortunately, Google Docs offers extensions that converts documents to and from Markdown on demand. The overall process is straightforward:

    • Convert the manuscript to Markdown.
    • Confirm the formatting.
    • Create a new document with the desired styles.
    • Import the Markdown manuscript into the new document.
    • Export to other formats as needed.
    (more…)

  • Realistic Text Messaging in Ebooks and Print

    This tutorial covers methods of approximating Text messaging in Ebooks and print. The solutions outlined below use tools that are readily available.

    Reference image for text messaging between two parties.
    Reference image for text messaging between two parties.
    (more…)

  • Realistic Text Messaging in EPUB

    At the heart of an EPUB lies Cascading Style Sheets (CSS) and Extensible HyperText Markup Language (XHTML). This grants the designer control over the look and feel of their eBooks, even in an environment where the reader can affect change at will.

    Designers can implement CSS styles that creates realistic Text message conversations. These elements reflow automatically, maintaining a consistent look and feel across devices.

    (more…)

  • Basic Images Styles in EPUB

    The challenge in designing eBooks are the unknowns. It’s impossible to know what devices your readers will use and these uncertainties stack up. Some of these elements are:

    • Screen size, resolution, and density. I.e., Dots Per Inch (DPI) or Pixels Per Inch (PPI);
    • The margins and visible page size;
    • Font type, spacing, and sizes;
    • Zoom factor; and
    • Orientation of the device.

    Note

    Fonts can be embedded into an EPUB to control the look and feel. However, there is no guarantee that Amazon, Apple, Google, or Kobo will not strip them out in favour of their own. E.g., Bookerly on Kindle platforms.

    It’s important that an EPUB reflow its content to adjust to changes in any of the above elements. A book that reflows ensures a quality reading experience for the reader.

    (more…)

  • Drop Caps in EPUB

    While initial or drop capitals are easy to add using Kindle Create, it’s not straightforward for EPUBs generated with Calibre. Fortunately, you can add the missing component by using their e-book editor.

    To start the process, add the following CSS style to your EPUB‘s stylesheet. This document is normally named stylesheet.css in a Calibre generated eBook.

    CSS Style

    .dropCharacter {
      float: left;
      font-family: 'Georgia', 'Calibri', serif;
      font-size: 5em;
      line-height: 0.8em;
      padding-right: 0.1em;
      padding-left: 0.05em;
      padding-bottom: 0.2em;
      vertical-align: top;
    }
    

    Note

    Instead of using pt, or px to define the dimensions, we use em. This type of measurement is relative, enabling the document to adjust automatically when the user changes fonts or size.

    The next step is to go through every chapter and find the first paragraph. While the converted document’s formatting will differ from this example, it will look similar to this:

    Default Code

    <body>
    
      <h1 class="blockFirstTop">THE VAN HELSING INCURSION</h1>
    
      <h2 class="blockFirstChapter">CHAPTER 1</h2>
    
      <p class="blockSubtitle">THEY’RE MAGICALLY DELICIOUS</p>
    
      <p>Clara had been lying flat against the snow-covered ground
         since the witching hour. The sky was taking on red hues,
         and the moon would soon secede its dominion over the
         celestial plain.</p>
    
      <p>She maintained a low heart rate while her movements were
         kept to an absolute minimum. Freshly fallen snow had
         accumulated during the night, all of which helped to
         conceal her position.</p>
    

    Output

    Screenshot of an EBook with no drop character.
    Screenshot of an EBook with no drop character

    For a drop character the first letter of the paragraph must be wrapped in a SPAN with the class defined. Once the changes are made, the preview panel will update the look and feel.

    For a consistent display of drop characters, consider:

    • Remove the first quotation mark prior to wrapping the character; and
    • Remove additional formatting like bold or italics.

    Adjusted Code

    <body>
    
      <h1 class="blockFirstTop">THE VAN HELSING INCURSION</h1>
    
      <h2 class="blockFirstChapter">CHAPTER 1</h2>
    
      <p class="blockSubtitle">THEY’RE MAGICALLY DELICIOUS</p>
    
      <p><span class="dropCharacter">C</span>lara had been
         lying flat against the snow-covered ground since the
         witching hour. The sky was taking on red hues, and the
         moon would soon secede its dominion over the celestial
         plain.</p>
    
      <p>She maintained a low heart rate while her movements were
         kept to an absolute minimum. Freshly fallen snow had
         accumulated during the night, all of which helped to
         conceal her position.</p>
    

    Output

    Screenshot of an EBook with a visible drop character.
    Screenshot of an EBook with a visible drop character

    That’s it!

    Note

    The look and feel may change based on the rendering engine. Viewing it on Google Play Books may have a a different reading experience Apple iBooks, or Rakuten Kobo.


Search