Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > More E-Book Readers > iRex

Notices

Reply
 
Thread Tools Search this Thread
Old 02-08-2007, 07:35 PM   #1
harpum
Enthusiast
harpum began at the beginning.
 
Posts: 47
Karma: 24
Join Date: Jan 2007
Device: Axim 51v/LG chocolate
Simple iliad cutting latex file for long page.

When I see letter size files, becuase height is two long, Iliad try to scale to small size. I cannot read it directly, I usually zoom it.

If I fit page to iliad width and cut one long page to 2 page,
I can easily see it without zooming and reduce time.

So I made very adhoc latex file.
Of course, this file is very simple and very ugly. But I believe some people upgrade it easily.

I believe someone can add hyperlinks in the second page which have a lot of free space.
Of course it will be possible to add TOC.

Thank you.

PS. I recommand crop file before converting.
I used pdflatex in Miktex.
--------------------------------------------------------
\documentclass{article}
\unitlength=1pt
\def\startp{1} %%% start page
\def\endp{27} %%% end page+1
\def\overlaprate{0.007} % percentage for overlap
\def\errfactor{1} % additional scale factor. You can enlarge or reduce it.
\def\fname{manual.pdf} % file name
\newlength{\paperx}
\setlength{\paperx}{347pt}% iliad page size(x-coordinate)
\newlength{\papery}
\setlength{\papery}{427pt} % iliad page size(y-coordinate)
\newlength{\pagex}
\newlength{\pagey}
\newlength{\cuty}
\newlength{\scale}
\newlength{\resultovery}
\newlength{\resulty}
\makeatletter
\newcommand*{\px}{\strip@pt\paperx}
\newcommand*{\py}{\strip@pt\papery}
\newcommand*{\pgx}{\strip@pt\pagex}
\newcommand*{\pgy}{\strip@pt\pagey}
\newcommand*{\cy}{\strip@pt\cuty}
\newcommand*{\sca}{\strip@pt\scale}
\newcommand*{\ry}{\strip@pt\resulty}
\newcommand*{\roy}{\strip@pt\resultovery}
\newcommand{\npt}[1]{\strip@pt#1}
\makeatother
\usepackage[paperwidth=\paperx,paperheight=\papery,margin={0pt ,0pt},pdftex,nohead,nofoot]{geometry}
\usepackage{ifthen,pdfpages,calc,hyperref}
\newcounter{pg}
\setcounter{pg}{\startp}
\begin{document}
%\tableofcontents
\title{Test File\\
Hi!!}
\date{}
\maketitle %%% You can make your own cover!
\center
\whiledo{\value{pg}<\endp}{
\setbox1=\hbox{
\expandafter\includegraphics[page=\thepg]{\fname}
}
\setlength{\pagex}{\the\wd1}
\setlength{\pagey}{\the\ht1}
\setlength{\scale}{\paperx *\real{\errfactor}/ \real{\pgx}}
\setlength{\cuty}{\pagey *\real{\sca}-\papery}
\setlength{\resulty}{\cuty / \real{\sca}}
\setlength{\resultovery}{\resulty + \pagey*\real{\overlaprate}}
\includegraphics[scale=\sca,viewport={{0} {\ry} {\pgx} {\pgy}},page=\thepg]{\fname}
\ifthenelse{\papery < \pagey}
{
\expandafter\includegraphics[scale=\sca,viewport={{0} {0} {\pgx} {\roy}},page=\thepg]{\fname}
}{}
\addtocounter{pg}{1}
}
\end{document}
Attached Files
File Type: pdf manual.pdf (444.0 KB, 838 views)
File Type: pdf sample.pdf (465.5 KB, 628 views)

Last edited by harpum; 02-08-2007 at 07:41 PM.
harpum is offline   Reply With Quote
Old 02-09-2007, 02:20 PM   #2
Alexander Turcic
Fully Converged
Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.Alexander Turcic ought to be getting tired of karma fortunes by now.
 
Alexander Turcic's Avatar
 
Posts: 18,163
Karma: 14021202
Join Date: Oct 2002
Location: Switzerland
Device: Too many to count here.
Thanks harpum, this is very interesting. I've tried a couple of command line tools to convert content to PDF, but it seems LaTeX is the way to go. Your sample could be very helpful.
Alexander Turcic is offline   Reply With Quote
Advert
Old 02-10-2007, 12:53 AM   #3
harpum
Enthusiast
harpum began at the beginning.
 
Posts: 47
Karma: 24
Join Date: Jan 2007
Device: Axim 51v/LG chocolate
One benefit of latex is that converting time is more shorter than other methods. And I believe expert easily add link and TOC.
(Frankly, I do not know well Latex. Please, upgrade this ugly code.)
Thanks.
harpum is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LaTeX style for the Iliad sigi iRex 4 05-20-2010 01:37 PM
Making PDFs for the iliad using LaTeX (with LyX) Antartica iRex 17 05-20-2010 01:35 PM
Mystery and Crime Chandler, Raymond: The Simple Art of Murder [long version] v1, 21 March 2010. Patricia Kindle Books (offline) 5 03-22-2010 12:28 AM
Mystery and Crime Chandler, Raymond: The Simple Art of Murder [long version] v1, 21 March 2010. Patricia IMP Books (offline) 0 03-21-2010 12:54 AM
PDF Generated with LaTeX for the iLiad Hadrien iRex 17 07-25-2008 09:59 AM


All times are GMT -4. The time now is 11:56 AM.


MobileRead.com is a privately owned, operated and funded community.