summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/elsarticle/contrib/doc-tooltips.sty
blob: 929d0004bd79ecb31726d1e3ec71d2949ef34753 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
%%
%% doc-tooltips.sty
%%
%% $Id: doc-tooltips.sty,v 1.2 2007-10-22 09:45:17 cvr Exp $
%%
%% (c) C. V. Radhakrishnan <cvr@river-valley.com>
%%
%% This package may be distributed under the terms of the LaTeX Project 
%% Public License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%
\usepackage[pdftex]{eforms}[2006/10/03]
\usepackage[noextratext,movetips,filename=jfigs]{fancytooltips}
\colorlet{tooltipcolor}{magenta!80}

\def\tooltip#1#2{\@bsphack
  \write\@auxout{\noexpand\TooltipPage{\thepage}}\@esphack%
  \checkTipNumber{#2}\edef\TipNumber{\FindTipNumber{#2}}%
  \leavevmode%
  \setbox0=\hbox{{\color{tooltipcolor}#1}}%
  \hbox to \wd0{%
  \hb@xt@\z@{\copy0}%
  \pushButton[\BC{}\BG{}\S{}\AA{\AAMouseExit{\JS{CloseTooltips();}}%
  \AAMouseEnter{\JS{this.getField("ikona."+(this.pageNum+1)).hidden=false;%
      try {app.clearInterval(animace);}catch (e){}%
      \ifmovetips nastav(\TipNumber);\fi
      zobraz(\TipNumber);}}}]%
    {TooltipField}{\wd0}{\ht0}}}%
\newtoks\@enLab  %\newtoks\@enfont
\def\@enQmark{?}
\def\@enLabel#1#2{%
  \edef\@enThe{\noexpand#1{\@enumctr}}%
  \@enLab\expandafter{\the\@enLab\csname the\@enumctr\endcsname}%
  \@enloop}
\def\@enSpace{\afterassignment\@enSp@ce\let\@tempa= }
\def\@enSp@ce{\@enLab\expandafter{\the\@enLab\space}\@enloop}
\def\@enGroup#1{\@enLab\expandafter{\the\@enLab{#1}}\@enloop}
\def\@enOther#1{\@enLab\expandafter{\the\@enLab#1}\@enloop}
\def\@enloop{\futurelet\@entemp\@enloop@}
\def\@enloop@{%
  \ifx A\@entemp         \def\@tempa{\@enLabel\Alph  }\else
  \ifx a\@entemp         \def\@tempa{\@enLabel\alph  }\else
  \ifx i\@entemp         \def\@tempa{\@enLabel\roman }\else
  \ifx I\@entemp         \def\@tempa{\@enLabel\Roman }\else
  \ifx 1\@entemp         \def\@tempa{\@enLabel\arabic}\else
  \ifx \@sptoken\@entemp \let\@tempa\@enSpace         \else
  \ifx \bgroup\@entemp   \let\@tempa\@enGroup         \else
  \ifx \@enum@\@entemp   \let\@tempa\@gobble          \else
                         \let\@tempa\@enOther
             \fi\fi\fi\fi\fi\fi\fi\fi
  \@tempa}
\newlength{\@sep} \newlength{\@@sep}
\setlength{\@sep}{.5\baselineskip plus.2\baselineskip
            minus.2\baselineskip}
\setlength{\@@sep}{.1\baselineskip plus.01\baselineskip
            minus.05\baselineskip}
\providecommand{\sfbc}{\rmfamily\upshape}
\providecommand{\sfn}{\rmfamily\upshape}
\def\@enfont{\ifnum \@enumdepth >1\let\@nxt\sfn \else\let\@nxt\sfbc \fi\@nxt}
\def\enumerate{% 
   \ifnum \@enumdepth >3 \@toodeep\else
      \advance\@enumdepth \@ne
      \edef\@enumctr{enum\romannumeral\the\@enumdepth}\fi
   \@ifnextchar[{\@@enum@}{\@enum@}}
\def\@@enum@[#1]{%
  \@enLab{}\let\@enThe\@enQmark
  \@enloop#1\@enum@
  \ifx\@enThe\@enQmark\@warning{The counter will not be printed.%
   ^^J\space\@spaces\@spaces\@spaces The label is: \the\@enLab}\fi
  \expandafter\edef\csname label\@enumctr\endcsname{\the\@enLab}%
  \expandafter\let\csname the\@enumctr\endcsname\@enThe
  \csname c@\@enumctr\endcsname7
  \expandafter\settowidth
            \csname leftmargin\romannumeral\@enumdepth\endcsname
%            {#1\hspace{\labelsep}}%
            {\the\@enLab\hskip\labelsep}%
  \@enum@}
\newdimen\lmrgn
\lmrgn=2em
\def\@enum@{\list{{\@enfont\csname label\@enumctr\endcsname}}%
           {\usecounter{\@enumctr}\def\makelabel##1{\hss\llap{##1}}%
		   \ifnum \@enumdepth>1\setlength{\topsep}{\@@sep}\else
           \setlength{\topsep}{\@sep}\fi
		   \ifnum \@enumdepth>1\setlength{\itemsep}{0pt plus1pt minus1pt}%
		   \else \setlength{\itemsep}{\@@sep}\fi
			\setlength\leftmargin{\lmrgn}%%%{1.8em}
		   \setlength{\parsep}{0pt plus1pt minus1pt}%
		   \setlength{\parskip}{0pt plus1pt minus1pt}}}
		   
\def\endenumerate{\par\ifnum \@enumdepth >1\addvspace{\@@sep}\else 
           \addvspace{\@sep}\fi \endlist}

\def\sitem{\@noitemargtrue\@item[\@itemlabel *]}

\def\itemize{\@ifnextchar[{\@Itemize}{\@Itemize[]}}

\def\@Itemize[#1]{\def\next{#1}%
  \ifnum \@itemdepth >\thr@@\@toodeep\else
	  \advance\@itemdepth\@ne
		\ifx\next\@empty\else\expandafter\def\csname 
		 labelitem\romannumeral\the\@itemdepth\endcsname{#1}\fi%
		\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
		\expandafter\list\csname\@itemitem\endcsname
		{\def\makelabel##1{\hss\llap{##1}}}%
	\fi}
    

\endinput
%%
%% End of package 'doc-tooltips.sty'
%%