From 7773e55cad46b0305e833329e97c73e80f318805 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 11 Jun 2018 12:42:37 +0900 Subject: add digicap-pro --- texmf-dist/tex/latex/digicap-pro/digi-p1.def | 220 +++++++++++++++++++++++ texmf-dist/tex/latex/digicap-pro/digicap-pro.sty | 170 ++++++++++++++++++ 2 files changed, 390 insertions(+) create mode 100644 texmf-dist/tex/latex/digicap-pro/digi-p1.def create mode 100644 texmf-dist/tex/latex/digicap-pro/digicap-pro.sty (limited to 'texmf-dist/tex') diff --git a/texmf-dist/tex/latex/digicap-pro/digi-p1.def b/texmf-dist/tex/latex/digicap-pro/digi-p1.def new file mode 100644 index 00000000..03a174fc --- /dev/null +++ b/texmf-dist/tex/latex/digicap-pro/digi-p1.def @@ -0,0 +1,220 @@ +%% +%% This is file `digi-p1.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% digicap-pro.dtx (with options: `copyright,digidisplay1') +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% digicap-pro package, %% +%% Copyright (C) 2008--2018 %% +%% dpstory@acrotex.net %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1.2 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\newcommand{\PicsThisDoc}[1]{% + \@for\@args:=#1\do{\expandafter\dc@setPicsAndCaptions\@args}% +} +\def\dc@setPicsAndCaptions#1#2#3#4{% + \dc@embedEPSCreateAppearances{#1}{#2}% + \dc@defTheseCaptions{#1}{#3}{#4}% +} +\newcommand{\setThumbAppearances}[2][]{% + \def\dc@argi{#1}\ifx\dc@argi\@empty\def\dc@thumbApprs{#2}% + \setkeys{dc@ro@appr}{#2}\else + \expandafter\def\csname dc@thumbApprs@#1\endcsname{#2}\fi +} +\define@key{dc@ro@appr}{normalop}[.5]{\def\dc@ro@appr@normalopacity{#1}} +\define@key{dc@ro@appr}{rolloverop}[1]% + {\def\dc@ro@appr@rolloveropacity{#1}} +\define@key{dc@ro@appr}{downop}[.3]% + {\def\dc@ro@appr@downopacity{#1}} +\define@key{dc@ro@appr}{boundarywidth}[30]% + {\def\dc@ro@appr@boundarywidth{#1}} +\define@key{dc@ro@appr}{rgbcolor}[]{% + \def\dc@ro@appr@rgbcolor{#1}\ifx\dc@ro@appr@rgbcolor\@empty + \else + \expandafter\ef@isitnamed\dc@ro@appr@rgbcolor\ef@nil + \ifx\ef@latex@color\ef@y\expandafter + \HyColor@XZeroOneThreeFour + \expandafter{\dc@ro@appr@rgbcolor}{\dc@ro@appr@rgbcolor}{}{}% + \edef\dc@ro@appr@rgbcolor{\dc@ro@appr@rgbcolor}\fi +\fi} +\let\dc@ro@appr@rgbcolor\@empty +\define@key{dc@ro@appr}{cmykcolor}[0 0 1 0]{% + \def\dc@ro@appr@cmykcolor{#1}\ifx\dc@ro@appr@cmykcolor\@empty + \else + \expandafter\ef@isitnamed\dc@ro@appr@cmykcolor\ef@nil + \ifx\ef@latex@color\ef@y\expandafter + \HyColor@XZeroOneThreeFour + \expandafter{\dc@ro@appr@cmykcolor}{\dc@ro@appr@cmykcolor}{}{}% + \edef\dc@ro@appr@cmykcolor{\dc@ro@appr@cmykcolor}\fi +\fi} +\def\dc@ro@appr@cmykcolor{0 0 1 0} +\setThumbAppearances{normalop,rolloverop,downop,boundarywidth,% + rgbcolor,cmykcolor} +\def\dc@embedEPSCreateAppearances#1#2{% + \embedEPS[transparencyGroup]{#1}{#2}% + \@ifundefined{dc@thumbApprs@#1}{\edef\dc@tmp@exp% + {\noexpand\setkeys{dc@ro@appr}{\dc@thumbApprs}}}% + {\edef\dc@tmp@exp{\noexpand\setkeys{dc@ro@appr}% + {\csname dc@thumbApprs@#1\endcsname}}}\dc@tmp@exp + \begin{createImage}{\bboxOf{#1}}{n#1} + gsave + \dc@mark/ca \dc@ro@appr@normalopacity + /SetTransparency pdfmark + \urxOf{#1} .1 mul \uryOf{#1} .1 mul moveto + currentpoint translate + .8 .8 scale + \dc@mark{#1} /SP pdfmark + grestore + \end{createImage} + \begin{createImage}{\bboxOf{#1}}{r#1} + \dc@mark/ca \dc@ro@appr@rolloveropacity + /CA \dc@ro@appr@rolloveropacity + /SetTransparency pdfmark + \dc@mark{#1} /SP pdfmark + \dc@ro@appr@boundarywidth\space setlinewidth + \ifx\dc@ro@appr@rgbcolor\@empty + \dc@ro@appr@cmykcolor\space setcmykcolor\else + \dc@ro@appr@rgbcolor\space setrgbcolor\fi\space + currentlinewidth 2 div dup + \urxOf{#1} currentlinewidth sub \uryOf{#1} currentlinewidth sub + rectstroke + \end{createImage} + \begin{createImage}{\bboxOf{#1}}{d#1} + \dc@mark/ca \dc@ro@appr@downopacity + /CA \dc@ro@appr@downopacity/SetTransparency pdfmark + \dc@mark{#1} /SP pdfmark + \dc@ro@appr@boundarywidth\space setlinewidth + \ifx\dc@ro@appr@rgbcolor\@empty + \dc@ro@appr@cmykcolor\space setcmykcolor\else + \dc@ro@appr@rgbcolor\space setrgbcolor\fi\space + currentlinewidth 2 div dup + \urxOf{#1} currentlinewidth sub \uryOf{#1} currentlinewidth sub + rectstroke + \end{createImage} +} +\def\dc@defTheseCaptions#1#2#3{% + \expandafter\gdef\csname #1Caption\endcsname{#2}% + \expandafter\gdef\csname #1Text\endcsname{#3}% +} +\newcommand{\presentationOrder}[1]{\def\dc@presentationOrder{#1}} +\newcommand{\dcFirstOpt}[2][]{% + \def\dc@argi{#1}\ifx\dc@argi\@empty\def\dc@icontrol{#2}\else + \expandafter\def\csname dc@icontrol@#1\endcsname{#2}\fi} +\newcommand{\dcSecondOpt}[2][]{% + \def\dc@argi{#1}\ifx\dc@argi\@empty\def\dc@iicontrol{#2}\else + \expandafter\def\csname dc@iicontrol@#1\endcsname{#2}\fi} +\dcFirstOpt{vcaption=b,hcaption=c,outerboxsep=0pt} +\dcSecondOpt{borderwidth=0bp,fboxsep=10bp,bordercolor=nocolor,bgop=.7} +\def\useRollovers{\def\dc@use@Rollover{*}% + \def\hiddenPresets{\F{\FHidden}}} +\def\noRollovers{\let\dc@use@Rollover\@empty + \def\hiddenPresets{}} +\let\dc@use@Rollover\@empty +\def\dc@fudge{\llap{.\hskip20in}} +\newcommand{\longCapFmt}[1]{% + \def\dc@longCapFmt{#1}} +\longCapFmt{} +\def\dc@showPic#1{\leavevmode\xBld{#1}\dc@fudge + \vbox to0pt{\vss\hbox to0pt{\hss + \def\dc@incgfx@addkeys{width=\digiDSWidth,% + height=\digiDSHeight,keepaspectratio,name=#1}% + \@ifundefined{dc@icontrol@#1}{}{\expandafter\let\expandafter + \dc@icontrol\expandafter=\csname dc@icontrol@#1\endcsname}% + \@ifundefined{dc@iicontrol@#1}{}{\expandafter\let\expandafter + \dc@iicontrol\expandafter=\csname dc@iicontrol@#1\endcsname}{}% + \expandafter\digiCap\dc@use@Rollover% + [\dc@icontrol,rollovername=ro#1]{\null}[\dc@iicontrol]% + {\dc@longCapFmt\csname#1Text\endcsname}% +\hss}\vss}\eBld} +\newcommand{\digiDisplaySpace}[2]{% + \def\digiDSHeight{#1}\def\digiDSWidth{#2}% + \parbox[c][#1]{#2}{\centering\insertPhotos}% +} +\newcommand{\insertPhotos}{\edef\dc@tmp@exp{\noexpand\@for + \noexpand\@args:=\dc@presentationOrder}\dc@tmp@exp\do{% + \edef\dc@tmp@exp{\noexpand\dc@showPic{\@args}}\dc@tmp@exp}% +} +\newcommand{\shortCapFmt}[1]{% + \def\dc@showCaption##1##2{\makebox[0pt][c]{\xBld{##1}#1##2\eBld}}} +\shortCapFmt{\sffamily\bfseries\color{blue}} +\newcommand{\insertCaptions}{\dc@fudge\edef\dc@tmp@exp{\noexpand\@for + \noexpand\@args:=\dc@presentationOrder}\dc@tmp@exp\do{% + \edef\dc@tmp@exp{\noexpand\dc@showCaption{\@args}% + {\noexpand\csname\@args Caption\noexpand\endcsname}}% + \dc@tmp@exp}% +} +\newcommand{\setWidthOfThumbs}[1]{{% + \setlength{\dimen0}{#1}% + \xdef\dc@thumbwidth{\the\dimen0}% +}} +\setWidthOfThumbs{0pt} +\newcommand{\addvspacetorows}[1]{\def\dc@addvspacetorows{#1}} +\addvspacetorows{1ex}% +\def\eq@tabSep{&} +\def\insertThumbs#1#2{\begingroup + \count0=0\relax\count2=0\relax + \def\dc@maxRows{#1}\def\dc@maxCols{#2}% + \setlength{\dimen0}{\dc@thumbwidth}\ifdim\dimen0=0pt + \setWidthOfThumbs{\linewidth/(\dc@maxCols)-\tabcolsep*2}\fi + \edef\dc@thisArg{\dc@presentationOrder,}% + \def\dc@insThumb@cr{\\[\dc@addvspacetorows]}% + \kern0pt\begin{tabular}{*{#2}{m{\dc@thumbwidth}}}% + \@whilenum\count0<#1\do{% + \@whilenum\count2<#2\do{% + \ifx\dc@thisArg\@empty + \global\let\dc@insThumb@cr\relax + \global\count0=\dc@maxRows + \global\count2=\dc@maxCols\else + \expandafter\dc@getNextArg\dc@thisArg\@nil + \global\advance\count2by1\relax + \ifx\dc@testArg\@empty + \else\ifnum\count2=\dc@maxCols + \else\eq@tabSep\fi\fi\fi + }\dc@insThumb@cr + \global\count2=0\relax\global\advance\count0by1\relax + }% +\end{tabular}% +\endgroup} +\def\dc@getNextArg#1,#2\@nil{\dc@digi@thumbs{#1}\gdef\dc@thisArg{#2}} +\def\normalAppr#1{n#1} +\def\downAppr#1{d#1} +\def\rolloverAppr#1{r#1} +\def\dc@digi@thumbs#1{\hfil% +{\dimen0=\widthOf{#1}bp\relax\dimen2=\heightOf{#1}bp\relax + \ifdim\dimen0<\dimen2\relax + \edef\dc@argi{\string!}\edef\dc@argii{\dc@thumbwidth}\else + \edef\dc@argi{\dc@thumbwidth}\edef\dc@argii{\string!}\fi + \xdef\dc@tmp@exp{\noexpand\resizebox{\dc@argi}{\dc@argii}}% +}\dc@tmp@exp{\pushButton[% + \autoCenter{n}\BC{}\BG{}\S{S}\W0 + \A{\JS{% + showThisPicture("#1");\r + lastPicture="#1";\r + this.dirty=false; + }}\I{\normalAppr{#1}}\RI{\downAppr{#1}}\IX{\rolloverAppr{#1}} + \TP{1}\FB{true}]{pb#1}{\widthOf{#1}bp}{\heightOf{#1}bp}}} +\begin{insDLJS}[showThisPicture]{digidjs1}{Show This Picture} +var lastPicture=""; +function showThisPicture(name) { + if (lastPicture != "") { + var f = this.getField("dcRollover.ro"+lastPicture); + if ( f != null ) f.display=display.hidden; + toggleSetThisLayer(lastPicture,false); + } + var f = this.getField("dcRollover.ro"+name); + if ( f != null ) f.display=display.visible; + toggleSetThisLayer(name); +} +try { app.runtimeHighlight=false; app.focusRect=false; } catch(e) {}; +\end{insDLJS} +\endinput +%% +%% End of file `digi-p1.def'. diff --git a/texmf-dist/tex/latex/digicap-pro/digicap-pro.sty b/texmf-dist/tex/latex/digicap-pro/digicap-pro.sty new file mode 100644 index 00000000..025d0e6f --- /dev/null +++ b/texmf-dist/tex/latex/digicap-pro/digicap-pro.sty @@ -0,0 +1,170 @@ +%% +%% This is file `digicap-pro.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% digicap-pro.dtx (with options: `copyright,package') +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% digicap-pro package, %% +%% Copyright (C) 2008--2018 %% +%% dpstory@acrotex.net %% +%% %% +%% This program can redistributed and/or modified under %% +%% the terms of the LaTeX Project Public License %% +%% Distributed from CTAN archives in directory %% +%% macros/latex/base/lppl.txt; either version 1.2 of the %% +%% License, or (at your option) any later version. %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{digicap-pro} + [2018/05/13 v1.3 Transparent Captions with Photos (dps)] +\DeclareOption{display1}{\AtEndOfPackage{\dc@input@displayi}} +\def\dc@input@displayi{\InputIfFileExists{digi-p1.def}{}{}} +\ProcessOptions +\RequirePackage{eforms} +\RequirePackage{graphicx} +\RequirePackage{graphicxbox} +\RequirePackage{opacity-pro} +\def\dc@nocolor{nocolor} +\define@key{opcolorbox}{borderwidth}[2pt]{\def\opcb@borderwidth{#1}} +\define@key{opcolorbox}{fboxsep}[6pt]{\def\opcb@fboxsep{#1}} +\define@key{opcolorbox}{width}[\linewidth]{\def\opcb@width{#1}} +\define@key{opcolorbox}{bordercolor}[black]{\def\opcb@bordercolor{#1}} +\define@key{opcolorbox}{bgcolor}[white]{\def\opcb@bgcolor{#1}} +\define@key{opcolorbox}{borderop}[.5]{\def\opcb@borderop{#1}} +\define@key{opcolorbox}{bordertextop}[1]{\def\opcb@bordertextop{#1}} +\define@key{opcolorbox}{bgop}[.5]{\def\opcb@bgop{#1}} +\define@key{opcolorbox}{textop}[1]{\def\opcb@textop{#1}} +\define@key{opcolorbox}{borderblend}[Normal]{% + \def\opcb@borderblendmode{#1}} +\define@key{opcolorbox}{bgblend}[Normal]{\def\opcb@bgblendmode{#1}} +\setkeys{opcolorbox}{borderwidth,fboxsep,width,bordercolor,bgcolor,% + bordertextop,borderop,bgop,textop,borderblend,bgblend} +\def\dc@mark{[\space}%] +\newcommand{\opcolorbox}[2][]{\begingroup + \edef\dc@tmp@exp{\noexpand\setkeys{opcolorbox}{#1}}\dc@tmp@exp + \ifx\opcb@bgcolor\dc@nocolor\let\opcb@set@bgcolor\mbox + \else\def\opcb@set@bgcolor{\colorbox{\opcb@bgcolor}}\fi + \ifx\opcb@bordercolor\dc@nocolor\let\opcb@set@bordercolor\mbox + \else\def\opcb@set@bordercolor{\colorbox{\opcb@bordercolor}}\fi + \setlength{\fboxsep}{\opcb@borderwidth}\setlength{\fboxrule}{0pt}% + \begin{settransparency}[\opcb@borderblendmode]{\opcb@bordertextop}% + {\opcb@borderop}% + \opcb@set@bordercolor{\parbox[c]{\opcb@width}{% + \setlength{\fboxsep}{\opcb@fboxsep}\setlength{\fboxrule}{0pt}% + \begin{settransparency}[\opcb@bgblendmode]{\opcb@textop}% + {\opcb@bgop}% + \opcb@set@bgcolor{\parbox[c]{\linewidth-2\fboxsep}{% + \begin{settransparency}{\opcb@textop}{\opcb@textop}% + #2% + \end{settransparency}% + }}% + \end{settransparency}}}% + \end{settransparency}% + \endgroup +} +\def\dc@vCaptionPlacement#1{\def\dc@captionPlacement{#1}% + \def\dc@@captionPlacement{0pt}% + \if\dc@captionPlacement c% + \def\dc@@captionPlacement{-\dc@graphicHalfHeight+3pt}\else + \if\dc@captionPlacement t% + \def\dc@@captionPlacement{-\dc@graphicHeight}% + \else + \def\dc@captionPlacement{b}% + \def\dc@@captionPlacement{0pt}% + \fi\fi +} +\dc@vCaptionPlacement{b} +\def\dc@hCaptionPlacement#1{\def\dc@argi{#1}% + \if\dc@argi l\def\dc@Hplacement{\relax}\else + \if\dc@argi c\def\dc@Hplacement{\hfil}\else + \if\dc@argi r\def\dc@Hplacement{\hfill}\else + \def\dc@Hplacement{\relax}\fi\fi\fi +} +\dc@hCaptionPlacement{c} +\def\dc@calc@adj@width#1{{% + \edef\dc@tmp@exp{\noexpand\setkeys{opcolorbox}{#1}}\dc@tmp@exp + \setlength{\linewidth}{\dc@graphicWidth-2\fboxsep}% + \setlength{\dimen@}{\opcb@width}% + \setlength{\dimen@ii}{\opcb@borderwidth}% + \setlength{\dimen@}{\dimen@-2\dimen@ii}% + \xdef\dc@adj@width{\the\dimen@}% +}} +\long\def\dc@insert@graphicx@opcolor@boxes#1#2#3#4#5{% + \graphicxbox{#1}{#2\parbox[\dc@captionPlacement]% + [\dc@graphicHeight-2\fboxsep]{\dc@graphicWidth-2\fboxsep}% + {\vskip0pt\dc@Hplacement\opcolorbox[#3,width=\dc@adj@width]% + {#4}\par\kern0pt}#5}% +} +\def\graphicHeight{\dc@graphicHeight-2\fboxsep-% + \dc@outerboxsep-\dc@outerboxsep-\opcb@borderwidth-\opcb@borderwidth} +\def\graphicWidth{\dc@graphicWidth-2\fboxsep-% + \dc@outerboxsep-\dc@outerboxsep-\opcb@borderwidth-\opcb@borderwidth} +%%\paragraph*{Fourth parameter, required.} The content of the caption. +\define@key{dc@commands}{outerboxsep}[3pt]{\def\dc@outerboxsep{#1}} +\define@key{dc@commands}{vcaption}[b]{\dc@vCaptionPlacement{#1}} +\define@key{dc@commands}{hcaption}[c]{\dc@hCaptionPlacement{#1}} +\define@key{dc@commands}{inclgraphicx}[]{% + \def\dc@inclgraphicx{#1\dc@incgfx@addkeys}} +\let\dc@incgfx@addkeys\@empty +\define@key{dc@commands}{rollovername}[]{{% + \gdef\dc@rollovername{#1}% + \ifx\dc@rollovername\@empty + {\count0=\dc@rollover@cnt\advance\count0by1\relax + \xdef\dc@rollover@cnt{\the\count0}% + \xdef\dc@rollovername{Cnt\dc@rollover@cnt}}% + \fi +}} +\let\dc@rollovername\@empty +\def\dc@rollover@cnt{0}% +\setkeys{dc@commands}{outerboxsep,vcaption,hcaption,inclgraphicx} +\newcommand{\digiCap}{\@ifstar{\dc@digiCapRollover} + {\dc@digiCap}} +\newcommand{\dc@digiCap}[2][]{\begingroup + \edef\dc@tmp@exp{\noexpand\setkeys{dc@commands}{#1}}\dc@tmp@exp + \def\dc@filename{#2}\setlength{\fboxsep}{\dc@outerboxsep}% + \dc@@digiCap +} +\newcommand{\dc@@digiCap}[2][]{% + \edef\dc@tmp@exp{\noexpand\setkeys{Gin}{\dc@inclgraphicx}}% + \dc@tmp@exp\edef\dc@tmp@exp{\setbox0= + \hbox{\noexpand\includegraphics[draft,\dc@inclgraphicx]% + {\dc@filename}}}\dc@tmp@exp\dimen@=\dp0 \advance\dimen@\ht0 + \edef\dc@graphicHeight{\the\dimen@}% + \edef\dc@graphicWidth{\the\wd0}% + \dc@calc@adj@width{#1}\parbox{\dc@graphicWidth}{% + \dc@insert@graphicx@opcolor@boxes{\dc@filename}{}{#1}{#2}{}}% +\endgroup} +\newcommand{\dc@digiCapRollover}[2][]{\begingroup + \edef\dc@tmp@exp{\noexpand\setkeys{dc@commands}{#1}}% + \dc@tmp@exp\def\dc@filename{#2}% + \setlength{\fboxsep}{\dc@outerboxsep}% + \ifx\dc@rollovername\@empty\setkeys{dc@commands}{rollovername}\fi + \dc@@digiCapRollover +} +\newcommand{\dc@@digiCapRollover}[2][]{% + \edef\dc@tmp@exp{\noexpand\setkeys{Gin}{\dc@inclgraphicx}}% + \dc@tmp@exp\edef\dc@tmp@exp{\setbox0=\hbox{% + \noexpand\includegraphics[draft,\dc@inclgraphicx]% + {\dc@filename}}}\dc@tmp@exp\dimen@=\dp0\advance\dimen@\ht0 + \edef\dc@graphicHeight{\the\dimen@}\dimen@=.5\dimen@ + \edef\dc@graphicHalfHeight{\the\dimen@}% + \edef\dc@graphicWidth{\the\wd0}% + \dc@calc@adj@width{#1}\parbox{\dc@graphicWidth}{% + \raisebox{\dc@@captionPlacement}[0pt][0pt]{\rlap + {\pushButton[\presets{\digiCapsPresets{\dc@rollovername}}% + \presets{\hiddenPresets}]{dcRollover.\dc@rollovername}% + {\dc@graphicWidth}{\dc@graphicHeight}}}% + \dc@insert@graphicx@opcolor@boxes{\dc@filename}% + {\xBld{\dc@rollovername}}{#1}{#2}{\eBld}% + }\global\let\dc@rollovername\@empty% +\endgroup} +\def\digiCapsPresets#1{\W0\BG{}\BC{}\H{N}\autoCenter{n}% rollover mod + \AA{\AAMouseEnter{\JS{toggleSetThisLayer("#1",true);}}% + \AAMouseExit{\JS{toggleSetThisLayer("#1",false);}}}} +\def\hiddenPresets{} +\endinput +%% +%% End of file `digicap-pro.sty'. -- cgit v1.2.3