summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/incgraph/incgraph.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/incgraph/incgraph.sty')
-rw-r--r--macros/latex/contrib/incgraph/incgraph.sty1077
1 files changed, 622 insertions, 455 deletions
diff --git a/macros/latex/contrib/incgraph/incgraph.sty b/macros/latex/contrib/incgraph/incgraph.sty
index 43a2aac9a3..3eef75881c 100644
--- a/macros/latex/contrib/incgraph/incgraph.sty
+++ b/macros/latex/contrib/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,
+ }