# Effort to make (La)TeX eBook-friendly

Does anyone know whether there is an organized effort to develop (La)TeX classes/packages specifically designed to create ereader-friendly PDFs?

My question is not how to create such PDFs using LaTeX, since Lev Bishop provides a fine summary of currently available methods in an answer to this question.

Edit: Would it be feasible to generate usable epub (or [insert your favorite eBook format here]) documents using LaTeX? I'm not very familiar with how epub documents/readers manage font-scaling, etc. If so, is there a project to create a program that would do this?

• ereader-specific page sizes (with small margins by default);
• increased minimum font size;
• a font thicker than CM (by default).
-
Feel free to edit the tags. –  Z Norwood Apr 22 '11 at 0:09
Read this on how to create ebooks from a tex file: d800fotos.wordpress.com/2015/01/19/… –  user70857 Jan 20 at 16:22

I compile my ebooks (tested and liked on both Sony Reader and Kindle) in XeLaTeX with this preamble:

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Cochin}

\usepackage[papersize={4.5in,6in},margin=0.5cm]{geometry}
\setlength{\parskip}{2pt}

\usepackage{fourier-orns}
\newcommand\textbreak{%
\begin{center}%
\decothreeleft \aldineleft \decosix \aldineright \decothreeright%
\end{center}}

\pagestyle{empty}
\usepackage[pdfauthor={AUTHOR},pdftitle={TITLE}]{hyperref}

\begin{document}


As a result, I get small pages, with small margins, a really nice font, pleasant to read, and embedded in the PDF, and the PDF metadata set so that it shows up nicely in the e-reader book listing.

-
I'm not very familiar with XeLaTeX; can anything in this preamble not be done with LaTeX? –  Z Norwood Apr 22 '11 at 23:48
\setmainfont{Cochin} is really hard to get done in LaTeX: XeLaTeX gives you easy access to TrueType and OpenType fonts. Of course, if you've a favourite font in LaTeX, you don't particularly need XeLaTeX. –  Mikael Vejdemo-Johansson Apr 27 '11 at 16:22
Your answer works like a charm in concert with this: tex.stackexchange.com/questions/11059/… –  andsens Dec 28 '12 at 15:38

Tuning font size, font family and margins are easy things to achieve in LaTeX.

For example, using scrbook, you can set the paper size, font size, and reduce the margins by playing with the DIV parameter:

\documentclass[paper=6in:9in,DIV=calc,12pt]{scrbook}


You can set the value of DIV manually to fit your needs. DIV represents the space allocated to the text in your page, so the bigger the value, the smaller the margin. Standard calculated values are listed in the Koma-Script documentation.

You can even set your margins manually. For example, I have a 6in:9in document with a 0.50in margin, a 0.50in binding correction to apply and a 0.125in mandatory bleed, so I set:

% Paper width
% W = 6.125in (6+0.125 --- bleed)
% Paper height
% H = 9.25in (9+2*.125 --- bleed)
% Paper gutter
% BCOR = 0.375in (0.5+0.5-0.625 --- margin with bleed)
% Margin (0.5in imposed on lulu, recommended on createspace)
% m = 0.625in (0.5+0.125 --- bleed)
% Text height
% h = H - 2m = 8in
% Text width
% w = W - 2m - BCOR = 4.5in
\areaset[0.375in]{4.5in}{8in}


As far as choosing fonts go, you can already switch to Latin Modern, which is a bit nicer than Computer Modern (de gustibus et coloribus...):

\usepackage{lmodern}


and then there's a lot of nice Type1 or OpenType fonts that can be used, too. pdf(la)tex embeds fonts in PDF documents, so there's no real limit to what you can do.

-

See also this; in particular, Peter Flynn references a mailing list devoted to the topic.

-
Great link---thanks. Apparently there is a TUG11 conference on "LaTeX and eBooks." –  Z Norwood Apr 22 '11 at 23:46