texlive[70635] Master/texmf-dist: incgraph (14mar24)

commits+karl at tug.org commits+karl at tug.org
Thu Mar 14 21:22:18 CET 2024


Revision: 70635
          https://tug.org/svn/texlive?view=revision&revision=70635
Author:   karl
Date:     2024-03-14 21:22:17 +0100 (Thu, 14 Mar 2024)
Log Message:
-----------
incgraph (14mar24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/incgraph/CHANGES.md
    trunk/Master/texmf-dist/doc/latex/incgraph/README.md
    trunk/Master/texmf-dist/doc/latex/incgraph/incgraph-doc.sty
    trunk/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdf
    trunk/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdf
    trunk/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdf
    trunk/Master/texmf-dist/doc/latex/incgraph/incgraph.pdf
    trunk/Master/texmf-dist/doc/latex/incgraph/incgraph.tex
    trunk/Master/texmf-dist/tex/latex/incgraph/incgraph.sty

Modified: trunk/Master/texmf-dist/doc/latex/incgraph/CHANGES.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/incgraph/CHANGES.md	2024-03-14 20:22:08 UTC (rev 70634)
+++ trunk/Master/texmf-dist/doc/latex/incgraph/CHANGES.md	2024-03-14 20:22:17 UTC (rev 70635)
@@ -17,6 +17,31 @@
 
 
 
+## [1.3.0] - 2024-03-14
+
+### Added
+- Option `overlay page number options app` (issue #2)
+- Option `xshift`
+- Option `yshift`
+- Autosize Options:
+    - Option `autosize`
+    - Option `autosize width gap`
+    - Option `autosize height gap`
+    - Option `autosize gap`
+    - Option `autosize min scale`
+    - Option `autosize max scale`
+
+### Changed
+- Implementation overhauled and completely rewritten in LaTeX3.
+    Major changes of the whole code.
+    Option keys kept to be pgfkeys.
+- `\igrboxcenter` drops box now after usage
+
+### Fixed
+- Documentation typo (issue #4)
+
+
+
 ## [1.2.0] - 2021-10-20
 
 ### Added
@@ -40,7 +65,7 @@
   [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 - From now on version numbers adhere to
   [Semantic Versioning](http://semver.org/spec/v2.0.0.html)
-- Readme moved from README to README.md and adapted to  
+- Readme moved from README to README.md 
 - Documentation code revised
 - Internal package creation process modernized (invisible to the user)
 - Adaption of paper size made compatible with lualatex

Modified: trunk/Master/texmf-dist/doc/latex/incgraph/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/incgraph/README.md	2024-03-14 20:22:08 UTC (rev 70634)
+++ trunk/Master/texmf-dist/doc/latex/incgraph/README.md	2024-03-14 20:22:17 UTC (rev 70635)
@@ -1,7 +1,7 @@
-# The LaTeX package incgraph - version 1.2.0 (2021/10/20)
+# The LaTeX package incgraph - version 1.3.0 (2024/03/14)
 
 
-> Copyright (c) 2012-2021 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+> Copyright (c) 2012-2024 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

Modified: trunk/Master/texmf-dist/doc/latex/incgraph/incgraph-doc.sty
===================================================================
--- trunk/Master/texmf-dist/doc/latex/incgraph/incgraph-doc.sty	2024-03-14 20:22:08 UTC (rev 70634)
+++ trunk/Master/texmf-dist/doc/latex/incgraph/incgraph-doc.sty	2024-03-14 20:22:17 UTC (rev 70635)
@@ -1,10 +1,10 @@
 % \LaTeX-Main\
 % !TeX encoding=UTF-8
-%% The LaTeX package incgraph - version 1.2.0 (2021/10/20)
+%% The LaTeX package incgraph - version 1.3.0 (2024/03/14)
 %% incgraph.tex: Manual
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2012-2021 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2012-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the
@@ -19,8 +19,8 @@
 %%
 %% This work consists of all files listed in README
 %%
-\def\version{1.2.0}%
-\def\datum{2021/10/20}%
+\def\version{1.3.0}%
+\def\datum{2024/03/14}%
 
 \IfFileExists{incgraph-doc.cfg}{\input{incgraph-doc.cfg}}{}\providecommand\igrpkgprefix{}
 
@@ -28,7 +28,7 @@
 \RequirePackage[english]{babel}
 \RequirePackage{lmodern,parskip,array,makeidx}
 \RequirePackage{amsmath,amssymb}
-\RequirePackage[svgnames,table,hyperref]{xcolor}
+\RequirePackage[svgnames,table]{xcolor}
 \RequirePackage{tikz}
 
 \RequirePackage[bookmarks,raiselinks,pageanchor,hyperindex,colorlinks]{hyperref}
@@ -106,8 +106,15 @@
   },
 }
 
+\newcommand{\formatPackageOption}[1]{package option}
+\newcommand{\formatPackageOptions}[1]{Package options}
+
 \tcbmakedocSubKey{docIgrKey}{igr}
 \tcbmakedocSubKeys{docIgrKeys}{igr}
+\tcbmakedocSubKeys[doc key prefix=,
+    index key formatter=\formatPackageOption,
+    index keys formatter=\formatPackageOptions
+]{docPackageOptions}{}
 
 \newcounter{texexp}
 

Modified: trunk/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/incgraph/incgraph.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/incgraph/incgraph.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/incgraph/incgraph.tex	2024-03-14 20:22:08 UTC (rev 70634)
+++ trunk/Master/texmf-dist/doc/latex/incgraph/incgraph.tex	2024-03-14 20:22:17 UTC (rev 70635)
@@ -1,10 +1,10 @@
 % \LaTeX-Main\
 % !TeX encoding=UTF-8
-%% The LaTeX package incgraph - version 1.2.0 (2021/10/20)
+%% The LaTeX package incgraph - version 1.3.0 (2024/03/14)
 %% incgraph.tex: Manual
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2012-2021 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2012-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the
@@ -36,7 +36,7 @@
 \end{tcolorbox}\bigskip
 {\large Thomas F.~Sturm%
   \footnote{Prof.~Dr.~Dr.~Thomas F.~Sturm, Institut f\"{u}r Mathematik und Informatik,
-    Universit\"{a}t der Bundeswehr M\"{u}nchen, D-85577 Neubiberg, Germany;
+    University of the Bundeswehr Munich, D-85577 Neubiberg, Germany;
      email: \href{mailto:thomas.sturm at unibw.de}{thomas.sturm at unibw.de}}\par\medskip
 \normalsize\url{https://www.ctan.org/pkg/incgraph}\par
 \url{https://github.com/T-F-S/incgraph}
@@ -115,14 +115,58 @@
 the package |graphicx| \cite{carlisle:graphics}, and the
 package |bookmark| \cite{oberdiek:bookmark}.
 
-\begin{itemize}
-\item The option |nopgf| prevents the loading of |pgf| and |pgffor|.\\
+The following package options are available:
+
+%-------------------------------------------------------------------------------
+\begin{docPackageOptions}
+  {
+    {
+      doc name = pgf,
+      doc description = {no value, initially set},
+    },
+    {
+      doc name = nopgf,
+      doc description = {no value, initially unset},
+    },
+  }
+  The option |nopgf| prevents the loading of |pgf| and |pgffor|.\\
   The opposite option |pgf| resets to loading the packages.
-\item The option |nographicx| prevents the loading of |graphicx|.\\
+\end{docPackageOptions}
+%-------------------------------------------------------------------------------
+
+%-------------------------------------------------------------------------------
+\begin{docPackageOptions}
+  {
+    {
+      doc name = graphicx,
+      doc description = {no value, initially set},
+    },
+    {
+      doc name = nographicx,
+      doc description = {no value, initially unset},
+    },
+  }
+  The option |nographicx| prevents the loading of |graphicx|.\\
   The opposite option |graphicx| resets to loading the package.
-\item The option |nobookmark| prevents the loading of |bookmark|.\\
+\end{docPackageOptions}
+%-------------------------------------------------------------------------------
+
+%-------------------------------------------------------------------------------
+\begin{docPackageOptions}
+  {
+    {
+      doc name = bookmark,
+      doc description = {no value, initially set},
+    },
+    {
+      doc name = nobookmark,
+      doc description = {no value, initially unset},
+    },
+  }
+  The option |nobookmark| prevents the loading of |bookmark|.\\
   The opposite option |bookmark| resets to loading the package.
-\end{itemize}
+\end{docPackageOptions}
+%-------------------------------------------------------------------------------
 
 So, the minimal package loading is done with the following:
 \begin{dispListing}
@@ -220,7 +264,7 @@
 \begin{texexptitled}%
   {Some text on a shrunk paper; see page~\pageref{inctext1}}{inctext1.listing}
 \begin{inctext}[paper=graphics,label={inctext1},bookmark={A huge ABC}]
-  \Huge ABC
+  \fontsize{20mm}{20mm}\selectfont\bfseries ABC
 \end{inctext}
 \end{texexptitled}
 
@@ -313,18 +357,18 @@
 \end{docIgrKey}
 
 
-\makeatletter%
+\ExplSyntaxOn
 \foreach \x in {a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,
   b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,
   c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,
   d0,d1,d2,d3,d4,d5,d6,d7,
   executive,letter,legal,ledger}
-{\begin{docIgrKey}{\x paper}{}{no value}
+{\begin{docIgrKey}{\x paper}{}{no~value}
   \igrset{\x paper}%
-  The paper size is set to
-  \texttt{\igr at target@width} $\times$ \texttt{\igr at target@height}.
+  The~paper~size~is~set~to~
+  \texttt{\l__incgra_target_width_tl}~$\times$~\texttt{\l__incgra_target_heigth_tl}.
 \end{docIgrKey}}
-\makeatother%
+\ExplSyntaxOff
 
 \begin{docIgrKey}{center}{}{no value, deprecated}
   An alias for \refKey{/igr/currentpaper}.
@@ -387,7 +431,7 @@
     },
   }
   Omits any existence checks by the package, i.e. the underlying
-  \docAuxCommand*{includegraphics} is called directly any may
+  \docAuxCommand*{includegraphics} is called directly and may
   stop the compilation with an error if the included file does not exist.
   Both options are equal, but the newer \refKey{/igr/no existence check}
   is considered to be more comprehensible.
@@ -532,43 +576,130 @@
   |bookmark| \cite{oberdiek:bookmark} for a list of applicable \meta{bookmark options}.
 \end{docIgrKey}
 
+
+
 \clearpage
-\subsection{Borders}
+\subsection{Autosize}
 
+\begin{docIgrKeys}
+  {
+    {
+      doc name = autosize,
+      doc parameter = \colOpt{=true\textbar false},
+      doc description = {default |true|, initially |false|},
+      doc new = {2024-03-09}
+    }
+  }
+If set to |true|, the picture box is resized to fit into the paper while
+keeping the aspect ratio. This
+setting has no effect for \refKey{/igr/graphicspaper}.
+Note that this autosize is applied after possible size and scaling options
+for |\includegraphics| are conducted, see \refCom{incgraph} and \refCom{incmultigraph}.
+
+\begin{texexptitled}%
+  {Autosized pictures; see from page~\pageref{autosize.1}}{autosize.listing}
+\incmultigraph[zerofill=4, currentpaper, autosize,
+  bookmark heading={Autosized pictures},
+  bookmark heading options={level=subsection},
+  bookmark={\nt},bookmark options={level=subsubsection},
+  overlay page number at bottom,
+  label={autosize.\n}]{exaimage-\nn.png}{1,...,150}
+\end{texexptitled}
+
+The following tuning
+options influence how the resizing is done.
+\end{docIgrKeys}
+
+
+\begin{docIgrKeys}
+  [
+    doc parameter = {=\meta{length}},
+    doc description = {no default, initially |0mm|},
+    doc new = {2024-03-09}
+  ]
+  {
+    { doc name = autosize width gap },
+    { doc name = autosize height gap },
+    { doc name = autosize gap }
+  }
+\meta{length} is subtracted from the width or height of the current paper size
+to compute the target size for the automatic picture box scaling.
+\refKey{/igr/autosize gap} sets both values at the same time.
+For example, |autosize gap=20mm| gives (at least) |10mm| space around
+the rescaled picture box.\par
+Negative \meta{length} values allow the picture box to extrude over the borders of
+the current paper.
+\end{docIgrKeys}
+
+
+\begin{docIgrKeys}
+  [
+    doc parameter = {=\meta{floating-point expression}},
+    doc new = {2024-03-09}
+  ]
+  {
+    { doc name = autosize min scale, doc description = {no default, initially |0.001|} },
+    { doc name = autosize max scale, doc description = {no default, initially |1000|} }
+  }
+The scale number of the automatic scaling will
+always be between \refKey{/igr/autosize min scale} and \refKey{/igr/autosize max scale}
+even if other settings are violated.\par
+|autosize min scale=1| means that the picture box is never to be shrunk.\par
+|autosize max scale=1| means that the picture box is never to be enlarged.\par
+\end{docIgrKeys}
+
+
+
+\clearpage
+\subsection{Borders and Shifts}
+
 The following settings enlarge or shrink the picture box, if
 \refKey{/igr/graphicspaper} is used. For other paper settings, the result
-will be just a certain shift of the picture box since the enlarged box
+will be a certain shift of the picture box since the enlarged box
 will be centered on the paper.
 
-\begin{docIgrKey}[][doc new=2015-03-12]{left border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{left border}{=\meta{length}}{no default, initially |0pt|}
 Adds a space of \meta{length} at the left hand side.
 \end{docIgrKey}
 
-\begin{docIgrKey}[][doc new=2015-03-12]{bottom border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{bottom border}{=\meta{length}}{no default, initially |0pt|}
 Adds a space of \meta{length} at the bottom.
 \end{docIgrKey}
 
-\begin{docIgrKey}[][doc new=2015-03-12]{right border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{right border}{=\meta{length}}{no default, initially |0pt|}
 Adds a space of \meta{length} at the right hand side.
 \end{docIgrKey}
 
-\begin{docIgrKey}[][doc new=2015-03-12]{top border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{top border}{=\meta{length}}{no default, initially |0pt|}
 Adds a space of \meta{length} at the top.
 \end{docIgrKey}
 
-\begin{docIgrKey}[][doc new=2015-03-12]{horizontal border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{horizontal border}{=\meta{length}}{no default, initially |0pt|}
 Adds a space of \meta{length} at the left hand side and the right hand side.
 \end{docIgrKey}
 
-\begin{docIgrKey}[][doc new=2015-03-12]{vertical border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{vertical border}{=\meta{length}}{no default, initially |0pt|}
 Adds a space of \meta{length} at the top and bottom.
 \end{docIgrKey}
 
-\begin{docIgrKey}[][doc new=2015-03-12]{border}{=\meta{length}}{no default, initially |0pt|}
+\begin{docIgrKey}[][doc new and updated={2015-03-12}{2024-03-08}]{border}{=\meta{length}}{no default, initially |0pt|}
 Adds a space of \meta{length} at all four sides.
 \end{docIgrKey}
 
+\begin{docIgrKey}[][doc new={2024-03-08}]{xshift}{=\meta{length}}{no default, initially |0pt|}
+Shifts the picture box in horizontal direction without changing the paper size.
+This adapts the current values of \refKey{/igr/left border} and \refKey{/igr/right border}.
+Therefore, use this option \emph{after} the border values are set.
+\end{docIgrKey}
 
+\begin{docIgrKey}[][doc new={2024-03-08}]{yshift}{=\meta{length}}{no default, initially |0pt|}
+Shifts the picture box in vertical direction without changing the paper size.
+This adapts the current values of \refKey{/igr/top border} and \refKey{/igr/bottom border}.
+Therefore, use this option \emph{after} the border values are set.
+\end{docIgrKey}
+
+
+
 \clearpage
 \subsection{Map and Match}
 
@@ -690,6 +821,11 @@
 \end{docIgrKey}
 
 
+\begin{docIgrKey}[][doc new=2021-10-21]{overlay page number options app}{=\marg{tikz options}}{no default, initially unset}
+  Appends the given \meta{tikz options} to \refKey{/igr/overlay page number options}.
+\end{docIgrKey}
+
+
 \begin{docIgrKey}{no overlay}{}{no value, initially set}
   Removes the overlay setting.
 \end{docIgrKey}
@@ -716,9 +852,9 @@
 
 \clearpage
 \hypertarget{optkeyexamples}{}%
-\bookmark[level=section,dest=optkeyexamples]{User Interface Examples}
+\bookmark[level=section,dest=optkeyexamples]{User Interface and Option Examples}
 \igrset{bookmark options={level=subsubsection}}
-\foreach \n in {1,...,11} {\inputlisting{\n}}
+\foreach \n in {1,...,12} {\inputlisting{\n}}
 
 \clearpage
 %--------------------------------------
@@ -793,7 +929,7 @@
 size. Note that the actual document content itself is not resized because
 letter and DIN A4 are not so very different. If needed, the content could be
 shrunk or enlarged easily by adding a |scale| option for the underlying
-|\includegraphics| macro.
+|\includegraphics| macro or by using \refKey{/igr/autosize}.
 
 
 \inputexamplelisting{\jobname-example-c.tex}{reformatting}
@@ -1179,9 +1315,9 @@
 @manual{tantau:tikz,
    author    = {Till Tantau},
    title     = {The TikZ and PGF Packages},
-   subtitle  = {Manual for version 3.1.9a},
+   subtitle  = {Manual for version 3.1.10},
    url       = {https://mirrors.ctan.org/graphics/pgf/base/doc/pgfmanual.pdf},
-   date      = {2021-05-15},
+   date      = {2023-01-15},
 }
 
 @manual{carlisle:graphics,
@@ -1195,7 +1331,7 @@
    author    = {Andreas Matthias},
    title     = {The pdfpages Package},
    url       = {https://mirrors.ctan.org/macros/latex/contrib/pdfpages/pdfpages.pdf},
-   date      = {2021-03-06},
+   date      = {2024-01-21},
 }
 
 @manual{oberdiek:bookmark,
@@ -1202,7 +1338,7 @@
   author    = {Heiko Oberdiek},
   title     = {The bookmark Package},
   url       = {https://mirrors.ctan.org/macros/latex/contrib/bookmark/bookmark.pdf},
-  date      = {2020-11-06},
+  date      = {2023-12-10},
 }
 
 \end{tcbverbatimwrite}

Modified: trunk/Master/texmf-dist/tex/latex/incgraph/incgraph.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/incgraph/incgraph.sty	2024-03-14 20:22:08 UTC (rev 70634)
+++ trunk/Master/texmf-dist/tex/latex/incgraph/incgraph.sty	2024-03-14 20:22:17 UTC (rev 70635)
@@ -1,8 +1,8 @@
-%% The LaTeX package incgraph - version 1.2.0 (2021/10/20)
+%% The LaTeX package incgraph - version 1.3.0 (2024/03/14)
 %% incgraph.sty: Graphics inclusion page
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2012-2021 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
+%% Copyright (c) 2012-2024 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the
@@ -17,35 +17,41 @@
 %%
 %% This work consists of all files listed in README
 %%
-\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{incgraph}[2021/10/20 version 1.2.0 LaTeX special graphics inclusion]
+\NeedsTeXFormat{LaTeX2e}[2023-11-01]
+\ProvidesExplPackage{incgraph}{2024/03/14}{1.3.0}
+  {LaTeX special graphics inclusion}
 
-\DeclareOption{pgf}{\def\igrreq at pgf{\RequirePackage{pgf}[2008/01/15]\RequirePackage{pgffor}}}%
-\DeclareOption{nopgf}{\def\igrreq at pgf{}}%
-\DeclareOption{graphicx}{\def\igrreq at graphicx{\RequirePackage{graphicx}}}%
-\DeclareOption{nographicx}{\def\igrreq at graphicx{}}%
-\DeclareOption{bookmark}{\def\igrreq at bookmark{\RequirePackage{bookmark}}}%
-\DeclareOption{nobookmark}{\def\igrreq at bookmark{}}%
+\bool_new:N \l__incgra_package_pgf_bool
+\bool_new:N \l__incgra_package_graphicx_bool
+\bool_new:N \l__incgra_package_bookmark_bool
 
-\ExecuteOptions{pgf,graphicx,bookmark}
-\ProcessOptions\relax
+\DeclareKeys[incgra]
+  {
+    pgf        .bool_set:N         = \l__incgra_package_pgf_bool,
+    nopgf      .bool_set_inverse:N = \l__incgra_package_pgf_bool,
+    graphicx   .bool_set:N         = \l__incgra_package_graphicx_bool,
+    nographicx .bool_set_inverse:N = \l__incgra_package_graphicx_bool,
+    bookmark   .bool_set: N        = \l__incgra_package_bookmark_bool,
+    nobookmark .bool_set_inverse:N = \l__incgra_package_bookmark_bool,
+  }
 
-\RequirePackage{pgfkeys}
-\igrreq at pgf
-\igrreq at graphicx
-\igrreq at bookmark
+\SetKeys[incgra]{ pgf, graphicx, bookmark }
 
-% key management
-\pgfkeys{/igr/.is family}
+\ProcessKeyOptions[incgra]
 
-\def\igrset{\pgfqkeys{/igr}}
+\bool_if:NT \l__incgra_package_pgf_bool
+  {
+    \RequirePackage{pgf}
+    \RequirePackage{pgffor}
+  }
+\bool_if:NT \l__incgra_package_graphicx_bool
+  { \RequirePackage{graphicx} }
+\bool_if:NT \l__incgra_package_bookmark_bool
+  { \RequirePackage{bookmark} }
 
-\newbox\igrbox
-\newdimen\igr at length
-\newcounter{igrtarget}
+\pgfkeys{/igr/.is~family}
+\cs_set_nopar:Npn \igrset { \pgfqkeys{/igr} }
 
-\ExplSyntaxOn
-
 \sys_if_engine_pdftex:TF
   {
     \NewDocumentCommand \igrGetPageSize {}
@@ -114,248 +120,317 @@
       }
   }
 
-\ExplSyntaxOff
+\box_new:N \igrbox
+\newcounter{igrtarget}
 
-\AtBeginDocument{%
-  \igrGetPageSize%
-  \let\igrOrginalPageWidth\igrPageWidth%
-  \let\igrOrginalPageHeight\igrPageHeight%
-}
+\bool_new:N \g__incgra_first_include_bool
+\bool_new:N \g__incgra_multi_include_bool
+\bool_new:N \l__incgra_apply_scaling_bool
+\bool_new:N \l__incgra_autosize_bool
+\bool_new:N \l__incgra_change_page_size_bool
+\bool_new:N \l__incgra_file_exist_bool
+\bool_new:N \l__incgra_overlay_bool
+\bool_new:N \l__incgra_set_hypertarget_bool
+\bool_new:N \l__incgra_turn_bool
 
-\def\igr at target@auto{%
-  \xdef\igrAutoTarget{igr-\theigrtarget}%
-}
+\clist_new:N \l__incgra_extensions_clist
+\dim_new:N \l__incgra_offx_left_dim
 
-\def\igr at target@user{%
-  \xdef\igrAutoTarget{\igr at usertarget}%
-  \global\let\igr at target@next=\igr at target@auto%
-}
+\fp_new:N \l__incgra_autosize_max_scale_fp
+\fp_new:N \l__incgra_autosize_min_scale_fp
+\fp_new:N \l__incgra_scale_fp
 
-\let\igr at target@next=\igr at target@auto
+\tl_new:N \l__incgra_autosize_height_gap_tl
+\tl_new:N \l__incgra_autosize_width_gap_tl
+\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_bottom_border_tl
+\tl_new:N \l__incgra_label_text_tl
+\tl_new:N \l__incgra_left_border_tl
+\tl_new:N \l__incgra_options_tl
+\tl_new:N \l__incgra_overlay_code_tl
+\tl_new:N \l__incgra_overlay_pagenumber_options_tl
+\tl_new:N \l__incgra_right_border_tl
+\tl_new:N \l__incgra_target_heigth_tl
+\tl_new:N \l__incgra_target_width_tl
+\tl_new:N \l__incgra_top_border_tl
 
-\NewDocumentCommand\igrtargetset{m}{%
-  \def\igr at usertarget{#1}%
-  \let\igr at target@next=\igr at target@user%
-}
+\NewHook { incgra/usertarget }
 
-\def\igr at nextAutoTarget{%
-  \refstepcounter{igrtarget}%
-  \igr at target@next%
-}
 
-\def\igr at do@rebox{%
-  \setbox\igrbox\hbox{%
-    \kern\igr at left@border%
-    \vbox{%
-      \kern\igr at top@border%
-      \box\igrbox%
-      \kern\igr at bottom@border%
-    }%
-    \kern\igr at right@border}%
-}
+\AddToHook{begindocument}
+  {
+    \igrGetPageSize
+    \let\igrOrginalPageWidth\igrPageWidth
+    \let\igrOrginalPageHeight\igrPageHeight
+  }
 
-\def\igr at rebox{%
-  \ifdim\igr at top@border=0pt\relax%
-    \ifdim\igr at bottom@border=0pt\relax%
-      \ifdim\igr at left@border=0pt\relax%
-        \ifdim\igr at right@border=0pt\relax%
-        \else%
-          \igr at do@rebox%
-        \fi%
-      \else%
-        \igr at do@rebox%
-      \fi%
-    \else%
-      \igr at do@rebox%
-    \fi%
-  \else%
-    \igr at do@rebox%
-  \fi%
-}
 
-\def\igr at get@box at dimensions{%
-  \igr at length=\wd\igrbox%
-  \edef\igrBoxWidth{\the\igr at length}%
-  \igr at length=\ht\igrbox%
-  \edef\igrBoxht{\the\igr at length}%
-  \igr at length=\dp\igrbox%
-  \edef\igrBoxdp{\the\igr at length}%
-  \advance\igr at length by \igrBoxht%
-  \edef\igrBoxHeight{\the\igr at length}%
-}
+\cs_new_protected:Npn \__incgra_set_next_target:
+  {
+    \refstepcounter{igrtarget}
+    \cs_gset_nopar:Npe \igrAutoTarget { igr-\theigrtarget }
+    \UseHook{ incgra/usertarget }
+  }
 
-\NewDocumentCommand\igrboxset{+m}{%
-  \igr at nextAutoTarget%
-  \setbox\igrbox\color at hbox#1\color at endbox%
-  \igr at rebox%
-  \igr at get@box at dimensions%
-}
 
+\NewDocumentCommand \igrtargetset { m }
+  {
+    \AddToHookNext{ incgra/usertarget }
+      { \cs_gset_nopar:Npe \igrAutoTarget { #1 } }
+  }
 
-\def\igr at hyper{\hypertarget{\igrAutoTarget}{}}
 
-\NewDocumentCommand\igrboxcenter{}{%
-  \igrGetPageSize%
-  \thispagestyle{\igrpagestyle}%
-  %
-  \igr at length=-1in%
-  \advance\igr at length by -\voffset%
-  \advance\igr at length by -\topmargin%
-  \advance\igr at length by -\headheight%
-  \advance\igr at length by -\headsep%
-  \edef\igr at offy@top{\the\igr at length}%
-  %
-  \igr at length=\igrPageHeight%
-  \advance\igr at length by -\igrBoxHeight%
-  \divide\igr at length by 2%
-  \edef\igr at offy@abs{\the\igr at length}%
-  %
-  \igr at length=-1in%
-  \advance\igr at length by -\hoffset%
-  \if at twoside
-    \ifodd\c at page
-      \advance\igr at length by -\oddsidemargin%
-    \else
-      \advance\igr at length by -\evensidemargin%
-    \fi
-    \else
-      \advance\igr at length by -\oddsidemargin%
-  \fi%
-  \edef\igr at offx@left{\the\igr at length}%
-  %
-  \igr at length=\igrPageWidth%
-  \advance\igr at length by -\igrBoxWidth%
-  \divide\igr at length by 2%
-  \advance\igr at length by \igr at offx@left%
-  \edef\igr at offx{\the\igr at length}%
-  %
-  \vbox to \vsize{%
-    \kern\igr at offy@top\hbox{\kern\igr at offx@left\igr at hypertarget\hss}%
-    \nointerlineskip\kern\igr at offy@abs%
-    \hbox to \hsize{\kern\igr at offx\box\igrbox\hss}%
-    \vss}%
-  \break%
-}
+\cs_new_protected:Npn \__incgra_apply_borders:
+  {
+    \bool_lazy_all:nF
+      {
+        { \dim_compare_p:nNn \l__incgra_top_border_tl = \c_zero_dim }
+        { \dim_compare_p:nNn \l__incgra_bottom_border_tl = \c_zero_dim }
+        { \dim_compare_p:nNn \l__incgra_left_border_tl = \c_zero_dim }
+        { \dim_compare_p:nNn \l__incgra_right_border_tl = \c_zero_dim }
+      }
+      {
+        \box_set_trim:Nnnnn \igrbox
+          { -\l__incgra_left_border_tl }
+          { -\l__incgra_bottom_border_tl }
+          { -\l__incgra_right_border_tl }
+          { -\l__incgra_top_border_tl }
+        \__incgra_get_box_dimensions:
+      }
+  }
 
-\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
+\cs_new_protected:Npn \__incgra_get_box_dimensions:
+  {
+    \cs_set_nopar:Npe \igrBoxWidth  { \dim_eval:n { \box_wd:N \igrbox } }
+    \cs_set_nopar:Npe \igrBoxht     { \dim_eval:n { \box_ht:N \igrbox } }
+    \cs_set_nopar:Npe \igrBoxdp     { \dim_eval:n { \box_dp:N \igrbox } }
+    \cs_set_nopar:Npe \igrBoxHeight { \dim_eval:n { \box_ht_plus_dp:N \igrbox } }
+  }
 
-\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 at overlay@on{%
-  \igrboxset{\begin{tikzpicture}\igrboxtikzcenter\igr at tikz@hook\end{tikzpicture}}}
+\cs_new_protected:Npn \__incgra_box_set:n #1
+  {
+    \__incgra_set_next_target:
+    \hbox_set:Nn \igrbox { #1 }
+    \__incgra_get_box_dimensions:
+  }
+\cs_set_eq:NN \igrboxset \__incgra_box_set:n
 
-\def\igr at overlay@off{}
 
-\let\igr at overlay=\igr at overlay@off
+% clone of \__kernel_kern:n
+\cs_new_protected:Npn \___incgra_kern:n #1
+  { \kern \dimexpr #1 \scan_stop: }
 
-% Output macros
 
-\def\igr at out@resize#1#2{%
-  \igrGetPageSize%
-  \let\igrCurrentPageWidth\igrPageWidth%
-  \let\igrCurrentPageHeight\igrPageHeight%
-  \eject%
-  \igrSetPageSize{#1}{#2}%
-  \igr at overlay%
-  \edef\theigrpage{\thepage}%
-  \igrboxcenter%
-  \igrSetPageSize{\igrCurrentPageWidth}{\igrCurrentPageHeight}%
-}
+\cs_new_protected:Npn \__incgra_box_use_center:
+  {
+    \igrGetPageSize
+    \thispagestyle{\igrpagestyle}
 
-\def\igr at out@center at fit@port{%
-  \igr at out@resize{\igr at target@width}{\igr at target@height}%
-}
+    \legacy_if:nTF { @twoside }
+      {
+        \int_if_odd:nTF \c at page
+          {
+            \dim_set:Nn \l__incgra_offx_left_dim { - 1in - \hoffset - \oddsidemargin}
+          }
+          {
+            \dim_set:Nn \l__incgra_offx_left_dim { - 1in - \hoffset - \evensidemargin}
+          }
+      }
+      {
+        \dim_set:Nn \l__incgra_offx_left_dim { - 1in - \hoffset - \oddsidemargin}
+      }
 
-\def\igr at out@center at fit@land{%
-  \igr at out@resize{\igr at target@height}{\igr at target@width}%
-}
+    \vbox_to_ht:nn { \vsize }
+      {
+        \___incgra_kern:n { - 1in - \voffset - \topmargin - \headheight - \headsep }
+        \hbox:n
+          {
+            \___incgra_kern:n { \l__incgra_offx_left_dim }
+            \bool_if:NT \l__incgra_set_hypertarget_bool
+              {
+                \hypertarget { \igrAutoTarget }{}
+              }
+            \hss
+          }
+        \nointerlineskip
+        \___incgra_kern:n { ( \igrPageHeight - \igrBoxHeight ) / 2 }
+        \hbox_to_wd:nn { \hsize }
+          {
+            \___incgra_kern:n { \l__incgra_offx_left_dim + ( \igrPageWidth - \igrBoxWidth ) / 2  }
+            \box_use_drop:N \igrbox
+            \hss
+          }
+        \vss
+      }
+    \break
+  }
 
-\def\igr at out@center at fit{%
-  \csname igr at out@center at fit@\igr at turn\endcsname%
-}
+\NewDocumentCommand \igrboxcenter { }{ \__incgra_box_use_center: }
 
-\def\igr at out@page{%
-  \igr at out@resize{\igrBoxWidth}{\igrBoxHeight}%
-}
 
-\def\igr at out@center at port{%
-  \clearpage%
-  \igr at overlay%
-  \edef\theigrpage{\thepage}%
-  \igrboxcenter%
-}
+\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_use_drop:N \igrbox };
+    \node[minimum~width=\igrBoxWidth, minimum~height=\igrBoxHeight, line~width=0mm, inner~sep=0mm, above~right] (page) at (0,0) {};
+  }
 
-\def\igr at out@center at land{%
-  \igrGetPageSize%
-  \let\igr at temp@w\igrPageWidth%
-  \let\igr at temp@h\igrPageHeight%
-  \igr at out@resize{\igr at temp@h}{\igr at temp@w}%
-}
+\NewCommandCopy \igrboxtikzpage \igrboxtikz
 
-\def\igr at out@center{%
-  \csname igr at out@center@\igr at turn\endcsname%
-}
+\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_use_drop:N \igrbox };
+    \cs_set_eq:NN \igrBoxWidth \igrPageWidth
+    \cs_set_eq:NN \igrBoxHeight \igrPageHeight
+    \node[minimum~width=\igrBoxWidth, minimum~height=\igrBoxHeight, line~width=0mm, inner~sep=0mm, above~right] (page) at (0,0) {};
+  }
 
-% Toolbox output
 
-\NewDocumentCommand\igrcenterfit{mm+m}{%
-  \igrboxset{#3}%
-  \igr at out@resize{#1}{#2}%
-}
+\cs_new_protected:Npn \__incgra_ship_box:nn #1#2
+  {
+    \bool_if:NT \l__incgra_apply_scaling_bool
+      {
+        \bool_if:NT \l__incgra_autosize_bool
+          {
+            \fp_set:Nn \l__incgra_scale_fp
+              {
+                max
+                  (
+                    \l__incgra_autosize_min_scale_fp,
+                    min
+                      (
+                        \l__incgra_autosize_max_scale_fp,
+                        (#1 - \l__incgra_autosize_width_gap_tl) / \igrBoxWidth,
+                        (#2 - \l__incgra_autosize_height_gap_tl) / \igrBoxHeight
+                      )
+                  )
+              }
+            \box_scale:Nnn \igrbox { \l__incgra_scale_fp }{ \l__incgra_scale_fp }
+            \__incgra_get_box_dimensions:
+          }
+        \__incgra_apply_borders:
+      }
+    \bool_if:NTF \l__incgra_change_page_size_bool
+      {
+        \igrGetPageSize
+        \cs_set_eq:NN \igrCurrentPageWidth \igrPageWidth
+        \cs_set_eq:NN \igrCurrentPageHeight \igrPageHeight
+        \eject
+        \igrSetPageSize { #1 }{ #2 }
+      }
+      {
+        \eject
+      }
+    \bool_if:NT \l__incgra_overlay_bool
+      {
+        \hbox_set:Nn \igrbox
+          {
+            \begin{tikzpicture}
+              \igrboxtikzcenter
+              \l__incgra_overlay_code_tl
+            \end{tikzpicture}
+          }
+        \__incgra_get_box_dimensions:
+      }
+    \cs_gset_nopar:Npx \theigrpage { \thepage }
+    \__incgra_box_use_center:
+    \bool_if:NT \l__incgra_change_page_size_bool
+      {
+        \igrSetPageSize { \igrCurrentPageWidth }{ \igrCurrentPageHeight }
+      }
+  }
+\cs_generate_variant:Nn \__incgra_ship_box:nn { oo }
 
-\NewDocumentCommand\igrpage{+m}{%
-  \igrboxset{#1}%
-  \igr at out@page%
-}
 
-\NewDocumentCommand\igrcenter{+m}{%
-  \igrboxset{#1}%
-  \igr at out@center at port%
-}
+\cs_new_protected:Npn \__incgra_output_page:
+  {
+    \__incgra_apply_borders:
+    \bool_set_false:N \l__incgra_apply_scaling_bool
+    \bool_set_true:N  \l__incgra_change_page_size_bool
+    \__incgra_ship_box:oo { \igrBoxWidth }{ \igrBoxHeight }
+  }
 
 
-% include macros
+\cs_new_protected:Npn \__incgra_output_fit:
+  {
+    \bool_set_true:N \l__incgra_apply_scaling_bool
+    \bool_set_true:N \l__incgra_change_page_size_bool
+    \bool_if:NTF \l__incgra_turn_bool
+      {
+        \__incgra_ship_box:oo { \l__incgra_target_heigth_tl }{ \l__incgra_target_width_tl }
+      }
+      {
+        \__incgra_ship_box:oo { \l__incgra_target_width_tl } {\l__incgra_target_heigth_tl }
+      }
+  }
 
-\ExplSyntaxOn
 
+\cs_new_protected:Npn \__incgra_output_center:
+  {
+    \bool_set_true:N \l__incgra_apply_scaling_bool
+    \bool_if:NTF \l__incgra_turn_bool
+      {
+        \bool_set_true:N \l__incgra_change_page_size_bool
+        \__incgra_ship_box:oo { \igrPageHeight }{ \igrPageWidth }
+      }
+      {
+        \bool_set_false:N \l__incgra_change_page_size_bool
+        \__incgra_ship_box:oo { \igrPageWidth }{ \igrPageHeight }
+      }
+  }
 
-\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
 
+\NewDocumentCommand \igrcenterfit { m m +m }
+  {
+    \group_begin:
+    \tl_set:Ne \l__incgra_target_width_tl { #1 }
+    \tl_set:Ne \l__incgra_target_heigth_tl { #2 }
+    \__incgra_box_set:n { #3 }
+    \__incgra_output_fit:
+    \group_end:
+  }
 
+
+\NewDocumentCommand \igrpage { +m }
+  {
+    \group_begin:
+    \__incgra_box_set:n { #1 }
+    \__incgra_output_page:
+    \group_end:
+  }
+
+
+\NewDocumentCommand \igrcenter { +m }
+  {
+    \group_begin:
+    \__incgra_box_set:n { #1 }
+    \__incgra_output_center:
+    \group_end:
+  }
+
+
 \cs_new_protected_nopar:Npn \__incgra_if_file_exist_extensions:nTF #1
   {
-    \bool_set_false:N \l_tmpa_bool
+    \bool_set_false:N \l__incgra_file_exist_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
+            \bool_set_true:N \l__incgra_file_exist_bool
             \clist_map_break:
           }
       }
-    \bool_if:NTF \l_tmpa_bool
+    \bool_if:NTF \l__incgra_file_exist_bool
   }
 
 
@@ -371,57 +446,49 @@
   }
 
 
+
 \cs_new_protected_nopar:Npn \__incgra_includegraphics:nn #1#2
   {
-    \igr at 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
+    \__incgra_match_hook:
+    \bool_if:NTF \g__incgra_multi_include_bool
       {
-        \bool_if:NTF \g__incgra_first_include
+        \bool_if:NTF \g__incgra_first_include_bool
           {
-            \tl_if_empty:NTF \l__incgra_label_text_tl
+            \__incgra_box_set:n
               {
-                \igrboxset{\l_tmpa_tl{#2}}
+                \exp_args:No \__incgra_include_graphics_base:nn { \l__incgra_options_tl, #1 }{ #2 }
+                \tl_if_empty:NF \l__incgra_label_text_tl { \label { \l__incgra_label_text_tl } }
               }
-              {
-                \igrboxset{\l_tmpa_tl{#2}\label{\l__incgra_label_text_tl}}
-              }
-            \igr at output
+            \__incgra_outout:
             \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 }
+                \exp_args:No \__incgra_bookmark_base:nn
+                  { \l__incgra_bookmark_heading_options_tl, dest=\igrAutoTarget }
+                  { \l__incgra_bookmark_heading_text_tl }
               }
-            \bool_gset_false:N \g__incgra_first_include
+            \bool_gset_false:N \g__incgra_first_include_bool
           }
           {
-            \igrboxset{\l_tmpa_tl{#2}}
-            \igr at output
+            \__incgra_box_set:n
+              {
+                \exp_args:No \__incgra_include_graphics_base:nn { \l__incgra_options_tl, #1 }{ #2 }
+              }
+            \__incgra_outout:
           }
       }
       {
-        \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 at output
+        \__incgra_box_set:n
+        {
+          \exp_args:No \__incgra_include_graphics_base:nn { \l__incgra_options_tl, #1 }{ #2 }
+          \tl_if_empty:NF \l__incgra_label_text_tl { \label { \l__incgra_label_text_tl } }
+        }
+        \__incgra_outout:
       }
     \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}
+        \exp_args:No \__incgra_bookmark_base:nn
+          { \l__incgra_bookmark_options_tl, dest=\igrAutoTarget }
+          { \l__incgra_bookmark_text_tl }
       }
   }
 
@@ -428,11 +495,22 @@
 \cs_generate_variant:Nn \__incgra_includegraphics:nn { nV }
 
 
+\cs_new_protected_nopar:Npn \__incgra_include_graphics_base:nn #1
+  {
+    \__incgra_include_graphics_base:w [ #1 ]
+  }
+
+\cs_new_protected_nopar:Npn \__incgra_bookmark_base:nn #1
+  {
+    \bookmark [ #1 ]
+  }
+
+
 \NewDocumentCommand \incgraph { +O{} O{} m }
   {
     \group_begin:
     \igrset{#1}
-    \bool_gset_false:N \g__incgra_multi_include
+    \bool_gset_false:N \g__incgra_multi_include_bool
     \tl_clear_new:N \nt
     \tl_set:Nn \nt {#3}
     \__incgra_if_file_exist:nTF{#3}
@@ -448,14 +526,14 @@
   {
     \group_begin:
     \igrset{#1}
-    \bool_gset_true:N \g__incgra_multi_include
-    \bool_gset_true:N \g__incgra_first_include
+    \bool_gset_true:N \g__incgra_multi_include_bool
+    \bool_gset_true:N \g__incgra_first_include_bool
     \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 at zero@fill{\n}}
+        \tl_set:Ne \nn { \__incgra_zerofill:n { \n } }
         \__incgra_if_file_exist:nTF{#3}
           {
             \__incgra_includegraphics:nV {#2} \nt
@@ -469,8 +547,8 @@
 \NewDocumentEnvironment{inctext}{ +O{} }
   {
     \igrset{#1}
-    \igr at match@hook
-    \igr at nextAutoTarget
+    \__incgra_match_hook:
+    \__incgra_set_next_target:
     \clearpage
     \begin{lrbox}{\igrbox}
   }
@@ -481,15 +559,13 @@
         \label{\l__incgra_label_text_tl}
       }
     \end{lrbox}
-    \igr at rebox
-    \igr at get@box at dimensions
-    \igr at output
+    \__incgra_get_box_dimensions:
+    \__incgra_outout:
     \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 }
+        \exp_args:No \__incgra_bookmark_base:nn
+          { \l__incgra_bookmark_options_tl, dest=\igrAutoTarget }
+          { \l__incgra_bookmark_text_tl }
       }
   }
 
@@ -498,7 +574,7 @@
   {
     include~command/.code =
       {
-        \cs_set_eq:NN \__incgra_include_graphics:w #1
+        \cs_set_eq:NN \__incgra_include_graphics_base:w #1
       },
     include~command/.default = \includegraphics,
     extensions/.code =
@@ -563,166 +639,257 @@
     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,
+    overlay~page~number~options/.store~in = \l__incgra_overlay_pagenumber_options_tl,
+    overlay~page~number~options~app/.code =
+      {
+        \tl_if_empty:NTF \l__incgra_overlay_pagenumber_options_tl
+          {
+            \tl_set:Nn \l__incgra_overlay_pagenumber_options_tl { #1 }
+          }
+          {
+            \tl_put_right:Nn \l__incgra_overlay_pagenumber_options_tl { ,#1 }
+          }
+      },
+    overlay~page~number~at/.style =
+      {
+        overlay =
+          {
+            \exp_last_unbraced:NNV \node[\l__incgra_overlay_pagenumber_options_tl]~at~(#1)~{\thepage};
+          }
+      },
   }
 
-\ExplSyntaxOff
 
+\cs_new_protected:Npn \__incgra_make_zerofill:nnnnnnnnn #1#2#3#4#5#6#7#8#9
+  {
+    \cs_gset_nopar:Npn \__incgra_zerofill_construct:n ##1
+      {
+        \if_int_compare:w ##1 < 10 \exp_stop_f: #1
+        \else: \if_int_compare:w ##1 < 100 \exp_stop_f: #2
+        \else: \if_int_compare:w ##1 < 1000 \exp_stop_f: #3
+        \else: \if_int_compare:w ##1 < 10000 \exp_stop_f: #4
+        \else: \if_int_compare:w ##1 < 100000 \exp_stop_f: #5
+        \else: \if_int_compare:w ##1 < 1000000 \exp_stop_f: #6
+        \else: \if_int_compare:w ##1 < 10000000 \exp_stop_f: #7
+        \else: \if_int_compare:w ##1 < 100000000 \exp_stop_f: #8
+        \else: \if_int_compare:w ##1 < 1000000000 \exp_stop_f: #9
+        \fi:\fi:\fi:\fi:\fi:\fi:\fi:\fi:\fi:
+        ##1
+      }
+  }
 
+\NewDocumentCommand \igrmakezerofill { m m }
+  {
+    \cs_gset_nopar:Npn \__incgra_zerofill_construct:n ##1 { ##1 }
+    \if_case:w #2 \exp_stop_f:
+    \or:\or: \__incgra_make_zerofill:nnnnnnnnn{0}{}{}{}{}{}{}{}{}
+    \or: \__incgra_make_zerofill:nnnnnnnnn{00}{0}{}{}{}{}{}{}{}
+    \or: \__incgra_make_zerofill:nnnnnnnnn{000}{00}{0}{}{}{}{}{}{}
+    \or: \__incgra_make_zerofill:nnnnnnnnn{0000}{000}{00}{0}{}{}{}{}{}
+    \or: \__incgra_make_zerofill:nnnnnnnnn{00000}{0000}{000}{00}{0}{}{}{}{}
+    \or: \__incgra_make_zerofill:nnnnnnnnn{000000}{00000}{0000}{000}{00}{0}{}{}{}
+    \or: \__incgra_make_zerofill:nnnnnnnnn{0000000}{000000}{00000}{0000}{000}{00}{0}{}{}
+    \or: \__incgra_make_zerofill:nnnnnnnnn{00000000}{0000000}{000000}{00000}{0000}{000}{00}{0}{}
+    \else: \__incgra_make_zerofill:nnnnnnnnn{000000000}{00000000}{0000000}{000000}{00000}{0000}{000}{00}{0}
+    \fi:
+    \cs_set_eq:NN #1 \__incgra_zerofill_construct:n
+  }
 
 
-\def\igr at make@zerofill#1#2#3#4#5#6#7#8#9{%
-  \def\igr at 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 \igrsetmatchvalue { m m }
+  {
+    \pgfkeyssetvalue { /igrmatch/#1 }{ #2 }
+  }
 
-\NewDocumentCommand\igrmakezerofill{mm}{%
-  \def\igr at zerofill##1{##1}%
-  \ifcase#2\or\or\igr at make@zerofill{0}{}{}{}{}{}{}{}{}%
-  \or\igr at make@zerofill{00}{0}{}{}{}{}{}{}{}%
-  \or\igr at make@zerofill{000}{00}{0}{}{}{}{}{}{}%
-  \or\igr at make@zerofill{0000}{000}{00}{0}{}{}{}{}{}%
-  \or\igr at make@zerofill{00000}{0000}{000}{00}{0}{}{}{}{}%
-  \or\igr at make@zerofill{000000}{00000}{0000}{000}{00}{0}{}{}{}%
-  \or\igr at make@zerofill{0000000}{000000}{00000}{0000}{000}{00}{0}{}{}%
-  \or\igr at make@zerofill{00000000}{0000000}{000000}{00000}{0000}{000}{00}{0}{}%
-  \else\igr at make@zerofill{000000000}{00000000}{0000000}{000000}{00000}{0000}{000}{00}{0}%
-  \fi%
-  \let#1=\igr at zerofill%
-}
+\NewExpandableDocumentCommand \igrifmatch { m m m }
+  {
+    \pgfkeysifdefined{ /igrmatch/#1 }
+      {
+        \pgfkeysgetvalue { /igrmatch/#1 }{ \igrmatchvalue }
+        #2
+      }
+      { #3 }
+  }
 
-\NewDocumentCommand\igrsetmatchvalue{mm}{%
-  \pgfkeyssetvalue{/igrmatch/#1}{#2}%
-}
 
-\NewExpandableDocumentCommand\igrifmatch{mmm}{%
-  \pgfkeysifdefined{/igrmatch/#1}{%
-    \pgfkeysgetvalue{/igrmatch/#1}{\igrmatchvalue}#2}{#3}%
-}
+\pgfkeys
+  {
+    /igrsetmatch/.unknown/.code=
+      {
+        \cs_set_eq:NN \igrmatchkey \pgfkeyscurrentname
+        \igrsetmatchvalue { \igrmatchkey }{ #1 }
+      }
+  }
 
-\pgfkeys{%
-  /igrsetmatch/.unknown/.code={%
-    \let\igrmatchkey=\pgfkeyscurrentname%
-    \igrsetmatchvalue{\igrmatchkey}{#1}%
-  }%
-}
+\NewDocumentCommand \igrsetmatches { m }
+  {
+    \pgfkeys{ /igrsetmatch/.cd, #1 }
+  }
 
-\NewDocumentCommand\igrsetmatches{m}{\pgfkeys{/igrsetmatch/.cd,#1}}
 
+\cs_new_protected:Npn \__incgra_define_paper_size:n #1
+  {
+    \__incgra_define_paper_size:w #1 \q_stop
+  }
 
-\igrset{%
-  zerofill/.code={\igrmakezerofill{\igr at zero@fill}{#1}},
-  set matches/.code=\igrsetmatches{#1},
-  hyper/.code={\let\igr at hypertarget=\igr at hyper},
-  no hyper/.code={\def\igr at hypertarget{}},
-  if match code/.code args={#1#2#3}{\def\igr at 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 at match@hook{}},
-  pagestyle/.store in=\igrpagestyle,
-  target/.code={\igrtargetset{#1}},
-  overlay at code/.store in=\igr at tikz@hook,
-  overlay/.code={\let\igr at overlay=\igr at overlay@on\igrset{overlay at code={#1}}},
-  overlay page number options/.store in=\igr at overlay@pagenumber at options,
-  overlay page number at/.style={overlay={%
-    \expandafter\node\expandafter[\igr at overlay@pagenumber at 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 at overlay=\igr at overlay@off},
-  portrait/.code={\def\igr at turn{port}},
-  landscape/.code={\def\igr at turn{land}},
-  paper size/.code args={#1:#2}{\def\igr at target@width{#1}\def\igr at target@height{#2}\let\igr at output=\igr at out@center at 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 at output=\igr at out@center},
-  documentpaper/.style={paper size=\igrOrginalPageWidth:\igrOrginalPageHeight},
-  graphicspaper/.code={\let\igr at output=\igr at out@page},
-  paper/.style={#1paper},
-  center/.style=currentpaper,
-  page/.style=graphicspaper,
-  left border/.store in=\igr at left@border,
-  bottom border/.store in=\igr at bottom@border,
-  right border/.store in=\igr at right@border,
-  top border/.store in=\igr at 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 at 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},
-}
 
+\use:x
+  {
+    \cs_new_protected:Npn \exp_not:N\__incgra_define_paper_size:w ##1 \c_colon_str ##2 \exp_not:N \q_stop
+  }
+  {
+    \__incgra_define_paper_size:nn { #1 }{ #2 }
+  }
+
+
+\cs_new_protected:Npn \__incgra_define_paper_size:nn #1#2
+  {
+    \tl_set:Ne \l__incgra_target_width_tl { #1 }
+    \tl_set:Ne \l__incgra_target_heigth_tl { #2 }
+    \cs_set_eq:NN \__incgra_outout: \__incgra_output_fit:
+  }
+
+\igrset
+  {
+    zerofill /    .code = \igrmakezerofill { \__incgra_zerofill:n }{ #1 },
+    set~matches / .code = \igrsetmatches { #1 },
+    hyper / .code  = \bool_set_true:N \l__incgra_set_hypertarget_bool,
+    no~hyper/.code = \bool_set_false:N \l__incgra_set_hypertarget_bool,
+    if~match~code / .code~args = {#1#2#3}
+      {
+        \cs_set_nopar:Npn \__incgra_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 =
+      {
+        \cs_set_nopar:Npn \__incgra_match_hook: { }
+      },
+    pagestyle / .store~in = \igrpagestyle,
+    target / .code = { \igrtargetset{#1} },
+    __overlay_code / .code = \tl_set:Nn \l__incgra_overlay_code_tl { #1 },
+    overlay / .code =
+      {
+        \bool_set_true:N \l__incgra_overlay_bool
+        \igrset { __overlay_code={#1} }
+      },
+    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 = \bool_set_false:N \l__incgra_overlay_bool,
+    portrait /   .code = \bool_set_false:N \l__incgra_turn_bool,
+    landscape /  .code = \bool_set_true:N \l__incgra_turn_bool,
+    paper~size / .code = \__incgra_define_paper_size:n{#1},
+    a0paper /    .code = \__incgra_define_paper_size:nn{841mm}{1189mm},
+    a1paper /    .code = \__incgra_define_paper_size:nn{594mm}{841mm},
+    a2paper /    .code = \__incgra_define_paper_size:nn{420mm}{594mm},
+    a3paper /    .code = \__incgra_define_paper_size:nn{297mm}{420mm},
+    a4paper /    .code = \__incgra_define_paper_size:nn{210mm}{297mm},
+    a5paper /    .code = \__incgra_define_paper_size:nn{148mm}{210mm},
+    a6paper /    .code = \__incgra_define_paper_size:nn{105mm}{148mm},
+    a7paper /    .code = \__incgra_define_paper_size:nn{74mm}{105mm},
+    a8paper /    .code = \__incgra_define_paper_size:nn{52mm}{74mm},
+    a9paper /    .code = \__incgra_define_paper_size:nn{37mm}{52mm},
+    a10paper /   .code = \__incgra_define_paper_size:nn{26mm}{37mm},
+    b0paper /    .code = \__incgra_define_paper_size:nn{1000mm}{1414mm},
+    b1paper /    .code = \__incgra_define_paper_size:nn{707mm}{1000mm},
+    b2paper /    .code = \__incgra_define_paper_size:nn{500mm}{707mm},
+    b3paper /    .code = \__incgra_define_paper_size:nn{353mm}{500mm},
+    b4paper /    .code = \__incgra_define_paper_size:nn{250mm}{353mm},
+    b5paper /    .code = \__incgra_define_paper_size:nn{176mm}{250mm},
+    b6paper /    .code = \__incgra_define_paper_size:nn{125mm}{176mm},
+    b7paper /    .code = \__incgra_define_paper_size:nn{88mm}{125mm},
+    b8paper /    .code = \__incgra_define_paper_size:nn{62mm}{88mm},
+    b9paper /    .code = \__incgra_define_paper_size:nn{44mm}{62mm},
+    b10paper /   .code = \__incgra_define_paper_size:nn{31mm}{44mm},
+    c0paper /    .code = \__incgra_define_paper_size:nn{917mm}{1297mm},
+    c1paper /    .code = \__incgra_define_paper_size:nn{648mm}{917mm},
+    c2paper /    .code = \__incgra_define_paper_size:nn{648mm}{917mm},
+    c3paper /    .code = \__incgra_define_paper_size:nn{324mm}{458mm},
+    c4paper /    .code = \__incgra_define_paper_size:nn{229mm}{324mm},
+    c5paper /    .code = \__incgra_define_paper_size:nn{162mm}{229mm},
+    c6paper /    .code = \__incgra_define_paper_size:nn{114mm}{162mm},
+    c7paper /    .code = \__incgra_define_paper_size:nn{81mm}{114mm},
+    c8paper /    .code = \__incgra_define_paper_size:nn{57mm}{81mm},
+    c9paper /    .code = \__incgra_define_paper_size:nn{40mm}{57mm},
+    c10paper /   .code = \__incgra_define_paper_size:nn{28mm}{40mm},
+    d0paper /    .code = \__incgra_define_paper_size:nn{771mm}{1091mm},
+    d1paper /    .code = \__incgra_define_paper_size:nn{545mm}{771mm},
+    d2paper /    .code = \__incgra_define_paper_size:nn{385mm}{545mm},
+    d3paper /    .code = \__incgra_define_paper_size:nn{272mm}{385mm},
+    d4paper /    .code = \__incgra_define_paper_size:nn{192mm}{272mm},
+    d5paper /    .code = \__incgra_define_paper_size:nn{136mm}{192mm},
+    d6paper /    .code = \__incgra_define_paper_size:nn{96mm}{136mm},
+    d7paper /    .code = \__incgra_define_paper_size:nn{68mm}{96mm},
+    executivepaper / .code = \__incgra_define_paper_size:nn{7.25in}{10.5in},
+    letterpaper / .code = \__incgra_define_paper_size:nn{8.5in}{11in},
+    legalpaper /  .code = \__incgra_define_paper_size:nn{8.5in}{14in},
+    ledgerpaper / .code = \__incgra_define_paper_size:nn{17in}{11in},
+    documentpaper / .style = \__incgra_define_paper_size:nn{\igrOrginalPageWidth}{\igrOrginalPageHeight},
+    currentpaper /  .code = { \cs_set_eq:NN \__incgra_outout: \__incgra_output_center: },
+    graphicspaper / .code = { \cs_set_eq:NN \__incgra_outout: \__incgra_output_page: },
+    paper /  .style = { #1paper },
+    center / .style = currentpaper,
+    page /   .style = graphicspaper,
+    left~border /   .code = \tl_set:Ne \l__incgra_left_border_tl   { \dim_eval:n { #1 } },
+    bottom~border / .code = \tl_set:Ne \l__incgra_bottom_border_tl { \dim_eval:n { #1 } },
+    right~border /  .code = \tl_set:Ne \l__incgra_right_border_tl  { \dim_eval:n { #1 } },
+    top~border /    .code = \tl_set:Ne \l__incgra_top_border_tl    { \dim_eval:n { #1 } },
+    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} },
+    xshift / .code =
+      {
+        \tl_set:Ne \l__incgra_left_border_tl  { \dim_eval:n { \l__incgra_left_border_tl + #1 } }
+        \tl_set:Ne \l__incgra_right_border_tl { \dim_eval:n { \l__incgra_right_border_tl - #1 } }
+      },
+    yshift / .code =
+      {
+        \tl_set:Ne \l__incgra_bottom_border_tl { \dim_eval:n { \l__incgra_bottom_border_tl + #1 } }
+        \tl_set:Ne \l__incgra_top_border_tl    { \dim_eval:n { \l__incgra_top_border_tl - #1 } }
+      },
+    autosize / .is~choice,
+    autosize / true / .code = \bool_set_true:N \l__incgra_autosize_bool,
+    autosize / false / .code = \bool_set_false:N \l__incgra_autosize_bool,
+    autosize/.default = true,
+    autosize~width~gap  /.code = \tl_set:Ne \l__incgra_autosize_width_gap_tl  { \dim_eval:n { #1 } },
+    autosize~height~gap /.code = \tl_set:Ne \l__incgra_autosize_height_gap_tl  { \dim_eval:n { #1 } },
+    autosize~gap /.style = {autosize~width~gap={#1}, autosize~height~gap={#1} },
+    autosize~min~scale  /.code = \fp_set:Nn \l__incgra_autosize_min_scale_fp { #1 },
+    autosize~max~scale  /.code = \fp_set:Nn \l__incgra_autosize_max_scale_fp { #1 },
+  }
+
+
+\igrset
+  {
+    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
+      },
+    autosize = false,
+    autosize~width~gap = 0pt,
+    autosize~height~gap = 0pt,
+    autosize~min~scale = 0.001,
+    autosize~max~scale = 1000,
+  }
+



More information about the tex-live-commits mailing list.