using an mp3 player as an “ebook reader”
Lots of people are finding this post through search engines. What are you looking for, people? Something that can show text and play mp3s, something that can change text into mp3s, or something else? Please do tell me in a comment! I’m not just curious, I actually know how to change text into speech automatically. I just haven’t tried it yet. OTOH, if you’re just looking for an ebook reader that can play mp3s… I don’t know, why don’t you get yourself an EeePC or something?
Every once in a while, a geek’s gotta do what a geek’s gotta do, so… Report, meet mp3 player. Mp3 player, meet report.
We’re going to try to display a report I wrote in LaTeX as a slideshow on my large screen (ho hum) mp3 player.
First, we’ll adapt the LaTeX source file so it will generate pages the size of the screen of our “ebook reader”.
We don’t want a4 paper (duh), and we want a small font so more text will fit on the screen, so we replace
\documentclass[a4paper]{article}
by
\documentclass[10pt]{article} .
We look up the screen resolution of the “ebook reader” on the net, it’s 128 x 160 pixels. We add the following:
\usepackage[vcentering,dvips]{geometry}
\geometry{papersize={128pt,160pt},total={108pt,140pt}}
Note that the second two numbers create a tiny margin. I know points (pt) and pixels are not the same thing, but for our purpose they will be.
We disable the useless automatically generated parts of the document by prefixing their commands with a % :
%\maketitle
%\tableofcontents
%\listoftables
%\listoffigures
Now we’re ready to compile the document with the usual command:
latex report.tex
Oops! We get lots of warnings about overfull hboxes. LaTeX has very nice two-side justification enabled by default, but on this scale it just won’t work because not enough words will fit on a line to make it look good. So, we’ll use the less pretty left justification instead. Insert this somewhere after \begin{document} : \raggedright . There, problem solved. Now re-run latex report.tex until it stops complaining about cross-references.
Now we have a dvi file, but what we want is a set of jpg files (the mp3 player doesn’t support any other image format). Fine. First we’ll make a postscript document:
dvips -o report.ps report.dvi
And then we’ll convert it to jpg files:
convert -antialias -negate report.ps rep%03d.jpg
Convert is part of the imagemagick package. This will generate a bunch of jpg files, named rep000.jpg, rep001.jpg, etc. -antialias should make the result a bit prettier, and -negate will change it to white text on black background, which should be easier on the eyes and maybe also on the batteries.
We use our favorite image viewer to verify everything looks alright (it does), and copy the files to our mp3 player, er, ebook reader. We’re done, only the mp3 player shows black screens instead of the text. I guess it doesn’t even support jpg very well, maybe a firmware update will fix that but I can’t be bothered to take the risks of that for something as silly as this. It’s a samsung yp-z5f if anyone’s curious.
We failed at the last step, thanks to proprietary software on the mp3 player. Still, I’d like to see you try this with an MS Word file, and get as nice results with this litte work:


Because LaTeX takes care of most of the formatting for you, it is much more flexible than WYSIWYG word processors.
Just to prove a point:
file rep000.jpg
rep000.jpg: JPEG image data, JFIF standard 1.01
See? It’s a real jpg. Nothing wrong with it. Oh well.
LaTeX tip of the day: include images this way:
\includegraphics[width=<SCALE>\textwidth]{<FILENAME>}
where <SCALE> would be, for example, .5 to make the image half as wide as the text. This way your images will never be too wide for the page, no matter what paper size you choose.

This is exactly what I was looking for. It’s easy to generated formatted LateX files with Open Office.org. I will try this as soon as possible.
Thanks
Let me know how that goes. I just had a look at some LaTeX generated by OpenOffice, and I think you may need to delete everything before \begin{document} and replace it by these commands:
\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage{txfonts}
\usepackage[vcentering,dvips]{geometry}
\geometry{papersize={128pt,160pt},total={108pt,140pt}}
\usepackage{color,graphicx}
I especially wonder what will happen to illustration and special formatting.
I am purchasing an mp3 player (samsung yp s5) and it includes the text feature, and i would like to read ebooks on there, however the only supported format for text files are .txt (plain text). Most ebooks dont have plain text there is juse Adobe, Mobipocket, and Mocrosoft reader. Is there a garunteed way to convert those formats in to plain text?? Please HELP ME!!!!!!!!!!!!!!
@Safiyyah:
Open the document on your computer, select all text, copy the text, open a plain text editor (on windows this would be notepad), paste the text in that editor, save, and you’re done.
Of course many ebooks are protected against this trick :/ .
On Linux and other UNIX-like operating systems there are many conversion utitilities with names like “pdftotext”.
Okay thank you, but since many ebooks are protected against copy & pasting….what can i do? What is Linux and other UNIX-like operating systems i have windows…..
thanx
Nat
What can you do to get the text out of a protected ebook?
The shortest answer is “nothing”. You might take a screenshot of each page and then feed those images to OCR software… but that’s really not worth the effort. Also, note that you may need to switch on a “text selection” tool in the document viewer to be able to copy-paste. Also, if I remember correctly, acroread has a “save as text” menu item in the file menu.
The somewhat longer answer is that someone somewhere may have made a program to do that, but you’re asking the wrong person. I don’t know much about software for MS Windows, I never used that operating system for anything else than simple office tasks … and even that was many years ago. By the way, please note that depending on where you live, it may be illegal to break the copy protection of an ebook you paid for. Silly but true.
The ultimate answer is that your computer isn’t doing what you want (converting some ebook format to plain text), but what someone else wants it to do (which is refusing to do what you want). It’s an annoying situation which is a natural result of using software of which you don’t have the human-readable code. If you did had that sourcecode, you (or someone else) could modify it to ignore the “disallow copying” information in ebook files. Unfortunately I’m not sure if such software (known as “free software” or “freedomware” or “open source” ) is available for all ebook formats. PDF is no problem, about the others I don’t know. It’s difficult to create software that reads file formats that are not published standards…
As far as possible, I use only software that I’m allowed to modify. This is one of the reasons I don’t use MS Windows. Another reason is that Windows simply can’t be made to work the way I like (this can be argued to be the same reason in different words). Linux (more precisely GNU/Linux) is what I use. If you’re curious, I recommend this website: http://www.getgnulinux.org/
UNIX is a group of operating systems that are all derived from one operating system designed very long ago, that are certified to match some standards. For example Solaris and BSD are UNIX, and - surprise! - so is MacOS X (if I’m not mistaken. at least it is UNIX-like, see next paragraph).
UNIX-like is a bigger group of operating systems, that all resemble UNIX. Most of these allow you to work in a graphical environment similar to what you’re used to from Windows, but all also have a text based working environment (”command line”). The general method of using the command line is to write a description of what you want in some plain text file(s), run some small program(s), and find what you want in a new file made by said programs. This may seem primitive, but it allows for really advanced automation of tasks. For example a few years ago I was in a situation where images and bits of text were shared between a few documents. I made it so that after modifying some image or text, I would have to type only one word on the command line, and my computer would figure out which documents needed to be updated, would update them, and then upload both pdf and html versions to my website. This automation was quite easy to do!
To convert an ebook to plain text, I would type this on the command line:
pdftotext AliceInWonderland.pdf AliceInWonderland.txt
Super easy, but works only for pdf files. For other filetypes there are other commands (for example antiword or catdoc for MS Word files), but as I said before I don’t know if these are available for all ebook filetypes. Usually a good strategy is to first “print” them to a postscript (ps) file in Windows, and then use ps2txt on Linux. Chances are that if copy-pasting isn’t allowed, printing isn’t allowed either, though.