I like to include the image in the document which has very large height. Is there any option that lets the tex engine to put a page break in the middle of the image? Note that resizing the image to fit in the page is not an option because that will make my image unreadable.

Note that I don't mind even if the image is splitted in the arbitrary fashion.

  • If the image is several times taller than it is wide, and has to span several pages, I think I'd just crop out portions of it for each page. If that process needs to be automated, that should be possible using ImageMagick, IrfanView, or other tools. – Mike Renfro Mar 27 '18 at 4:14

I used the crop option build-in in the regular \includegraphics of standard package graphicx, and automated the process in pure LaTeX, using the packages calc} (for the length) and forloop for the image parts.

Here is a working code (in the multipageimage macro).


    \newlength{\hhimg} \newlength{\wwimg}
    \newsavebox{\myimage} \savebox{\myimage}{\includegraphics{#2}}
    \newcounter{nb} \setcounter{nb}{#1}
    \newlength{\newwidth} \newlength{\newheight}
    \newlength{\lowertrim} \newlength{\uppertrim}
    \forloop{img}{0}{\value{img} < \value{nb}}{ 
            {\hhimg*\ratio{\theimg pt}{\thenb pt}}
            {\hhimg*\ratio{\thenb pt-\theimg pt-1pt}{\thenb pt}}    
        trim=0 {\the\lowertrim} 0 {\the\uppertrim}, clip=true]{#2}




With the result shown below at reduced size and in real size to download (with the image) from mydropbox.


For this example, the number of pages to spread on the image is the first optional parameter (with default to 2) and the image parts are maximized to fit the \textheight or \textwidth according to their aspectratio. This could be easily customized.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.