Register Guidelines E-Books Search Today's Posts Mark Forums Read

 MobileRead Forums LaTex Formatted PDF for Kindle Screen / Moby Dick Test

 11-19-2010, 04:39 PM #1 CyberpunkDad Neuromancer Fanboi     Posts: 49 Karma: 480 Join Date: Nov 2010 Device: Kindle 3 / 3G LaTex Formatted PDF for Kindle Screen / Moby Dick Test As a new person here and a new Kindle owner, I have yet to get my Kindle. While it has been sitting in our house for the last week, my wife -- refuses to give it to me more than three days before my birthday. The gall of it, I mean really[sic]. Be that as it may, I've spent a lot of time thinking about the Kindle, and more importantly, thinking about PDF's, formatting, and all that kind of goodness. I've been a long time lover of the LaTex typesetting system, and after digging around in Google, I found some people who had been playing around with using LaTex to lay out text an save in a Kindle usable (so reflow wouldnt be an issue). Returning from lunch, I found myself 3 hours from getting my Kindle, so I thought I would play around with using LaTex. If anyone is home right now, and has their Kindle nearby (non-dx) and would like to download this PDF I made using the Project Gutenberg Moby Dick txt, I'd love to hear how it looks. Click here to download. For those interested in the LaTex code I used, it's below. I'm planning on looking at this myself when I get home, but I'm feeling a bit impatient. Code: \documentclass[8pt]{article} \usepackage[utf8]{inputenc} \usepackage[paperwidth=9cm, paperheight=12cm, top=1cm, left=1cm, right=1cm, bottom=1cm]{geometry} \usepackage{graphicx} \usepackage[T1]{fontenc} \usepackage[scaled]{helvet} \renewcommand*\familydefault{\sfdefault} \frenchspacing \sloppy \pagestyle{empty} \begin{document} \end{documnent}
 11-19-2010, 05:07 PM #2 CyberpunkDad Neuromancer Fanboi     Posts: 49 Karma: 480 Join Date: Nov 2010 Device: Kindle 3 / 3G Slightly Smaller Font Version Here is a version with a slightly smaller font to showcase the typesetting a bit more. Click here to download. Code change: Code: \documentclass[fontsize=9pt]{scrartcl} Some Screenshots: And:
 11-19-2010, 06:17 PM #3 Top Tomato Member   Posts: 23 Karma: 1074640 Join Date: Jun 2008 Device: Kindle 3G I'm giving it a try right now for you. They look very good, extremely readable. Not my favorite choice of font, but you're doing this for you, not me. The dictionary lookup doesn't work. Also, quite a few words are split into two - that is, when I move the cursor around, the Kindle thinks it's two words. "circulation" on the first page of Chapter 1 is an example. Those may or may not bother you. So, I have to ask, why are you going for pdfs over mobi? Attached Thumbnails
11-19-2010, 06:57 PM   #4
LDBoblo
Wizard

Posts: 1,386
Karma: 16056
Join Date: Jun 2009
Location: Asia
Device: Kindle 3 WiFi, Sony PRS-505
Quote:
 Originally Posted by Top Tomato I'm giving it a try right now for you. They look very good, extremely readable. Not my favorite choice of font, but you're doing this for you, not me. The dictionary lookup doesn't work. Also, quite a few words are split into two - that is, when I move the cursor around, the Kindle thinks it's two words. "circulation" on the first page of Chapter 1 is an example. Those may or may not bother you. So, I have to ask, why are you going for pdfs over mobi?
Judging by the page layout and overall simplicity of the document, I'd say it's primarily for better hyphenation and justification.

I too do everything in PDF, though I use InDesign and not TeX. H&J is one major consideration, along with ligatures, swashes, custom kerning, numeral styles, smallcaps, more complex or attractive layouts, footnotes, multiple fonts, and page numbers.

 11-19-2010, 07:00 PM #5 tomsem Wizard   Posts: 2,478 Karma: 2534423 Join Date: Apr 2009 Location: USA Device: Kindle PW, iPad Air 2, Fire HD6 Word search does seem to work, even on 'circulation'. I did get definitions to pop up for some words - but it often the wrong definition! Ex.: position cursor next to the word 'water-gazers' on page 4, 'gaze' pops up. The second instance of 'whenever' on page 3 does pop up the correct definition. Strange. No idea why dictionary would not work if search does. I loaded a page into Illustrator and there's nothing strange with the layout. I suspect a bug in the way Kindle is using the Adobe PDF library (Mobile Reader SDK). I would want author & title metadata in there, though Kindle sometimes won't show it. Also there is no need for margins, or I'd make them maybe 1/4 the size they are. Even if they are zero, Kindle will still have a margin in full screen mode since the viewport for PDF/ebooks does not extend to the edges of the screen. It doesn't matter so much here because whitespace will be trimmed in fit to screen mode, but when zooming the margins will just be in the way. Last edited by tomsem; 11-19-2010 at 07:16 PM.
