23

I wanna create a flowchart as a chain. What I want to achieve is a chain spanned over multiple pages on top of every page (see picture):

enter image description here

For the example picture I created it manually (copied the code from texample.net, made a standalone chaine, cropped it manually in half and used eso-pic to place it on top of the page). Is there a way to do something like this "automatically"?

A further question:

Could anybody give some suggestions of how to handle this, if no rimless printer is available? Should I look for a different solution?

schmendrich
  • 3,908

1 Answers1

4

Once again, this was agood opportunity to use Gonzalo Medina's excellent background package. So far it works quite well, except for an unexpected error: if there is a TikZ cooordinate bigger than 90cm, it throws ! Dimension too large and I can't work with sizes bigger than about 19 feet. This is odd, as 19 feet x 12 inch per foot x 2.54 cm per inch = 579cm. So as it stands now, the chains are restricted to a width of 4 pages in A4 (and 6cm on the fifth), whereas it should be up to 27 in my opinion. Anyway, here's what I have so far, you need to complie three times to get it right:

Code

\documentclass[parskip]{scrartcl}
\usepackage[left=15mm,right=15mm,bottom=25mm,top=50mm]{geometry}
\usepackage[scale=1,angle=0,opacity=1,color=black]{background}
\usetikzlibrary{calc}
\usepackage{xifthen}
\usepackage{lipsum}

\pgfmathsetmacro{\topheightreservedforpicture}{4}

\backgroundsetup%
{ contents={
        \multipagetikz{1}{4}{\tpone}
        \multipagetikz{6}{5}{\tptwo}
  }
}

\newcommand{\multipagetikz}[3]% start page, num pages, picture code
{   \pgfmathtruncatemacro{\currentpage}{\value{page}}
    \pgfmathtruncatemacro{\maxpage}{#1+#2}
    \pgfmathtruncatemacro{\minpage}{#1-1}
    \pgfmathsetmacro{\paperwidthcm}{\paperwidth/28.453}
    \pgfmathsetmacro{\additionalxshift}{-(\value{page}-#1)*\paperwidthcm}
    \ifthenelse{\currentpage < \maxpage \AND \currentpage > \minpage}
    { \begin{tikzpicture}[overlay,remember picture,rounded corners=5mm,shift={($(current page.north west)+(0,-\topheightreservedforpicture)+(\additionalxshift,0)$)}]
            #3
        \end{tikzpicture}   
    }{}
}

\newcommand{\tpone}
{   \fill[left color=red,right color=blue!50!cyan] (0,0) -- (60,0) to[out=0,in=270,looseness=0.2] (84,3) -- cycle;
}

\newcommand{\tptwo}
{   \fill[top color=orange,bottom color=violet] (0,1) -- (55,0) to[out=0,in=270,looseness=0.2] (90,3) -- (10,3.5) -- cycle;
}

\begin{document}

\lipsum[1-60]

\end{document}

Output

enter image description here

Tom Bombadil
  • 40,123