%% The LaTeX package incgraph - version 1.2.0 (2021/10/20)
%% incgraph.sty: Graphics inclusion page
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2012-2021 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `author-maintained'.
%%
%% This work consists of all files listed in README
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{incgraph}[2021/10/20 version 1.2.0 LaTeX special graphics inclusion]

\DeclareOption{pgf}{\def\igrreq@pgf{\RequirePackage{pgf}[2008/01/15]\RequirePackage{pgffor}}}%
\DeclareOption{nopgf}{\def\igrreq@pgf{}}%
\DeclareOption{graphicx}{\def\igrreq@graphicx{\RequirePackage{graphicx}}}%
\DeclareOption{nographicx}{\def\igrreq@graphicx{}}%
\DeclareOption{bookmark}{\def\igrreq@bookmark{\RequirePackage{bookmark}}}%
\DeclareOption{nobookmark}{\def\igrreq@bookmark{}}%

\ExecuteOptions{pgf,graphicx,bookmark}
\ProcessOptions\relax

\RequirePackage{pgfkeys}
\igrreq@pgf
\igrreq@graphicx
\igrreq@bookmark

% key management
\pgfkeys{/igr/.is family}

\def\igrset{\pgfqkeys{/igr}}

\newbox\igrbox
\newdimen\igr@length
\newcounter{igrtarget}

\ExplSyntaxOn

\sys_if_engine_pdftex:TF
  {
    \NewDocumentCommand \igrGetPageSize {}
      {
        \cs_gset_nopar:Npx \igrPageWidth  { \the\pdfpagewidth  }
        \cs_gset_nopar:Npx \igrPageHeight { \the\pdfpageheight }
      }
    \NewDocumentCommand \igrSetPageSize { m m }
      {
        \pdfpagewidth  #1
        \pdfpageheight #2
      }
    \NewDocumentCommand \igrGetLastPage { m }
      {
        \pdfximage{#1}
        \cs_gset_nopar:Npx \igrLastPage { \the\pdflastximagepages }
      }
  }
  {
    \sys_if_engine_luatex:TF
      {
        \NewDocumentCommand \igrGetPageSize {}
          {
            \cs_gset_nopar:Npx \igrPageWidth  { \the\pagewidth  }
            \cs_gset_nopar:Npx \igrPageHeight { \the\pageheight }
          }
        \NewDocumentCommand \igrSetPageSize { m m }
          {
            \pagewidth  #1
            \pageheight #2
          }
        \NewDocumentCommand \igrGetLastPage { m }
          {
            \saveimageresource{#1}
            \cs_gset_nopar:Npx \igrLastPage { \the\lastsavedimageresourcepages }
          }
      }
      {
        \cs_if_exist:NTF \pdfpagewidth
          {
            \NewDocumentCommand \igrGetPageSize {}
              {
                \cs_gset_nopar:Npx \igrPageWidth  { \the\pdfpagewidth  }
                \cs_gset_nopar:Npx \igrPageHeight { \the\pdfpageheight }
              }
            \NewDocumentCommand \igrSetPageSize { m m }
              {
                \pdfpagewidth  #1
                \pdfpageheight #2
              }
          }
          {
            \NewDocumentCommand \igrGetPageSize {}
              {
                \cs_gset_nopar:Npx \igrPageWidth  { \the\paperwidth  }
                \cs_gset_nopar:Npx \igrPageHeight { \the\paperheight }
              }
            \NewDocumentCommand \igrSetPageSize { m m }
              {
              }
          }
        \NewDocumentCommand \igrGetLastPage { m }
          {
            \cs_gset_nopar:Npx \igrLastPage { 1 }
          }
      }
  }

\ExplSyntaxOff

\AtBeginDocument{%
  \igrGetPageSize%
  \let\igrOrginalPageWidth\igrPageWidth%
  \let\igrOrginalPageHeight\igrPageHeight%
}

\def\igr@target@auto{%
  \xdef\igrAutoTarget{igr-\theigrtarget}%
}

\def\igr@target@user{%
  \xdef\igrAutoTarget{\igr@usertarget}%
  \global\let\igr@target@next=\igr@target@auto%
}

\let\igr@target@next=\igr@target@auto

\NewDocumentCommand\igrtargetset{m}{%
  \def\igr@usertarget{#1}%
  \let\igr@target@next=\igr@target@user%
}

\def\igr@nextAutoTarget{%
  \refstepcounter{igrtarget}%
  \igr@target@next%
}

\def\igr@do@rebox{%
  \setbox\igrbox\hbox{%
    \kern\igr@left@border%
    \vbox{%
      \kern\igr@top@border%
      \box\igrbox%
      \kern\igr@bottom@border%
    }%
    \kern\igr@right@border}%
}

\def\igr@rebox{%
  \ifdim\igr@top@border=0pt\relax%
    \ifdim\igr@bottom@border=0pt\relax%
      \ifdim\igr@left@border=0pt\relax%
        \ifdim\igr@right@border=0pt\relax%
        \else%
          \igr@do@rebox%
        \fi%
      \else%
        \igr@do@rebox%
      \fi%
    \else%
      \igr@do@rebox%
    \fi%
  \else%
    \igr@do@rebox%
  \fi%
}

\def\igr@get@box@dimensions{%
  \igr@length=\wd\igrbox%
  \edef\igrBoxWidth{\the\igr@length}%
  \igr@length=\ht\igrbox%
  \edef\igrBoxht{\the\igr@length}%
  \igr@length=\dp\igrbox%
  \edef\igrBoxdp{\the\igr@length}%
  \advance\igr@length by \igrBoxht%
  \edef\igrBoxHeight{\the\igr@length}%
}

\NewDocumentCommand\igrboxset{+m}{%
  \igr@nextAutoTarget%
  \setbox\igrbox\color@hbox#1\color@endbox%
  \igr@rebox%
  \igr@get@box@dimensions%
}


\def\igr@hyper{\hypertarget{\igrAutoTarget}{}}

\NewDocumentCommand\igrboxcenter{}{%
  \igrGetPageSize%
  \thispagestyle{\igrpagestyle}%
  %
  \igr@length=-1in%
  \advance\igr@length by -\voffset%
  \advance\igr@length by -\topmargin%
  \advance\igr@length by -\headheight%
  \advance\igr@length by -\headsep%
  \edef\igr@offy@top{\the\igr@length}%
  %
  \igr@length=\igrPageHeight%
  \advance\igr@length by -\igrBoxHeight%
  \divide\igr@length by 2%
  \edef\igr@offy@abs{\the\igr@length}%
  %
  \igr@length=-1in%
  \advance\igr@length by -\hoffset%
  \if@twoside
    \ifodd\c@page
      \advance\igr@length by -\oddsidemargin%
    \else
      \advance\igr@length by -\evensidemargin%
    \fi
    \else
      \advance\igr@length by -\oddsidemargin%
  \fi%
  \edef\igr@offx@left{\the\igr@length}%
  %
  \igr@length=\igrPageWidth%
  \advance\igr@length by -\igrBoxWidth%
  \divide\igr@length by 2%
  \advance\igr@length by \igr@offx@left%
  \edef\igr@offx{\the\igr@length}%
  %
  \vbox to \vsize{%
    \kern\igr@offy@top\hbox{\kern\igr@offx@left\igr@hypertarget\hss}%
    \nointerlineskip\kern\igr@offy@abs%
    \hbox to \hsize{\kern\igr@offx\box\igrbox\hss}%
    \vss}%
  \break%
}

\NewDocumentCommand\igrboxtikz{}{%
  \path[use as bounding box] (0,0) rectangle (\igrBoxWidth,\igrBoxHeight);
  \node[line width=0mm,inner sep=0,rectangle,above right] (box) at (0,0) {\box\igrbox};
  \node[minimum width=\igrBoxWidth,minimum height=\igrBoxHeight,line width=0mm,inner sep=0mm,above right] (page) at (0,0) {};%
}

\let\igrboxtikzpage=\igrboxtikz

\NewDocumentCommand\igrboxtikzcenter{}{%
  \igrGetPageSize%
  \path[use as bounding box] (0,0) rectangle (\igrPageWidth,\igrPageHeight);
  \node[line width=0mm,inner sep=0,rectangle,above right] (box) at ({(\igrPageWidth-\igrBoxWidth)/2},{(\igrPageHeight-\igrBoxHeight)/2}) {\box\igrbox};
  \let\igrBoxWidth\igrPageWidth%
  \let\igrBoxHeight\igrPageHeight%
  \node[minimum width=\igrBoxWidth,minimum height=\igrBoxHeight,line width=0mm,inner sep=0mm,above right] (page) at (0,0) {};%
}

\def\igr@overlay@on{%
  \igrboxset{\begin{tikzpicture}\igrboxtikzcenter\igr@tikz@hook\end{tikzpicture}}}

\def\igr@overlay@off{}

\let\igr@overlay=\igr@overlay@off

% Output macros

\def\igr@out@resize#1#2{%
  \igrGetPageSize%
  \let\igrCurrentPageWidth\igrPageWidth%
  \let\igrCurrentPageHeight\igrPageHeight%
  \eject%
  \igrSetPageSize{#1}{#2}%
  \igr@overlay%
  \edef\theigrpage{\thepage}%
  \igrboxcenter%
  \igrSetPageSize{\igrCurrentPageWidth}{\igrCurrentPageHeight}%
}

\def\igr@out@center@fit@port{%
  \igr@out@resize{\igr@target@width}{\igr@target@height}%
}

\def\igr@out@center@fit@land{%
  \igr@out@resize{\igr@target@height}{\igr@target@width}%
}

\def\igr@out@center@fit{%
  \csname igr@out@center@fit@\igr@turn\endcsname%
}

\def\igr@out@page{%
  \igr@out@resize{\igrBoxWidth}{\igrBoxHeight}%
}

\def\igr@out@center@port{%
  \clearpage%
  \igr@overlay%
  \edef\theigrpage{\thepage}%
  \igrboxcenter%
}

\def\igr@out@center@land{%
  \igrGetPageSize%
  \let\igr@temp@w\igrPageWidth%
  \let\igr@temp@h\igrPageHeight%
  \igr@out@resize{\igr@temp@h}{\igr@temp@w}%
}

\def\igr@out@center{%
  \csname igr@out@center@\igr@turn\endcsname%
}

% Toolbox output

\NewDocumentCommand\igrcenterfit{mm+m}{%
  \igrboxset{#3}%
  \igr@out@resize{#1}{#2}%
}

\NewDocumentCommand\igrpage{+m}{%
  \igrboxset{#1}%
  \igr@out@page%
}

\NewDocumentCommand\igrcenter{+m}{%
  \igrboxset{#1}%
  \igr@out@center@port%
}


% include macros

\ExplSyntaxOn


\bool_new:N \g__incgra_first_include
\bool_new:N \g__incgra_multi_include
\clist_new:N \l__incgra_extensions_clist
\tl_new:N \l__incgra_bookmark_heading_options_tl
\tl_new:N \l__incgra_bookmark_heading_text_tl
\tl_new:N \l__incgra_bookmark_options_tl
\tl_new:N \l__incgra_bookmark_text_tl
\tl_new:N \l__incgra_label_text_tl
\tl_new:N \l__incgra_options_tl


\cs_new_protected_nopar:Npn \__incgra_if_file_exist_extensions:nTF #1
  {
    \bool_set_false:N \l_tmpa_bool
    \clist_map_inline:Nn \l__incgra_extensions_clist
      {
        \file_if_exist:nTF { #1 ##1 }
          {
            \tl_put_right:Nn \nt {##1}
            \bool_set_true:N \l_tmpa_bool
            \clist_map_break:
          }
      }
    \bool_if:NTF \l_tmpa_bool
  }


\cs_new_protected_nopar:Npn \__incgra_if_file_exist_extensions_star:nTF #1#2#3
  {
    \file_if_exist:nTF { #1 }
      {
        #2
      }
      {
        \__incgra_if_file_exist_extensions:nTF {#1}{#2}{#3}
      }
  }


\cs_new_protected_nopar:Npn \__incgra_includegraphics:nn #1#2
  {
    \igr@match@hook

    \tl_set:Nn       \l_tmpa_tl { \__incgra_include_graphics:w [ }
    \tl_put_right:NV \l_tmpa_tl \l__incgra_options_tl
    \tl_put_right:Nn \l_tmpa_tl { ,#1] }

    \bool_if:NTF \g__incgra_multi_include
      {
        \bool_if:NTF \g__incgra_first_include
          {
            \tl_if_empty:NTF \l__incgra_label_text_tl
              {
                \igrboxset{\l_tmpa_tl{#2}}
              }
              {
                \igrboxset{\l_tmpa_tl{#2}\label{\l__incgra_label_text_tl}}
              }
            \igr@output
            \tl_if_empty:NF \l__incgra_bookmark_heading_text_tl
              {
                \tl_set:Nn       \l_tmpa_tl { \bookmark[ }
                \tl_put_right:NV \l_tmpa_tl \l__incgra_bookmark_heading_options_tl
                \tl_put_right:Nn \l_tmpa_tl { ,dest=\igrAutoTarget] }
                \l_tmpa_tl { \l__incgra_bookmark_heading_text_tl }
              }
            \bool_gset_false:N \g__incgra_first_include
          }
          {
            \igrboxset{\l_tmpa_tl{#2}}
            \igr@output
          }
      }
      {
        \tl_if_empty:NTF \l__incgra_label_text_tl
          {
            \igrboxset{\l_tmpa_tl{#2}}
          }
          {
            \igrboxset{\l_tmpa_tl{#2}
            \label{\l__incgra_label_text_tl}}
          }
        \igr@output
      }
    \tl_if_empty:NF \l__incgra_bookmark_text_tl
      {
        \tl_set:Nn       \l_tmpa_tl { \bookmark[ }
        \tl_put_right:NV \l_tmpa_tl \l__incgra_bookmark_options_tl
        \tl_put_right:Nn \l_tmpa_tl { ,dest=\igrAutoTarget] }
        \l_tmpa_tl{\l__incgra_bookmark_text_tl}
      }
  }

\cs_generate_variant:Nn \__incgra_includegraphics:nn { nV }


\NewDocumentCommand \incgraph { +O{} O{} m }
  {
    \group_begin:
    \igrset{#1}
    \bool_gset_false:N \g__incgra_multi_include
    \tl_clear_new:N \nt
    \tl_set:Nn \nt {#3}
    \__incgra_if_file_exist:nTF{#3}
      {
        \__incgra_includegraphics:nV {#2} \nt
      }
      {}
    \group_end:
  }


\NewDocumentCommand \incmultigraph { +O{} O{} m m }
  {
    \group_begin:
    \igrset{#1}
    \bool_gset_true:N \g__incgra_multi_include
    \bool_gset_true:N \g__incgra_first_include
    \tl_clear_new:N \nt
    \tl_clear_new:N \nn
    \foreach \n [count=\ni] in {#4}
      {
        \tl_set:Nn \nt {#3}
        \tl_set:Nx \nn {\igr@zero@fill{\n}}
        \__incgra_if_file_exist:nTF{#3}
          {
            \__incgra_includegraphics:nV {#2} \nt
          }
          {}
      }
    \group_end:
  }


\NewDocumentEnvironment{inctext}{ +O{} }
  {
    \igrset{#1}
    \igr@match@hook
    \igr@nextAutoTarget
    \clearpage
    \begin{lrbox}{\igrbox}
  }
  {
    \unskip
    \tl_if_empty:NF \l__incgra_label_text_tl
      {
        \label{\l__incgra_label_text_tl}
      }
    \end{lrbox}
    \igr@rebox
    \igr@get@box@dimensions
    \igr@output
    \tl_if_empty:NF \l__incgra_bookmark_text_tl
      {
        \tl_set:Nn       \l_tmpa_tl { \bookmark[ }
        \tl_put_right:NV \l_tmpa_tl \l__incgra_bookmark_options_tl
        \tl_put_right:Nn \l_tmpa_tl { ,dest=\igrAutoTarget] }
        \l_tmpa_tl { \l__incgra_bookmark_text_tl }
      }
  }


\igrset
  {
    include~command/.code =
      {
        \cs_set_eq:NN \__incgra_include_graphics:w #1
      },
    include~command/.default = \includegraphics,
    extensions/.code =
      {
        \clist_set:Nn \l__incgra_extensions_clist {#1}
      },
    extensions~add/.code =
      {
        \clist_put_right:Nn \l__incgra_extensions_clist {#1}
      },
    extensions~from~graphics/.code=
      {
        \cs_if_exist:NT \Gin@extensions
          {
            \clist_set:NV \l__incgra_extensions_clist \Gin@extensions
          }
      },
    existence~check/.code =
      {
        \cs_set_eq:NN \__incgra_if_file_exist:nTF #1
      },
    ignore~on~not~found/.style =
      {
        existence~check = \file_if_exist:nTF
      },
    ignore~on~not~found~with~extensions/.code =
      {
        \cs_set_eq:NN \__incgra_if_file_exist:nTF \__incgra_if_file_exist_extensions:nTF
        \quark_if_nil:NF { #1 }
          {
            \clist_set:Nn \l__incgra_extensions_clist {#1}
          }
      },
    ignore~on~not~found~with~extensions/.default = \q_nil,
    ignore~on~not~found~with~extensions*/.code =
      {
        \cs_set_eq:NN \__incgra_if_file_exist:nTF \__incgra_if_file_exist_extensions_star:nTF
        \quark_if_nil:NF { #1 }
          {
            \clist_set:Nn \l__incgra_extensions_clist {#1}
          }
      },
    ignore~on~not~found~with~extensions*/.default = \q_nil,
    no~existence~check/.style =
      {
        existence~check = \use_ii:nnn
      },
    fail~on~not~found/.style = no~existence~check,
    options/.store~in = \l__incgra_options_tl,
    options~add/.code =
      {
        \tl_if_empty:NTF \l__incgra_options_tl
          {
            \tl_set:Nn \l__incgra_options_tl { #1 }
          }
          {
            \tl_put_right:Nn \l__incgra_options_tl { ,#1 }
          }
      },
    bookmark/.store~in                 = \l__incgra_bookmark_text_tl,
    bookmark~options/.store~in         = \l__incgra_bookmark_options_tl,
    bookmark~heading/.store~in         = \l__incgra_bookmark_heading_text_tl,
    bookmark~heading~options/.store~in = \l__incgra_bookmark_heading_options_tl,
    label/.store~in                    = \l__incgra_label_text_tl,
  }

\ExplSyntaxOff




\def\igr@make@zerofill#1#2#3#4#5#6#7#8#9{%
  \def\igr@zerofill##1{%
    \ifnum##1<10 #1%
    \else\ifnum##1<100 #2%
    \else\ifnum##1<1000 #3%
    \else\ifnum##1<10000 #4%
    \else\ifnum##1<100000 #5%
    \else\ifnum##1<1000000 #6%
    \else\ifnum##1<10000000 #7%
    \else\ifnum##1<100000000 #8%
    \else\ifnum##1<1000000000 #9%
    \fi\fi\fi\fi\fi\fi\fi\fi\fi%
    ##1%
  }%
}

\NewDocumentCommand\igrmakezerofill{mm}{%
  \def\igr@zerofill##1{##1}%
  \ifcase#2\or\or\igr@make@zerofill{0}{}{}{}{}{}{}{}{}%
  \or\igr@make@zerofill{00}{0}{}{}{}{}{}{}{}%
  \or\igr@make@zerofill{000}{00}{0}{}{}{}{}{}{}%
  \or\igr@make@zerofill{0000}{000}{00}{0}{}{}{}{}{}%
  \or\igr@make@zerofill{00000}{0000}{000}{00}{0}{}{}{}{}%
  \or\igr@make@zerofill{000000}{00000}{0000}{000}{00}{0}{}{}{}%
  \or\igr@make@zerofill{0000000}{000000}{00000}{0000}{000}{00}{0}{}{}%
  \or\igr@make@zerofill{00000000}{0000000}{000000}{00000}{0000}{000}{00}{0}{}%
  \else\igr@make@zerofill{000000000}{00000000}{0000000}{000000}{00000}{0000}{000}{00}{0}%
  \fi%
  \let#1=\igr@zerofill%
}

\NewDocumentCommand\igrsetmatchvalue{mm}{%
  \pgfkeyssetvalue{/igrmatch/#1}{#2}%
}

\NewExpandableDocumentCommand\igrifmatch{mmm}{%
  \pgfkeysifdefined{/igrmatch/#1}{%
    \pgfkeysgetvalue{/igrmatch/#1}{\igrmatchvalue}#2}{#3}%
}

\pgfkeys{%
  /igrsetmatch/.unknown/.code={%
    \let\igrmatchkey=\pgfkeyscurrentname%
    \igrsetmatchvalue{\igrmatchkey}{#1}%
  }%
}

\NewDocumentCommand\igrsetmatches{m}{\pgfkeys{/igrsetmatch/.cd,#1}}


\igrset{%
  zerofill/.code={\igrmakezerofill{\igr@zero@fill}{#1}},
  set matches/.code=\igrsetmatches{#1},
  hyper/.code={\let\igr@hypertarget=\igr@hyper},
  no hyper/.code={\def\igr@hypertarget{}},
  if match code/.code args={#1#2#3}{\def\igr@match@hook{\igrifmatch{#1}{#2}{#3}}},
  if match set/.style args={#1#2#3}{if match code={#1}{\igrset{#2}}{\igrset{#3}}},
  if match set bookmark/.style args={#1#2#3}{if match code={#1}{\igrset{bookmark={#2}}}{\igrset{bookmark={#3}}}},
  disable match/.code={\def\igr@match@hook{}},
  pagestyle/.store in=\igrpagestyle,
  target/.code={\igrtargetset{#1}},
  overlay@code/.store in=\igr@tikz@hook,
  overlay/.code={\let\igr@overlay=\igr@overlay@on\igrset{overlay@code={#1}}},
  overlay page number options/.store in=\igr@overlay@pagenumber@options,
  overlay page number at/.style={overlay={%
    \expandafter\node\expandafter[\igr@overlay@pagenumber@options]
      at (#1) {\thepage};}},
  overlay page number at top/.style={overlay page number at={\igrBoxWidth/2,\igrBoxHeight-#1}},
  overlay page number at top/.default=1.5cm,
  overlay page number at bottom/.style={overlay page number at={\igrBoxWidth/2,#1}},
  overlay page number at bottom/.default=1.5cm,
  no overlay/.code={\let\igr@overlay=\igr@overlay@off},
  portrait/.code={\def\igr@turn{port}},
  landscape/.code={\def\igr@turn{land}},
  paper size/.code args={#1:#2}{\def\igr@target@width{#1}\def\igr@target@height{#2}\let\igr@output=\igr@out@center@fit},
  a0paper/.style={paper size=841mm:1189mm},
  a1paper/.style={paper size=594mm:841mm},
  a2paper/.style={paper size=420mm:594mm},
  a3paper/.style={paper size=297mm:420mm},
  a4paper/.style={paper size=210mm:297mm},
  a5paper/.style={paper size=148mm:210mm},
  a6paper/.style={paper size=105mm:148mm},
  a7paper/.style={paper size=74mm:105mm},
  a8paper/.style={paper size=52mm:74mm},
  a9paper/.style={paper size=37mm:52mm},
  a10paper/.style={paper size=26mm:37mm},
  b0paper/.style={paper size=1000mm:1414mm},
  b1paper/.style={paper size=707mm:1000mm},
  b2paper/.style={paper size=500mm:707mm},
  b3paper/.style={paper size=353mm:500mm},
  b4paper/.style={paper size=250mm:353mm},
  b5paper/.style={paper size=176mm:250mm},
  b6paper/.style={paper size=125mm:176mm},
  b7paper/.style={paper size=88mm:125mm},
  b8paper/.style={paper size=62mm:88mm},
  b9paper/.style={paper size=44mm:62mm},
  b10paper/.style={paper size=31mm:44mm},
  c0paper/.style={paper size=917mm:1297mm},
  c1paper/.style={paper size=648mm:917mm},
  c2paper/.style={paper size=648mm:917mm},
  c3paper/.style={paper size=324mm:458mm},
  c4paper/.style={paper size=229mm:324mm},
  c5paper/.style={paper size=162mm:229mm},
  c6paper/.style={paper size=114mm:162mm},
  c7paper/.style={paper size=81mm:114mm},
  c8paper/.style={paper size=57mm:81mm},
  c9paper/.style={paper size=40mm:57mm},
  c10paper/.style={paper size=28mm:40mm},
  d0paper/.style={paper size=771mm:1091mm},
  d1paper/.style={paper size=545mm:771mm},
  d2paper/.style={paper size=385mm:545mm},
  d3paper/.style={paper size=272mm:385mm},
  d4paper/.style={paper size=192mm:272mm},
  d5paper/.style={paper size=136mm:192mm},
  d6paper/.style={paper size=96mm:136mm},
  d7paper/.style={paper size=68mm:96mm},
  executivepaper/.style={paper size=7.25in:10.5in},
  letterpaper/.style={paper size=8.5in:11in},
  legalpaper/.style={paper size=8.5in:14in},
  ledgerpaper/.style={paper size=17in:11in},
  currentpaper/.code={\let\igr@output=\igr@out@center},
  documentpaper/.style={paper size=\igrOrginalPageWidth:\igrOrginalPageHeight},
  graphicspaper/.code={\let\igr@output=\igr@out@page},
  paper/.style={#1paper},
  center/.style=currentpaper,
  page/.style=graphicspaper,
  left border/.store in=\igr@left@border,
  bottom border/.store in=\igr@bottom@border,
  right border/.store in=\igr@right@border,
  top border/.store in=\igr@top@border,
  horizontal border/.style={left border=#1,right border=#1},
  vertical border/.style={bottom border=#1,top border=#1},
  border/.style={left border=#1,bottom border=#1,right border=#1,top border=#1},
%
  graphicspaper,
  options=,
  bookmark=,
  bookmark options=,
  bookmark heading=,
  bookmark heading options=,
  label=,
  zerofill=0,
  hyper,
  disable match,
  include command,
  ignore on not found,
  extensions={.jpg,.png},
  pagestyle=empty,
  overlay@code=,
  no overlay,
  portrait,
  border=0pt,
  overlay page number options={fill opacity=0.35,draw opacity=0.5,text opacity=1,
    inner xsep=1em,rounded corners,fill=white,draw=black},
}

