elsarticle/doc/pdfwidgets.sty
changeset 11 e73184c3928f
equal deleted inserted replaced
-1:000000000000 0:e3526b33e536
       
     1 %%
       
     2 %% pdfwidgets.sty
       
     3 %%
       
     4 %% $Id: pdfwidgets.sty,v 1.2 2007-10-22 09:45:17 cvr Exp $
       
     5 %%    
       
     6 %% (c) C. V. Radhakrishnan <cvr@river-valley.org>
       
     7 %%
       
     8 %% This package may be distributed under the terms of the LaTeX Project 
       
     9 %% Public License, as described in lppl.txt in the base LaTeX distribution.
       
    10 %% Either version 1.0 or, at your option, any later version.
       
    11 %%
       
    12 %\RequirePackage[oldstyle]{minion}
       
    13 %\RequirePackage[scaled=.8]{prima}
       
    14 %\RequirePackage[scaled=.9]{lfr}
       
    15 \usepackage[dvipsnames,svgnames]{xcolor}
       
    16 \RequirePackage{graphicx}
       
    17 \RequirePackage{tikz}
       
    18 \usetikzlibrary{backgrounds}
       
    19 
       
    20 %\def\thesection{\ifnum\c@section<10
       
    21 %    \protect\phantom{0}\fi\arabic{section}}
       
    22 
       
    23 \newdimen\lmrgn
       
    24 \def\rulecolor{orange}
       
    25 \def\rulewidth{1pt}
       
    26 \pgfdeclareshape{filledbox}{%
       
    27   \inheritsavedanchors[from=rectangle] % this is nearly a rectangle
       
    28   \inheritanchorborder[from=rectangle]
       
    29   \inheritanchor[from=rectangle]{center}
       
    30   \inheritanchor[from=rectangle]{north}
       
    31   \inheritanchor[from=rectangle]{south}
       
    32   \inheritanchor[from=rectangle]{west}
       
    33   \inheritanchor[from=rectangle]{east}
       
    34   % ... and possibly more
       
    35   \backgroundpath{% this is new
       
    36     % store lower right in xa/ya and upper right in xb/yb
       
    37     \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
       
    38     \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
       
    39     % compute corner of ``flipped page''
       
    40     \pgf@xc=\pgf@xb \advance\pgf@xc by-5pt % this should be a parameter
       
    41     \pgf@yc=\pgf@yb \advance\pgf@yc by-5pt
       
    42     % construct main path
       
    43     \pgfsetlinewidth{\rulewidth}
       
    44     \pgfsetstrokecolor{\rulecolor}
       
    45     \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
       
    46   \pgfsetcornersarced{\pgfpoint{9pt}{9pt}}
       
    47     \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
       
    48 %  \pgfsetcornersarced{\pgforigin}
       
    49   \pgfsetcornersarced{\pgfpoint{9pt}{9pt}}
       
    50     \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}}
       
    51   \pgfsetcornersarced{\pgfpoint{9pt}{9pt}}
       
    52     \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
       
    53   \pgfsetcornersarced{\pgforigin}
       
    54     \pgfpathclose ;
       
    55 %  \draw(\pgf@xa,\pgf@ya) -- (\pgf@xa,\pgf@yb) ;
       
    56  }%
       
    57 }
       
    58 \pgfdeclareshape{roundedbox}{%
       
    59   \inheritsavedanchors[from=rectangle] % this is nearly a rectangle
       
    60   \inheritanchorborder[from=rectangle]
       
    61   \inheritanchor[from=rectangle]{center}
       
    62   \inheritanchor[from=rectangle]{north}
       
    63   \inheritanchor[from=rectangle]{south}
       
    64   \inheritanchor[from=rectangle]{west}
       
    65   \inheritanchor[from=rectangle]{east}
       
    66   % ... and possibly more
       
    67   \backgroundpath{% this is new
       
    68     % store lower right in xa/ya and upper right in xb/yb
       
    69     \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
       
    70     \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
       
    71     % compute corner of ``flipped page''
       
    72     \pgf@xc=\pgf@xb \advance\pgf@xc by-5pt % this should be a parameter
       
    73     \pgf@yc=\pgf@yb \advance\pgf@yc by-5pt
       
    74     % construct main path
       
    75     \pgfsetlinewidth{\rulewidth}
       
    76     \pgfsetstrokecolor{\rulecolor}
       
    77     \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
       
    78   \pgfsetcornersarced{\pgfpoint{4pt}{4pt}}
       
    79     \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
       
    80 %  \pgfsetcornersarced{\pgforigin}
       
    81   \pgfsetcornersarced{\pgfpoint{4pt}{4pt}}
       
    82     \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}}
       
    83   \pgfsetcornersarced{\pgfpoint{4pt}{4pt}}
       
    84     \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
       
    85 %  \pgfsetcornersarced{\pgforigin}
       
    86   \pgfsetcornersarced{\pgfpoint{4pt}{4pt}}
       
    87     \pgfpathclose ;
       
    88 %  \draw(\pgf@xa,\pgf@ya) -- (\pgf@xa,\pgf@yb) ;
       
    89  }%
       
    90 }
       
    91 
       
    92 
       
    93 
       
    94 
       
    95 \pgfdeclareshape{buttonbox}{%
       
    96   \inheritsavedanchors[from=rectangle] % this is nearly a rectangle
       
    97   \inheritanchorborder[from=rectangle]
       
    98   \inheritanchor[from=rectangle]{center}
       
    99   \inheritanchor[from=rectangle]{north}
       
   100   \inheritanchor[from=rectangle]{south}
       
   101   \inheritanchor[from=rectangle]{west}
       
   102   \inheritanchor[from=rectangle]{east}
       
   103   % ... and possibly more
       
   104   \backgroundpath{% this is new
       
   105     % store lower right in xa/ya and upper right in xb/yb
       
   106     \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
       
   107     \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
       
   108     % compute corner of ``flipped page''
       
   109     \pgf@xc=\pgf@xb \advance\pgf@xc by-5pt % this should be a parameter
       
   110     \pgf@yc=\pgf@yb \advance\pgf@yc by-5pt
       
   111     % construct main path
       
   112     \pgfsetlinewidth{1pt}
       
   113     \pgfsetstrokecolor{blue!10}
       
   114     \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
       
   115   \pgfsetcornersarced{\pgfpoint{4pt}{4pt}}
       
   116     \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
       
   117 %  \pgfsetcornersarced{\pgforigin}
       
   118   \pgfsetcornersarced{\pgfpoint{4pt}{4pt}}
       
   119     \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}}
       
   120   \pgfsetcornersarced{\pgforigin}
       
   121 %  \pgfsetcornersarced{\pgfpoint{9pt}{9pt}}
       
   122     \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
       
   123   \pgfsetcornersarced{\pgforigin}
       
   124     \pgfpathclose ;
       
   125 %  \draw(\pgf@xa,\pgf@ya) -- (\pgf@xa,\pgf@yb) ;
       
   126  }%
       
   127 }
       
   128 \pgfdeclareshape{quotedbox}{%
       
   129   \inheritsavedanchors[from=rectangle] % this is nearly a rectangle
       
   130   \inheritanchorborder[from=rectangle]
       
   131   \inheritanchor[from=rectangle]{center}
       
   132   \inheritanchor[from=rectangle]{north}
       
   133   \inheritanchor[from=rectangle]{south}
       
   134   \inheritanchor[from=rectangle]{west}
       
   135   \inheritanchor[from=rectangle]{east}
       
   136   % ... and possibly more
       
   137   \backgroundpath{% this is new
       
   138     % store lower right in xa/ya and upper right in xb/yb
       
   139     \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
       
   140     \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
       
   141     % compute corner of ``flipped page''
       
   142     \pgf@xc=\pgf@xb \advance\pgf@xc by-5pt % this should be a parameter
       
   143     \pgf@yc=\pgf@yb \advance\pgf@yc by-5pt
       
   144     % construct main path
       
   145     \pgfsetlinewidth{\rulewidth}
       
   146     \pgfsetstrokecolor{\rulecolor}
       
   147     \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
       
   148   \pgfsetcornersarced{\pgfpoint{9pt}{9pt}}
       
   149     \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
       
   150   \pgfsetcornersarced{\pgforigin}
       
   151 %  \pgfsetcornersarced{\pgfpoint{4pt}{4pt}}
       
   152     \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yb}}
       
   153   \pgfsetcornersarced{\pgforigin}
       
   154 %  \pgfsetcornersarced{\pgfpoint{9pt}{9pt}}
       
   155     \pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
       
   156   \pgfsetcornersarced{\pgforigin}
       
   157     \pgfpathclose ;
       
   158 %  \draw(\pgf@xa,\pgf@ya) -- (\pgf@xa,\pgf@yb) ;
       
   159  }%
       
   160 }
       
   161 
       
   162 \newcounter{clip}
       
   163 \newdimen\mywidth
       
   164 \mywidth=\linewidth
       
   165 
       
   166 \def\src#1{\gdef\@src{#1}}\let\@src\@empty
       
   167 \def\includeclip{\@ifnextchar[{\@includeclip}{\@includeclip[]}}
       
   168 \def\@includeclip[#1]#2#3#4{\par
       
   169 %    \vskip.75\baselineskip plus 3pt minus 1pt
       
   170     \computeLinewidth{\mywidth}%
       
   171     \begingroup\color{white}%
       
   172      \noindent%
       
   173      \begin{tikzpicture}
       
   174       %\node[fill=black!10,draw,shape=filledbox,
       
   175       \node[fill=black!10,%
       
   176 			draw,
       
   177 			shade,%
       
   178 			top color=blue!10,
       
   179 			bottom color=cyan!5,
       
   180 			shape=filledbox,
       
   181       inner sep=\Sep,
       
   182       text width=\Linewidth] (x)
       
   183       {\parbox{\Linewidth}
       
   184       {\ifx\@src\@empty\else\refstepcounter{clip}\label{clip\theclip}%
       
   185 			  {\par\vskip6pt\color{orange}\sffamily\small
       
   186 				 ~Clip \theclip:\space\@src.}%
       
   187 			 \par\vskip3pt\fi\normalcolor
       
   188 			 \includegraphics[width=\Linewidth,page={#2},%
       
   189          viewport={#3},clip=true,#1]{#4}}
       
   190        \hspace*{-10pt}};
       
   191       \end{tikzpicture}
       
   192      \endgroup
       
   193 %     \par\vskip.5\baselineskip
       
   194 %         plus 3pt minus 1pt
       
   195 				 }
       
   196 %%                                         
       
   197 %% include clippings from a pdf document:
       
   198 %% #1 => Optional argument for \includegraphics
       
   199 %% #2 => page number
       
   200 %% #3 => co-ordinates
       
   201 %% #4 => file name
       
   202 
       
   203 \newenvironment{quoted}{%\bigskip
       
   204     \computeLinewidth{.95\linewidth}%
       
   205     \global\setbox0=\hbox\bgroup
       
   206 	   \begin{minipage}{.95\linewidth}\color{brown}%
       
   207 		 \footnotesize\ttfamily\obeyspaces\obeylines}
       
   208 	{\end{minipage}\egroup
       
   209    \vskip12pt plus 3pt minus 3pt\noindent\begin{tikzpicture}
       
   210 	  \node[fill=blue!10,draw,shade,top color=orange!10,
       
   211 		      bottom color=white,shape=filledbox,
       
   212 		 inner sep=8pt,text width=\Linewidth] (x) {\box0} ;
       
   213  	  \end{tikzpicture}%
       
   214 	 \vskip12pt plus 3pt minus 3pt}
       
   215 
       
   216 \newdimen\Linewidth
       
   217 \newdimen\Sep
       
   218 \def\computeLinewidth#1{\global\setlength\Linewidth{#1}%
       
   219    \global\addtolength{\Linewidth}{-2\Sep}}
       
   220 
       
   221 \newdimen\npskip
       
   222 \npskip=0mm
       
   223 
       
   224 \long\def\NavigationPanel{%
       
   225    \global\setbox0=\hbox\bgroup
       
   226 	   \begin{minipage}[t][.8125\panelheight][t]{.9\panelwidth}\color{brown}%
       
   227      %\centering
       
   228      \ifx\@pinclude\empty\relax\par\vfill\else
       
   229 		 \@pinclude\fi
       
   230 		 %River Valley Technologies
       
   231 	   \end{minipage}\egroup
       
   232 		 \Sep=.5cm
       
   233 		 \@tempdima=\panelwidth
       
   234 		 \advance\@tempdima-1cm
       
   235 		 \computeLinewidth{\@tempdima}%
       
   236 		 \def\rulewidth{.2pt}%
       
   237 	 \noindent\begin{tikzpicture}
       
   238 	  \node[fill=blue!10,draw,shade,bottom color=brown!30,
       
   239 		      top color=white,shape=filledbox,
       
   240 		 inner sep=\the\Sep,text width=\Linewidth] (x) 
       
   241 		 {\hspace*{\npskip}\box0} ;
       
   242  	  \end{tikzpicture}%
       
   243 		\vspace*{.0125\panelheight}
       
   244 }
       
   245 
       
   246 \long\def\pinclude#1{\gdef\@pinclude{#1}}
       
   247 \let\@pinclude\empty
       
   248 
       
   249 \def\Strut{\vrule depth 2pt height 10pt width 0pt}
       
   250 \def\pdfButton#1#2{\begin{tikzpicture}
       
   251      \node[fill=blue!10,draw,shade,top color=blue!50,
       
   252 		       bottom color=white,shape=buttonbox,
       
   253 					 inner sep=2pt,text width=#1](x) 
       
   254 					 {\parbox{#1}{\centering\Strut#2}}; \end{tikzpicture}}
       
   255 
       
   256 \def\vpanel{\def\@linkcolor{blue}%
       
   257             \def\@urlcolor{blue}%
       
   258 						\def\@menucolor{blue}%
       
   259        \begin{minipage}[t][\vpanelheight][c]{\paperwidth}%
       
   260        \normalsfcodes%
       
   261    \hspace*{.25cm}
       
   262 	  \begin{minipage}[c][\vpanelheight][c]{17cm}
       
   263 		 \parbox[c][27mm][b]{15mm}%
       
   264 %		  {\includegraphics[width=15mm]{logo4.pdf}}\hfill%\hspace{1cm}
       
   265      {\def\rulecolor{Goldenrod}%
       
   266 		  \def\rulewidth{1pt}%
       
   267 			\begin{tikzpicture}%
       
   268       %\node[fill=black!10,draw,shape=filledbox,
       
   269       \node[fill=white!10,%
       
   270 			 draw,
       
   271 %			 shade,%
       
   272 %			 top color=blue!10,
       
   273 %			 bottom color=white,
       
   274 			 shape=roundedbox,
       
   275       inner sep=2mm,
       
   276       text width=13mm] (x)
       
   277       {\includegraphics[width=13mm]{els-logo.pdf}};
       
   278 			\end{tikzpicture}}\hfill
       
   279 %
       
   280      \parbox[c][24mm][b]{145mm}%	
       
   281 	    {{\fontsize{30}{30}\selectfont\textsf{\color{white}elsarticle.cls}}
       
   282 			\quad{\fontsize{14}{14}\selectfont\sffamily\color{blue!50}
       
   283 			 A better way to format your submission}}
       
   284     \end{minipage} 
       
   285 	 \hfill
       
   286 	 \begin{minipage}[c][\vpanelheight][b]{7.9cm}
       
   287 	  \sffamily\footnotesize
       
   288 	  \pdfButton{2cm}{\href{mailto:elsarticle@river-valley.com}{BUGS}}
       
   289 	  \pdfButton{2cm}{\href{http://support.river-valley.com}{SUPPORT}}
       
   290 	  \pdfButton{2cm}%
       
   291 		 {\href{http://www.elsevier.com/locate/latex}%
       
   292 		  {RESOURCES}}
       
   293 %		\pdfButton{2cm}{\Acrobatmenu{GoToPage}{GoTo}}
       
   294 	 \end{minipage}\\
       
   295 	 \rule{\paperwidth}{0.1pt}
       
   296 	 \end{minipage}%
       
   297 }
       
   298 
       
   299 \@ifundefined{backgroundcolor}%
       
   300   {\def\backgroundcolor#1{\gdef\@backgroundcolor{#1}}}{}
       
   301 \colorlet{panelbackground}{orange!10}
       
   302 \backgroundcolor{orange!10}
       
   303 \def\@urlcolor{brown}
       
   304 \def\@linkcolor{brown}
       
   305 \def\@menucolor{brown}
       
   306 
       
   307 \RequirePackage{moreverb}
       
   308 
       
   309 \newenvironment{vquote}%
       
   310     {\medskip
       
   311 		 \verbatimwrite{tmp.tex}}
       
   312     {\endverbatimwrite
       
   313 		 \aftergroup\printBox}
       
   314 
       
   315 \def\printBox{\bgroup\def\rulecolor{orange}%
       
   316     \def\rulewidth{.2pt}%
       
   317 		\noindent\begin{tikzpicture}
       
   318 	  \node[fill=blue!10,draw,shade,top color=white!10,
       
   319 		      bottom color=cyan!5,shape=quotedbox,
       
   320 		 inner sep=8pt,text width=.95\linewidth] (x) 
       
   321 		 {\color{orange}\verbatiminput{tmp.tex}%
       
   322 		 \vspace*{-\baselineskip}%
       
   323 		 } ;
       
   324  	  \end{tikzpicture}%
       
   325 		\egroup
       
   326 		\medskip
       
   327 }
       
   328 \def\red{\color{Sepia}}
       
   329 \def\verbatim@font{\red\normalfont\ttfamily}
       
   330 
       
   331 \def\verbatimcontinuewrite{%
       
   332   \@bsphack
       
   333 %  \verbatim@out=#1
       
   334   \let\do\@makeother\dospecials
       
   335   \obeyspaces\catcode`\^^M\active \catcode`\^^I=12
       
   336   \def\verbatim@processline{%
       
   337     \immediate\write\verbatim@out
       
   338       {\the\verbatim@line}}%
       
   339   \verbatim@start}
       
   340 
       
   341 \def\@@@lbr{\expandafter\@gobble\string\{}
       
   342 \def\@@@rbr{\expandafter\@gobble\string\}}
       
   343 \def\@@@pcr{\expandafter\@gobble\string\%}
       
   344 
       
   345 
       
   346 %\immediate\write18{touch mytool.tex
       
   347 %  ^^J rm mytool.tex ^^J touch mytool.tex}
       
   348 
       
   349 \newenvironment{toolwrite}[1]%
       
   350   {\@tempdima=#1
       
   351 	 \verbatimwrite{xx}}
       
   352 	{\endverbatimwrite
       
   353 	 \immediate\write18{echo 
       
   354 	 "\string\Clear\@@@lbr\the\@tempdima\@@@rbr\@@@lbr\@@@pcr">>mytool.tex^^J
       
   355 	   cat xx.tex >> mytool.tex ^^J
       
   356 		 echo "\@@@rbr" >> mytool.tex}}
       
   357 
       
   358 \tikzstyle{place}=[scale=.39,rectangle,draw=blue!90,fill=blue!30,thin,%
       
   359                    minimum height=1mm,minimum width=13mm]
       
   360 \tikzstyle{trans}=[scale=.39,rectangle,draw=Olive,fill=Olive!20,thin,%
       
   361                    minimum height=1mm,minimum width=13mm]
       
   362 \tikzstyle{past}=[scale=.39,rectangle,draw=Olive,fill=Olive!60,thin,%
       
   363                    minimum height=1mm,minimum width=13mm]
       
   364 
       
   365 \def\printSq#1{\parbox{107mm}{\@tempcnta=1
       
   366    \let\printfill\@empty
       
   367    \loop\ifnum\@tempcnta<#1
       
   368 	  {\printfill\ifnum\c@page=\@tempcnta
       
   369     	 \tikz\node at(0,0) [place]{};\else
       
   370 			\ifnum\c@page<\@tempcnta
       
   371 		   \hyperlink{page.\the\@tempcnta}{\tikz\node at(0,0)
       
   372 			 [trans]{};}%
       
   373 			\else
       
   374 		   \hyperlink{page.\the\@tempcnta}{\tikz\node at(0,0)
       
   375 			 [past]{};}%
       
   376 			\fi\fi}%
       
   377 		\advance\@tempcnta 1 \let\printfill\,\repeat}}	
       
   378 
       
   379 
       
   380 \endinput
       
   381 
       
   382