4 %% $Id: pdfwidgets.sty,v 1.2 2007-10-22 09:45:17 cvr Exp $
6 %% (c) C. V. Radhakrishnan <cvr@river-valley.org>
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.
12 %\RequirePackage[oldstyle]{minion}
13 %\RequirePackage[scaled=.8]{prima}
14 %\RequirePackage[scaled=.9]{lfr}
15 \usepackage[dvipsnames,svgnames]{xcolor}
16 \RequirePackage{graphicx}
18 \usetikzlibrary{backgrounds}
20 %\def\thesection{\ifnum\c@section<10
21 % \protect\phantom{0}\fi\arabic{section}}
24 \def\rulecolor{orange}
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
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}
55 % \draw(\pgf@xa,\pgf@ya) -- (\pgf@xa,\pgf@yb) ;
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
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}}
88 % \draw(\pgf@xa,\pgf@ya) -- (\pgf@xa,\pgf@yb) ;
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}
125 % \draw(\pgf@xa,\pgf@ya) -- (\pgf@xa,\pgf@yb) ;
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}
158 % \draw(\pgf@xa,\pgf@ya) -- (\pgf@xa,\pgf@yb) ;
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}%
174 %\node[fill=black!10,draw,shape=filledbox,
175 \node[fill=black!10,%
182 text width=\Linewidth] (x)
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}}
193 % \par\vskip.5\baselineskip
197 %% include clippings from a pdf document:
198 %% #1 => Optional argument for \includegraphics
200 %% #3 => co-ordinates
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} ;
214 \vskip12pt plus 3pt minus 3pt}
218 \def\computeLinewidth#1{\global\setlength\Linewidth{#1}%
219 \global\addtolength{\Linewidth}{-2\Sep}}
224 \long\def\NavigationPanel{%
225 \global\setbox0=\hbox\bgroup
226 \begin{minipage}[t][.8125\panelheight][t]{.9\panelwidth}\color{brown}%
228 \ifx\@pinclude\empty\relax\par\vfill\else
230 %River Valley Technologies
231 \end{minipage}\egroup
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} ;
243 \vspace*{.0125\panelheight}
246 \long\def\pinclude#1{\gdef\@pinclude{#1}}
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}}
256 \def\vpanel{\def\@linkcolor{blue}%
257 \def\@urlcolor{blue}%
258 \def\@menucolor{blue}%
259 \begin{minipage}[t][\vpanelheight][c]{\paperwidth}%
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}%
268 %\node[fill=black!10,draw,shape=filledbox,
269 \node[fill=white!10,%
273 % bottom color=white,
277 {\includegraphics[width=13mm]{els-logo.pdf}};
278 \end{tikzpicture}}\hfill
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}}
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}}
291 {\href{http://www.elsevier.com/locate/latex}%
293 % \pdfButton{2cm}{\Acrobatmenu{GoToPage}{GoTo}}
295 \rule{\paperwidth}{0.1pt}
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}
307 \RequirePackage{moreverb}
309 \newenvironment{vquote}%
311 \verbatimwrite{tmp.tex}}
313 \aftergroup\printBox}
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}%
328 \def\red{\color{Sepia}}
329 \def\verbatim@font{\red\normalfont\ttfamily}
331 \def\verbatimcontinuewrite{%
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}}%
341 \def\@@@lbr{\expandafter\@gobble\string\{}
342 \def\@@@rbr{\expandafter\@gobble\string\}}
343 \def\@@@pcr{\expandafter\@gobble\string\%}
346 %\immediate\write18{touch mytool.tex
347 % ^^J rm mytool.tex ^^J touch mytool.tex}
349 \newenvironment{toolwrite}[1]%
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}}
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]
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)
374 \hyperlink{page.\the\@tempcnta}{\tikz\node at(0,0)
377 \advance\@tempcnta 1 \let\printfill\,\repeat}}