11-19-2010, 07:16 PM   #6
Top Tomato
Member

Posts: 23
Karma: 1074640
Join Date: Jun 2008
Device: Kindle 3G
Quote:
 Originally Posted by tomsem Word search does seem to work, even on 'circulation'. I did get definitions to pop up for some words - but it often the wrong definition! Ex.: position cursor next to the word 'water-gazers' on page 4, 'gaze' pops up. The second instance of 'whenever' on page 3 does pop up the correct definition. Strange.
Huh. You're right, the definitions do seem to pop up for a few words. For me it's very few and far between. I still can't get circulation to work, for example. But I got the definition of "gaze" when my cursor was 4 words before "water-gazers."

On the first page, I could get "whenever" to pop up, but not damp, drizzly, November or soul.

Strange, indeed.

I figured the OP was doing this for the high-quality layout purposes. I actually did a lot of LaTeX layouts myself in August in prep for my Kindle. (I use LaTeX almost daily at work.) But once I got it, I discovered I preferred the mobi format. It was a huge surprise since I'm normally very picky.

Last edited by Top Tomato; 11-19-2010 at 07:20 PM.

 11-19-2010, 07:16 PM #7 mikeayers Zealot     Posts: 113 Karma: 290343 Join Date: Nov 2010 Device: kindle-3 What are the advantages of using PDF vs some other format? I'd like to try it out, but I got home but my 4 day old kindle (and my wife) are out. She might be needing one for xmas.
11-19-2010, 07:54 PM   #8
tomsem
Wizard

Posts: 2,478
Karma: 2534423
Join Date: Apr 2009
Location: USA
Device: Kindle PW, iPad Air 2, Fire HD6
Quote:
 Originally Posted by mikeayers What are the advantages of using PDF vs some other format? I'd like to try it out, but I got home but my 4 day old kindle (and my wife) are out. She might be needing one for xmas.
- better typographical control and versatility (as good as the authoring app allows), including scripts that Kindle doesn't support (Hebrew, Arabic, Indic, math/music notation etc.), your choice of typefaces etc., hyphenation.
- non textual content (graphs, tables) that can't be reflowed and which automatic conversion cannot handle.
- ability to use vector graphics that remain 'smooth' when zoomed.
- wysiwyg makes it easier to anticipate what the result will look like, even without access to the reading device in question, and page layout programs and PDF are natural partners.
- by contrast, there are no mobi authoring tools that offer wysiwyg. You are basically editing HTML - or something that gets turned into HTML - and have to compile the result to see what it is going to look like on a Kindle (or Kindle previewer app).

I'm not saying PDF is the ideal format for Kindle - far from it - just that it is an important complement to the reflowable formats we have to date.

11-19-2010, 09:11 PM   #9
mikeayers
Zealot

Posts: 113
Karma: 290343
Join Date: Nov 2010
Device: kindle-3
Quote:
 Originally Posted by tomsem - better typographical control and versatility (as good as the authoring app allows), including scripts that Kindle doesn't support (Hebrew, Arabic, Indic, math/music notation etc.), your choice of typefaces etc., hyphenation. - non textual content (graphs, tables) that can't be reflowed and which automatic conversion cannot handle. - ability to use vector graphics that remain 'smooth' when zoomed. - wysiwyg makes it easier to anticipate what the result will look like, even without access to the reading device in question, and page layout programs and PDF are natural partners. - by contrast, there are no mobi authoring tools that offer wysiwyg. You are basically editing HTML - or something that gets turned into HTML - and have to compile the result to see what it is going to look like on a Kindle (or Kindle previewer app). I'm not saying PDF is the ideal format for Kindle - far from it - just that it is an important complement to the reflowable formats we have to date.
