02-08-2007, 08:35 PM | #1 |
Enthusiast
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} Last edited by harpum; 02-08-2007 at 08:41 PM. |
02-09-2007, 03:20 PM | #2 |
Fully Converged
Posts: 18,171
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.
|
Advert | |
|
02-10-2007, 01:53 AM | #3 |
Enthusiast
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. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
LaTeX style for the Iliad | sigi | iRex | 4 | 05-20-2010 02:37 PM |
Making PDFs for the iliad using LaTeX (with LyX) | Antartica | iRex | 17 | 05-20-2010 02: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 01: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 01:54 AM |
PDF Generated with LaTeX for the iLiad | Hadrien | iRex | 17 | 07-25-2008 10:59 AM |