So, I'm writing a report on powerautomate flow code. I'm attaching screenshots in the appendix of code (because it's visual code blocks), but these are VERY large images. (3500x21094) with a really tight ratio.
I'm using code inspired by this post to split the images into pages :
\documentclass[11pt,a4paper]{article}
\usepackage{adjustbox}
\usepackage{fp}
\usepackage{graphicx}
\graphicspath{ {./Assets/} }
\newcommand{\cropImg}[3]{
\FPeval{\top}{#2 / #3}
\FPeval{\bot}{(#3-#2-1) / #3}
\adjincludegraphics[
width=\textwidth,
trim={0 {\bot\height} 0 {\top\height}},
clip, % needed for trim to work
]{#1}
}
\begin{document}
\cropImg{LargePowerFlowImage}{1}{10}
\end{document}
I'm running into "dimensions too large" when running this on some of my tallest screenshots when building though.
This link suggests this is because I'm going beyond the capacity of latex, and the images wouldn't fit.HOWEVER it's only too big as an actual image, and the result of \cropimage is well within reason.
ABD: EveryShipout initializing macros ( FP-EVAL ( FP-UPN ( FP-DIV ) ) )
( FP-EVAL ( FP-UPN ( FP-SUB ) ( FP-SUB ) ( FP-DIV ) ) )
! Dimension too large.
<argument> \ht \@tempboxa
l.19 \cropImg{FlowCompute}{1}{10}
Is there a way to override Latex's limits on graphics size so I can import those screenshots into the code, where they are broken down ? (also posted on Reddit
\maxdimen
so you overflow tex arithmetic this is a hard limit but you can probably re-arrange the calculations to require different arithmetic, or better generate the images using external tools so they are correct size without scaling or trimming.