diff options
author | Karl Berry <karl@freefriends.org> | 2012-09-28 22:46:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-09-28 22:46:29 +0000 |
commit | 5532da0334f19f07353a3c4a85b5b848bc6b3f90 (patch) | |
tree | 92495ff19c9614ceb6dc98964f853da022e24639 /Master/texmf-dist | |
parent | 2ea467335e53afde5e4bc6a6806bd6c194e416e1 (diff) |
incgraph (28sep12)
git-svn-id: svn://tug.org/texlive/trunk@27841 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/latex/incgraph/CHANGES | 88 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/incgraph/README | 2 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdf | bin | 88901 -> 88917 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.tex | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdf | bin | 99366 -> 99408 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.tex | 6 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdf | bin | 92251 -> 92275 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.tex | 4 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/incgraph/incgraph.pdf | bin | 636753 -> 715498 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/incgraph/incgraph.tex | 765 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/incgraph/incgraph.sty | 209 |
11 files changed, 690 insertions, 389 deletions
diff --git a/Master/texmf-dist/doc/latex/incgraph/CHANGES b/Master/texmf-dist/doc/latex/incgraph/CHANGES index 67443f6754c..aa213cf9c7e 100644 --- a/Master/texmf-dist/doc/latex/incgraph/CHANGES +++ b/Master/texmf-dist/doc/latex/incgraph/CHANGES @@ -1,37 +1,51 @@ -%% The LaTeX package incgraph - version 1.02 (2012/07/06)
-%%
-%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2012 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de>
-%% -------------------------------------------------------------------------------------------
-%%
-%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
-%%
-%% This work has the LPPL maintenance status `author-maintained'.
-%%
-%% This work consists of all files listed in README
-%%
-
-version 1.00 (2012/06/21): initial public release
-
-version 1.01 (2012/07/04):
-- the code of the hypertarget setting is rewritten to place it at
- the top left corner of the page (previously it was placed at the
- top left corner of the text area).
-- new macro '\igrtargetset' to set hypertarget values manually
-- new key 'target' to set hypertarget values manually
-
-version 1.02 (2012/07/06):
-- bug fixed in '\igrboxtikz' which caused a small shift.
-- key 'nohyper' renamed to 'no hyper'
-- new macro '\igrboxtikzcenter' to support tikz pictures with a centered box.
-- option key 'include command' now has a default.
-- new feature to overlay included graphics with tikz picture code
- using the new option keys 'overlay', 'overlay page number at',
- 'overlay page number at bottom', 'overlay page number at top',
- 'no overlay'.
+%% The LaTeX package incgraph - version 1.10 (2012/09/28) +%% +%% ------------------------------------------------------------------------------------------- +%% Copyright (c) 2012 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> +%% ------------------------------------------------------------------------------------------- +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `author-maintained'. +%% +%% This work consists of all files listed in README +%% + +version 1.00 (2012/06/21): initial public release + +version 1.01 (2012/07/04): +- the code of the hypertarget setting is rewritten to place it at + the top left corner of the page (previously it was placed at the + top left corner of the text area). +- new macro '\igrtargetset' to set hypertarget values manually +- new key 'target' to set hypertarget values manually + +version 1.02 (2012/07/06): +- bug fixed in '\igrboxtikz' which caused a small shift. +- key 'nohyper' renamed to 'no hyper' +- new macro '\igrboxtikzcenter' to support tikz pictures with a centered box. +- option key 'include command' now has a default. +- new feature to overlay included graphics with tikz picture code + using the new option keys 'overlay', 'overlay page number at', + 'overlay page number at bottom', 'overlay page number at top', + 'no overlay'. + +version 1.10 (2012/09/28): +- overlay code and graphics inclusion decoupled internally +- interlineskip problem fixed +- output macro implementation rewritten +- new macro '\igrcenterfit' for an arbitrary paper size +- new user interface environment 'inctext' to support + arbitrary internal graphics +- documentation structure changed +- introduction of various paper format options with the key 'paper' +- new 'landscape' and 'portrait' keys +- new keys 'currentpaper', 'graphicspaper' and 'documentpaper' + to replace the deprecated keys 'page' and 'center' +- various internal code changes diff --git a/Master/texmf-dist/doc/latex/incgraph/README b/Master/texmf-dist/doc/latex/incgraph/README index 877fb337b6e..7bdc701b68f 100644 --- a/Master/texmf-dist/doc/latex/incgraph/README +++ b/Master/texmf-dist/doc/latex/incgraph/README @@ -1,4 +1,4 @@ -%% The LaTeX package incgraph - version 1.02 (2012/07/06) +%% The LaTeX package incgraph - version 1.10 (2012/09/28) %% %% ------------------------------------------------------------------------------------------- %% Copyright (c) 2012 by Prof. Dr. Dr. Thomas F. Sturm <thomas dot sturm at unibw dot de> diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdf b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdf Binary files differindex 1e4a7ffc4aa..b9f63200f8f 100644 --- a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdf +++ b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.pdf diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.tex b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.tex index f7e46d3482d..d0b0836e580 100644 --- a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.tex +++ b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-a.tex @@ -1,7 +1,10 @@ \documentclass{article} \usepackage{incgraph} -\igrset{center,zerofill=4,bookmark={Page \theigrpage\ (\nt)}} +\igrset{paper=letter, + zerofill=4, + bookmark={Page \theigrpage\ (\nt)} + } \begin{document}% \incgraph{example.jpg} diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdf b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdf Binary files differindex 25da93a2ea7..704e9048782 100644 --- a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdf +++ b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.pdf diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.tex b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.tex index e70d4ee343f..7ef4d8205a9 100644 --- a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.tex +++ b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-b.tex @@ -1,8 +1,10 @@ \documentclass{article} \usepackage{incgraph,tikz} -\igrset{page,zerofill=4,options={width=18cm}, - overlay page number at top=7mm} +\igrset{paper=graphics, + zerofill=4, + options={width=18cm}, + overlay page number at top=7mm} \igrsetmatches{ 1 = A very red image, 123 = A greenish example } diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdf b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdf Binary files differindex a2cb337393f..3b830d85298 100644 --- a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdf +++ b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.pdf diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.tex b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.tex index 3a47e886eb2..4257c2b0c21 100644 --- a/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.tex +++ b/Master/texmf-dist/doc/latex/incgraph/incgraph-example-c.tex @@ -1,8 +1,8 @@ -\documentclass[a4paper]{article} +\documentclass{article} \usepackage{incgraph} \begin{document}% - \incmultigraph[center, + \incmultigraph[paper=a4, bookmark={Imported page \n\ of \nt}][page=\n] {incgraph-example-a.pdf}{1,...,4} \end{document} diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph.pdf b/Master/texmf-dist/doc/latex/incgraph/incgraph.pdf Binary files differindex 3e2bc935247..c5c6e4a629f 100644 --- a/Master/texmf-dist/doc/latex/incgraph/incgraph.pdf +++ b/Master/texmf-dist/doc/latex/incgraph/incgraph.pdf diff --git a/Master/texmf-dist/doc/latex/incgraph/incgraph.tex b/Master/texmf-dist/doc/latex/incgraph/incgraph.tex index 930f66ff762..40236bc1d7b 100644 --- a/Master/texmf-dist/doc/latex/incgraph/incgraph.tex +++ b/Master/texmf-dist/doc/latex/incgraph/incgraph.tex @@ -1,5 +1,5 @@ % \LaTeX-Main\ -%% The LaTeX package incgraph - version 1.02 (2012/07/06) +%% The LaTeX package incgraph - version 1.10 (2012/09/28) %% incgraph.sty: Manual %% %% ------------------------------------------------------------------------------------------- @@ -61,8 +61,8 @@ pdfkeywords={graphics inclusion page} } -\def\version{1.02}% -\def\datum{2012/07/06}% +\def\version{1.10}% +\def\datum{2012/09/28}% \makeindex @@ -174,253 +174,40 @@ Note that you can always load the mentioned packages yourself. This is intended to avoid possible option clashes the easy way. -%-------------------------------------- -\section{Basic Tool Box}\label{sec:basictoolbox} -If you are just looking for macros to include an external picture, you may -proceed to Section \ref{sec:interface} directly. - -\subsection{Full Page Commands} - -\begin{docCommand}{igrpage}{\marg{text}} - The \meta{text} is put on a separate page which is resized to fit the - dimensions of the \meta{text}. \meta{text} may be single letter, an - included picture, or any \LaTeX\ code. - The page number is stored into \docAuxCommand{theigrpage} and - \docAuxCommand{igrAutoTarget} holds a hypertarget value for bookmarking. - The style of the separate page is set to - the content of the macro - \docAuxCommand{igrpagestyle} which defaults to 'empty' but can be - redefined.\\ - An application for |igrpage| is found in Example~\ref{fullpaperdrawing1} - on page~\pageref{fullpaperdrawing1}. -\end{docCommand} - -\begin{docCommand}{igrcenter}{\marg{text}} - The \meta{text} is put in the center of a separate page which has the - current document dimensions. \meta{text} may be single letter, an - included picture or any \LaTeX\ code. - The page number is stored into \docAuxCommand{theigrpage} and - \docAuxCommand{igrAutoTarget} holds a hypertarget value for bookmarking. - The style of the separate page is set to - the content of the macro - \docAuxCommand{igrpagestyle} which defaults to 'empty' but can be - redefined.\\ - An application for |igrcenter| is found in Example~\ref{fullpaperdrawing2} - on page~\pageref{fullpaperdrawing2}. -\end{docCommand} - -\begin{docCommand}{igrtargetset}{\marg{anchor}} - The next value for \docAuxCommand{igrAutoTarget} is set to \meta{anchor}. - This can be used for hand-made hyperlinks or bookmarks. - An application for |igrtargetset| is found in Example~\ref{fullpaperdrawing2} - on page~\pageref{fullpaperdrawing2}. -\end{docCommand} - - -\subsection{Box Commands} - -\begin{docCommand}{igrboxset}{\marg{text}} - The \meta{text} is put into a \TeX\ box named \docAuxCommand{igrbox}. - Additionally, some auxiliary macros are defined: - \begin{itemize} - \item\docAuxCommand{igrAutoTarget}: unique value for a hyper target. - \item\docAuxCommand{igrBoxWidth}: width of the |\igrbox|. - \item\docAuxCommand{igrBoxHeight}: total height of the |\igrbox|. - \item\docAuxCommand{igrBoxht}: height of the |\igrbox|. - \item\docAuxCommand{igrBoxdp}: depth of the |\igrbox|. - \end{itemize} -\begin{dispExample} - \igrboxset{This is an example} - |\igrAutoTarget| = \igrAutoTarget, |\igrBoxWidth| = \igrBoxWidth, - |\igrBoxHeight| = \igrBoxHeight,\\ - |\igrBoxht| = \igrBoxht, |\igrBoxdp| = \igrBoxdp; -\end{dispExample} -\end{docCommand} - -\begin{docCommand}{igrboxcenter}{} - The current content of the |\igrbox| - is put in the center of a separate page which has the - current |pdfpage| dimensions.\\ - The style of the separate page is set to - the content of the macro - \docAuxCommand{igrpagestyle} which defaults to 'empty' but can be - redefined. - Note that a |\clearpage| or similar has to be inserted before this command. -\end{docCommand} - -\clearpage -\begin{docCommand}{igrboxtikz}{} - The current content of the |\igrbox| is embedded into a |\node| command - from the |tikz| package \cite{tantau:2010c} which has to be loaded separately. - Also, the bounding box is adjusted to the |\igrbox|.\\ - To support positioning inside the picture, two |tikz| nodes named - |box| and |page| are defined which both take the dimensions of the |\igrbox|. -\begin{dispExample} -\igrboxset{\includegraphics{example.jpg}}% -\begin{tikzpicture}% - \igrboxtikz% - \draw[blue,very thick] (0,0) rectangle (\igrBoxWidth,\igrBoxHeight); - \draw[red] (0,0) grid (\igrBoxWidth,\igrBoxHeight); - \draw[black] ([xshift=-1cm,yshift=-1cm]page.north east) circle (1cm); -\end{tikzpicture} -\end{dispExample} - -The boxing macros can also be used nested (see the result on the following page): -\begin{dispListing} -\igrpage{\igrboxset{\includegraphics{example.jpg}}% - \begin{tikzpicture}% - \igrboxtikz% - \draw[blue,very thick] (0,0) rectangle (\igrBoxWidth,\igrBoxHeight); - \draw[red] (0,0) grid (\igrBoxWidth,\igrBoxHeight); - \draw[black] ([xshift=1cm,yshift=-1cm]page.north west) circle (1cm); -\end{tikzpicture}} -\end{dispListing} -\tcbusetemp -\end{docCommand} - - -\begin{docCommand}{igrboxtikzpage}{} - This is an alias for \refCom{igrboxtikz}. -\end{docCommand} - - -\begin{docCommand}{igrboxtikzcenter}{} - The current content of the |\igrbox| is embedded into a |\node| command - from the |tikz| package \cite{tantau:2010c} which has to be loaded separately. - This node is placed in the center of a bounding box which takes the current - page dimensions. Afterwards, |\igrBoxWidth| and |\igrBoxHeight| are - redefined to the dimensions of the total page.\\ - To support positioning inside the picture, two |tikz| nodes named - |box| and |page| are defined. |box| takes the dimensions of the |\igrbox| - and |page| takes the dimensions of the |tikzpicture|. -\begin{dispListing} -\igrcenter{\igrboxset{\includegraphics{example.jpg}}% - \begin{tikzpicture}% - \igrboxtikzcenter% - \draw[help lines] (0,0) grid (\igrBoxWidth,\igrBoxHeight); - \draw[dashed] (box.south west) rectangle (box.north east); - - \draw[very thick,<->] (page.north west)--(box.north west); - \draw[very thick,<->] (page.north east)--(box.north east); - \draw[very thick,<->] (page.south west)--(box.south west); - \draw[very thick,<->] (page.south east)--(box.south east); -\end{tikzpicture}} -\end{dispListing} -See the result on the following page. -\tcbusetemp -\end{docCommand} - - -\subsection{Map and Match Commands} - - -\begin{docCommand}{igrsetmatchvalue}{\marg{key}\marg{value}} - The given \meta{key} is mapped to the given \meta{value}. Later, this - \meta{value} can be retrieved by \refCom{igrifmatch}. -\begin{dispExample} -\igrsetmatchvalue{my key A}{my value A} -\def\keytester#1{\igrifmatch{#1}{Hurray: '\igrmatchvalue'}{'#1' unknown}} - -\keytester{foo}\\ -\keytester{my key A} -\end{dispExample} -\end{docCommand} - - -\begin{docCommand}{igrsetmatches}{\marg{list}} - The \meta{list} is a comma separated list of \meta{key}=\meta{value} pairs. - On every pair, the \refCom{igrsetmatchvalue} macro is applied. -\begin{dispExample} -\igrsetmatches{my key A = my value A, bar = Shakespeare} -\def\keytester#1{\igrifmatch{#1}{Hurray: '\igrmatchvalue'}{'#1' unknown}} - -\keytester{foo}\\ -\keytester{bar}\\ -\keytester{my key A} -\end{dispExample} -\end{docCommand} - - -\begin{docCommand}{igrifmatch}{\marg{key}\marg{then}\marg{else}} - If a \meta{key} was defined by \refCom{igrsetmatchvalue} or - \refCom{igrsetmatches}, the corresponding value is put in the - macro \docAuxCommand{igrmatchvalue} and the \meta{then} code is - executed. If the \meta{key} is unknown, the \meta{else} code is - executed. -\begin{dispExample} -\igrsetmatches{1 = January, 2 = February, 3 = March, apr = April} -\def\monthname#1{\igrifmatch{#1}{The name of month #1\ is \igrmatchvalue.}{% - You are kidding.}} - -\monthname{1} \monthname{foo} \monthname{2}\\ -\monthname{3} \monthname{apr} \monthname{35} -\end{dispExample} -\end{docCommand} - - -\clearpage -\subsection{Zero Filling Commands} -\begin{docCommand}{igrmakezerofill}{\marg{macro}\marg{digits}} - With this command, a new \meta{macro} can be defined which takes a - non negative number as parameter. - This number is filled up with leading zeros until the - \meta{digits} count is reached. - If \meta{digits} is 0 or 1, nothing is added. A \meta{digits} value - greater than 10 is treated as 10 which is the maximum number of - possible digits. -\begin{dispExample} -\igrmakezerofill{\myfill}{0} -\myfill{7}, \myfill{12}, \myfill{934}, \myfill{665234}.\\ -\igrmakezerofill{\myfill}{3} -\myfill{7}, \myfill{12}, \myfill{934}, \myfill{665234}.\\ -\igrmakezerofill{\myfill}{5} -\myfill{7}, \myfill{12}, \myfill{934}, \myfill{665234}.\\ -\igrmakezerofill{\myfill}{9} -\myfill{7}, \myfill{12}, \myfill{934}, \myfill{665234}.\\ -\igrmakezerofill{\myfill}{30} -\myfill{7}, \myfill{12}, \myfill{934}, \myfill{665234}. -\end{dispExample} -\begin{dispExample} -\igrmakezerofill{\threedigits}{3} -\threedigits{1}% -\foreach \n in {2,...,100} {, \threedigits{\n}}. -\end{dispExample} -\end{docCommand} - -\clearpage %-------------------------------------- -\section{Convenience User Interface}\label{sec:interface} +\section{User Interface}\label{sec:interface} + +\subsection{Inclusion Macros for External Graphics} The macros of this section rely on the |\includegraphics| command from the package |graphicx| \cite{carlisle:1999a}. -Section \ref{sec:basictoolbox} describes more basic commands. - -\subsection{Inclusion Macros for Graphics} +%Section \ref{sec:basictoolbox} describes more basic commands. \begin{docCommand}{incgraph}{\oarg{options}\oarg{graphics options}\marg{file name}} The picture file with the given \meta{file name} is included in the center of a separate page. Depending on the \meta{options}, this page keeps the document size or is resized to the graphics dimensions. - The applicable \meta{options} are listed in Subsection \ref{sec:keys}. + The applicable \meta{options} are listed in Section \ref{sec:keys}. If \meta{graphics options} are given, these are added to the options for the underlying |\includegraphics| command. See the documentation of |graphicx| \cite{carlisle:1999a} for a list of applicable \meta{graphics options}. + \begin{texexptitled}[listing only,before={\par\medskip}]% {The hand-drawn example (centered); see page~\pageref{exacenter}}{exacenter.listing} -\incgraph[center,label={exacenter},overlay page number at bottom, +\incgraph[paper=current,label={exacenter},overlay page number at bottom, bookmark={The hand-drawn example (centered)}]{example.jpg} \end{texexptitled} \begin{texexptitled}[listing only,before={\par\medskip}]% {The hand-drawn example (resized page); see page~\pageref{exaresized}}{exaresized.listing} -\incgraph[page,label={exaresized}, +\incgraph[paper=graphics,label={exaresized}, bookmark={The hand-drawn example (resized page)}]{example.jpg} \end{texexptitled} \begin{texexptitled}[listing only,before={\par\medskip}]% {The hand-drawn example (rotated and oversized); see page~\pageref{exarotated}}{exarotated.listing} -\incgraph[center,label={exarotated},target=oversized, +\incgraph[paper=current,label={exarotated},target=oversized, bookmark={The hand-drawn example (rotated and oversized)}]% [angle=30,scale=3]{example.jpg} \end{texexptitled} @@ -432,7 +219,7 @@ Section \ref{sec:basictoolbox} describes more basic commands. parts are substituted by elements of the \meta{list} are included in the center of a separate page. Depending on the \meta{options}, the pages keep the document size or are resized to the graphics dimensions. - The applicable \meta{options} are listed in Subsection \ref{sec:keys}. + The applicable \meta{options} are listed in Section \ref{sec:keys}. If \meta{graphics options} are given, these are added to the options for the underlying |\includegraphics| command. See the documentation of |graphicx| \cite{carlisle:1999a} for a list of applicable \meta{graphics options}.\\ @@ -457,44 +244,150 @@ Section \ref{sec:basictoolbox} describes more basic commands. {A series of pictures; see from page~\pageref{exaseries.1}. The image files exaimage-0001.png to exaimage-0150.png are included but only three of them exist.}{exaseries.listing} -\incmultigraph[zerofill=4,center,bookmark={A series of pictures: \nt}, - label={exaseries.\n}]{exaimage-\nn.png}{1,...,150} +\incmultigraph[zerofill=4,bookmark={A series of pictures: \nt}, + paper=current,label={exaseries.\n}]{exaimage-\nn.png}{1,...,150} \end{texexptitled} \end{docCommand} +\subsection{Inclusion Macro for Internal Graphics} + +\begin{docEnvironment}{inctext}{\oarg{options}} + The environment content is included in the center + of a separate page. Depending on the \meta{options}, this page keeps the + document size or is resized to the content dimensions. + The applicable \meta{options} are listed in Section \ref{sec:keys}. + + +\begin{texexptitled}[listing only,before={\par\medskip}]% + {Some text on a shrunk paper; see page~\pageref{inctext1}}{inctext1.listing} +\begin{inctext}[paper=graphics,label={inctext1},bookmark={A huge ABC}] + \Huge ABC +\end{inctext} +\end{texexptitled} + + +\begin{texexptitled}[listing only,before={\par\medskip}]% + {A tikzpicture as text content; see page~\pageref{inctext2}}{inctext2.listing} +\begin{inctext}[paper=a6,landscape,label={inctext2},bookmark={Graph}, + overlay page number at bottom=8mm] + \begin{tikzpicture}[zustand/.style={circle,fill=Gold,draw},scale=2] + \draw node[zustand] (s0) {$s_0$} + +(30:3cm) node[zustand] (s1) {$s_1$} + ++(-30:3cm) node[zustand] (s2) {$s_2$} + +(30:3cm) node[zustand] (s3) {$s_3$}; + \path[very thick,-latex] + (s0) edge node[above left] {a} (s1) + edge node[below left] {b} (s2) + (s1) edge[out=-120,in=120] node[left] {b} (s2) + edge node[above right] {a} (s3) + (s2) edge[out=60,in=-60] node[right] {a} (s1) + edge node[below right] {b} (s3); + \end{tikzpicture} +\end{inctext} +\end{texexptitled} +\end{docEnvironment} + + +\subsection{(Global) Option Setting} \begin{docCommand}{igrset}{\marg{options}} - Sets options for \refCom{incgraph} and \refCom{incmultigraph} - inside the current \TeX\ group. - For example, the options \refKey{/igr/center} and + Sets options for \refCom{incgraph}, \refCom{incmultigraph}, and + \refEnv{inctext} inside the current \TeX\ group. + For example, the options \refKey{/igr/paper} and \refKey{/igr/zerofill} may be defined for the whole document by this: \begin{dispListing} -\igrset{center,zerofill=3} +\igrset{paper=current,zerofill=3} \end{dispListing} \end{docCommand} -\subsection{Option Keys}\label{sec:keys} -\begin{docIgrKey}{center}{}{no value} - The included image file is put in the center of a separate page which has the - current document dimensions. See page \pageref{exacenter} for the output +\clearpage +%-------------------------------------- +\section{Option Keys}\label{sec:keys} + +\subsection{Paper (Media) Size}\label{sec:papersize} + +\begin{docIgrKey}{currentpaper}{}{no value} + The paper size keeps unchanged at the current size + except if \refKey{/igr/landscape} is used. + The current paper size has not to + be the document paper size. + See page \pageref{exacenter} for the output of Example \ref{exacenter.listing} on page \pageref{exacenter.listing}. \end{docIgrKey} -\begin{docIgrKey}{page}{}{no value, initially set} - The included image file is put on a separate page which is resized to fit the - dimensions of the image. See page \pageref{exaresized} for the output +\begin{docIgrKey}{documentpaper}{}{no value} + The paper size is set to the initial document paper size. +\end{docIgrKey} + +\begin{docIgrKey}{graphicspaper}{}{no value, initially set} + The paper is resized to the dimensions of the included image. + The \refKey{/igr/landscape} option is ignored for this paper. + See page \pageref{exaresized} for the output of Example \ref{exaresized.listing} on page \pageref{exaresized.listing}. \end{docIgrKey} + +\begin{docIgrKey}{paper size}{=\meta{width}:\meta{height}}{no default} + The paper is resized to the given \meta{width} and \meta{height}. +\end{docIgrKey} + +\begin{docIgrKey}{paper}{=\meta{name}}{no default} + The paper sized is chosen according to the given \meta{name}. + Feasible values for the \meta{name} are + |current|, |document|, |graphics|, + |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. +\end{docIgrKey} + +\begin{docIgrKey}{landscape}{}{no value} + If set the width and height of the chosen paper are switched. Note that + this turns the paper by 90 degrees but the contents of the paper is not + turned. +\end{docIgrKey} + +\begin{docIgrKey}{portrait}{}{no value, initially set} + Disables the \refKey{/igr/landscape} mode. +\end{docIgrKey} + + +\makeatletter% +\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} + \igrset{\x paper}% + The paper size is set to + \texttt{\igr@target@width} $\times$ \texttt{\igr@target@height}. +\end{docIgrKey}} +\makeatother% + +\begin{docIgrKey}{center}{}{no value, deprecated} + An alias for \refKey{/igr/currentpaper}. +\end{docIgrKey} + +\begin{docIgrKey}{page}{}{no value, deprecated} + An alias for \refKey{/igr/graphicspaper}. +\end{docIgrKey} + + +\clearpage +\subsection{Graphics Inclusion} + \begin{docIgrKey}{options}{=\marg{graphics options}}{no default, initially empty} The \meta{graphics options} are applied to the underlying |\includegraphics| command. See the documentation of |graphicx| \cite{carlisle:1999a} for a list of applicable \meta{graphics options}. \begin{texexptitled}[listing only,before={\par\medskip}]% {A resized image; see page~\pageref{exagraphresize}}{exagraphresize.listing} -\igrset{options={width=10cm,height=10cm},page, - overlay page number at top=5mm} +\igrset{options={width=10cm,height=10cm}, paper=graphics, + overlay page number at top=5mm + } \incgraph[bookmark={A resized image}, label={exagraphresize}]% {exaimage-0037.png} @@ -506,33 +399,59 @@ Section \ref{sec:basictoolbox} describes more basic commands. for the underlying |\includegraphics| command. \end{docIgrKey} -\begin{docIgrKey}{label}{=\marg{text}}{no default, initially empty} - Adds a \LaTeX\ label to the included image. + +\begin{docIgrKey}{include command}{\colOpt{=\meta{macro}}}{default and initially \cs{includegraphics}} + Replaces the internally used \cs{includegraphics} command by the given \meta{macro}. + Note that \meta{macro} has to have the same signature as \cs{includegraphics}, + i.\,e.\ it has to take two arguments where the first argument is optional. \end{docIgrKey} -\begin{docIgrKey}{zerofill}{=\marg{digits}}{no default, initially |0|} - For \refCom{incmultigraph}, the current number element - is filled up with leading zeros until the \meta{digits} count is reached. - If \meta{digits} is 0 or 1, nothing is added. A \meta{digits} value - greater than 10 is treated as 10 which is the maximum number of - possible digits. The result is accessible as |\nn|, see \refCom{incmultigraph}. - Note that |zerofill| should be set to |0| if the list elements - in \refCom{incmultigraph} are not numbers. +\begin{docIgrKey}{existence check}{=\meta{macro}}{no default} + Replaces the internally used \cs{IfFileExists} command by the given \meta{macro}. + Note that \meta{macro} has to have the same signature as \cs{IfFileExists}, + i.\,e.\ it has to take three arguments. \end{docIgrKey} +\begin{docIgrKey}{fail on not found}{}{no value} + Stops the compilation with an error if the included file does not exist. +\end{docIgrKey} + +\begin{docIgrKey}{ignore on not found}{}{no value, initially set} + Not existing included files are ignored without warning. +\end{docIgrKey} + + +\subsection{Hypertargets, Labels, and Bookmarks} + \begin{docIgrKey}{hyper}{}{no value, initially set} - An automated hypertarget is set to the current image. The hypertarget is placed + An automated hyper target is set to the current image. The hyper target is placed at the top left corner of the page. It is used internally, when a bookmark is added. \end{docIgrKey} \begin{docIgrKey}{no hyper}{}{no value} - No automated hypertarget is set to the current image. Use this option, if + No automated hyper target is set to the current image. Use this option, if the package |bookmark| is not included. \end{docIgrKey} +\begin{docIgrKey}{target}{=\meta{anchor}}{no default} + The next hypertarget destination value is set to \meta{anchor} instead of + an automatically created value. This may be used for hyperlinks. +\begin{dispExample} +\hyperlink{oversized}{This is linked to the oversized example (click me)}. +The target value '|oversized|' was defined in Example~\ref{exarotated.listing}, +see page~\pageref{exarotated.listing}. +\end{dispExample} +\end{docIgrKey} + \clearpage -\begin{docIgrKey}{bookmark}{=\marg{text}}{no default, initially empty} + +\begin{docIgrKey}{label}{=\meta{text}}{no default, initially empty} + Adds a \LaTeX\ label to the included image. +\end{docIgrKey} + + +\begin{docIgrKey}{bookmark}{=\meta{text}}{no default, initially empty} Adds a PDF bookmark with the given \meta{text} to the current image. \end{docIgrKey} @@ -543,18 +462,19 @@ Section \ref{sec:basictoolbox} describes more basic commands. \begin{texexptitled}[listing only,before={\par\medskip}]% {Bookmark options; see page~\pageref{exabookmark}}{exabookmark.listing} % not every PDF reader will show the effect! -\igrset{bookmark options={bold,color={red}},center} +\igrset{bookmark options={bold,color={red}},currentpaper} \incgraph[bookmark={This ugly image again!},label={exabookmark}]% {example.jpg} \end{texexptitled} \end{docIgrKey} -\begin{docIgrKey}{bookmark heading}{=\marg{text}}{no default, initially empty} +\begin{docIgrKey}{bookmark heading}{=\meta{text}}{no default, initially empty} For \refCom{incmultigraph}, an additional bookmark with the given \meta{text} is set as a heading before the images are included. \begin{texexptitled}[listing only,before={\par\medskip}]% {A series of pictures; see from page~\pageref{exaheading.1}}{exaheading.listing} -\incmultigraph[zerofill=4,center,bookmark heading={A series of pictures}, +\incmultigraph[zerofill=4,currentpaper, + bookmark heading={A series of pictures}, bookmark heading options={level=subsection}, bookmark={\nt},bookmark options={level=subsubsection}, overlay page number at bottom, @@ -568,17 +488,10 @@ Section \ref{sec:basictoolbox} describes more basic commands. |bookmark| \cite{oberdiek:2011a} for a list of applicable \meta{bookmark options}. \end{docIgrKey} -\begin{docIgrKey}{target}{=\marg{anchor}}{no default} - The next hypertarget destination value is set to \meta{anchor} instead of - an automatically created value. This may be used for hyperlinks. -\begin{dispExample} -\hyperlink{oversized}{This is linked to the oversized example (click me)}. -The target value '|oversized|' was defined in Example~\ref{exarotated.listing}, -see page~\pageref{exarotated.listing}. -\end{dispExample} -\end{docIgrKey} \clearpage +\subsection{Map and Match} + \begin{docIgrKey}{set matches}{=\marg{list}}{no default, initially empty} The \meta{list} is a comma separated list of \meta{key}=\meta{value} pairs. For every pair, the given \meta{key} is mapped to the given \meta{value}. @@ -622,7 +535,8 @@ see page~\pageref{exarotated.listing}. If the \meta{key} is unknown, the current PDF bookmark is set to \meta{else}. \begin{texexptitled}[listing only,before={\par\medskip}]% {Map and match example; see from page~\pageref{examatch.1}}{examatch.listing} -\incmultigraph[zerofill=4,page,bookmark heading={Map and match example}, +\incmultigraph[zerofill=4,paper=graphics, + bookmark heading={Map and match example}, bookmark heading options={level=subsection}, bookmark options={level=subsubsection}, if match set bookmark={\n}{\igrmatchvalue\ (\n)}{\nt}, @@ -639,29 +553,8 @@ see page~\pageref{exarotated.listing}. \end{docIgrKey} \clearpage -\begin{docIgrKey}{include command}{\colOpt{=\marg{macro}}}{default and initially \cs{includegraphics}} - Replaces the internally used \cs{includegraphics} command by the given \meta{macro}. - Note that \meta{macro} has to have the same signature as \cs{includegraphics}, - i.\,e.\ it has to take two arguments where the first argument is optional. -\end{docIgrKey} -\begin{docIgrKey}{existence check}{=\marg{macro}}{no default} - Replaces the internally used \cs{IfFileExists} command by the given \meta{macro}. - Note that \meta{macro} has to have the same signature as \cs{IfFileExists}, - i.\,e.\ it has to take three arguments. -\end{docIgrKey} - -\begin{docIgrKey}{fail on not found}{}{no value} - Stops the compilation with an error if the included file does not exist. -\end{docIgrKey} - -\begin{docIgrKey}{ignore on not found}{}{no value, initially set} - Not existing included files are ignored without warning. -\end{docIgrKey} - -\begin{docIgrKey}{pagestyle}{=\marg{page style}}{no default, initially |empty|} - Sets the \meta{page style} for the included graphics. -\end{docIgrKey} +\subsection{Overlays} \begin{docIgrKey}{overlay}{=\marg{tikz code}}{no default, initially unset} Introduces arbitrary \meta{tikz code} to be drawn over the included image. @@ -669,10 +562,10 @@ see page~\pageref{exarotated.listing}. To support positioning inside the picture, two |tikz| nodes named |box| and |page| are defined. |box| takes the dimensions of the included image and |page| takes the dimensions of the image or of the page depending on the usage of - \refKey{/igr/page} or \refKey{/igr/center}. + \refKey{/igr/paper}. \begin{texexptitled}[listing only,before={\par\medskip}]% {Overlay; see page~\pageref{overlay}}{overlay.listing} -\igrset{bookmark options={level=subsection},center} +\igrset{bookmark options={level=subsection}, paper=current} \incgraph[bookmark={Picture with overlay},label={overlay}, overlay={ \node[draw=red,line width=3pt,fill=red,fill opacity=0.1, @@ -692,33 +585,57 @@ see page~\pageref{exarotated.listing}. \end{texexptitled} \end{docIgrKey} -\begin{docIgrKey}{overlay page number at}{=\marg{position}}{no default, initially unset} +\begin{docIgrKey}{overlay page number at}{=\meta{position}}{no default, initially unset} Overlays the page number at the given |tikz| \meta{position}. \end{docIgrKey} -\begin{docIgrKey}{overlay page number at bottom}{\colOpt{=\marg{length}}}{default |1.5cm|} +\begin{docIgrKey}{overlay page number at bottom}{\colOpt{=\meta{length}}}{default |1.5cm|} Overlays the page number at \meta{length} above the bottom edge of the paper. See Example~\ref{exacenter.listing} on page~\pageref{exacenter.listing} and the result on page~\pageref{exacenter}. \end{docIgrKey} -\begin{docIgrKey}{overlay page number at top}{\colOpt{=\marg{length}}}{default |1.5cm|} +\begin{docIgrKey}{overlay page number at top}{\colOpt{=\meta{length}}}{default |1.5cm|} Overlays the page number at \meta{length} below the top edge of the paper. See Example~\ref{exagraphresize.listing} on page~\pageref{exagraphresize.listing} and the result on page~\pageref{exagraphresize}. \end{docIgrKey} \begin{docIgrKey}{no overlay}{}{no value, initially set} - Removes the overlay setting, identical to |include command| without value. + Removes the overlay setting. +\end{docIgrKey} + + +\subsection{Miscellaneous} + + +\begin{docIgrKey}{pagestyle}{=\meta{page style}}{no default, initially |empty|} + Sets the \meta{page style} for the included graphics. +\end{docIgrKey} + + +\begin{docIgrKey}{zerofill}{=\meta{digits}}{no default, initially |0|} + For \refCom{incmultigraph}, the current number element + is filled up with leading zeros until the \meta{digits} count is reached. + If \meta{digits} is 0 or 1, nothing is added. A \meta{digits} value + greater than 10 is treated as 10 which is the maximum number of + possible digits. The result is accessible as |\nn|, see \refCom{incmultigraph}. + Note that |zerofill| should be set to |0| if the list elements + in \refCom{incmultigraph} are not numbers. \end{docIgrKey} \clearpage -\foreach \n in {1,...,9} {\inputlisting{\n}} +\hypertarget{optkeyexamples}{}% +\bookmark[level=section,dest=optkeyexamples]{User Interface Examples} +\igrset{bookmark options={level=subsubsection}} +\foreach \n in {1,...,11} {\inputlisting{\n}} \clearpage %-------------------------------------- + \section{Examples} + \subsection{Including some Scans to Standard Paper} In this scenario, we have some scans (or images from whatever source) which should be combined to a PDF document for our paperless office. @@ -776,7 +693,7 @@ is needed. |incgraph| is used to reformat to the desired paper size. Of course, it also works the other way around. The following Example \ref{reformatting} is a complete template for such a document. -The document gets the desired paper size with the usual |\documentclass| option. +The document gets the desired paper size with the \refKey{/igr/paper} option. 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 @@ -803,12 +720,13 @@ on a separate page which could be resized or take the original document paper size. In Example \ref{fullpaperdrawing1}, a |tikzpicture| is drawn. The whole -environment is put inside an \refCom{igrpage} macro which puts the drawing +picture is put inside an \refEnv{inctext} environment which puts the drawing on a separate page which gets the dimensions of the drawing. \begin{texexptitled}[listing only]{Creation of a special text page (resized)}{fullpaperdrawing1} -\igrpage{\begin{tikzpicture}% +\begin{inctext}[paper=graphics, bookmark=My special text page (resized)] +\begin{tikzpicture}% \coordinate (A) at (0,0); \coordinate (B) at (16,16); \path[use as bounding box,top color=Goldenrod!25,bottom color=Navy!25] (A) rectangle (B); @@ -823,9 +741,8 @@ on a separate page which gets the dimensions of the drawing. This is my special page. It takes the dimensions of the underlying |tikzpicture| as seen in the source code of Example~\ref{fullpaperdrawing1} on page~\pageref{fullpaperdrawing1}.}; -\end{tikzpicture}} -\bookmark[dest=\igrAutoTarget,level=subsubsection]% - {My special text page (resized)} +\end{tikzpicture} +\end{inctext} \end{texexptitled} See the result on the following page. \clearpage\inputlastlisting @@ -839,9 +756,9 @@ directly inside the |tikzpicture|. \begin{texexptitled}[listing only]{Creation of a special text page (fitted)}{fullpaperdrawing2} -\igrtargetset{mytarget} -\bookmark[dest=mytarget,level=subsubsection]{My special text page (fitted)} -\igrcenter{\begin{tikzpicture}% +\begin{inctext}[paper=current, target=mytarget, + bookmark=My special text page (fitted)] +\begin{tikzpicture}% \coordinate (A) at (0,0); \coordinate (B) at (21,29.7); \path[use as bounding box,top color=Goldenrod!25,bottom color=Navy!25] (A) rectangle (B); @@ -856,7 +773,8 @@ directly inside the |tikzpicture|. This is my special page. It consumes the whole document paper size with an underlying |tikzpicture| as seen in the source code of Example~\ref{fullpaperdrawing2} on page~\pageref{fullpaperdrawing2}.}; -\end{tikzpicture}} +\end{tikzpicture} +\end{inctext} \end{texexptitled} See the result on the following \hyperlink{mytarget}{page}. \clearpage\inputlastlisting @@ -865,6 +783,241 @@ See the result on the following \hyperlink{mytarget}{page}. +%-------------------------------------- +\section{Basic Tool Box}\label{sec:basictoolbox} +In this section, some basic macros of the package are documented. +It is assumed that most users will only need the macros from the +user interface described in Section \ref{sec:interface} and Section \ref{sec:keys}. + + +\subsection{Full Page Commands} + +\begin{docCommand}{igrpage}{\marg{text}} + The \meta{text} is put on a separate page which is resized to fit the + dimensions of the \meta{text}. \meta{text} may be single letter, an + included picture, or any \LaTeX\ code. + The page number is stored into \docAuxCommand{theigrpage} and + \docAuxCommand{igrAutoTarget} holds a hyper target value for bookmarking. + The style of the separate page is set to + the content of the macro + \docAuxCommand{igrpagestyle} which defaults to 'empty' but can be + redefined. +\end{docCommand} + +\begin{docCommand}{igrcenter}{\marg{text}} + The \meta{text} is put in the center of a separate page which has the + current document dimensions. \meta{text} may be single letter, an + included picture or any \LaTeX\ code. + The page number is stored into \docAuxCommand{theigrpage} and + \docAuxCommand{igrAutoTarget} holds a hyper target value for bookmarking. + The style of the separate page is set to + the content of the macro + \docAuxCommand{igrpagestyle} which defaults to 'empty' but can be + redefined. +\end{docCommand} + +\begin{docCommand}{igrcenterfit}{\marg{width}\marg{height}\marg{text}} + The \meta{text} is put in the center of a separate page which + is resized to the given \meta{width} and \meta{height}. + \meta{text} may be single letter, an + included picture or any \LaTeX\ code. + The page number is stored into \docAuxCommand{theigrpage} and + \docAuxCommand{igrAutoTarget} holds a hyper target value for bookmarking. + The style of the separate page is set to + the content of the macro + \docAuxCommand{igrpagestyle} which defaults to 'empty' but can be + redefined. +\end{docCommand} + + +\begin{docCommand}{igrtargetset}{\marg{anchor}} + The next value for \docAuxCommand{igrAutoTarget} is set to \meta{anchor}. + This can be used for hand-made hyperlinks or bookmarks. + An application for |igrtargetset| is found in Example~\ref{fullpaperdrawing2} + on page~\pageref{fullpaperdrawing2}. +\end{docCommand} + +\clearpage +\subsection{Box Commands} + +\begin{docCommand}{igrboxset}{\marg{text}} + The \meta{text} is put into a \TeX\ box named \docAuxCommand{igrbox}. + Additionally, some auxiliary macros are defined: + \begin{itemize} + \item\docAuxCommand{igrAutoTarget}: unique value for a hyper target. + \item\docAuxCommand{igrBoxWidth}: width of the |\igrbox|. + \item\docAuxCommand{igrBoxHeight}: total height of the |\igrbox|. + \item\docAuxCommand{igrBoxht}: height of the |\igrbox|. + \item\docAuxCommand{igrBoxdp}: depth of the |\igrbox|. + \end{itemize} +\begin{dispExample} + \igrboxset{This is an example} + |\igrAutoTarget| = \igrAutoTarget, |\igrBoxWidth| = \igrBoxWidth, + |\igrBoxHeight| = \igrBoxHeight,\\ + |\igrBoxht| = \igrBoxht, |\igrBoxdp| = \igrBoxdp; +\end{dispExample} +\end{docCommand} + +\begin{docCommand}{igrboxcenter}{} + The current content of the |\igrbox| + is put in the center of a separate page which has the + current |pdfpage| dimensions.\\ + The style of the separate page is set to + the content of the macro + \docAuxCommand{igrpagestyle} which defaults to 'empty' but can be + redefined. + Note that a |\clearpage| or similar has to be inserted before this command. +\end{docCommand} + +\clearpage +\begin{docCommand}{igrboxtikz}{} + The current content of the |\igrbox| is embedded into a |\node| command + from the |tikz| package \cite{tantau:2010c} which has to be loaded separately. + Also, the bounding box is adjusted to the |\igrbox|.\\ + To support positioning inside the picture, two |tikz| nodes named + |box| and |page| are defined which both take the dimensions of the |\igrbox|. +\begin{dispExample} +\igrboxset{\includegraphics{example.jpg}}% +\begin{tikzpicture}% + \igrboxtikz% + \draw[blue,very thick] (0,0) rectangle (\igrBoxWidth,\igrBoxHeight); + \draw[red] (0,0) grid (\igrBoxWidth,\igrBoxHeight); + \draw[black] ([xshift=-1cm,yshift=-1cm]page.north east) circle (1cm); +\end{tikzpicture} +\end{dispExample} + +The boxing macros can also be used nested (see the result on the following page): +\begin{dispListing} +\igrpage{\igrboxset{\includegraphics{example.jpg}}% + \begin{tikzpicture}% + \igrboxtikz% + \draw[blue,very thick] (0,0) rectangle (\igrBoxWidth,\igrBoxHeight); + \draw[red] (0,0) grid (\igrBoxWidth,\igrBoxHeight); + \draw[black] ([xshift=1cm,yshift=-1cm]page.north west) circle (1cm); +\end{tikzpicture}} +\end{dispListing} +\tcbusetemp +\end{docCommand} + + +\begin{docCommand}{igrboxtikzpage}{} + This is an alias for \refCom{igrboxtikz}. +\end{docCommand} + + +\begin{docCommand}{igrboxtikzcenter}{} + The current content of the |\igrbox| is embedded into a |\node| command + from the |tikz| package \cite{tantau:2010c} which has to be loaded separately. + This node is placed in the center of a bounding box which takes the current + page dimensions. Afterwards, |\igrBoxWidth| and |\igrBoxHeight| are + redefined to the dimensions of the total page.\\ + To support positioning inside the picture, two |tikz| nodes named + |box| and |page| are defined. |box| takes the dimensions of the |\igrbox| + and |page| takes the dimensions of the |tikzpicture|. +\begin{dispListing} +\igrcenter{\igrboxset{\includegraphics{example.jpg}}% + \begin{tikzpicture}% + \igrboxtikzcenter% + \draw[help lines] (0,0) grid (\igrBoxWidth,\igrBoxHeight); + \draw[dashed] (box.south west) rectangle (box.north east); + + \draw[very thick,<->] (page.north west)--(box.north west); + \draw[very thick,<->] (page.north east)--(box.north east); + \draw[very thick,<->] (page.south west)--(box.south west); + \draw[very thick,<->] (page.south east)--(box.south east); +\end{tikzpicture}} +\end{dispListing} +See the result on the following page. +\tcbusetemp +\end{docCommand} + + +\subsection{Map and Match Commands} + + +\begin{docCommand}{igrsetmatchvalue}{\marg{key}\marg{value}} + The given \meta{key} is mapped to the given \meta{value}. Later, this + \meta{value} can be retrieved by \refCom{igrifmatch}. +\begin{dispExample} +\igrsetmatchvalue{my key A}{my value A} +\def\keytester#1{\igrifmatch{#1}{Hurray: '\igrmatchvalue'}{'#1' unknown}} + +\keytester{foo}\\ +\keytester{my key A} +\end{dispExample} +\end{docCommand} + + +\begin{docCommand}{igrsetmatches}{\marg{list}} + The \meta{list} is a comma separated list of \meta{key}=\meta{value} pairs. + On every pair, the \refCom{igrsetmatchvalue} macro is applied. +\begin{dispExample} +\igrsetmatches{my key A = my value A, bar = Shakespeare} +\def\keytester#1{\igrifmatch{#1}{Hurray: '\igrmatchvalue'}{'#1' unknown}} + +\keytester{foo}\\ +\keytester{bar}\\ +\keytester{my key A} +\end{dispExample} +\end{docCommand} + + +\begin{docCommand}{igrifmatch}{\marg{key}\marg{then}\marg{else}} + If a \meta{key} was defined by \refCom{igrsetmatchvalue} or + \refCom{igrsetmatches}, the corresponding value is put in the + macro \docAuxCommand{igrmatchvalue} and the \meta{then} code is + executed. If the \meta{key} is unknown, the \meta{else} code is + executed. +\begin{dispExample} +\igrsetmatches{1 = January, 2 = February, 3 = March, apr = April} +\def\monthname#1{\igrifmatch{#1}{The name of month #1\ is \igrmatchvalue.}{% + You are kidding.}} + +\monthname{1} \monthname{foo} \monthname{2}\\ +\monthname{3} \monthname{apr} \monthname{35} +\end{dispExample} +\end{docCommand} + + +\clearpage +\subsection{Zero Filling Commands} + +\begin{docCommand}{igrmakezerofill}{\marg{macro}\marg{digits}} + With this command, a new \meta{macro} can be defined which takes a + non negative number as parameter. + This number is filled up with leading zeros until the + \meta{digits} count is reached. + If \meta{digits} is 0 or 1, nothing is added. A \meta{digits} value + greater than 10 is treated as 10 which is the maximum number of + possible digits. +\begin{dispExample} +\igrmakezerofill{\myfill}{0} +\myfill{7}, \myfill{12}, \myfill{934}, \myfill{665234}.\\ +\igrmakezerofill{\myfill}{3} +\myfill{7}, \myfill{12}, \myfill{934}, \myfill{665234}.\\ +\igrmakezerofill{\myfill}{5} +\myfill{7}, \myfill{12}, \myfill{934}, \myfill{665234}.\\ +\igrmakezerofill{\myfill}{9} +\myfill{7}, \myfill{12}, \myfill{934}, \myfill{665234}.\\ +\igrmakezerofill{\myfill}{30} +\myfill{7}, \myfill{12}, \myfill{934}, \myfill{665234}. +\end{dispExample} +\begin{dispExample} +\igrmakezerofill{\threedigits}{3} +\threedigits{1}% +\foreach \n in {2,...,100} {, \threedigits{\n}}. +\end{dispExample} +\end{docCommand} + +\clearpage +%-------------------------------------- + + + + + + + % Actually, it is not a good idea to include the references like this! % Do not follow this bad example ... \begin{tcbverbatimwrite}{\jobname.bib} diff --git a/Master/texmf-dist/tex/latex/incgraph/incgraph.sty b/Master/texmf-dist/tex/latex/incgraph/incgraph.sty index a7c6bbe7c0a..5020e69c43f 100644 --- a/Master/texmf-dist/tex/latex/incgraph/incgraph.sty +++ b/Master/texmf-dist/tex/latex/incgraph/incgraph.sty @@ -1,4 +1,4 @@ -%% The LaTeX package incgraph - version 1.02 (2012/07/06) +%% The LaTeX package incgraph - version 1.10 (2012/09/28) %% incgraph.sty: Graphics inclusion page %% %% ------------------------------------------------------------------------------------------- @@ -18,7 +18,7 @@ %% This work consists of all files listed in README %% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{incgraph}[2012/07/06 version 1.02 LaTeX special graphics inclusion] +\ProvidesPackage{incgraph}[2012/09/28 version 1.10 LaTeX special graphics inclusion] \DeclareOption{pgf}{\def\igrreq@pgf{\RequirePackage{pgf}[2008/01/15]\RequirePackage{pgffor}}}% \DeclareOption{nopgf}{\def\igrreq@pgf{}}% @@ -50,11 +50,11 @@ } \def\igr@target@auto{% - \edef\igrAutoTarget{igr-\theigrtarget}% + \xdef\igrAutoTarget{igr-\theigrtarget}% } \def\igr@target@user{% - \edef\igrAutoTarget{\igr@usertarget}% + \xdef\igrAutoTarget{\igr@usertarget}% \global\let\igr@target@next=\igr@target@auto% } @@ -83,6 +83,7 @@ \edef\igrBoxHeight{\the\igr@length}% } + \def\igr@hyper{\hypertarget{\igrAutoTarget}{}} \def\igr@empty{} @@ -94,7 +95,6 @@ \advance\igr@length by -\topmargin% \advance\igr@length by -\headheight% \advance\igr@length by -\headsep% - \advance\igr@length by -\lineskip% \edef\igr@offy@top{\the\igr@length}% % \igr@length=\pdfpageheight% @@ -114,7 +114,8 @@ \edef\igr@offx{\the\igr@length}% % \vbox to \vsize{% - \kern\igr@offy@top\hbox{\kern\igr@offx@left\igr@hypertarget\hss}\kern\igr@offy@abs% + \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% @@ -131,45 +132,100 @@ \def\igrboxtikzcenter{% \path[use as bounding box] (0,0) rectangle (\pdfpagewidth,\pdfpageheight); \node[line width=0mm,inner sep=0,rectangle,above right] (box) at ({(\pdfpagewidth-\igrBoxWidth)/2},{(\pdfpageheight-\igrBoxHeight)/2}) {\box\igrbox}; - \let\igrBoxWidth=\pdfpagewidth% - \let\igrBoxHeight=\pdfpageheight% - \node[minimum width=\pdfpagewidth,minimum height=\pdfpageheight,line width=0mm,inner sep=0mm,above right] (page) at (0,0) {};% + \edef\igrBoxWidth{\the\pdfpagewidth}% + \edef\igrBoxHeight{\the\pdfpageheight}% + \node[minimum width=\igrBoxWidth,minimum height=\igrBoxHeight,line width=0mm,inner sep=0mm,above right] (page) at (0,0) {};% } -\long\def\igrpage#1{% - \def\igr@mode{page}% - \igrboxset{#1}% +\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{% + \edef\igrCurrentPageWidth{\the\pdfpagewidth}% + \edef\igrCurrentPageHeight{\the\pdfpageheight}% \eject% - \pdfpagewidth=\igrBoxWidth% - \pdfpageheight=\igrBoxHeight% + \pdfpagewidth=#1% + \pdfpageheight=#2% + \igr@overlay% \edef\theigrpage{\thepage}% \igrboxcenter% - \pdfpagewidth=\igrOrginalPageWidth% - \pdfpageheight=\igrOrginalPageHeight% + \pdfpagewidth=\igrCurrentPageWidth% + \pdfpageheight=\igrCurrentPageHeight% } -\long\def\igrcenter#1{% - \def\igr@mode{center}% - \igrboxset{#1}% +\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{% + \edef\igr@temp@w{\the\pdfpagewidth}\edef\igr@temp@h{\the\pdfpageheight}% + \igr@out@resize{\igr@temp@h}{\igr@temp@w}% +} + +\def\igr@out@center{% + \csname igr@out@center@\igr@turn\endcsname% +} + +% Toolbox output + +\long\def\igrcenterfit#1#2#3{% + \igrboxset{#3}% + \igr@out@resize{#1}{#2}% +} + +\long\def\igrpage#1{% + \igrboxset{#1}% + \igr@out@page% +} + +\long\def\igrcenter#1{% + \igrboxset{#1}% + \igr@out@center@port% +} + + +% include macros + \def\incgraph{% - \@ifnextchar[{\inc@incgraph}{\inc@incgraph[]}} + \@ifnextchar[{\inc@graph}{\inc@graph[]}} -\def\inc@incgraph[#1]{% - \@ifnextchar[{\inc@@incgraph[#1]}{\inc@@incgraph[#1][]}} +\def\inc@graph[#1]{% + \@ifnextchar[{\inc@@graph[#1]}{\inc@@graph[#1][]}} -\long\def\inc@@incgraph[#1][#2]#3{% +\long\def\inc@@graph[#1][#2]#3{% \begingroup% \def\nt{#3}% \igr@if@file@exists{\nt}{% \igrset{#1}% \igr@match@hook% \edef\igr@incgraph{\noexpand\igr@include@graphics[\igr@options,#2]}% - \igr@output{\igr@incgraph{\nt}\ifx\igr@label@text\igr@empty\else\label{\igr@label@text}\fi}% + \igrboxset{\igr@incgraph{\nt}\ifx\igr@label@text\igr@empty\else\label{\igr@label@text}\fi}% + \igr@output% \ifx\igr@bookmark@text\igr@empty\else% \edef\igr@bookmark{\noexpand\bookmark[\igr@bookmark@options,dest=\noexpand\igrAutoTarget]}% \igr@bookmark{\igr@bookmark@text}\fi% @@ -186,12 +242,12 @@ } \def\incmultigraph{% - \@ifnextchar[{\inc@incmultigraph}{\inc@incmultigraph[]}} + \@ifnextchar[{\inc@multigraph}{\inc@multigraph[]}} -\def\inc@incmultigraph[#1]{% - \@ifnextchar[{\inc@@incmultigraph[#1]}{\inc@@incmultigraph[#1][]}} +\def\inc@multigraph[#1]{% + \@ifnextchar[{\inc@@multigraph[#1]}{\inc@@multigraph[#1][]}} -\long\def\inc@@incmultigraph[#1][#2]#3#4{% +\long\def\inc@@multigraph[#1][#2]#3#4{% \begingroup% \igrset{#1}% \ifx\igr@label@text\igr@empty\global\let\igr@process@label=\igr@empty\else% @@ -203,7 +259,8 @@ \igr@if@file@exists{\nt}{% \igr@match@hook% \edef\igr@incgraph{\noexpand\igr@include@graphics[\igr@options,#2]}% - \igr@output{\igr@incgraph{\nt}\igr@process@label}% + \igrboxset{\igr@incgraph{\nt}\igr@process@label}% + \igr@output% \igr@process@bookmark@heading% \ifx\igr@bookmark@text\igr@empty\else% \edef\igr@bookmark{\noexpand\bookmark[\igr@bookmark@options,dest=\noexpand\igrAutoTarget]}% @@ -211,6 +268,29 @@ }{}}\endgroup% } + +\newenvironment{inctext}[1][]{% + \igrset{#1}% + \igr@match@hook% + \igr@nextAutoTarget% + \begin{lrbox}{\igrbox}% +}{% + \unskip\ifx\igr@label@text\igr@empty\else\label{\igr@label@text}\fi\end{lrbox}% + \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}% + \igr@output% + \ifx\igr@bookmark@text\igr@empty\else% + \edef\igr@bookmark{\noexpand\bookmark[\igr@bookmark@options,dest=\noexpand\igrAutoTarget]}% + \igr@bookmark{\igr@bookmark@text}\fi% +} + + \def\igr@make@zerofill#1#2#3#4#5#6#7#8#9{% \def\igr@zerofill##1{% \ifnum##1<10 #1% @@ -262,16 +342,8 @@ \newcommand{\igr@no@existence@check}[3]{#2} -\newcommand{\igr@include@graphics@tikz}[2][1]{% - \igrboxset{\includegraphics[#1]{#2}}% - \begin{tikzpicture}% - \csname igrboxtikz\igr@mode\endcsname% - \igr@tikz@hook% - \end{tikzpicture}} \igrset{% - center/.code={\let\igr@output=\igrcenter}, - page/.code={\let\igr@output=\igrpage}, options/.store in=\igr@options, options add/.code={% \toks0=\expandafter{\igr@options}% @@ -298,16 +370,70 @@ pagestyle/.store in=\igrpagestyle, target/.code={\igrtargetset{#1}}, overlay@code/.store in=\igr@tikz@hook, - overlay/.style={include command=\igr@include@graphics@tikz,overlay@code={#1}}, + overlay/.code={\let\igr@overlay=\igr@overlay@on\igrset{overlay@code={#1}}}, overlay page number at/.style={overlay={\node[fill opacity=0.35,draw opacity=0.5,text opacity=1, inner xsep=1em,rounded corners,fill=white,draw=black] 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/.style={include command}, + 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}{\edef\igr@target@width{#1}\edef\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, % - page, + graphicspaper, options=, bookmark=, bookmark options=, @@ -321,5 +447,8 @@ ignore on not found, pagestyle=empty, overlay@code=, + no overlay, + portrait, } + |