texlive[69311] Master/texmf-dist: overpic (4jan24)

commits+karl at tug.org commits+karl at tug.org
Fri Jan 5 23:10:51 CET 2024


Revision: 69311
          https://tug.org/svn/texlive?view=revision&revision=69311
Author:   karl
Date:     2024-01-05 23:10:51 +0100 (Fri, 05 Jan 2024)
Log Message:
-----------
overpic (4jan24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/overpic/overpic.pdf
    trunk/Master/texmf-dist/source/latex/overpic/overpic.dtx
    trunk/Master/texmf-dist/tex/latex/overpic/overpic.sty

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

Modified: trunk/Master/texmf-dist/source/latex/overpic/overpic.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/overpic/overpic.dtx	2024-01-05 21:44:47 UTC (rev 69310)
+++ trunk/Master/texmf-dist/source/latex/overpic/overpic.dtx	2024-01-05 22:10:51 UTC (rev 69311)
@@ -19,7 +19,7 @@
 %
 %<*package>
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{overpic}[2020/02/22 1.3 picture overlays (RN)]
+\ProvidesPackage{overpic}[2024/01/04 2.0 picture overlays (RN)]
 %</package>
 %
 %<*driver>
@@ -58,7 +58,7 @@
 %</driver>
 % \fi
 %
-% \CheckSum{180}
+% \CheckSum{178}
 %
 % \CharacterTable
 %  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
@@ -242,7 +242,7 @@
 %<*package>
 % \fi
 %    \begin{macrocode}
-\RequirePackage{graphicx,epic}
+\RequirePackage{keyval,graphicx,epic}
 %    \end{macrocode}
 %
 % \begin{macro}{\OVP at scale}
@@ -253,7 +253,7 @@
 % \end{macro}
 % All the keys: 
 %    \begin{macrocode}
-\define at key{Gin}{rel}{%
+\define at key{OVP}{rel}{%
   \def\OVP at scale{#1}%
   \ifnum\OVP at scale>\z@
     \let\OVP at calc\OVP at calc@rel
@@ -261,19 +261,21 @@
     \PackageError{overpic}{Invalid number for option `rel'}\@ehc
   \fi
 }
-\define at key{Gin}{percent}[]{%
-  \setkeys{Gin}{rel=100}%
+\define at key{OVP}{percent}[]{%
+  \setkeys{OVP}{rel=100}%
 }
-\define at key{Gin}{permil}[]{%
-  \setkeys{Gin}{rel=\@m}%
+\define at key{OVP}{permil}[]{%
+  \setkeys{OVP}{rel=\@m}%
 }
-\define at key{Gin}{abs}[]{%
+\define at key{OVP}{abs}[]{%
   \let\OVP at calc\OVP at calc@abs
 }
-\newif\ifGin at grid
-\define at key{Gin}{grid}[true]{\lowercase{\Gin at boolkey{#1}}{grid}}
-\define at key{Gin}{tics}{\count@=#1}
-\define at key{Gin}{unit}{\unitlength=\dimexpr#1\relax}
+\def\OVP at boolkey#1#2{%
+  \csname OVP@#2\ifx\relax#1\relax true\else#1\fi\endcsname}
+\newif\ifOVP at grid
+\define at key{OVP}{grid}[true]{\lowercase{\OVP at boolkey{#1}}{grid}}
+\define at key{OVP}{tics}{\count@=#1}
+\define at key{OVP}{unit}{\unitlength=\dimexpr#1\relax}
 %    \end{macrocode}
 % \begin{macro}{\OVP at calc@abs}
 % Some calculations in abs mode. \cmd{\@tempcnta} is the normalized width
@@ -287,6 +289,8 @@
 }
 %    \end{macrocode}
 % \end{macro}
+% \changes{2.0}{2024/01/01}{Use a separate namespace for the keys to avoid
+%   unfavorable influence on \cmd\includegraphics.}
 % \begin{macro}{\OVP at calc@rel}
 % Some calculations in rel mode. The bigger value of width or height
 % is the base.
@@ -313,9 +317,9 @@
 % \end{macro}
 % The package options set the defaults:
 %    \begin{macrocode}
-\DeclareOption{percent}{\setkeys{Gin}{rel=100}}
-\DeclareOption{permil}{\setkeys{Gin}{rel=\@m}}
-\DeclareOption{abs}{\setkeys{Gin}{abs}}
+\DeclareOption{percent}{\setkeys{OVP}{rel=100}}
+\DeclareOption{permil}{\setkeys{OVP}{rel=\@m}}
+\DeclareOption{abs}{\setkeys{OVP}{abs}}
 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}}
 \ExecuteOptions{percent}
 \ProcessOptions
@@ -323,24 +327,24 @@
 %    \end{macrocode}
 %
 % \begin{environment}{overpic}
-% Box 0 gets a graphic.
+% Box \cmd{\OVP at box} gets a graphic.
 % \changes{1.2}{2018/09/02}{Wrong place of \cmd\setkeys
 %   (bug report from 'aminophen')}
+% \changes{2.0}{2024/01/04}{Better key handling}
 %    \begin{macrocode}
 \newenvironment{overpic}[2][]{%
+  \let\OVP at temp=\KV at errx
+%    \end{macrocode}
+% Silently ignore unknown keys.
+%    \begin{macrocode}
+  \let\KV at errx\@gobble
   \sbox\OVP at box{\includegraphics[#1]{#2}}%
-  \count@=\z@ \Gin at gridfalse
-  \setkeys{Gin}{#1}%
+  \count@=\z@ \OVP at gridfalse
+  \setkeys{OVP}{#1}%
 %    \end{macrocode}
-% Reset the graphics parameter:
+% Reset to previous state.
 %    \begin{macrocode}
-  \let\Gin at outer@scalex\relax
-  \let\Gin at outer@scaley\relax
-  \let\Gin at angle\relax
-  \let\Gin at ewidth\Gin at exclamation
-  \let\Gin at eheight\Gin at exclamation
-  \def\Gin at scalex{1}%
-  \let\Gin at scaley\Gin at exclamation
+  \let\KV at errx\OVP at temp
   \OVP at picture{#1}%
 }{\endpicture}
 %    \end{macrocode}
@@ -348,18 +352,18 @@
 % \begin{environment}{Overpic}
 % \changes{1.0}{2017/10/06}{Suggested by \mbox{Herbert Vo\ss}}
 % \changes{1.3}{2020/02/22}{Added missing \cmd\setkeys}
-% Box 0 gets any \TeX\ code.
+% Box \cmd{\OVP at box} gets any \TeX\ code.
 %    \begin{macrocode}
 \newenvironment{Overpic}[2][]{%
   \sbox\OVP at box{#2}%
-  \count@=\z@ \Gin at gridfalse
-  \setkeys{Gin}{#1}%  
+  \count@=\z@ \OVP at gridfalse
+  \setkeys{OVP}{#1}%  
   \OVP at picture{#1}%
 }{\endpicture}
 %    \end{macrocode}
 % \end{environment}
 % \begin{macro}{\OVP at picture}
-% Put box 0 and and optionally grid at the lower left corner of a
+% Put box \cmd{\OVP at box} and a optionally grid at the lower left corner of a
 % picture environment. 
 %    \begin{macrocode}
 \newcommand*\OVP at picture[1]{%
@@ -370,7 +374,7 @@
   \OVP at calc
   \picture(\@tempcnta,\@tempcntb)%
     \put(0,0){\makebox(0,0)[bl]{\usebox\OVP at box}}%
-    \ifGin at grid
+    \ifOVP at grid
       \put(0,0){\normalfont\fontsize\@viipt\@viiipt\selectfont
         \grid(\@tempcnta,\@tempcntb)(\count@,\count@)[0,0]}%
     \fi
@@ -381,7 +385,7 @@
 % Sets new defaults.
 %    \begin{macrocode}
 \newcommand*\setOverpic[1]{%
-  \setkeys{Gin}{#1}%
+  \setkeys{OVP}{#1}%
 }
 %    \end{macrocode}
 % \end{macro}

Modified: trunk/Master/texmf-dist/tex/latex/overpic/overpic.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/overpic/overpic.sty	2024-01-05 21:44:47 UTC (rev 69310)
+++ trunk/Master/texmf-dist/tex/latex/overpic/overpic.sty	2024-01-05 22:10:51 UTC (rev 69311)
@@ -19,10 +19,10 @@
 %% version 2005/12/01 or later.
 %% 
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\ProvidesPackage{overpic}[2020/02/22 1.3 picture overlays (RN)]
-\RequirePackage{graphicx,epic}
+\ProvidesPackage{overpic}[2024/01/04 2.0 picture overlays (RN)]
+\RequirePackage{keyval,graphicx,epic}
 \newcommand*\OVP at scale{\z@}
-\define at key{Gin}{rel}{%
+\define at key{OVP}{rel}{%
   \def\OVP at scale{#1}%
   \ifnum\OVP at scale>\z@
     \let\OVP at calc\OVP at calc@rel
@@ -30,19 +30,21 @@
     \PackageError{overpic}{Invalid number for option `rel'}\@ehc
   \fi
 }
-\define at key{Gin}{percent}[]{%
-  \setkeys{Gin}{rel=100}%
+\define at key{OVP}{percent}[]{%
+  \setkeys{OVP}{rel=100}%
 }
-\define at key{Gin}{permil}[]{%
-  \setkeys{Gin}{rel=\@m}%
+\define at key{OVP}{permil}[]{%
+  \setkeys{OVP}{rel=\@m}%
 }
-\define at key{Gin}{abs}[]{%
+\define at key{OVP}{abs}[]{%
   \let\OVP at calc\OVP at calc@abs
 }
-\newif\ifGin at grid
-\define at key{Gin}{grid}[true]{\lowercase{\Gin at boolkey{#1}}{grid}}
-\define at key{Gin}{tics}{\count@=#1}
-\define at key{Gin}{unit}{\unitlength=\dimexpr#1\relax}
+\def\OVP at boolkey#1#2{%
+  \csname OVP@#2\ifx\relax#1\relax true\else#1\fi\endcsname}
+\newif\ifOVP at grid
+\define at key{OVP}{grid}[true]{\lowercase{\OVP at boolkey{#1}}{grid}}
+\define at key{OVP}{tics}{\count@=#1}
+\define at key{OVP}{unit}{\unitlength=\dimexpr#1\relax}
 \newcommand*\OVP at calc@abs{%
   \divide\@tempcnta by \unitlength
   \divide\@tempcntb by \unitlength
@@ -65,30 +67,26 @@
     \divide\count@ by 10 %
   \fi
 }
-\DeclareOption{percent}{\setkeys{Gin}{rel=100}}
-\DeclareOption{permil}{\setkeys{Gin}{rel=\@m}}
-\DeclareOption{abs}{\setkeys{Gin}{abs}}
+\DeclareOption{percent}{\setkeys{OVP}{rel=100}}
+\DeclareOption{permil}{\setkeys{OVP}{rel=\@m}}
+\DeclareOption{abs}{\setkeys{OVP}{abs}}
 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}}
 \ExecuteOptions{percent}
 \ProcessOptions
 \newsavebox\OVP at box
 \newenvironment{overpic}[2][]{%
+  \let\OVP at temp=\KV at errx
+  \let\KV at errx\@gobble
   \sbox\OVP at box{\includegraphics[#1]{#2}}%
-  \count@=\z@ \Gin at gridfalse
-  \setkeys{Gin}{#1}%
-  \let\Gin at outer@scalex\relax
-  \let\Gin at outer@scaley\relax
-  \let\Gin at angle\relax
-  \let\Gin at ewidth\Gin at exclamation
-  \let\Gin at eheight\Gin at exclamation
-  \def\Gin at scalex{1}%
-  \let\Gin at scaley\Gin at exclamation
+  \count@=\z@ \OVP at gridfalse
+  \setkeys{OVP}{#1}%
+  \let\KV at errx\OVP at temp
   \OVP at picture{#1}%
 }{\endpicture}
 \newenvironment{Overpic}[2][]{%
   \sbox\OVP at box{#2}%
-  \count@=\z@ \Gin at gridfalse
-  \setkeys{Gin}{#1}%
+  \count@=\z@ \OVP at gridfalse
+  \setkeys{OVP}{#1}%
   \OVP at picture{#1}%
 }{\endpicture}
 \newcommand*\OVP at picture[1]{%
@@ -99,13 +97,13 @@
   \OVP at calc
   \picture(\@tempcnta,\@tempcntb)%
     \put(0,0){\makebox(0,0)[bl]{\usebox\OVP at box}}%
-    \ifGin at grid
+    \ifOVP at grid
       \put(0,0){\normalfont\fontsize\@viipt\@viiipt\selectfont
         \grid(\@tempcnta,\@tempcntb)(\count@,\count@)[0,0]}%
     \fi
 }
 \newcommand*\setOverpic[1]{%
-  \setkeys{Gin}{#1}%
+  \setkeys{OVP}{#1}%
 }
 \endinput
 %%



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