Printing a Book with CSS: Boom!

HTML and CSS, two of our favorite acronyms, are normally associated with web pages. And deservedly so: HTML is the dominant document format on the web and CSS is used to style most HTML pages. But, are they suitable for off-screen use? Can CSS be used for serious print jobs? To find out, we decided to take the ultimate challenge: to produce the next edition of our book directly from HTML and CSS files. In this article we sketch our solution and quote from the style sheet used. Towards the end we describe the book microformat (boom!) we developed in the process.

The studious reader may want to fetch a sample HTML file, sample style sheet, as well as the PDF file generated by Prince. The PDF file is similar to the one we sent to the printer. We encourage you to base your own book on the sample file and tell us how it goes.

Pigs, Gourds, and Wikis: Media Queries for formatting Poetry on Kindle and EPUB

What a tangled web we weave!

Amazon wants to maintain support for its legacy ereaders, we all want to support different size ereaders, but nobody supports the code the same way.

What to do?

One solution is to use media queries, something I’ve been meaning to explain for months.

A media query lets you create multiple sets of CSS (just what you want to do, right?) and then apply the most appropriate set automatically according to the ereader the ebook is opened in.

Learn CSS3: Media Queries

Media queries is a CSS3 extension to media types that allows us far greater control over rendering across different devices than do media types alone. Used in conjunction with a media type, a media query is a logical expression, evaluating to true or false, that tests one or more features of the output device to which the CSS is to be applied. Media queries can be used in tags, XML processing instructions, the @import at-rule, and the @media at-rule. The CSS associated with the media query expression is only applied if the expression evaluates to true.

A logical expression can consist of either a media feature, or a media feature followed by a colon (:) and a value—similar to a normal property/value pair. A logical expression in a media query must be enclosed in parentheses (…). Let’s look at a some examples:

CSS 2.1 selectors, Part 1

Among the first things you learn about when you start out with CSS are selectors. Selectors are obviously a fundamental part of CSS, but few developers use them to their full potential. While you can get a lot done with just the type, ID, and class selectors, there are many more.

Learning how to use the full range of CSS selectors available in CSS 2.1 properly can actually help you keep your HTML a lot cleaner. It will let you minimise unnecessary use of the class attribute and the need for adding extraneous div and span elements to the markup. Sounds good, right?

Video Center – Unruly Guides

DIY Formatting Kit Videos

Note: all CURRENT videos are now located on our First Steps Publishing Site

VIDEO 1: Preparing your word document for HTML conversion
VIDEO 2: Convert manuscript to clean HTML
VIDEO 3: Setting Page Breaks in SIGIL using CSS
(OPTION) SIGIL: Splitting HTML eBook Files in SIGIL
VIDEO 4: Rename pages, Set Semantics and the Start Page
VIDEO 5: Creating a Linkable Table of Contents
(OPTION) Creating Linkable Table of Contents (TOC)
VIDEO 6: Working with the TOC.ncx Editor and Meta Editor
VIDEO 7: Make content changes to pages, reorder pages, add and remove images.
VIDEO 8: HTML Clean Up
VIDEO 9 Final proof and validation of epub file
Converting EPUB to Kindle Digital Publishing in One Step

Search Through MS Word Doc to Find Text, Keyword, Phrase or Regex Match

With PowerGREP, you can quickly search for a piece of information through files and folders on your computer, including Microsoft Word documents saved in DOC, DOT and DOCX files. Simply type in a keyword or phrase in the Search box, select which folder PowerGREP should go through and which types of files are of interest. When you click the search button, PowerGREP will present you with a list of MS Word documents and other files in which the text you entered in the search box was found. The list will show one line of context for each match. You can instantly inspect the entire context by double-clicking on the match in the results.

Microsoft releases free reference ebooks

Microsoft has released some free ebook reference guides for its various software technologies. The full list of titles is available here.

Most of the books are aimed at IT departments exclusively, but we thought we’d highlight a couple of the books that might be useful for publishing house production departments: