summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-03-14 20:22:17 +0000
committerKarl Berry <karl@freefriends.org>2024-03-14 20:22:17 +0000
commitf7004d19658397ec2ff9af87ee2f84509872a77e (patch)
treeef5ab7e2cd737ebd2d13a237cf93049ec6544727 /Master
parentda895cafca5415b63ab705b4e6457d9496e48a9f (diff)
incgraph (14mar24)
git-svn-id: svn://tug.org/texlive/trunk@70635 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/latex/incgraph/CHANGES.md27
-rw-r--r--Master/texmf-dist/doc/latex/incgraph/README.md4
-rw-r--r--Master/texmf-dist/doc/latex/incgraph/incgraph-doc.sty17
-rw-r--r--Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdfbin317493 -> 313915 bytes
-rw-r--r--Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdfbin328766 -> 324489 bytes
-rw-r--r--Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdfbin320763 -> 315803 bytes
-rw-r--r--Master/texmf-dist/doc/latex/incgraph/incgraph.pdfbin1023673 -> 889331 bytes
-rw-r--r--Master/texmf-dist/doc/latex/incgraph/incgraph.tex198
-rw-r--r--Master/texmf-dist/tex/latex/incgraph/incgraph.sty1077
9 files changed, 829 insertions, 494 deletions
diff --git a/Master/texmf-dist/doc/latex/incgraph/CHANGES.md b/Master/texmf-dist/doc/latex/incgraph/CHANGES.md
index 0b6698f2100..c0def83b0ad 100644
--- a/Master/texmf-dist/doc/latex/incgraph/CHANGES.md
+++ b/Master/texmf-dist/doc/latex/incgraph/CHANGES.md
@@ -17,6 +17,31 @@ and this project adheres to
+## [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 @@ and this project adheres to
[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
diff --git a/Master/texmf-dist/doc/latex/incgraph/README.md b/Master/texmf-dist/doc/latex/incgraph/README.md
index 78e1983b504..860dc7d9050 100644
--- a/Master/texmf-dist/doc/latex/incgraph/README.md
+++ b/Master/texmf-dist/doc/latex/incgraph/README.md
@@ -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
diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph-doc.sty b/Master/texmf-dist/doc/latex/incgraph/incgraph-doc.sty
index efa2c71447b..761af119d36 100644
--- a/Master/texmf-dist/doc/latex/incgraph/incgraph-doc.sty
+++ b/Master/texmf-dist/doc/latex/incgraph/incgraph-doc.sty
@@ -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}
diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdf b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdf
index 1e5b76d3044..d6765c29410 100644
--- a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdf
+++ b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdf b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdf
index 9ee06ea60da..04edecf5757 100644
--- a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdf
+++ b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdf b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdf
index 67ca683b623..3b3ff6e5d40 100644
--- a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdf
+++ b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph.pdf b/Master/texmf-dist/doc/latex/incgraph/incgraph.pdf
index 1dd52b2d1dd..651ba6f48bd 100644
--- a/Master/texmf-dist/doc/latex/incgraph/incgraph.pdf
+++ b/Master/texmf-dist/doc/latex/incgraph/incgraph.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph.tex b/Master/texmf-dist/doc/latex/incgraph/incgraph.tex
index 1b739cfaf8c..6c56f047e0d 100644
--- a/Master/texmf-dist/doc/latex/incgraph/incgraph.tex
+++ b/Master/texmf-dist/doc/latex/incgraph/incgraph.tex
@@ -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@unibw.de}{thomas.sturm@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 @@ loads the packages |pgf|, |pgffor| \cite{tantau:tikz},
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 @@ the package |graphicx| \cite{carlisle:graphics}.
\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 @@ the package |graphicx| \cite{carlisle:graphics}.
\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@target@width} $\times$ \texttt{\igr@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 @@ the package |graphicx| \cite{carlisle:graphics}.
},
}
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,42 +576,129 @@ see page~\pageref{exarotated.listing}.
|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 @@ Adds a space of \meta{length} at all four sides.
\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 @@ Adds a space of \meta{length} at all four sides.
\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 @@ Then, all four pages of the original document are imported to the new paper
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 @@ See the result on the following page.
@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,14 +1331,14 @@ See the result on the following page.
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,
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}
diff --git a/Master/texmf-dist/tex/latex/incgraph/incgraph.sty b/Master/texmf-dist/tex/latex/incgraph/incgraph.sty
index 43a2aac9a32..3eef75881c4 100644
--- a/Master/texmf-dist/tex/latex/incgraph/incgraph.sty
+++ b/Master/texmf-dist/tex/latex/incgraph/incgraph.sty
@@ -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,34 +17,40 @@
%%
%% 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@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{}}%
+\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
-
-\RequirePackage{pgfkeys}
-\igrreq@pgf
-\igrreq@graphicx
-\igrreq@bookmark
+\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,
+ }
-% key management
-\pgfkeys{/igr/.is family}
+\SetKeys[incgra]{ pgf, graphicx, bookmark }
-\def\igrset{\pgfqkeys{/igr}}
+\ProcessKeyOptions[incgra]
-\newbox\igrbox
-\newdimen\igr@length
-\newcounter{igrtarget}
+\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} }
-\ExplSyntaxOn
+\pgfkeys{/igr/.is~family}
+\cs_set_nopar:Npn \igrset { \pgfqkeys{/igr} }
\sys_if_engine_pdftex:TF
{
@@ -114,248 +120,317 @@
}
}
-\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
+\box_new:N \igrbox
+\newcounter{igrtarget}
+
+\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
+
\clist_new:N \l__incgra_extensions_clist
+\dim_new:N \l__incgra_offx_left_dim
+
+\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
+
+\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
+
+\NewHook { incgra/usertarget }
+
+
+\AddToHook{begindocument}
+ {
+ \igrGetPageSize
+ \let\igrOrginalPageWidth\igrPageWidth
+ \let\igrOrginalPageHeight\igrPageHeight
+ }
+
+
+\cs_new_protected:Npn \__incgra_set_next_target:
+ {
+ \refstepcounter{igrtarget}
+ \cs_gset_nopar:Npe \igrAutoTarget { igr-\theigrtarget }
+ \UseHook{ incgra/usertarget }
+ }
+
+
+\NewDocumentCommand \igrtargetset { m }
+ {
+ \AddToHookNext{ incgra/usertarget }
+ { \cs_gset_nopar:Npe \igrAutoTarget { #1 } }
+ }
+
+
+\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:
+ }
+ }
+
+
+\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 } }
+ }
+
+
+\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
+
+
+% clone of \__kernel_kern:n
+\cs_new_protected:Npn \___incgra_kern:n #1
+ { \kern \dimexpr #1 \scan_stop: }
+
+
+\cs_new_protected:Npn \__incgra_box_use_center:
+ {
+ \igrGetPageSize
+ \thispagestyle{\igrpagestyle}
+
+ \legacy_if:nTF { @twoside }
+ {
+ \int_if_odd:nTF \c@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}
+ }
+
+ \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
+ }
+
+\NewDocumentCommand \igrboxcenter { }{ \__incgra_box_use_center: }
+
+
+\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) {};
+ }
+
+\NewCommandCopy \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_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) {};
+ }
+
+
+\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 }
+
+
+\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 }
+ }
+
+
+\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 }
+ }
+ }
+
+
+\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 }
+ }
+ }
+
+
+\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,68 +446,71 @@
}
+
\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
+ \__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
- {
- \igrboxset{\l_tmpa_tl{#2}}
- }
+ \__incgra_box_set:n
{
- \igrboxset{\l_tmpa_tl{#2}\label{\l__incgra_label_text_tl}}
+ \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 } }
}
- \igr@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@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@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 }
}
}
\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@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@match@hook
- \igr@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@rebox
- \igr@get@box@dimensions
- \igr@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};
+ }
+ },
+ }
+
+
+\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
+ }
+
+
+\NewDocumentCommand \igrsetmatchvalue { m m }
+ {
+ \pgfkeyssetvalue { /igrmatch/#1 }{ #2 }
+ }
+
+\NewExpandableDocumentCommand \igrifmatch { m m m }
+ {
+ \pgfkeysifdefined{ /igrmatch/#1 }
+ {
+ \pgfkeysgetvalue { /igrmatch/#1 }{ \igrmatchvalue }
+ #2
+ }
+ { #3 }
+ }
+
+
+\pgfkeys
+ {
+ /igrsetmatch/.unknown/.code=
+ {
+ \cs_set_eq:NN \igrmatchkey \pgfkeyscurrentname
+ \igrsetmatchvalue { \igrmatchkey }{ #1 }
+ }
+ }
+
+\NewDocumentCommand \igrsetmatches { m }
+ {
+ \pgfkeys{ /igrsetmatch/.cd, #1 }
}
-\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},
-}
+
+\cs_new_protected:Npn \__incgra_define_paper_size:n #1
+ {
+ \__incgra_define_paper_size:w #1 \q_stop
+ }
+
+
+\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,
+ }