From 57f947c6aa7497724bc2621e5a86d85c02580253 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 9 Aug 2021 21:03:43 +0000 Subject: cooltooltips (9aug21) git-svn-id: svn://tug.org/texlive/trunk@60201 c570f23f-e606-0410-a88d-b1316a301751 --- .../source/latex/cooltooltips/cooltooltips.dtx | 124 +++++++++++---------- .../source/latex/cooltooltips/cooltooltips.ins | 20 ++-- 2 files changed, 78 insertions(+), 66 deletions(-) (limited to 'Master/texmf-dist/source/latex') diff --git a/Master/texmf-dist/source/latex/cooltooltips/cooltooltips.dtx b/Master/texmf-dist/source/latex/cooltooltips/cooltooltips.dtx index 7f3304d813d..dcfd2a4d0d8 100644 --- a/Master/texmf-dist/source/latex/cooltooltips/cooltooltips.dtx +++ b/Master/texmf-dist/source/latex/cooltooltips/cooltooltips.dtx @@ -1,17 +1,17 @@ % \iffalse meta-comment % -% Copyright (C) 2006 by Scott Pakin -% -------------------------------------------------------- +% Copyright (C) 2006-2021 by Scott Pakin +% ------------------------------------------------------------- % % This file may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3b +% conditions of the LaTeX Project Public License, either version 1.3c % of this license or (at your option) any later version. % The latest version of this license is in: % % http://www.latex-project.org/lppl.txt % -% and version 1.3b or later is part of all distributions of LaTeX -% version 2006/01/07 or later. +% and version 1.3c or later is part of all distributions of LaTeX +% version 2008/05/04 or later. % % \fi % @@ -22,7 +22,7 @@ %\NeedsTeXFormat{LaTeX2e}[2001/06/01] %\ProvidesPackage{cooltooltips} %<*package> - [2006/03/07 v1.0 Cool PDF tooltips] + [2021/08/08 v1.1 Cool PDF tooltips] % % %<*driver> @@ -37,13 +37,13 @@ \begin{document} \sloppy \DocInput{cooltooltips.dtx} -% \PrintChanges + \PrintChanges \PrintIndex \end{document} % % \fi % -% \CheckSum{204} +% \CheckSum{216} % % \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 @@ -63,31 +63,19 @@ % % % \changes{v1.0}{2006/03/07}{Initial version} +% \changes{v1.1}{2021/08/08}{Enable support for Lua\string\LaTeX} % % \GetFileInfo{cooltooltips.dtx} % -% \DoNotIndex{\@ifundefined,\@tempboxa,\@tempcnta,\@tempcntb} -% \DoNotIndex{\@tempdima,\@tempdimb,\@tempdimc,\\} -% \DoNotIndex{\active,\addtolength,\advance} -% \DoNotIndex{\begingroup,\bgroup} -% \DoNotIndex{\catcode,\csname} -% \DoNotIndex{\DeclareRobustCommand,\def,\dp} -% \DoNotIndex{\edef,\egroup,\else,\endcsname,\endgroup,\expandafter} -% \DoNotIndex{\fi} -% \DoNotIndex{\gdef} -% \DoNotIndex{\hbox,\hspace,\ht} -% \DoNotIndex{\ifnum,\ifpdf,\immediate} -% \DoNotIndex{\let} -% \DoNotIndex{\makebox,\mbox,\MessageBreak} -% \DoNotIndex{\newcommand,\noexpand} -% \DoNotIndex{\paperwidth,\pdflastannot,\pdflastobj,\pdflastxform} -% \DoNotIndex{\renewcommand} -% \DoNotIndex{\savebox,\setbox,\setcounter,\setlength,\space} -% \DoNotIndex{\stepcounter,\strip@pt} -% \DoNotIndex{\the,\thepage} -% \DoNotIndex{\usebox} -% \DoNotIndex{\wd} -% \DoNotIndex{\xdef} +% \DoNotIndex{\@ifundefined,\@tempboxa,\@tempcnta,\@tempcntb,\@tempdima} +% \DoNotIndex{\@tempdimb,\@tempdimc,\DeclareRobustCommand,\MessageBreak,\\} +% \DoNotIndex{\active,\addtolength,\advance,\begingroup,\bgroup,\catcode} +% \DoNotIndex{\csname,\def,\dp,\edef,\egroup,\else,\endcsname,\endgroup} +% \DoNotIndex{\expandafter,\fi,\gdef,\hbox,\hspace,\ht,\ifnum,\immediate} +% \DoNotIndex{\let,\makebox,\mbox,\newcommand,\noexpand,\paperwidth} +% \DoNotIndex{\pdflastannot,\pdflastobj,\pdflastxform,\renewcommand} +% \DoNotIndex{\savebox,\setbox,\setcounter,\setlength,\space,\stepcounter} +% \DoNotIndex{\strip@pt,\the,\thepage,\usebox,\wd,\xdef} % % ^^A Define the document's metadata. % \title{The \cool\ package\thanks{This document @@ -142,11 +130,11 @@ % up a brief tooltip when the mouse moves over them and also open a % small window containing additional text. \cool\ works only with % pdf\LaTeX\@. Furthermore, the tooltips that \cool\ produces are much -% less cool when viewed under older versions of Acrobat~($<7.0$) or the -% current version of xpdf~(3.00) because they don't pop up the extra, -% small window. \cooltooltip[0 0 1]{Example}{This is an example of a -% cool tooltip. Pretty cool, eh?}{http://www.ctan.org/}{Visit CTAN on -% the Web}{This text\strut} is an example of a cool tooltip (assuming +% less cool when viewed under older versions of Acrobat~($<7.0$) or most +% other \acro{pdf} readers because they don't pop up the extra, small +% window. \cooltooltip[0 0 1]{Example}{This is an example of a cool +% tooltip. Pretty cool, eh?}{http://www.ctan.org/}{Visit CTAN on the +% Web}{This text\strut} is an example of a cool tooltip (assuming % you're viewing this document with a sufficiently capable \acro{pdf} % reader). Move your mouse pointer over it and watch what happens. % Then, click on the link. If your \acro{pdf} reader is properly @@ -156,8 +144,8 @@ % If the \cool\ popup mechanism causes problems with your browser you % can \cooltooltiptoggle{\fcolorbox{blue}{white}{click here}} to disable % popups. (Click again to re-enable them.) Regardless of whether -% popups are enabled the tooltip and hyperlink mechanisms continue to -% function. +% popups are enabled the tooltip and hyperlink mechanisms should continue +% to function. % % The cool tooltip shown above was created with the following code: % @@ -272,17 +260,17 @@ % \label{sec:license} % % \begin{center} -% Copyright \textcopyright{} 2006 +% Copyright \textcopyright{} 2006--2021 % by Scott Pakin \texttt{} % \end{center} % % \noindent % This file may be distributed and/or modified under the conditions of -% the \LaTeX{} Project Public License, either version~1.3b of this +% the \LaTeX{} Project Public License, either version~1.3c of this % license or (at your option) any later version. The latest version of % this license is in \url{http://www.latex-project.org/lppl.txt} and -% version~1.3b or later is part of all distributions of \LaTeX{} version -% 2006/01/07 or later. +% version~1.3c or later is part of all distributions of \LaTeX{} version +% 2008/05/04 or later. % } % % \section{Implementation} @@ -314,12 +302,37 @@ % % \bigskip % -% Because \cool\ works only with pdf\LaTeX\ and only in \acro{pdf} mode, -% we load the \textsf{ifpdf} package up front to simplify testing for -% that case. +% Because \cool\ works only with pdf\LaTeX---or Lua\LaTeX\ with the +% \pkgname{luatex85} compatibility package---and only in \acro{pdf} +% mode, we load the \textsf{iftex} package up front to simplify testing +% for the execution environment. % \begin{macrocode} -\RequirePackage{ifpdf} +\RequirePackage{iftex} +\ifluatex + \RequirePackage{luatex85} +\fi +% \end{macrocode} +% +% \begin{macro}{\ifcoolpdf} +% \begin{macro}{\coolpdftrue} +% \begin{macro}{\coolpdffalse} +% We define a new test, |\ifcoolpdf|, which is true only when \TeX\ is +% in \acro{pdf} mode and only when pdf\LaTeX\ or Lua\LaTeX~+ +% \pkgname{luatex85} is being used to build the document. +% \begin{macrocode} +\newif\ifcoolpdf +\ifpdf + \ifluatex + \coolpdftrue + \fi + \ifpdftex + \coolpdftrue + \fi +\fi % \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} % % % \subsection{\pdfterm{AcroForm} construction} @@ -339,7 +352,7 @@ % At the end of the document we need to export the final value of % |\ctip@form@fields| as an \pdfterm{AcroForm}. % \begin{macrocode} -\ifpdf +\ifcoolpdf \AtEndDocument{% \immediate\pdfobj { << @@ -364,7 +377,7 @@ % Define an empty \pdfterm{XForm} object to use as an invisible icon for % the \pdfterm{Text} annotation. % \begin{macrocode} -\ifpdf +\ifcoolpdf \setbox\@tempboxa=\hbox{} \immediate\pdfxform\@tempboxa \edef\ctip@empty@icon{\the\pdflastxform} @@ -438,10 +451,10 @@ % % \begin{macro}{\ctip@update@pagenum} % We can't reliably use |\thepage| to get the current page number -% (cf.~\url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=wrongpn}). -% Hence, we exploit the |\label|\slash|\pageref| mechanism to get an -% accurate page number. |\ctip@update@pagenum| creates a label (based -% on Section~\ref{sec:text}'s |\ctip@tip@number|) then sets +% (cf.~\url{https://texfaq.org/FAQ-wrongpn}). Hence, we exploit the +% |\label|\slash|\pageref| mechanism to get an accurate page number. +% |\ctip@update@pagenum| creates a label (based on +% Section~\ref{sec:text}'s |\ctip@tip@number|) then sets % |\ctip@current@page| to the page on which the label occurs. % \begin{macrocode} \newcommand*{\ctip@update@pagenum}{% @@ -827,14 +840,13 @@ % \subsection{Sanity checks} % \label{sec:sanity-checks} % -% Complain---but attempt to continue---if we're not running pdf\LaTeX\ -% in \acro{pdf} mode. +% Complain---but attempt to continue---if we're not running +% pdf\LaTeX\ or Lua\LaTeX\ in \acro{pdf} mode. % \begin{macrocode} -\RequirePackage{ifpdf} -\ifpdf +\ifcoolpdf \else \PackageWarning{cooltooltips}{% - Not running pdfLaTeX in PDF mode; disabling cooltooltips% + Not running pdfLaTeX or LuaLaTeX in PDF mode; disabling cooltooltips% } \renewcommand*{\ctip@cooltooltip@i}[6][]{\mbox{#6}} \fi diff --git a/Master/texmf-dist/source/latex/cooltooltips/cooltooltips.ins b/Master/texmf-dist/source/latex/cooltooltips/cooltooltips.ins index 0156ff98d07..e0d7f2cf009 100644 --- a/Master/texmf-dist/source/latex/cooltooltips/cooltooltips.ins +++ b/Master/texmf-dist/source/latex/cooltooltips/cooltooltips.ins @@ -1,15 +1,15 @@ %% -%% Copyright (C) 2006 by Scott Pakin +%% Copyright (C) 2006-2021 by Scott Pakin %% %% This file may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License, either version 1.3b of this license +%% the LaTeX Project Public License, either version 1.3c of this license %% or (at your option) any later version. The latest version of this %% license is in: -%% +%% %% http://www.latex-project.org/lppl.txt -%% -%% and version 1.3b or later is part of all distributions of LaTeX version -%% 2006/01/07 or later. +%% +%% and version 1.3c or later is part of all distributions of LaTeX version +%% 2008/05/04 or later. %% \input docstrip.tex @@ -21,17 +21,17 @@ This is a generated file. -Copyright (C) 2006 by Scott Pakin +Copyright (C) 2006-2021 by Scott Pakin This file may be distributed and/or modified under the conditions of -the LaTeX Project Public License, either version 1.3b of this license +the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. The latest version of this license is in: http://www.latex-project.org/lppl.txt -and version 1.3b or later is part of all distributions of LaTeX version -2006/01/07 or later. +and version 1.3c or later is part of all distributions of LaTeX version +2008/05/04 or later. \endpreamble -- cgit v1.2.3