Your document looks great. The only other PDF I've looked at is The Linux Journal.
Even with rotating the screen and zooming, it's not very kindle friendly at all.

 11-19-2010, 11:33 PM #10 CyberpunkDad Neuromancer Fanboi     Posts: 49 Karma: 480 Join Date: Nov 2010 Device: Kindle 3 / 3G I was pretty happy with the result. Now that I can see the font size it helps. So I can tweak. There are a lot of other font options available which is cool. It let's you do things like stopgap lettering if you want. You know those classics with the big illustrative first letter? Granted it's work, but for me it's worth it if the end result is something that makes the reading more enjoyable. I also wanted to give it a whirl so that it I ran into a PDF of any kind that I wanted to convert into something that didn't require panning, I'd be able to have somewhere to start. That being said, some of the XML markup that you can add to HTML files seems really interesting too.
 11-20-2010, 01:45 AM #11 rkomar Wizard   Posts: 1,768 Karma: 4368476 Join Date: Oct 2010 Location: Vancouver, BC, Canada Device: PRS-505, PB 902, PRS-T1, PB 623 I, too, have been using LaTeX for producing e-reader sized PDFs. If you use the pdftex and hyperref packages, you can get a working table of contents, index, footnotes,... Here's what the start of my main tex files look like: \documentclass[12pt,a5paper,openany,oneside]{book} \usepackage[a5paper]{geometry} \usepackage[pdftex,pdftitle={My Awesome Buke},pdfauthor={Blow, Joe}]{hyperref} \usepackage[pdftex]{color,graphicx} \textwidth 128mm \topmargin -15mm \textheight 175mm \evensidemargin -15mm \oddsidemargin -15mm You can also use '\sloppy' to reduce the amount of hyphenation.
11-20-2010, 01:51 AM   #12
rkomar
Wizard

Posts: 1,768
Karma: 4368476
Join Date: Oct 2010
Device: PRS-505, PB 902, PRS-T1, PB 623
Quote:
 Originally Posted by CyberpunkDad That being said, some of the XML markup that you can add to HTML files seems really interesting too.
I use 'latex2html' to convert my LaTeX source to html. From there, it's very little work to produce an epub file using 'sigil' (although you kindle owners probably don't care about that ).

03-22-2011, 10:15 AM   #13
SiTeX
Junior Member

Posts: 1
Karma: 10
Join Date: Mar 2011
Device: Kindle
LaTeX to Kindle

Quote:
 Originally Posted by rkomar I, too, have been using LaTeX for producing e-reader sized PDFs. If you use the pdftex and hyperref packages, you can get a working table of contents, index, footnotes,...
Hello,
I formatted a document using pdftex with hyperref. Of course, the PDF document contains a TOC with active links. When I upload these files to a Kindle, the TOC appears but the links are not active.
Another problem, already mentioned elsewhere in this forum, is that the definition feature only works on a few words. Interesting!
Tom Price

 04-06-2011, 08:04 PM #14 valex Member   Posts: 24 Karma: 26 Join Date: Oct 2010 Location: IL, USA Device: kindle 3 Here are my settings in preambula: \usepackage[papersize={85.09mm,111.76mm},margin=0.55mm]{geometry} % Tried to fix the dictionary lookup - didn't help \usepackage{cmap} % font \usepackage[minionint,opticals,fullfamily]{MinionPro} \usepackage{MnSymbol} \figureversion{text,proprotional} % Make sure words with ligatures are searchable in PDF \input glyphtounicode \pdfgentounicode=1 % Microtypography enhancements \PassOptionsToPackage{kerning=true, spacing=true, babel=true}{microtype} \usepackage[normalmargins]{savetrees} \pagestyle{empty} The settings give me decent PDF quality. The dictionary problem is curios - when the cursor is activated and moved from word to word, it appears that a dictionary popup-shaped shadow blinks quickly where the pop-up should have appeared and the outlines of the letters in that area are visibly "smeared". Another problem is that Kindle centers partially full pages (starts/ends of chapters) vertically which could be solved by drawing very thin horizontal lines in header/footer in some light grey color so that they are invisible. I am investigating how to do that without losing any page real estate.
04-07-2011, 04:29 PM   #15
valex
Member

Posts: 24
Karma: 26
Join Date: Oct 2010
Location: IL, USA
Device: kindle 3
Quote:
 Originally Posted by valex Another problem is that Kindle centers partially full pages (starts/ends of chapters) vertically
Update: fixed by placing invisible (light gray) dots into the corners

Code:
\usepackage[width=85.09mm, height=111.76mm, center]{crop}

\usepackage[pdftex]{pict2e}
\usepackage{color}
\definecolor{light-gray}{gray}{0.95}

\newcommand*\cornerCrop{%
\begin{picture}(0,0)
\unitlength1pt
\put(0,0){\color{light-gray}\circle*{1}}
\end{picture}}

\cropdef\cornerCrop\cornerCrop\cornerCrop\cornerCrop{cornerDots}
\crop[cornerDots]

 Tags kindle, latex, pdf