diff options
author | Norbert Preining <norbert@preining.info> | 2020-07-30 03:01:28 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-07-30 03:01:28 +0000 |
commit | d2d95b04c14dc91a6976651379d33b2b472e6cb8 (patch) | |
tree | 4cb031e392017cff2b8a920e9817e4f39968b939 /macros/latex/contrib | |
parent | 71c876217b8d8b05eef7acf91b1a13d2e5262091 (diff) |
CTAN sync 202007300301
Diffstat (limited to 'macros/latex/contrib')
43 files changed, 1881 insertions, 833 deletions
diff --git a/macros/latex/contrib/annee-scolaire/LISEZMOI.md b/macros/latex/contrib/annee-scolaire/LISEZMOI.md index 3701237ba9..9b03ccca22 100644 --- a/macros/latex/contrib/annee-scolaire/LISEZMOI.md +++ b/macros/latex/contrib/annee-scolaire/LISEZMOI.md @@ -1,4 +1,4 @@ -<!-- Time-stamp: <2020-04-05 11:51:09 administrateur> --> +<!-- Time-stamp: <2020-07-29 19:14:43 administrateur> --> <!-- Création : 2020-04-05T11:48:13+0200 --> # annee-scolaire @@ -9,14 +9,14 @@ Auteur: Yvon Henel, alias _Le TeXnicien de surface_ ## LICENCE Le contenu de cette archive est placé sous la « LaTeX Project Public License ». -Voir http://www.ctan.org/license/lppl1.3 +Voir http://www.ctan.org/license/lppl1.3c pour la licence. © 2020 Yvon Henel (Le TeXnicien de surface) ## Description de l’extension -Une macro \anneescolaire pour écrire automatiquement l’année scolaire +Une macro `\anneescolaire` pour écrire automatiquement l’année scolaire en fonction de la date de compilation. Deux autres macros pour obtenir l’année civile de début et celle de @@ -26,4 +26,9 @@ Une macro à redéfinir pour changer l’aspect des numéros d’années. ## Historique -Version 1.5 — 2020-04-05 — Première version publique +* Version 1.6 — 2020-07-29 + * Correction de la documentation française ; + * Remplacement de la macro `\c_one` — obsolète — par 1 ; + * Nettoyage du fichier <kbd>ins</kbd>. + +* Version 1.5 — 2020-04-05 — Première version publique diff --git a/macros/latex/contrib/annee-scolaire/MANIFEST.md b/macros/latex/contrib/annee-scolaire/MANIFEST.md new file mode 100644 index 0000000000..807075b9c2 --- /dev/null +++ b/macros/latex/contrib/annee-scolaire/MANIFEST.md @@ -0,0 +1,101 @@ +# Manifest for annee-scolaire + +This file is a listing of all files considered to be part of this package. +It is automatically generated with `texlua build.lua manifest`. + + +## Repository manifest + +The following groups list the files included in the development repository of the package. +Files listed with a ‘†’ marker are included in the TDS but not CTAN files, and files listed +with ‘‡’ are included in both. + +### Source files + +These are source files for a number of purposes, including the `unpack` process which +generates the installation files of the package. Additional files included here will also +be installed for processing such as testing. + +* annee-scolaire.dtx ‡ +* annee-scolaire.ins ‡ + +### Typeset documentation source files + +These files are typeset using LaTeX to produce the PDF documentation for the package. + +* annee-scolaire.dtx ‡ + +### Documentation files + +These files form part of the documentation but are not typeset. Generally they will be +additional input files for the typeset documentation files listed above. + +* LISEZMOI.md ‡ +* README.md ‡ +* MANIFEST.md + +### Text files + +Plain text files included as documentation or metadata. + +* LISEZMOI.md ‡ +* MANIFEST.md +* README.md ‡ + +### Derived files + +The files created by ‘unpacking’ the package sources. This typically includes +`.sty` and `.cls` files created from DocStrip `.dtx` files. + +* annee-scolaire.sty † + +### Typeset documents + +The output files (PDF, essentially) from typesetting the various source, demo, +etc., package files. + +* annee-scolaire.pdf ‡ + + +## TDS manifest + +The following groups list the files included in the TeX Directory Structure used to install +the package into a TeX distribution. + +### Source files (TDS) + +All files included in the `annee-scolaire/source` directory. + +* annee-scolaire.dtx +* annee-scolaire.ins + +### TeX files (TDS) + +All files included in the `annee-scolaire/tex` directory. + +* annee-scolaire.sty + +### Doc files (TDS) + +All files included in the `annee-scolaire/doc` directory. + +* LISEZMOI.md +* README.md +* annee-scolaire-eng.pdf +* annee-scolaire-fra.pdf +* annee-scolaire.pdf + + +## CTAN manifest + +The following group lists the files included in the CTAN package. + +### CTAN files + +* LISEZMOI.md +* README.md +* annee-scolaire-eng.pdf +* annee-scolaire-fra.pdf +* annee-scolaire.dtx +* annee-scolaire.ins +* annee-scolaire.pdf diff --git a/macros/latex/contrib/annee-scolaire/README.md b/macros/latex/contrib/annee-scolaire/README.md index c53af88c6c..8c58c40c0d 100644 --- a/macros/latex/contrib/annee-scolaire/README.md +++ b/macros/latex/contrib/annee-scolaire/README.md @@ -1,4 +1,4 @@ -<!-- Time-stamp: <2020-04-05 11:47:51 administrateur> --> +<!-- Time-stamp: <2020-07-29 19:13:24 administrateur> --> <!-- Création : 2020-04-05T11:47:41+0200 --> # annee-scolaire @@ -9,14 +9,14 @@ Author: Yvon Henel, aka Le TeXnicien de surface ## LICENCE This material is subject to the LaTeX Project Public License. -See http://www.ctan.org/license/lppl1.3 +See http://www.ctan.org/license/lppl1.3c for the details of that license. © 2020 Yvon Henel (Le TeXnicien de surface) ## Description of the Package -A macro \anneescolaire to automatically write academic year (French way) +A macro `\anneescolaire` to automatically write academic year (French way) according to the date of compilation day. Two other macros to obtain the beginning calendar year and the ending @@ -27,5 +27,11 @@ A macros to be redefined to change the presentation of the years. ## History -Version 1.5 — 2020-04-05 — First public version +* Version 1.6 — 2020-07-29 + + Correction of some typos in French documentation + + Replacement of obsolete macro `\c_one` + + Cleaning of the <kbd>ins</kbd> file + +* Version 1.5 — 2020-04-05 — First public version + diff --git a/macros/latex/contrib/annee-scolaire/annee-scolaire-eng.pdf b/macros/latex/contrib/annee-scolaire/annee-scolaire-eng.pdf Binary files differindex 232dd8e338..e49af7a772 100644 --- a/macros/latex/contrib/annee-scolaire/annee-scolaire-eng.pdf +++ b/macros/latex/contrib/annee-scolaire/annee-scolaire-eng.pdf diff --git a/macros/latex/contrib/annee-scolaire/annee-scolaire-fra.pdf b/macros/latex/contrib/annee-scolaire/annee-scolaire-fra.pdf Binary files differindex 128e872f5a..8889124cf3 100644 --- a/macros/latex/contrib/annee-scolaire/annee-scolaire-fra.pdf +++ b/macros/latex/contrib/annee-scolaire/annee-scolaire-fra.pdf diff --git a/macros/latex/contrib/annee-scolaire/annee-scolaire.dtx b/macros/latex/contrib/annee-scolaire/annee-scolaire.dtx index 6a8d5ebf48..80a7500927 100644 --- a/macros/latex/contrib/annee-scolaire/annee-scolaire.dtx +++ b/macros/latex/contrib/annee-scolaire/annee-scolaire.dtx @@ -13,7 +13,7 @@ % %<*driver|package|doc> \RequirePackage{expl3}[2013/03/12] -\GetIdInfo$Id: annee-scolaire.dtx 1.5 2020-04-05 TdS $ +\GetIdInfo$Id: annee-scolaire.dtx 1.6 2020-07-29 TdS $ {} %</driver|package|doc> %<*driver> @@ -52,7 +52,14 @@ % \maketitle % % \changes{v1.5}{2020/04/05}{First public -% version.\foreignlanguage{french}{Première version publique.}} +% version.\foreignlanguage{french}{\emph{Première version publique.}}} +% \changes{v1.6}{2020/04/13}{Correction of typos in documentation. +% \foreignlanguage{french}{\emph{Correction d'erreurs dans la documentation.}}} +% \changes{v1.6}{2020/04/13}{Unification of lppl version in documentation. +% \foreignlanguage{french}{\emph{Unification de la version de la LPPL dans la +% documentation.}}} +% \changes{v1.6}{2020/07/29}{Replacement of obsolete macro \cs{c_one}. +% \foreignlanguage{french}{\emph{Remplacement de la macro obsolète \cs{c_one}.}}} % % \thispagestyle{empty} % @@ -167,9 +174,9 @@ La documentation française pour l'utilisateur de l'extension \section{The Macros} \label{sec:macros} -The \pkg{annee-scolaire} offers three main document macros which produce text in -the final document and one macro which is used to determine the presentation of -the said text. +\pkg{annee-scolaire} offers three main document macros which produce +text in the final document and one macro which is used to determine the +presentation of the said text. \subsection{Main Macros} \label{sec:main} @@ -243,7 +250,7 @@ See examples on page \pageref{sec:changelook}. \section{Les macros} \label{sec:macros} -L'extension \pkg{annee-scolaire} offrent quatre macros de document: trois macros +L'extension \pkg{annee-scolaire} offre quatre macros de document: trois macros principales produisant du texte et une macro, qui ne devrait être utilisée que rarement et peut-être même jamais, qui permet de changer la présentation du texte écrit. @@ -272,7 +279,7 @@ Comme son nom l'indique, cette macro donne l'année de début de l'année scolai \begin{function}{\finanneescolaire} \begin{syntax} - \cs{finanneescolaire}\oarg{shift} + \cs{finanneescolaire}\oarg{décalage} \end{syntax} \end{function} @@ -578,7 +585,7 @@ qui précède. Il ne viendra à l'esprit de personne d'y voir un encouragement \int_const:Nn \c_@@_Annee_Deb_int { \int_compare:nNnTF { 100*\the\month + \the\day } < { 100*\c_@@_Premier_Mois_int + \c_@@_Premier_Jour_int} - {\year - \c_one + \c_@@_Decalage_int} + {\year - 1 + \c_@@_Decalage_int} {\year + \c_@@_Decalage_int} } % \end{macrocode} @@ -587,7 +594,7 @@ qui précède. Il ne viendra à l'esprit de personne d'y voir un encouragement % \begin{variable}{\c_@@_Annee_Fin_int} % \begin{macrocode} \int_const:Nn \c_@@_Annee_Fin_int { - \c_@@_Annee_Deb_int + \c_one + \c_@@_Annee_Deb_int + 1 } % \end{macrocode} % \end{variable} diff --git a/macros/latex/contrib/annee-scolaire/annee-scolaire.ins b/macros/latex/contrib/annee-scolaire/annee-scolaire.ins index 88230a8ee8..de8c6d5e35 100644 --- a/macros/latex/contrib/annee-scolaire/annee-scolaire.ins +++ b/macros/latex/contrib/annee-scolaire/annee-scolaire.ins @@ -1,6 +1,6 @@ \iffalse meta-comment -File annee-scolaire.ins Copyright (C) 2019 Yvon Henel +File annee-scolaire.ins Copyright (C) 2019, 2020 Yvon Henel It may be distributed and/or modified under the conditions of the LaTeX Project Public License (LPPL), either version 1.3c of this @@ -9,10 +9,6 @@ of this license is in the file http://www.latex-project.org/lppl.txt -This file is part of the "l3trial bundle" (The Work in LPPL) -and all files in that bundle must be distributed together. - -The released version of this bundle is available from CTAN. \fi \input l3docstrip.tex @@ -33,15 +29,6 @@ Do not distribute a modified version of this file. \file{annee-scolaire.sty}{\from{annee-scolaire.dtx}{package}} \file{annee-scolaire-fra.tex}{\from{annee-scolaire.dtx}{doc,FRA}} \file{annee-scolaire-eng.tex}{\from{annee-scolaire.dtx}{doc,ENG}} - % % examples - % \file{annee-scolaire-test-fra.tex}{\from{annee-scolaire.dtx}{test,FRA}} - % \file{annee-scolaire-test-eng.tex}{\from{annee-scolaire.dtx}{test,ENG}} } -% \usedir{./testfiles} % ne marche pas comme attendu :( -% \generate{ -% \file{annee-scolaire-test.lvt}{\from{annee-scolaire.dtx}{lvt}} -% } - - \endbatchfile diff --git a/macros/latex/contrib/annee-scolaire/annee-scolaire.pdf b/macros/latex/contrib/annee-scolaire/annee-scolaire.pdf Binary files differindex 937f688ca2..1e6be40cd3 100644 --- a/macros/latex/contrib/annee-scolaire/annee-scolaire.pdf +++ b/macros/latex/contrib/annee-scolaire/annee-scolaire.pdf diff --git a/macros/latex/contrib/babel-contrib/german/README b/macros/latex/contrib/babel-contrib/german/README index f9189ba339..d929351078 100644 --- a/macros/latex/contrib/babel-contrib/german/README +++ b/macros/latex/contrib/babel-contrib/german/README @@ -21,7 +21,7 @@ This bundle is an extension to the babel package for multilingual typesetting. It provides all necessary macros, definitions and settings to typeset German documents. The bundle includes support for the traditional and reformed German orthography as well as for the Austrian -and Swiss varieties of German. +and Swiss (standard) varieties of German. == CONTENTS == diff --git a/macros/latex/contrib/babel-contrib/german/germanb.dtx b/macros/latex/contrib/babel-contrib/german/germanb.dtx index 4e8a344b55..21e0c78802 100644 --- a/macros/latex/contrib/babel-contrib/german/germanb.dtx +++ b/macros/latex/contrib/babel-contrib/german/germanb.dtx @@ -2,7 +2,7 @@ % % File `germanb.dtx' % -% Copyright 1989--2016 +% Copyright 1989--2020 % Johannes L. Braams % Bernd Raichle % Walter Schmidt @@ -25,7 +25,7 @@ % % The Current Maintainer of this work is Juergen Spitzmueller. % \fi -% \CheckSum{508} +% \CheckSum{513} % % \iffalse % Tell the \LaTeX\ system who we are and write an entry on the @@ -39,7 +39,7 @@ %<germanb>\ProvidesLanguage{germanb} %\fi %\ProvidesFile{germanb.dtx} - [2018/12/08 v2.11 German support for babel (pre-1996 orthography)] + [2020/07/21 v2.12 German support for babel (pre-1996 orthography)] %\iffalse % %<*filedriver> @@ -146,7 +146,7 @@ % % \begin{abstract} % \noindent This manual documents \babel\ language support for German (pre-1996 orthography), -% including support for the Austrian and Swiss varieties of German. +% including support for the Austrian and Swiss (standard) varieties of German. % The manual is part of the \textsf{babel-german} bundle. % \end{abstract} % @@ -154,7 +154,7 @@ % % The \babel\ `language definition file' \file{germanb.ldf} documented in this manual provides % the \babel\ package with all language specific strings, settings and commands needed for writing -% German texts, including texts in the Austrian and Swiss varieties of German, in \emph{traditional +% German texts, including texts in the Austrian and Swiss (standard) varieties of German, in \emph{traditional % (1901--1996) spelling}.\footnote{% % The file \file{germanb.ldf} started as a re-implementation of the % package \file{german.sty} (v.\,2.5b), which was originally @@ -286,7 +286,7 @@ % Modern engines (i.\,e., \texttt{xetex} and \texttt{luatex}) have already embraced those new patterns, i.\,e., they are activated on these engines by default. % The classic \TeX\ engines (\texttt{tex}\slash\texttt{pdftex}), however, haven't: they continue to use the old patterns. The reason for this is one % of \TeX's quality standards: refrain, if ever possible, from changing the output of user's documents in the wake of software updates. -% An exception is (pre-1996) Swiss German: here, the classic engines use the `experimental' patterns by default (since there were no patterns available +% An exception is (pre-1996) Swiss Standard German: here, the classic engines use the `experimental' patterns by default (since there were no patterns available % previously anyway). % % So you need to explicitly activate the new patterns for a given document (except for \Lopt{swissgerman}) with the classic engines, should you @@ -344,7 +344,7 @@ % \end{tabular} % \end{table} % -% \noindent One further note related to the use of \graph{ss} in Swiss German. As opposed to other consonantial letters, the \graph{s} +% \noindent One further note related to the use of \graph{ss} in Swiss Standard German. As opposed to other consonantial letters, the \graph{s} % is excluded from the three consonant rule (\emph{Dreikonsonantenregel}) of traditional German spelling which prescribes % that one of three identical consonants has to be omitted if a vowel follows the three consonants (i.\,e., \emph{Schiffahrt}, % not \emph{Schifffahrt}), except if the word is hyphenated (\emph{Schiff-fahrt}); the shorthands |"ff| etc. account for that. @@ -450,10 +450,10 @@ \ifx\CurrentOption\bbl@opt@swissgerman \ifx\l@swissgerman\@undefined \ifx\l@german\@undefined - \@nopatterns{Swiss German (trad. orthography) and German (trad. orthography)} + \@nopatterns{Swiss Standard German (trad. orthography) and German (trad. orthography)} \adddialect\l@swissgerman0 \else - \@nopatterns{Swiss German (trad. orthography)} + \@nopatterns{Swiss Standard German (trad. orthography)} \adddialect\l@swissgerman\l@german \fi \fi @@ -595,7 +595,7 @@ % % \begin{macro}{\dateswissgerman} % \changes{Version 2.7}{2013/12/13}{Added \cs{dateswissgerman}.} -% The macro |\dateswissgerman| does the same for Swiss German dates. It +% The macro |\dateswissgerman| does the same for Swiss Standard German dates. It % is only defined if \Lopt{swissgerman} is requested. % The result is identical to German. % \changes{Version 2.8}{2016/11/01}{Only define \cs{dateswissgerman} if @@ -676,13 +676,13 @@ % % \changes{Version 2.9a=Version 2.10}{2018/03/28}{Implement boolean switch % \cs{tosstrue}\slash\cs{tossfalse} to customize \graph{\ss}-related -% shorthands in Swiss German context.} +% shorthands in Swiss Standard German context.} % \changes{Version 2.9a=Version 2.10}{2018/03/28}{Implement modifier \Lopt{toss} -% to customize \graph{\ss}-related shorthands in Swiss German context.} +% to customize \graph{\ss}-related shorthands in Swiss Standard German context.} % \begin{macro}{toss} % \begin{macro}{\tosstrue} % \begin{macro}{\tossfalse} -% For Swiss German, we allow optionally to expand the \graph{\ss}-related +% For Swiss Standard German, we allow optionally to expand the \graph{\ss}-related % shorthands the Swiss way, i.\,e. as \graph{ss} (globally, if the modifier \Lopt{toss} % is used or locally if |\tosstrue|.). % \begin{macrocode} @@ -818,6 +818,13 @@ % \changes{Version 2.6a}{1995/02/15}{Use \cs{ddot} instead of % \cs{@MATHUMLAUT}} % +% Since we need to add special cases for hyperref which needs hyperref's |\texorpdfstring|, +% we provide a dummy command for the case that hyperref is not loaded. +% \changes{Version 2.9c=Version 2.12}{2020/07/21}{Properly handle shorthands in hyperref pdf strings} +% \begin{macrocode} +\providecommand\texorpdfstring[2]{#1} +% \end{macrocode} +% % Now we can define the doublequote shorthands: the umlauts, % \changes{Version 2.6c}{1996/05/30}{added the \cs{allowhyphens}} % \begin{macrocode} @@ -875,7 +882,10 @@ % \changes{Version 2.6f}{1998/06/15}{Copied the coding for \texttt{"f} % from german.dtx version 2.5d} % \begin{macrocode} -\declare@shorthand{german}{"f}{\textormath{\bbl@discff}{f}} +\declare@shorthand{german}{"f}{% + \texorpdfstring{\textormath{\bbl@discff}{f}}% TeX string + {f}% PDF string +} \def\bbl@discff{\penalty\@M \afterassignment\bbl@insertff \let\bbl@nextff= } \def\bbl@insertff{% @@ -893,10 +903,14 @@ % \begin{macrocode} \declare@shorthand{german}{"-}{\nobreak\-\bbl@allowhyphens} \declare@shorthand{german}{"|}{% - \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}% - \bbl@allowhyphens}{}} + \texorpdfstring{\textormath{\penalty\@M\discretionary{-}{}{\kern.03em}\bbl@allowhyphens}{}}% TeX string + {}% PDF string +} \declare@shorthand{german}{""}{\hskip\z@skip} -\declare@shorthand{german}{"~}{\textormath{\leavevmode\hbox{-}}{-}} +\declare@shorthand{german}{"~}{% + \texorpdfstring{\textormath{\leavevmode\hbox{-}}{-}}% tex string + {-}% PDF string +} \declare@shorthand{german}{"=}{\penalty\@M-\hskip\z@skip} \declare@shorthand{german}{"/}{\textormath {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}} diff --git a/macros/latex/contrib/babel-contrib/german/germanb.pdf b/macros/latex/contrib/babel-contrib/german/germanb.pdf Binary files differindex e52056aa87..90180b1e1e 100644 --- a/macros/latex/contrib/babel-contrib/german/germanb.pdf +++ b/macros/latex/contrib/babel-contrib/german/germanb.pdf diff --git a/macros/latex/contrib/babel-contrib/german/ngermanb.dtx b/macros/latex/contrib/babel-contrib/german/ngermanb.dtx index 01413286b9..5d8d045eb3 100644 --- a/macros/latex/contrib/babel-contrib/german/ngermanb.dtx +++ b/macros/latex/contrib/babel-contrib/german/ngermanb.dtx @@ -2,7 +2,7 @@ % % File `ngermanb.dtx' % -% Copyright 1989--2016 +% Copyright 1989--2020 % Johannes L. Braams % Bernd Raichle % Walter Schmidt @@ -29,7 +29,7 @@ % by Bernd Raichle, Hubert Partl et.al. % % \fi -% \CheckSum{403} +% \CheckSum{407} % % \iffalse % Tell the \LaTeX\ system who we are and write an entry on the @@ -43,7 +43,7 @@ %<ngermanb>\ProvidesLanguage{ngermanb} %\fi %\ProvidesFile{ngermanb.dtx} - [2018/12/08 v2.11 German support for babel (post-1996 orthography)] + [2020/07/21 v2.12 German support for babel (post-1996 orthography)] %\iffalse % %<*filedriver> @@ -103,7 +103,7 @@ % % \begin{abstract} % \noindent This manual documents \babel\ language support for German (post-1996 orthography), -% including support for the Austrian and Swiss varieties of German. +% including support for the Austrian and Swiss (standard) varieties of German. % The manual is part of the \textsf{babel-german} bundle. % \end{abstract} % @@ -111,7 +111,7 @@ % % The \babel\ `language definition file' \file{ngermanb.ldf} documented in this manual provides % the \babel\ package with all language specific strings, settings and commands needed for writing -% German texts, including texts in the Austrian and Swiss varieties of German.\footnote{% +% German texts, including texts in the Austrian and Swiss (standard) varieties of German.\footnote{% % The file \file{ngermanb.ldf} started as a re-implementation of the % package \file{ngerman.sty} by Bernd Raichle (cf.\,\cite{gerdoc}), % which itself builds on \file{german.sty}, originally developed by @@ -358,7 +358,7 @@ \fi \ifx\CurrentOption\bbl@opt@nswissgerman \ifx\l@ngerman\@undefined - \@nopatterns{German (new orthography), needed by Swiss German (new orthography)} + \@nopatterns{German (new orthography), needed by Swiss Standard German (new orthography)} \adddialect\l@nswissgerman0 \else \adddialect\l@nswissgerman\l@ngerman @@ -487,7 +487,7 @@ % % \begin{macro}{\datenswissgerman} % \changes{Version 2.7}{2013/12/13}{Added \cs{datenswissgerman}.} -% The macro |\datenswissgerman| does the same for Swiss German dates. +% The macro |\datenswissgerman| does the same for Swiss Standard German dates. % The result is identical to German. This macro is only defined if % \Lopt{nswissgerman} is requested. % \changes{Version 2.8}{2016/11/01}{Only define \cs{datenswissgerman} if @@ -554,13 +554,13 @@ % % \changes{Version 2.9a=Version 2.10}{2018/03/28}{Implement boolean switch % \cs{ntosstrue}\slash\cs{ntossfalse} to customize \graph{\ss}-related -% shorthands in Swiss German context.} +% shorthands in Swiss Standard German context.} % \changes{Version 2.9a=Version 2.10}{2018/03/28}{Implement modifier \Lopt{toss} -% to customize \graph{\ss}-related shorthands in Swiss German context.} +% to customize \graph{\ss}-related shorthands in Swiss Standard German context.} % \begin{macro}{toss} % \begin{macro}{\ntosstrue} % \begin{macro}{\ntossfalse} -% For Swiss German, we allow optionally to expand the \graph{\ss}-related +% For Swiss Standard German, we allow optionally to expand the \graph{\ss}-related % shorthands the Swiss way, i.\,e. as \graph{ss} (globally, if the modifier \Lopt{toss} % is used or locally if |\ntosstrue|.). % \begin{macrocode} @@ -673,6 +673,13 @@ % \end{macrocode} % \end{macro} % +% Since we need to add special cases for hyperref which needs hyperref's |\texorpdfstring|, +% we provide a dummy command for the case that hyperref is not loaded. +% \changes{Version 2.9c=Version 2.12}{2020/07/21}{Properly handle shorthands in hyperref pdf strings} +% \begin{macrocode} +\providecommand\texorpdfstring[2]{#1} +% \end{macrocode} +% % Now we can define the doublequote shorthands: the umlauts, % \begin{macrocode} \declare@shorthand{ngerman}{"a}{\textormath{\"{a}\bbl@allowhyphens}{\ddot a}} @@ -713,10 +720,14 @@ % \begin{macrocode} \declare@shorthand{ngerman}{"-}{\nobreak\-\bbl@allowhyphens} \declare@shorthand{ngerman}{"|}{% - \textormath{\penalty\@M\discretionary{-}{}{\kern.03em}% - \bbl@allowhyphens}{}} + \texorpdfstring{\textormath{\penalty\@M\discretionary{-}{}{\kern.03em}\bbl@allowhyphens}{}}% TeX string + {}% PDF string +} \declare@shorthand{ngerman}{""}{\hskip\z@skip} -\declare@shorthand{ngerman}{"~}{\textormath{\leavevmode\hbox{-}}{-}} +\declare@shorthand{ngerman}{"~}{% + \texorpdfstring{\textormath{\leavevmode\hbox{-}}{-}}% tex string + {-}% PDF string +} \declare@shorthand{ngerman}{"=}{\penalty\@M-\hskip\z@skip} \declare@shorthand{ngerman}{"/}{\textormath {\bbl@allowhyphens\discretionary{/}{}{/}\bbl@allowhyphens}{}} diff --git a/macros/latex/contrib/babel-contrib/german/ngermanb.pdf b/macros/latex/contrib/babel-contrib/german/ngermanb.pdf Binary files differindex 1bb41c513d..4b02945872 100644 --- a/macros/latex/contrib/babel-contrib/german/ngermanb.pdf +++ b/macros/latex/contrib/babel-contrib/german/ngermanb.pdf diff --git a/macros/latex/contrib/clefval/Changements b/macros/latex/contrib/clefval/Changements deleted file mode 100644 index ab87566fec..0000000000 --- a/macros/latex/contrib/clefval/Changements +++ /dev/null @@ -1,8 +0,0 @@ -CLEFVAL - -Version 0 - 2004-05-22 -Premire version publique - --- -Le \TeX nicien de surface -Yvon.Henel@wanadoo.fr
\ No newline at end of file diff --git a/macros/latex/contrib/clefval/Changes b/macros/latex/contrib/clefval/Changes deleted file mode 100644 index 0cfc923e99..0000000000 --- a/macros/latex/contrib/clefval/Changes +++ /dev/null @@ -1,8 +0,0 @@ -CLEFVAL - -Version 0 - 2004-05-22 -First public version - --- -Le \TeX nicien de surface -Yvon.Henel@wanadoo.fr
\ No newline at end of file diff --git a/macros/latex/contrib/clefval/LISEZMOI b/macros/latex/contrib/clefval/LISEZMOI deleted file mode 100644 index f6e77551c7..0000000000 --- a/macros/latex/contrib/clefval/LISEZMOI +++ /dev/null @@ -1,35 +0,0 @@ -CLEFVAL 0 2004-05-22 - -LISEZMOI % ce fichier -README -Changes -Makefile -clefval.dtx -clefval.pdf % documentation bilingue -clefval.ins % produit le module avec les messages en anglais -fra-cleval.ins % produit le module avec les messages en franais -exemple.tex % un exemple d'utilisation de engpron et clefval -exemple.pdf % -example.tex % la version anglaise du document prcdent -example.pdf % - -clefval.xml - - -clefval.sty, deux macros \TheKey et \TheValue pour dfinir puis -utiliser des paires clef/valeur. Ce module fournit une sorte de - hashage du pauvre ;-) - - -Pour produire le fichier clefval.sty, -avec les messages en franais, lancer : - -latex fra-clefval.ins - -Sous *nix, on peut utiliser le Makefile fourni, -make help -pour obtenir de l'aide. - --- -Le \TeX nicien de surface -Yvon.Henel@wanadoo.fr diff --git a/macros/latex/contrib/clefval/LISEZMOI.md b/macros/latex/contrib/clefval/LISEZMOI.md new file mode 100644 index 0000000000..ec6e67d603 --- /dev/null +++ b/macros/latex/contrib/clefval/LISEZMOI.md @@ -0,0 +1,42 @@ +<!-- Time-stamp: <2020-07-29 14:27:40 administrateur> --> +<!-- Création : 2020-07-28T17:22:37+0200 --> + +# clefval + +Auteurs : Yvon Henel, alias Le TeXnicien de surface +([contact](le.texnicien.de.surface@yvon-henel.fr)) +et Josselin Noirel. + +## LICENCE + +Le contenu de cette archive est placé sous la « LaTeX Project Public +License » version 1.3c ou postérieure. + +Voir https://www.latex-project.org/lppl.txt pour la licence. + +© 2020 Yvon Henel (Le TeXnicien de surface) + +## Description de l’extension + +`clefval.sty` fournit deux macros `\TheKey` et `\TheValue` pour +définir puis utiliser des paires clef/valeur. Ce module fournit une +sorte de « hashage » du pauvre ;-) + +### Exemples fournis + + * **example.pdf** depuis <kbd>example.tex</kbd>, version anglaise du suivant ; + * **exemple.pdf** depuis <kbd>exemple.tex</kbd> : fichier + *historique* codé en 8bit utilisant les extensions `engpron` et `clefval` ; + * **example-utf8.pdf** depuis <kbd>example-utf8.tex</kbd> avec <kbd>pdflatex</kbd>. Le + source peut être compilé avec <kbd>lualatex</kbd> ou <kbd>xelatex</kbd>. Les + pdf-s ainsi créés contiendront un texte supplémentaire car <kbd>pdflatex</kbd> + ne peut pas, par défaut, utiliser une clé écrite en cyrillique. + + +## Historique + +Version 0.1 — 2020-07-27 — adaptation aux sources codés en utf-8 + +Version 0 — 2004-05-22 — première version publique + + diff --git a/macros/latex/contrib/clefval/MANIFEST.md b/macros/latex/contrib/clefval/MANIFEST.md new file mode 100644 index 0000000000..aa9d4c6e1e --- /dev/null +++ b/macros/latex/contrib/clefval/MANIFEST.md @@ -0,0 +1,73 @@ +# Manifest for clefval + +This file is a listing of all files considered to be part of this package. +It is automatically generated with `texlua build.lua manifest`. + + +## Repository manifest + +The following groups list the files included in the development repository of the package. +Files listed with a ‘†’ marker are included in the TDS but not CTAN files, and files listed +with ‘‡’ are included in both. + +### Source files + +These are source files for a number of purposes, including the `unpack` process which +generates the installation files of the package. Additional files included here will also +be installed for processing such as testing. + +* clefval.dtx +* clefval.ins + +### Typeset documentation source files + +These files are typeset using LaTeX to produce the PDF documentation for the package. + +* clefval.dtx +* example-utf8.tex +* example.tex +* exemple.tex + +### Documentation files + +These files form part of the documentation but are not typeset. Generally they will be +additional input files for the typeset documentation files listed above. + +* LISEZMOI.md +* README.md + +### Text files + +Plain text files included as documentation or metadata. + +* LISEZMOI.md +* MANIFEST.md +* README.md + +### Derived files + +The files created by ‘unpacking’ the package sources. This typically includes +`.sty` and `.cls` files created from DocStrip `.dtx` files. + +* clefval.sty + +### Typeset documents + +The output files (PDF, essentially) from typesetting the various source, demo, +etc., package files. + +* clefval.pdf +* example-utf8.pdf +* example.pdf +* exemple.pdf + + +## TDS manifest + +The following groups list the files included in the TeX Directory Structure used to install +the package into a TeX distribution. + + +## CTAN manifest + +The following group lists the files included in the CTAN package. diff --git a/macros/latex/contrib/clefval/Makefile b/macros/latex/contrib/clefval/Makefile deleted file mode 100644 index 801ba0b9c4..0000000000 --- a/macros/latex/contrib/clefval/Makefile +++ /dev/null @@ -1,190 +0,0 @@ -# --------------------------------------------------------------- -# Makefile for the paresse package by Y. Henel -# modified version of the Makefile of the kerntest package -# many thanks to Harald Harders whose kerntest.xml I have also -# hacked to obtain my paresse.xml -# -# documentation bilingue / bilingual documentation -# --------------------------------------------------------------- - -SRCDIR=clefval -INSTALLDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/tex/latex/clefval -DOCDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/doc/latex/clefval -SOURCEDIR=`kpsewhich --expand-path='$$TEXMFLOCAL'`/source/latex/clefval -VERSION=0 - -TEX= clefval.sty \ - -DOC= clefval.pdf \ - - -FRADOC= \ - LISEZMOI \ - Changements \ - exemple.pdf \ - exemple.tex \ - -ENGDOC= \ - README \ - Changes \ - example.pdf \ - example.tex \ - -SOURCE= \ - Makefile \ - clefval.dtx \ - clefval.ins \ - fra-clefval.ins \ - -XML= clefval.xml \ - -# --------------------------------------------------------------- - -.SUFFIXES: .sty .ins .dtx .dvi .ps .pdf - -# --------------------------------------------------------------- -.ins.sty: - latex $< - -.dtx.pdf: - pdflatex $< - makeindex -s gind.ist $(*D)/$(*F) - makeindex -s gglo.ist -o $(*D)/$(*F).gls $(*D)/$(*F).glo - pdflatex $< - -.tex.pdf: - pdflatex $< - pdflatex $< - -.dvi.ps: - dvips -o $(*D)/$(*F).ps $(*D)/$(*F) - -# --------------------------------------------------------------- - -sty: - @-rm -f clefval.sty - @-latex clefval.ins - -eng-sty: sty - -fra-sty: - @-rm -f clefval.sty - @-latex fra-clefval.ins - -# --------------------------------------------------------------- - -help: - @-echo "******************************************************" - @-echo "* Choisir une des options :" - @-echo "= Choose one of the options:" - @-echo "* 'doc' -> clefval.pdf" - @-echo "* 'fra-sty' -> clefval.sty (version française du module)" - @-echo "* 'sty' -> clefval.sty (English version of the package)" - @-echo "* 'dist'-> clefval.sty & doc" - @-echo "* 'clean' petit nettoyage" - @-echo "* 'distclean' (encore plus propre)" - @-echo "* 'tar' -> clefval-VERSION.tar.gz" - @-echo "* 'install-fra' pour l'installation " - @-echo "* de l'extension francisée et de la documentation." - @-echo "************ OU / OR ***********" - @-echo "= 'install-eng' for an installation" - @-echo "= of the English version of package and documentation." - @-echo "************ NOTA BENE ***********" - @-echo "* l'installation est faite par defaut dans TEXMFLOCAL " - @-echo "= by default installs in TEXMFLOCAL" - @-echo "* c'est a dire :" - @-echo "* that is: " - @-echo `kpsewhich --expand-path='$$TEXMFLOCAL'` - @-echo "******************************************************" - -dist: sty clefval.pdf - -# --------------------------------------------------------------- - -clean: - @-rm -f clefval.glo clefval.gls clefval.idx clefval.ilg - @-rm -f clefval.ind clefval.aux clefval.log clefval.toc - @-rm -f fra-clefval.log - @-rm -f clefval.dvi clefval.ps - @-rm -f exemple.aux exemple.log exemple.dvi exemple.ps - @-rm -f example.aux example.log example.dvi example.ps - @-rm -f *~ - -distclean: clean - @-rm -f clefval.sty - @-rm -f clefval.pdf - -# --------------------------------------------------------------- - -tar: dist clean - echo clefval-$(VERSION).tar.gz - -rm -f clefval-$(VERSION).tar.gz - tar czCf .. clefval-$(VERSION).tar.gz \ - $(SRCDIR)/README \ - $(SRCDIR)/LISEZMOI \ - $(SRCDIR)/Changes \ - $(SRCDIR)/Changements \ - $(SRCDIR)/Makefile \ - $(SRCDIR)/clefval.dtx \ - $(SRCDIR)/clefval.sty \ - $(SRCDIR)/clefval.ins \ - $(SRCDIR)/fra-clefval.ins \ - $(SRCDIR)/clefval.pdf \ - $(SRCDIR)/exemple.pdf \ - $(SRCDIR)/example.pdf \ - $(SRCDIR)/exemple.tex \ - $(SRCDIR)/example.tex \ - $(SRCDIR)/clefval.xml - -# --------------------------------------------------------------- - -texlive: sty doc clean - @-rm -rf texmf - mkdir -p texmf/tex/latex/clefval - mkdir -p texmf/doc/latex/clefval - mkdir -p texmf/source/latex/clefval - mkdir -p texmf/doc/html/catalogue/entries - cp $(TEX) texmf/tex/latex/clefval - cp $(DOC) texmf/doc/latex/clefval - cp $(ENGDOC) texmf/doc/latex/clefval - cp $(FRADOC) texmf/doc/latex/clefval - cp $(SOURCE) texmf/source/latex/clefval - cp $(XML) texmf/doc/html/catalogue/entries - -# --------------------------------------------------------------- - -zip: texlive - -@rm -f clefval-$(VERSION).zip - zip -r clefval-$(VERSION).zip texmf - @-rm -r texmf/ - -# --------------------------------------------------------------- - -install-fra: fra-sty doc - if [ ! -d $(INSTALLDIR) ]; then mkdir -p $(INSTALLDIR); fi - if [ ! -d $(DOCDIR) ]; then mkdir -p $(DOCDIR); fi - if [ ! -d $(SOURCEDIR) ]; then mkdir -p $(SOURCEDIR); fi - install -m644 $(TEX) $(INSTALLDIR) - install -m644 $(DOC) $(DOCDIR) - install -m644 $(FRADOC) $(DOCDIR) - install -m644 $(SOURCE) $(SOURCEDIR) - texhash -# --------------------------------------------------------------- - -install-eng: eng-sty doc - if [ ! -d $(INSTALLDIR) ]; then mkdir -p $(INSTALLDIR); fi - if [ ! -d $(DOCDIR) ]; then mkdir -p $(DOCDIR); fi - if [ ! -d $(SOURCEDIR) ]; then mkdir -p $(SOURCEDIR); fi - install -m644 $(TEX) $(INSTALLDIR) - install -m644 $(DOC) $(DOCDIR) - install -m644 $(ENGDOC) $(DOCDIR) - install -m644 $(SOURCE) $(SOURCEDIR) - texhash -# --------------------------------------------------------------- - -install: install-eng - -doc: sty clefval.pdf -# --------------------------------------------------------------- -# echu e an abaden -# Le \TeX nicien de surface 2004-05-20 diff --git a/macros/latex/contrib/clefval/README b/macros/latex/contrib/clefval/README deleted file mode 100644 index bc1fc128f4..0000000000 --- a/macros/latex/contrib/clefval/README +++ /dev/null @@ -1,31 +0,0 @@ -CLEFVAL 01 2004-05-22 - -LISEZMOI -README % this file -Changes -Makefile -clefval.dtx -clefval.pdf % bilingual documentation -clefval.ins % for an English version (of the warnings) of the package -fra-celval.ins % for a French version (of the warnings) of the package -example.tex % an example of usage of engpron and clefval -example.pdf % -exemple.tex % the French version of above -exemple.pdf % -clefval.xml - - -clefval.sty provides two macros \TheKey and \TheValue to define then -use pairs of key/value and gives a semblance of hash. - - -To produce the clefval.sty file run: -latex clefval.ins - -*nix users should use the provided Makefile, run -make help -to obtain help. - --- -Le \TeX nicien de surface -Yvon.Henel@wanadoo.fr diff --git a/macros/latex/contrib/clefval/README.md b/macros/latex/contrib/clefval/README.md new file mode 100644 index 0000000000..1fe7a14bee --- /dev/null +++ b/macros/latex/contrib/clefval/README.md @@ -0,0 +1,41 @@ +<!-- Time-stamp: <2020-07-29 14:23:06 administrateur> --> +<!-- Création : 2020-07-28T17:22:37+0200 --> + +# clefval + +Authors: Yvon Henel, aka Le TeXnicien de surface +([contact](le.texnicien.de.surface@yvon-henel.fr)) +and Josselin Noirel. + +## LICENCE + +This material is subject to the LaTeX Project Public License, version +1.3c or later. + +See https://www.latex-project.org/lppl.txt +for the details of that license. + +© 2020 Yvon Henel (Le TeXnicien de surface) + +## Description of the Package + +`clefval.sty` provides two macros `\TheKey` and `\TheValue` to define +then use pairs of key/value and gives a semblance of hash. + +### Examples provided + + * **example.pdf** from <kbd>example.tex</kbd>, English version of the following. + * **exemple.pdf** from <kbd>exemple.tex</kbd> (French): 8bit encoded + legacy file using package `engpron` together with `clefval`. + * **example-utf8.pdf** from <kbd>example-utf8.tex</kbd> with <kbd>pdflatex</kbd>. The + source can also be processed with <kbd>lualatex</kbd> and <kbd>xelatex</kbd>. The + then created pdf-s will contain an additionnal text for <kbd>pdflatex</kbd> + cannot by default process a key written in cyrillic alphabet. + +## History + +Version 0.1 — 2020-07-27 — adapted to utf-8 encoded source + +Version 0 — 2004-05-22 — first public version + + diff --git a/macros/latex/contrib/clefval/clefval.dtx b/macros/latex/contrib/clefval/clefval.dtx index 67bbea73a8..d8cc603b7c 100644 --- a/macros/latex/contrib/clefval/clefval.dtx +++ b/macros/latex/contrib/clefval/clefval.dtx @@ -1,55 +1,51 @@ % \iffalse meta-comment -% -*- mode: LaTeX; coding: iso-8859-15 -*- % -%%%% Copyright (C) 2004 by Josselin Noirel -%%%% and Yvon Henel <Yvon.Henel@wanadoo.fr> +%%%% Copyright (C) 2004, 2020 by Josselin Noirel +%%%% and Yvon Henel aka Le TeXnicien de surface %%%% -------------------------------------------------------- % % This file may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.2 +% 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.2 or later is part of all distributions of LaTeX -% version 1999/12/01 or later. % \fi % % \iffalse %<package>\NeedsTeXFormat{LaTeX2e} -%<package>\def\fileversion{v0} -%<package>\def\filedate{2004/05/22} +%<package>\def\fileversion{v0.1} +%<package>\def\filedate{2020/07/27} %<packfra>\def\fileinfo{d\'efinir et utiliser des paires cle/valeurs} %<packeng>\def\fileinfo{define and use pair of key/values} %<package>\ProvidesPackage{clefval} %<package> [\filedate\space\fileversion\space\fileinfo] %<*driver> \documentclass[a4paper]{ltxdoc} -\usepackage[latin9]{inputenc} \usepackage[T1]{fontenc} \usepackage{clefval} \usepackage{xspace,url,multicol,ifthen} \IfFileExists{lmodern.sty}{\usepackage{lmodern}}{} -\usepackage[english,frenchb]{babel} +\usepackage[english, main=french]{babel} % commentez la ligne suivante pour avoir un document avec le code -\OnlyDescription +% \OnlyDescription % comment out the preceding line to obtain the full code % with explanations in French only, sorry. \EnableCrossrefs \CodelineIndex \RecordChanges \makeatletter -%%% quelques redfinition de commande de la classe ltxdoc.cls ou de -%%% l'extension doc.sty pour une documentation en franais. +%%% quelques redéfinition de commande de la classe ltxdoc.cls ou de +%%% l'extension doc.sty pour une documentation en français. \GlossaryPrologue{\section*{{Changements -- Changes}}\markboth{{Changements -- Changes}}{{Changements -- Changes}}} \IndexPrologue{\section*{Index}\markboth{Index}{Index}% \begin{Morciau}\selectlanguage{french} - Les nombres en italique renvoient la page o l'entre est dcrite ; les - nombres souligns renvoient la ligne de code de la dfinition ; les - nombres en caractres romains renvoient la ligne de code o l'entre est - utilise.\EnAnglais Numbers written in italic refer to the page where the + Les nombres en italique renvoient à la page où l'entrée est décrite ; les + nombres soulignés renvoient à la ligne de code de la définition ; les + nombres en caractères romains renvoient à la ligne de code où l'entrée est + utilisée.\EnAnglais Numbers written in italic refer to the page where the corresponding entry is described; numbers underlined refer to the code line of the definition; numbers in roman refer to the code line where the entry is used.\end{Morciau}} @@ -60,7 +56,7 @@ \special@index{environnements:\levelchar{% \string\ttfamily\space#1}\encapchar main}\@esphack} \makeatother -\def\generalname{Gnral} +\def\generalname{Général} %%% fin de la francisation \setlength{\columnseprule}{0.5pt} \setlength{\multicolsep}{6pt plus 2.0pt minus 1.5pt} @@ -109,7 +105,17 @@ % % \GetFileInfo{clefval.sty} % -% \changes{v0}{2004/05/20}{1\iere version publique.} +% \changes{v0}{2004/05/20}{1\iere version +% publique. \textit{\foreignlanguage{english}{1st public version.}}} +% \changes{v0.1}{2020/07/27}{Amélioration du message d'erreur dans le +% document. \textit{\foreignlanguage{english}{Improved error message +% in document.}}} +% \changes{v0.1}{2020/07/27}{Version permettant l'utilisation du +% codage utf-8 avec \texttt{pdflatex}, \texttt{lualatex} et +% \texttt{xelatex}. \textit{\foreignlanguage{english}{This version can +% be used in utf-8 encoded source with \texttt{pdflatex}, +% \texttt{lualatex} and \texttt{xelatex}.}}} + % % \DoNotIndex{\newcommand, \renewcommand, \providecommand,^^A % \def, \let,\csname, \endcsname, \afterassignment,^^A @@ -133,7 +139,8 @@ % \textsf{clefval}} % % \author{Le \TeX nicien de -% surface\thanks{\texttt{Yvon.Henel@wanadoo.fr}}\and Josselin Noirel} +% surface\thanks{\texttt{le.texnicien.de.surface@yvon-henel.fr}}\and +% Josselin Noirel} % % \maketitle % @@ -141,68 +148,96 @@ % \label{secIntro} % \noindent\textbf{Description}\DescribeMacro{\TheKey}\DescribeMacro{\TheValue} % \begin{Morciau}[Macros~publiques/Public~Macros] -% Deux macros \cs{TheKey} et \cs{TheValue} pour dfinir puis utiliser +% Deux macros \cs{TheKey} et \cs{TheValue} pour définir puis utiliser % des paires clef/valeur. % \EnAnglais % Two macros \cs{TheKey} and \cs{TheValue} to define then use pairs % of key/value. % \end{Morciau} % \begin{Morciau}[Syntaxe/Syntax] -% \cs{TheKey}\marg{cl}\marg{valeur} pour dfinir la \emph{valeur} -% associe la \emph{cl}, ne produit pas de texte ; -% \cs{TheValue}\marg{cl} pour insrer la \emph{valeur} associe la -% \emph{cl}. +% \cs{TheKey}\marg{clé}\marg{valeur} pour définir la \emph{valeur} +% associée à la \emph{clé}, ne produit pas de texte ; +% \cs{TheValue}\marg{clé} pour insérer la \emph{valeur} associée à la +% \emph{clé}. % \EnAnglais % \cs{TheKey}\marg{key}\marg{value} to define the \emph{value} % associated to the \emph{key}, does not produce text ; % \cs{TheValue}\marg{key} to insert the \emph{value} linked to the % \emph{key}. % \end{Morciau} +% +% +% \subsection{Version 0.1} +% +% \begin{Morciau} +% Edd \textsc{Barrett}, le 27 juillet 2020, a signalé sur +% \texttt{stackexchange} un problème lié à l'utilisation de +% \texttt{clefval}. C'est lui, également, qui a fourni un ECM et +% trouvé la cause dudit problème: la présence d'un espace insécable +% dans le fichier codé en \texttt{iso-8859-15} entrainait l'arrêt de +% \LaTeX{} avec le message: +% \EnAnglais +% On the 27th July 2020, Edd \textsc{Barrett} wrote on +% \texttt{stackexchange} about a problem linked to the use of +% \texttt{clefval}. He also wrote a MCE and found the cause of the +% said problem: an unbreakable space in the file encoded in +% \texttt{iso-8859-15} forced \LaTeX{} to stop with the following +% error message: +% \end{Morciau} +% +% \texttt{Package inputenc Error: Invalid UTF-8 byte "A0.} +% +% \begin{Morciau} +% Comme tout le travail avait été fait, il m'a été facile de +% corriger l'erreur dans le code. J'en ai profité pour faire +% apparaître, \emph{dans le document}, un message d'erreur plus +% explicite nommant la clé indéfinie et pour moderniser un peu cette +% extension. +% \EnAnglais +% As all the work was already done I easily wrote the correction in +% the code. I've taken the opportunity to make appear, \emph{in the +% document}, a more explicit error message in case of undefined key +% and to modernise a bit this package. +% \end{Morciau} +% % \section{Utilisation -- Usage} % -% \begin{Morciau}[Procd/Process] -% Le procd mis en uvre par ce module est le mme que celui des -% rfrences classiques de \LaTeX{} avec \cs{label} et \cs{ref}. Il +% \begin{Morciau}[Procédé/Process] +% Le procédé mis en œuvre par ce module est le même que celui des +% références classiques de \LaTeX{} avec \cs{label} et \cs{ref}. Il % faut donc deux compilations pour en voir l'effet. % \EnAnglais % \texttt{clefval} uses the process which \LaTeX's \cs{label} and \cs{ref} % use. You must therefore compile twice to obtain the full effect. % \end{Morciau} % \begin{Morciau} -% Lors de la 1\iere compilation, \cs{TheKey}\LB|{cl}|\LB|{valeur}| crit, -% dans le fichier \texttt{aux}, \cs{newkey}\LB|{cl}|\LB|{{valeur}}|. |cl| et -% |valeur| sont dvelopps moins qu'ils ne soient protgs soit pour avoir -% t dclars robustes (voir \cs{DeclareRobustCommand}) soit pour avoir t -% protgs (voir \cs{protect}) par vous. +% Lors de la 1\iere compilation, \cs{TheKey}\LB|{clé}|\LB|{valeur}| écrit, +% dans le fichier \texttt{aux}, \cs{newkey}\LB|{clé}|\LB|{valeur}|. |clé| et +% |valeur| sont développés à moins qu'ils ne soient protégés soit pour avoir +% été déclarés robustes (voir \cs{DeclareRobustCommand}) soit pour avoir été +% protégés (voir \cs{protect}) par vous. % \EnAnglais % During the 1st run of \LaTeX, \cs{TheKey}\LB|{key}|\LB|{value}| writes -% \cs{newkey}\LB|{key}|\LB|{{value}}| in the \texttt{aux} file. |key| +% \cs{newkey}\LB|{key}|\LB|{value}| in the \texttt{aux} file. |key| % and |value| are expanded unless they are protected since they have been % declared robust (see \cs{DeclareRobustCommand}) or since they have been % protected (see \cs{protect}) by you. % \end{Morciau} % \begin{Morciau} -% Lors de la 2\ieme compilation, aprs lecture du fichier \texttt{aux}, -% \cs{TheValue}|{cl}| crit |valeur|. +% Lors de la 2\ieme compilation, après lecture du fichier \texttt{aux}, +% \cs{TheValue}|{clé}| écrit |valeur|. % \EnAnglais % During the 2nd run, the \texttt{aux} file having been read, % \cs{TheValue}|{key}| writes |value|. % \end{Morciau} % \begin{Morciau}[Attention/Caution] % Les deux arguments de \cs{TheKey} sont \og mobiles \fg au sens de \LaTeX{} -% et il faudra donc parfois les protger. On crira donc -% \cs{TheKey}\LB\texttt{\{}\LB\cs{protect}|\(|\LB|2+3|\cs{protect}|\)|\LB\texttt{\}} si on -% ne veut pas d'ennuis ou, plus simplement, -% \cs{TheKey}\LB\texttt{\{}\LB|$|\LB|2+3|\LB|$|\LB\texttt{\}} \Sourire +% et il faudra donc parfois les protéger. % \EnAnglais % Both arguments of \cs{TheKey} are `moving' as \LaTeX{} defines it and we have % sometimes to protect them. -% -% So one will write -% \cs{TheKey}\LB\texttt{\{}\LB\cs{protect}|\(|\LB|2+3|\cs{protect}|\)|\LB\texttt{\}} -% to avoid troubles or, more easily, -% \cs{TheKey}\LB\texttt{\{}\LB|$|\LB|2+3|\LB|$|\LB\texttt{\}} \Sourire % \end{Morciau} +% % \begin{Morciau} % Par ailleurs, les arguments ne doivent pas contenir de saut de % paragraphe (\cs{par}) ---~ou tout autre truc interdit dans les @@ -212,29 +247,67 @@ % (\cs{par}) ---~or any other thingummy which is forbidden in the % arguments of a macro which is not \cs{long}. % \end{Morciau} +% +% \begin{Morciau}[Exemples/Examples] +% On peut écrire +% \EnAnglais +% On can write +% \end{Morciau} +% +% {\centering \TheKey{clou}{$2+5=7$}|\TheKey{clou}{$2+5=7$}| +% \TheKey{glue}{\(2+6=8\)}|\TheKey{glue}{\(2+6=8\)}| +% \par} +% +% \begin{Morciau} +% puis \EnAnglais then +% \end{Morciau} +% +% {\centering |\TheValue{clou}|, |\TheValue{glue}|\par} +% +% \begin{Morciau} +% pour obtenir \EnAnglais to obtain +% \end{Morciau} +% +% {\centering \TheValue{clou}, \TheValue{glue}.\par} +% +% \begin{Morciau} +% On peut utiliser |$2+3$| comme clé --- même si on ne voit pas +% pourquoi on le ferait --- mais \textbf{pas} |\(2+3\)|. Ce qui +% tient à la manière dont les commandes |\(| et |\)| ont été +% robustifiées. \emph{Ce n'est pas un bogue mais une fonctionnalité.} +% \EnAnglais +% On can use |$2+3$| as a key ---and I don't say that one should--- +% but \textbf{not} |\(2+3\)|. That is due to the way the macros |\(| +% and |\)| have been robustified. \emph{It's not a bug but a feature.} +% \end{Morciau} +% +% % \begin{Morciau}[Avertissements/Warnings] -% Le module signale les dfinitions multiples d'une mme clef et -% marque {\selectlanguage{english}\textbf{????}} l o l'on utilise -% \cs{TheValue}\LB|{clou}| alors que |clou| n'est pas dfinie comme +% Le module signale les définitions multiples d'une même clef et +% marque {\selectlanguage{english}\textbf{[?? clou ??]}} là où l'on utilise +% \cs{TheValue}\LB|{clou}| alors que |clou| n'est pas définie comme % clef. En cas d'erreur, le fichier \texttt{log} contient la ligne : % \EnAnglais % The package warns about multiple definitions of the same key and -% writes \textbf{????} where one used \cs{TheValue}\LB|{kew}| whereas +% writes \textbf{[?? kew ??]} where one used \cs{TheValue}\LB|{kew}| whereas % |kew| was not defined as a key. In case of error, the \texttt{log} % file contains the line: % \end{Morciau} % \noindent\hspace*{\stretch{1}}\texttt{LaTeX Warning: There were undefined -% references.}\hspace*{\stretch{1}} +% references.}\hspace*{\stretch{1}} +% +% \vspace{\baselineskip} +% % \begin{Morciau}[Remarque/Remark] % Josselin \textsc{Noirel} est intervenu efficacement, tant sur \fctt % que par courriel, pour corriger les modifications que j'avais fait -% subir au code tir de \texttt{ltxref} et \texttt{ltfiles}. C'est -% pour sa contribution dcisive qu'il est cit comme co-auteur de ce -% module. Qu'il trouve l l'expression de ma profonde gratitude. +% subir au code tiré de \texttt{ltxref} et \texttt{ltfiles}. C'est +% pour sa contribution décisive qu'il est cité comme co-auteur de ce +% module. Qu'il trouve là l'expression de ma profonde gratitude. % -% Cependant, j'assume l'entire responsabilit de la rdaction de -% cette documentation et de sa traduction ainsi que la paternit de -% l'ide d'utiliser le mcanisme des \cs{label} pour accder un +% Cependant, j'assume l'entière responsabilité de la rédaction de +% cette documentation et de sa traduction ainsi que la paternité de +% l'idée d'utiliser le mécanisme des \cs{label} pour accéder à un % \texttt{hashage} rudimentaire. % \EnAnglais % Josselin \textsc{Noirel} has efficiently helped me, on \fctt and by @@ -248,24 +321,56 @@ % having fathered the idea of using the \cs{label} mecanism to obtain % a rudimentary \texttt{hash}. % \end{Morciau} -% \hspace*{\stretch{1}}Le \TeX nicien de surface. \hspace*{0.125\linewidth} +% +% \vspace{\baselineskip} +% +% \begin{Morciau}[Version 0.1/Version 0.1] +% Cette version est compatible avec un fichier codé en utf-8 compilé +% avec \texttt{pdflatex}, \texttt{lualatex} ou \texttt{xelatex} +% d'après mes --- quelques --- essais. Si ce n'était pas le cas, +% n'hésitez pas à me signaler le problème. +% \EnAnglais +% This version is usable with a utf-8 encoded source run through +% \texttt{pdflatex}, \texttt{lualatex} or \texttt{xelatex} as it +% appears from my ---not very numerous--- trials. If it was not the +% case don't hesitate to contact me. +% \end{Morciau} +% +% \hspace*{\stretch{1}}Le \TeX nicien de +% surface. \hspace*{0.125\linewidth} +% +% \vspace{2\baselineskip} +% +% \begingroup +% \small +% \hspace*{\stretch{1}}\textbf{In memoriam Énola Néra}\hspace*{\stretch{1}} +% +% \begin{Morciau} +% Gentille chienne aimante et fidèle, compagne de plus de 10 ans que +% son cœur a laché le 27 juillet 2020. +% \EnAnglais +% Kind, loving and faithfull bitch, companion of more than 10 years +% whose heart stopped on the 27th July 2020. +% \end{Morciau} +% \endgroup +% % \StopEventually{} % \section{Le code} % \label{secCode} % % Le code comporte des balises utilisable par \texttt{DocStrip} avec -% lesquelles on peut produire une version francise ou une version +% lesquelles on peut produire une version francisée ou une version % anglaise de \NomDeModule{clefval}. Voir la documentation de % \texttt{DocStrip} pour de plus amples renseignements. % -% On dit boujour, en franais ou en anglais suivant la manire dont on -% a cr \NomDeModule{clefval}. Puis on entre dans le vif du +% On dit boujour, en français ou en anglais suivant la manière dont on +% a créé \NomDeModule{clefval}. Puis on entre dans le vif du % sujet. % -% Le code a d'abord t repris de \texttt{ltxref} mais j'avais +% Le code a d'abord été repris de \texttt{ltxref} mais j'avais % quelques ennuis avec les avertissements concernant les clefs non -% dfinies ou dfinies plusieurs fois. Josselin Noirel a bien voulu -% rpondre mon appel au secours sur \fctt. Le code qui suit est donc +% définies ou définies plusieurs fois. Josselin Noirel a bien voulu +% répondre à mon appel au secours sur \fctt. Le code qui suit est donc % la correction par Josselin de mes modifications du code de % \texttt{ltxref}, moyennant quoi, je signe \Sourire % @@ -273,30 +378,30 @@ %<*package> % \fi % \begin{macro}{\@setTheValue} -% Le code est copi sur celui de |\@setref| dans -% \texttt{ltxref}. Cette macro est appele par \cs{TheValue}. Elle -% vrifie que la clef appele existe. Si elle n'existe pas elle -% imprime {\selectlanguage{english}\textbf{????}} et place un +% Le code est copié sur celui de |\@setref| dans +% \texttt{ltxref}. Cette macro est appelée par \cs{TheValue}. Elle +% vérifie que la \meta{clef} appelée existe. Si elle n'existe pas elle +% imprime {\selectlanguage{english}\textbf{[?? \meta{clef} ??]}} et place un % avertissement dans le \texttt{log}. Sinon elle rend son premier % argument. % % On utilise |\G@refundefinedtrue| pour provoquer le message d'erreur % \og There were undefined references \fg. Un peu sybillin pour ce qui -% nous concerne, il a l'avantage d'tre reconnu par au moins +% nous concerne, il a l'avantage d'être reconnu par au moins % \texttt{emacs} plus \texttt{Auctex} et d'indiquer qu'il faut % relancer la compilation. % \begin{macrocode} \newcommand*{\@setTheValue}[2]{% \ifx#1\relax \protect\G@refundefinedtrue - \nfss@text{\reset@font\bfseries????}% + \nfss@text{\reset@font\bfseries[?? #2 ??]}% % \end{macrocode} % \end{macro} % \iffalse %</package> %<*packfra> % \fi -% \textsf{Messages d'avertissement en franais} +% \textsf{Messages d'avertissement en français} % \begin{macrocode} \@latex@warning{Valeur de #2 en page \thepage\space non d\'efinie}% % \end{macrocode} @@ -316,16 +421,16 @@ \else #1\null \fi} % \end{macrocode} % \begin{macro}{\TheValue} -% Le code est copi sur celui de |\ref| dans \texttt{ltxref}. Si +% Le code est copié sur celui de |\ref| dans \texttt{ltxref}. Si % l'argument de \cs{TheValue} est une clef valide, on obtient la -% valeur rfrence par cette clef. +% valeur référencée par cette clef. % \begin{macrocode} \newcommand*{\TheValue}[1]{\expandafter\@setTheValue\csname V@#1\endcsname{#1}} % \end{macrocode} % \end{macro} % \begin{macro}{\@newk@ey} -% Le code est copi sur celui de |\@newl@bel| dans \texttt{ltxref}. +% Le code est copié sur celui de |\@newl@bel| dans \texttt{ltxref}. % \begin{macrocode} \newcommand*{\@newk@ey}[3]{{% \@ifundefined{#1@#2}% @@ -337,7 +442,7 @@ %</package> %<*packfra> % \fi -% \textsf{Messages d'avertissement en franais} +% \textsf{Messages d'avertissement en français} % \begin{macrocode} \@latex@warning@no@line{Des clefs sont d\'efinies plusieurs fois.}}% \@latex@warning@no@line{La clef #2 est d\'efinie plusieurs fois}}% @@ -359,7 +464,7 @@ \global\@namedef{#1@#2}{#3}}} % \end{macrocode} % \begin{macro}{\newkey} -% On opre ici une puissante magie qui fait que tout marche comme +% On opère ici une puissante magie qui fait que tout marche comme % attendu \Sourire % \begin{macrocode} \def\newkey{\@newk@ey V} @@ -372,16 +477,16 @@ % ^^A fin du code de Josselin Noirel %<*package> % \fi -% partir d'ici votre serviteur s'est dbrouill tout seul pour +% À partir d'ici votre serviteur s'est débrouillé tout seul pour % modifier le code des bases de \LaTeX. % % \begin{macro}{\@protected@write} -% Le code est copi sur celui de |\protected@write| dfini dans -% \texttt{ltfiles}. On n'a besoin que d'un seul argument qui est crit -% dans le fichier |\@auxout| c--d. le fichier \texttt{aux}. -% La macro prend soin de ce qui est protg soit de manire dfinitive -% pour avoir t dfini par \cs{DeclareRobustCommand} et ses petits -% amis, soit pour tre prcd de \cs{protect} comme on doit le faire +% Le code est copié sur celui de |\protected@write| défini dans +% \texttt{ltfiles}. On n'a besoin que d'un seul argument qui est écrit +% dans le fichier |\@auxout| c-à-d. le fichier \texttt{aux}. +% La macro prend soin de ce qui est protégé soit de manière définitive +% pour avoir été défini par \cs{DeclareRobustCommand} et ses petits +% amis, soit pour être précédé de \cs{protect} comme on doit le faire % parfois pour les arguments \og mobiles \fg (\emph{moving % argument}). % \begin{macrocode} @@ -394,9 +499,9 @@ % \end{macrocode} % \end{macro} % \begin{macro}{\@multiplekeys} -% En mettant |\@multiplekeys| \cs{relax}, on s'assure qu'il n'y aura -% pas de hurlements alors que rien n'est encore dfini et donc encore -% moins dfini plusieurs fois \Sourire +% En mettant |\@multiplekeys| à \cs{relax}, on s'assure qu'il n'y aura +% pas de hurlements alors que rien n'est encore défini et donc encore +% moins défini plusieurs fois \Sourire % \begin{macrocode} \let \@multiplekeys \relax % \end{macrocode} @@ -404,7 +509,7 @@ % \begin{macro}{\TheKey} % Le code remprend celui de \cs{label} mais il nous faut deux % arguments, le 1\ier pour la clef, le 2\textsuperscript{nd} pour la -% valeur associe. +% valeur associée. % \begin{macrocode} \def\TheKey#1#2{{\@bsphack \@protected@write{\string\newkey{#1}{#2}}% diff --git a/macros/latex/contrib/clefval/clefval.ins b/macros/latex/contrib/clefval/clefval.ins index a5f33524c3..ab1da62243 100644 --- a/macros/latex/contrib/clefval/clefval.ins +++ b/macros/latex/contrib/clefval/clefval.ins @@ -1,37 +1,32 @@ -%%% 2004-05-22 +%% 2020-07-27 %% -%% Copyright (C) 2004 by Yvon Henel Le TeXnicien de surface -%% <Yvon.Henel@wanadoo.fr> +%% Copyright (C) 2004, 2020 by Yvon Henel Le TeXnicien de surface +%% <le.texnicien.de.surface@yvon-henel.fr> %% %% This file may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version -%% 1999/12/01 or later. -%% \input docstrip.tex \keepsilent \preamble This is a generated file. -Copyright (C) 2004 Y. Henel, le TeXnicien de surface -<Yvon.Henel@wanadoo.fr> +Copyright (C) 2004, 2020 Y. Henel, le TeXnicien de surface +<le.texnicien.de.surface@yvon-henel.fr> This file may be distributed and/or modified under the conditions of -the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version -1999/12/01 or later. \endpreamble -%%% for English warnings : +%%% for English warnings: \generate{\file{clefval.sty}{\from{clefval.dtx}{package,packeng}}} \Msg{***************************************************************} diff --git a/macros/latex/contrib/clefval/clefval.pdf b/macros/latex/contrib/clefval/clefval.pdf Binary files differindex f4535d6385..61e0c1c986 100644 --- a/macros/latex/contrib/clefval/clefval.pdf +++ b/macros/latex/contrib/clefval/clefval.pdf diff --git a/macros/latex/contrib/clefval/example-utf8.pdf b/macros/latex/contrib/clefval/example-utf8.pdf Binary files differnew file mode 100644 index 0000000000..493ee8ed6d --- /dev/null +++ b/macros/latex/contrib/clefval/example-utf8.pdf diff --git a/macros/latex/contrib/clefval/example-utf8.tex b/macros/latex/contrib/clefval/example-utf8.tex new file mode 100644 index 0000000000..7e39691afc --- /dev/null +++ b/macros/latex/contrib/clefval/example-utf8.tex @@ -0,0 +1,101 @@ +% Time-stamp: <2020-07-29 12:47:56 administrateur> +% Création : 2020-07-28T12:21:18+0200 +%% ========================================================================= +%% Part of the `clefval' package. +%% Ce fichier fait partie de l'extension « clefval » +%% +%% 2020-07-27; v0.1 +%% +%% Copyright (C) 2004, 2020 by Yvon Henel Le TeXnicien de surface +%% <le.texnicien.de.surface@yvon-henel.fr> +%% +%% This file may be distributed and/or modified under the 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 +%% ======================================================================== +\documentclass{article} +\usepackage{clefval} +\usepackage{iftex} +\usepackage[french,main=english]{babel} + +\ifpdftex +\else +\usepackage{fontspec} +\setmainfont{DejaVu Serif} +\setsansfont{DejaVu Sans} +\setmonofont{DejaVu Sans Mono} +\fi + +\TheKey{j}{Joe} +\TheKey{éçà@§}{bizarre} +\TheKey{Разбрах}{in bulgarian: Благодаря за помощта} + +\begin{document} +\bgroup +\setlength{\parindent}{0pt} +\noindent\hrulefill +\vspace{0.5\baselineskip} + +\textbf{English} + +Cast a glance to the source to see some examples of \textbf{clefval} +usage. + +This file can be processed with \texttt{pdflatex}, \texttt{lualatex} +or \texttt{xelatex}. + +\vspace{0.5\baselineskip} +\noindent\hrulefill +\vspace{0.5\baselineskip} + +\begin{otherlanguage}{french} + \textbf{Français} + + Jetez un œil sur le source pour voir quelques exemples d'utilisation + de \textbf{clefval}. + + On peut compiler ce document avec \texttt{pdflatex}, \texttt{lualatex} + ou \texttt{xelatex}. +\end{otherlanguage} + +\vspace{0.5\baselineskip} +\noindent\hrulefill +\egroup + +\vspace{\baselineskip} + +\(\ast\)\TheKey{}{void key}% +% without the `%' character there's a spurious blank +% sans le caractère « % » un espace superflu apparait +\TheKey{Chip and Dale}{two anthropomorphic \emph{chipmunk} brothers}\(\ast\) + +\TheValue{j} + +\TheValue{k} + +\TheValue{éçà@§} + +\ifpdftex \else \TheValue{Разбрах} \fi +% pdflatex doesn't know what to do with that key ;) +% pdflatex ne sait pas quoi faire de cette clé ;) + +\TheValue{} + +\TheValue{Chip and Dale} + +\TheKey{$2+3=5$}{interresting equality \(2+3=5\)} +\TheValue{$2+3=5$} +% we can use $...$ but not \(...\) as a key +% on peut utiliser $...$ mais pas \(...\) comme clé + +\end{document} + +%%% Local Variables: +%%% coding: utf-8 +%%% TeX-engine: default +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/macros/latex/contrib/clefval/example.pdf b/macros/latex/contrib/clefval/example.pdf Binary files differindex f1ff324485..1ed2c15c3d 100644 --- a/macros/latex/contrib/clefval/example.pdf +++ b/macros/latex/contrib/clefval/example.pdf diff --git a/macros/latex/contrib/clefval/example.tex b/macros/latex/contrib/clefval/example.tex index f2dcc48838..c24bc874f4 100644 --- a/macros/latex/contrib/clefval/example.tex +++ b/macros/latex/contrib/clefval/example.tex @@ -1,4 +1,17 @@ -% -*- mode: LaTeX; coding: iso-8859-15 -*- +%% Part of the `clefval' package. +%% +%% 2020-07-27; v0.1 +%% +%% Copyright (C) 2004, 2020 by Yvon Henel Le TeXnicien de surface +%% <le.texnicien.de.surface@yvon-henel.fr> +%% +%% This file may be distributed and/or modified under the 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 +%% ======================================================================== \documentclass[a4paper,10pt]{article} \usepackage[latin9]{inputenc} \usepackage[T1]{fontenc} @@ -88,7 +101,8 @@ Content of the \texttt{aux} file (extract) : \vspace*{\stretch{1}} \end{document} -%%% Local Variables: +%%% Local Variables: +%%% coding: iso-8859-15 %%% mode: latex %%% TeX-master: t %%% End: diff --git a/macros/latex/contrib/clefval/exemple.pdf b/macros/latex/contrib/clefval/exemple.pdf Binary files differindex 27a8f27f95..a605643b70 100644 --- a/macros/latex/contrib/clefval/exemple.pdf +++ b/macros/latex/contrib/clefval/exemple.pdf diff --git a/macros/latex/contrib/clefval/exemple.tex b/macros/latex/contrib/clefval/exemple.tex index 11d24c5a8d..6159784d35 100644 --- a/macros/latex/contrib/clefval/exemple.tex +++ b/macros/latex/contrib/clefval/exemple.tex @@ -1,4 +1,18 @@ -% -*- mode: LaTeX; coding: iso-8859-15 -*- +%% Part of the `clefval' package. +%% Ce fichier fait partie de l'extension clefval +%% +%% 2020-07-27; v0.1 +%% +%% Copyright (C) 2004, 2020 by Yvon Henel Le TeXnicien de surface +%% <le.texnicien.de.surface@yvon-henel.fr> +%% +%% This file may be distributed and/or modified under the 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 +%% ======================================================================== \documentclass[a4paper,10pt]{article} \usepackage[latin9]{inputenc} \usepackage[T1]{fontenc} @@ -92,6 +106,7 @@ Contenu du fichier \texttt{aux} (extrait) : \end{document} %%% Local Variables: +%%% coding: iso-8859-15 %%% mode: latex %%% TeX-master: t %%% End: diff --git a/macros/latex/contrib/clefval/fra-clefval.ins b/macros/latex/contrib/clefval/fra-clefval.ins deleted file mode 100644 index 8471c591ea..0000000000 --- a/macros/latex/contrib/clefval/fra-clefval.ins +++ /dev/null @@ -1,58 +0,0 @@ -%%% 2004-05-22 -%% -%% Copyright (C) 2004 by Yvon Henel Le TeXnicien de surface -%% <Yvon.Henel@wanadoo.fr> -%% -%% This file may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version -%% 1999/12/01 or later. -%% -\input docstrip.tex -\keepsilent -\preamble -This is a generated file. - -Copyright (C) 2004 Y. Henel, le TeXnicien de surface -<Yvon.Henel@wanadoo.fr> - -This file may be distributed and/or modified under the conditions of -the LaTeX Project Public License, either version 1.2 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.2 or later is part of all distributions of LaTeX version -1999/12/01 or later. -\endpreamble -%%% pour messages en fran\c cais : -\generate{\file{clefval.sty}{\from{clefval.dtx}{package,packfra}}} - -\Msg{****************************************************************} -\Msg{*} -\Msg{* VERSION FRANAISE :: FRENCH VERSION} -\Msg{*} -\Msg{* Pour finir l'installation vous devez placer} -\Msg{* le fichier suivant dans un rpertoire parcouru par TeX.} -\Msg{*} -\Msg{* \space\space clefval.sty} -\Msg{*} -\Msg{* Pour produire la documentation (bilingue) faire : } -\Msg{* pdflatex clefval.dtx} -\Msg{* makeindex -s gind clefval } -\Msg{* makeindex -s gglo -o clefval.gls clefval.glo} -\Msg{* pdflatex clefval.dtx} -\Msg{*} -\Msg{* puis placez clefval.pdf dans un rpertoire de documentation} -\Msg{* comme par exemple texmf-local/doc/latex/clefval} -\Msg{*} -\Msg{********************* TeXez dans la joie ! *********************} -\Msg{****************************************************************} - -\endbatchfile diff --git a/macros/latex/contrib/popupmenu/README b/macros/latex/contrib/popupmenu/README deleted file mode 100644 index 16256c5097..0000000000 --- a/macros/latex/contrib/popupmenu/README +++ /dev/null @@ -1,19 +0,0 @@ -The popupmenu Package - -popupmenu is a LaTeX package used to create a menu structure. This -menu structure (an array of menu items) is passed to the Acrobat -JavaScript method app.popUpMenuEx() method to create a popup menu. -Using the environments defined in this package, and the command -\popUpMenu, you can create and display hierarchical menus. The menu -items can have JavaScript actions associated with them, they can be -marked and dis-enabled. - -The package requires only hyperref. Thus, users of pdftex, dvipdfm, -and dvips can use this package. Two examples are included in the -distribution, additional examples can be found at the AeB Blog - - http://www.math.uakron.edu/~dpstory/aebblog.html - - -D. P. Story -09/27/2010 diff --git a/macros/latex/contrib/popupmenu/README.md b/macros/latex/contrib/popupmenu/README.md new file mode 100644 index 0000000000..f60d94df47 --- /dev/null +++ b/macros/latex/contrib/popupmenu/README.md @@ -0,0 +1,18 @@ +The popupmenu Package +Dated: 2020-07-26 + +popupmenu is a LaTeX package used to create a menu structure. This +menu structure (an array of menu items) is passed to the Acrobat +JavaScript method app.popUpMenuEx() method to create a popup menu. +Using the environments defined in this package, and the command +\popUpMenu, you can create and display hierarchical menus. + +Workflows supported: pdflatex, lualatex, xelatex, +dvips-><distiller|ps2pdf>. + +What's New 2020-07-26: Defined the tracking option and the +\puProcessMenu command to track menu selections. Other +improvements and bug fixes were made. + +D. P. Story +2020-07-29 diff --git a/macros/latex/contrib/popupmenu/docs/popupmenu-man.pdf b/macros/latex/contrib/popupmenu/docs/popupmenu-man.pdf Binary files differnew file mode 100644 index 0000000000..b498159c13 --- /dev/null +++ b/macros/latex/contrib/popupmenu/docs/popupmenu-man.pdf diff --git a/macros/latex/contrib/popupmenu/docs/popupmenu-man.tex b/macros/latex/contrib/popupmenu/docs/popupmenu-man.tex new file mode 100644 index 0000000000..150fc84c26 --- /dev/null +++ b/macros/latex/contrib/popupmenu/docs/popupmenu-man.tex @@ -0,0 +1,685 @@ +\documentclass{article} +\usepackage[fleqn]{amsmath} +\usepackage[ + web={centertitlepage,designv,tight*,usetemplates, + forcolorpaper,latextoc,pro},%usesf, + eforms,aebxmp +]{aeb_pro} +%\usepackage{multicol} +%\usepackage{aeb_mlink} +\usepackage[tracking]{popupmenu} +\usepackage{array} +\usepackage[altbullet]{lucidbry} + +%\previewOn + +\usepackage{makeidx} +\makeindex +\usepackage{acroman} + +\leftmargini\parindent + + +\usepackage[active]{srcltx} + +\urlstyle{rm} +\let\tops\texorpdfstring +\let\pkg\textsf +\let\app\textsf +\let\opt\texttt +\let\uif\textsf +\let\env\texttt +\def\meta#1{\textit{\texttt{#1}}} +\def\ameta#1{$\langle\textit{\texttt{#1}}\rangle$} +\newdimen\aebdimen \aebdimen6pt %\partopsep \advance\aebdimen\partopsep +\newcommand\bVerb[1][]{\begingroup#1\vskip\aebdimen\parindent0pt}% +\def\eVerb{\vskip\aebdimen\endgroup\noindent} +\def\SUB#1{\ensuremath{{}_{\text{#1}}}} +\def\darg#1{\texttt{\{#1\}}} +\def\takeMeasure{\bgroup\obeyspaces\takeMeasurei} +\def\takeMeasurei#1{\global\setbox\webtempboxi\hbox{\ttfamily#1}\egroup} +\def\bxSize{\wd\webtempboxi+2\fboxsep+2\fboxrule} +\let\amtIndent\leftmargini +\makeatletter +\def\setDisplayNumber#1#2{\kern0pt + \setlength\abovedisplayshortskip{0pt}% + \setlength\belowdisplayshortskip{0pt}% + \setlength\abovedisplayskip{0pt}% + \setlength\belowdisplayskip{0pt}% + \begin{equation}\label{#2}\end{equation}\kern0pt +} +\renewenvironment{quote}[1][] + {\def\@rgi{#1}\ifx\@rgi\@empty + \let\rghtm\@empty\else\def\rghtm{\rightmargin\leftmargin}\fi + \list{}{\rghtm} %{\rightmargin\leftmargin}% + \item\relax} + {\endlist} +\renewcommand*\descriptionlabel[1]{\hspace\labelsep + \normalfont #1} +\setcounter{secnumdepth}{4} +\setcounter{tocdepth}{5} +\renewcommand*{\theparagraph}{\texorpdfstring{\protect\P\protect\ }{\textparagraph}} +\renewcommand{\paragraph} + {\renewcommand{\@seccntformat}[1]{\theparagraph}% + \@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\bfseries}} %\color{\aeb@subsubsectioncolor} +\renewcommand*\l@paragraph{\@dottedtocline{4}{5.0em}{1em}} %{7.0em}{4.1em}} +\def\chgCurrLblName#1{\def\@currentlabelname{#1}} +\def\echgCurrLblName#1{\edef\@currentlabelname{#1}} +\makeatother + +\reversemarginpar +\def\FmtMP#1{\marginpar{\slshape\raggedleft\small#1}} + + +\newcommand{\YT}{\textsf{YouTube}} + + +%\def\tutpath{doc/tutorial} +%\def\tutpathi{tutorial} + +\DeclareDocInfo +{ + university={\AcroTeX.Net}, + title={The manual for the \tops{\protect\pkg}{}{popupmenu} package}, +% title={The \texorpdfstring{\textsf{popupmenu} Package\\[1em]}{: } +% Create popup-menus to perform actions}, + author={D. P. Story}, + email={dpstory@acrotex.net}, + subject={Creating popup-menues}, + talksite={\url{www.acrotex.net}}, + version={1.2, 2020/07/26}, + keywords={AcroTeX, PDF, popup-menus, JavaScript}, + copyrightStatus=True, + copyrightNotice={Copyright (C) \the\year, D. P. Story}, + copyrightInfoURL={http://www.acrotex.net} +} + +\def\dps{$\hbox{$\mathfrak D$\kern-.3em\hbox{$\mathfrak P$}% + \kern-.6em \hbox{$\mathcal S$}}$} + +\universityLayout{fontsize=Large} +\titleLayout{fontsize=LARGE} +\authorLayout{fontsize=Large} +\tocLayout{fontsize=Large,color=aeb} +\sectionLayout{indent=-40pt,fontsize=large,color=aeb} %,afterskip=1sp} +\subsectionLayout{indent=-20pt,color=aeb} %,afterskip=1sp} +\subsubsectionLayout{indent=0pt,color=aeb} %,afterskip=1sp} +\subsubDefaultDing{\texorpdfstring{$\bullet$}{\textrm\textbullet}} + +\def\thispkg{\pkg{popupmenu}} + +\let\tops\texorpdfstring +\newenvironment{eqComments}[1][\strut]{\smallskip\leftskip-\labelwidth +\item[]\textbf{\textcolor{blue}{#1}}}{\par\smallskip} + +\begin{popupmenu}{Intro} + \item{title=title,return=Title: The manual for the popupmenu package} + \item{title=author,return=Author: D. P. Story} + \item{title=package name,return=Package: popupmenu} +\end{popupmenu} + +\urlPath{\homeAtUA}{http://www.math.uakron.edu/~dpstory} +\urlPath{\homeAeB}{http://www.acrotex.net} +\urlPath{\blogAeB}{http://blog.acrotex.net} +\urlPath{\urlCTAN}{https://www.ctan.org} +\urlPath{\embedYT}{http://www.youtube.com/embed} +\urlPath{\watchYT}{http://www.youtube.com/watch?v} +\begin{popupmenu}{Various} + \item{title=Various AcroTeX Links,return=none} + \item{title=-} + \begin{submenu}{title=AeB at U of Akron} + \item{title=Home page,return=\homeAtUA/acrotex.html} + \item{title=Tutorials,return=\homeAtUA/acrotex.html\#educational} + \end{submenu} + \begin{submenu}{title=Commercial AcroTeX} + \item{title=AcroTeX main page,return=\homeAeB} + \item{title=AcroTeX blog,return=\blogAeB} + \end{submenu} + \begin{submenu}{title=AcroTeX on CTAN} + \item{title=Contributions: AcroTeX ,return=\urlCTAN/author/story} + \item{title=The popupmenu Package,return=\urlCTAN/pkg/popupmenu} + \end{submenu} + \begin{submenu}{title=YouTube Videos} + \begin{submenu}{title=Action Videos} + \item{title=Kung-Fu fighting (Bruce Lee version),return=\embedYT/GZ9e3Dy7obA} + \item{title=Rocket Jump,return=\embedYT/7XzdZ4KcI8Y} + \end{submenu} + \begin{submenu}{title=Miscellaneous} + \item{title=J\"{u}rgen's favorite song,return={\watchYT=mLDF5MBMWHE}} + \item{title=\Esc"Sea Hunt\Esc" US TV series (1958-61) lead-in,return=\embedYT/Lz0aMoWh8Q4} + \item{title=Learn \cs{LaTeX} in one video,return=\embedYT/VhmkLrOjLsw} + \end{submenu} + \end{submenu} +\end{popupmenu} + +\puUseMenus{Intro,Various} + +\chngDocObjectTo{\newDO}{doc} +\begin{docassembly} +var titleOfManual="The popupmenu MANUAL"; +var manualfilename="Manual_BG_Print_popupmenu.pdf"; +var manualtemplate="Manual_BG_Brown.pdf"; // Blue, Green, Brown +var _pathToBlank="C:/Users/Public/Documents/ManualBGs/"+manualtemplate; +var doc; +var buildIt=false; +if ( buildIt ) { + console.println("Creating new " + manualfilename + " file."); + doc = \appopenDoc({cPath: _pathToBlank, bHidden: true}); + var _path=this.path; + var pos=_path.lastIndexOf("/"); + _path=_path.substring(0,pos)+"/"+manualfilename; + \docSaveAs\newDO ({ cPath: _path }); + doc.closeDoc(); + doc = \appopenDoc({cPath: manualfilename, oDoc:this, bHidden: true}); + f=doc.getField("ManualTitle"); + f.value=titleOfManual; + doc.flattenPages(); + \docSaveAs\newDO({ cPath: manualfilename }); + doc.closeDoc(); +} else { + console.println("Using the current "+manualfilename+" file."); +} +var _path=this.path; +var pos=_path.lastIndexOf("/"); +_path=_path.substring(0,pos)+"/"+manualfilename; +\addWatermarkFromFile({ + bOnTop:false, + bOnPrint:false, + cDIPath:_path +}); +\executeSave(); + +\end{docassembly} + +\begin{document} + +\maketitle + +\selectColors{linkColor=black} +\tableofcontents +\selectColors{linkColor=webgreen} + +\section{Introduction}\label{s:intro} + +Acrobat JavaScript has an interesting function, \texttt{app.popUpMenuEx()}, +that we exploit in this package. The function takes as its argument an array +of structured menu items and displays these items as a pop-up menu. When an +item is selected, a value is returned, which can then be acted upon in some +way. Here is a simple example, pass your mouse pointer over the button: +\pushButton[\CA{Info}\BC{}\S{S}\H{N}\AAmouseenter{% + var cChoice = \popUpMenu(Intro);\r + if ( cChoice != null ) app.alert(cChoice); }]{intro}{}{11bp}\olBdry. This +documentation describes the environments, commands, and JavaScript required +to create such pop-up menus. + +\subsection{Sample files} + +The file \texttt{pu-exmpls.tex} is the only demo file; it incorporates the examples of this +documentation, as well as few other bits and pieces. + +\subsection{Options, requirements, and workflows} + +\paragraph*{Options.} There are two options for this package +\opt{tracking}\FmtMP{\opt{tracking}} and \opt{!tracking} (the default). The +push button \pushButton[\CA{Info}\BC{}\S{S}\H{N}\AAmouseenter{var cChoice = + \popUpMenu(Intro);\r if ( cChoice != null ) app.alert(cChoice); + }]{intro}{}{11bp} introduced earlier is an example of a menu system with + \emph{no tracking} (\opt{!tracking}). As you selected menu items appearance + of the item does not change. When the \opt{tracking} option is taken, the + menu keeps track of which menu item is selected by placing a check mark to + the left of the menu item; for example, + \pushButton[\CA{Info}\BC{}\S{S}\H{N}\AAmouseenter{trackingPU=true;\r var + cChoice = \puProcessMenu(Intro);\r if ( cChoice != null ) + app.alert(cChoice); }]{intro}{}{11bp}\olBdry, notice as you select items, a + check mark appears; select another item, the previous check mark is removed, + and the latest item selected is now checked. More on tracking in \hyperref[s:tracking]{Section~\ref*{s:tracking}}. + +\paragraph*{Requirements.} +This package requires the \pkg{eforms} package, which is part of \pkg{acrotex}.\footnote{\url{http://www.ctan/pkg/acrotex}} + +\paragraph*{Workflows.} This is a general {\LaTeX} package, any workflows can be used to build +a \thispkg{} document: \app{pdflatex}, \app{lualatex}, \app{xelatex}, or +\app{dvips\,->\,\ameta{\upshape{distiller\,\string|\,ps2pdf}}}.\footnote{\pkg{popupmenu} +uses document JavaScript when \cs{puUseMenus} is expanded in the preamble; +\app{ps2pdf} does not support the creation of document JavaScript. If all +menu structures are defined as field scripts, \app{ps2pdf} should work. See +Section~\ref*{ps2pdf} for more information.} + +\section{The \tops{\protect\pkg}{}{popupmenu} environment} + +%\typeout{!! \Intro } + +To generate a pop-up menu using \texttt{app.popUpMenuEx()} you need to pass to it through its argument +a menu-array. The most convenient way of creating this ``menu-array'' is with the \env{popupmenu} environment. Before +discussing the full syntax of \env{popupmenu} we reproduce the \env{popupmenu} environment that produced the \textsf{Intro} +button in first paragraph of this section: +\begin{Verbatim}[fontsize=\small,commandchars=!()] +\begin{popupmenu}{Intro} + \item{title=title,return=Title: The manual for the popupmenu package} + \item{title=author,return=Author: D. P. Story} + \item{title=package name,return=Package: popupmenu} +\end{popupmenu} +\end{Verbatim} +This environment defines a JavaScript variable \texttt{Intro} and a {\LaTeX} command \cs{Intro} +that expands to what you see below. +\begin{Verbatim}[fontsize=\small,commandchars=!()] +var Intro = [ + {cName: "title", cReturn: "Title: The manual for the popupmenu package"}, + {cName: "author", cReturn: "Author: D. P. Story"}, + {cName: "package name", cReturn: "Package: popupmenu"} +]; +\end{Verbatim} +The above is a properly formed ``menu-array''. + +\newtopic\noindent +The rollover push button was created with the following code: +\begin{Verbatim}[fontsize=\small,commandchars={|~@}] +\pushButton[\CA{Info}\BC{}\S{S}\H{N}\AAmouseenter{% + var cChoice = \popUpMenu(Intro);\r + if ( cChoice != null ) app.alert(cChoice); }]{intro}{}{11bp} +\end{Verbatim} +The mouse-enter JavaScript is \texttt{var\:cChoice\:=\:\string\popUpMenu(Intro)}. The +array name (\texttt{Intro}) is passed to the convenience command +\cs{popUpMenU} to get the return value \texttt{cChoice}.\footnote{The name of the return variable is your choice, +you can say \texttt{var retn=\cs{popUpMenu(Intro)}}, for example.} Finally, if +nonempty, an alert dialog box is emitted with the return value displayed in +it. BTY,\footnote{By the way} \cs{popUpMenu} expands to the JavaScript method +\texttt{app.popUpMenuEx()}. + +\section{The \tops{\env}{}{popupmenu} environment} + +This general syntax for the \env{popupmenu} environment is, +\bVerb\takeMeasure{\small\string\item\darg{title=\ameta{str},marked=\ameta{\upshape{true|false}},enabled=\ameta{\upshape{true|false}},return=\ameta{str}}}% +\setlength\eflength{\bxSize}% +\def\1{\rlap{\hskip\eflength\ding{182}}} +\def\2{\rlap{\hskip\eflength\ding{183}}} +\def\3{\rlap{\hskip\eflength\ding{184}}} +\def\4{\rlap{\hskip\eflength\ding{185}}} +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% *[\ameta{opts}]\darg{\ameta{ytvID}}\darg{\ameta{text}} +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red},fontsize=\small] +!1\begin{popupmenu}{!ameta(name)} +!2\item{title=!ameta(str),marked=!ameta(!upshape(true|false)),enabled=!ameta(!upshape(true|false)),return=!ameta(str)} +!3\item{title=-} +... +!4\begin{submenu}{title=!ameta(str),marked=!ameta(!upshape(true|false))} +\item{title=!ameta(str),marked=!ameta(!upshape(true|false)),enabled=!ameta(!upshape(true|false)),return=!ameta(str)} +\item{title=-} +... +\end{submenu} +... +\end{popupmenu} +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:puenv} +\end{minipage}\end{minipage}\eVerb +At the top-level \ding{182}, the \env{popupmenu} environment takes one +argument. The \ameta{name} argument plays two roles: (1) it becomes the name +of the JavaScript \emph{menu-array}; (2) it becomes a command name +\cs{\ameta{name}} that expands to the JavaScript menu-array. For this reason, +\ameta{name} must consist of ASCII letters only. The body of \env{popupmenu} +consists of one or more \cs{item} commands (\ding{183} and \ding{184}). The +body may contain zero or more \env{submenu} environments (\ding{185}); +\env{submenu} may then contain one or more \cs{item} commands. You can have +sub-menus inside other sub-menus. + +Generally, some underlying JavaScript, such as when the \opt{tracing} option +is in force, sets a menu item to \texttt{marked=true} or +\texttt{marked=false}; so as a rule, it is not recommended to initially specify +the \texttt{marked} key. + +\paragraph*{Discussion of \cs{item\darg{\ameta{KV-pairs}}}.} There are four key-value pairs. +\begin{quote} +\begin{description} + \item[\texttt{title=\ameta{str\upshape{\string|-}}}] (required) The + value of \texttt{title} (\ameta{str}) is the menu item title; a + value of `\texttt{-}' is reserved to signal that a separator line + should be drawn. + \item[\texttt{marked=\ameta{\upshape{true\string|false}}}] (optional) + If \texttt{true}, the menu item is marked with a check. The default + is \texttt{false} (not marked). Leave this key to JavaScript. + \item[\texttt{enabled=\ameta{\upshape{true\string|false}}}] (optional) + If \texttt{true} the item is to appear enabled; otherwise the menu + item is grayed out. The default is \texttt{true} (enabled). + \item[\texttt{return=\ameta{str}}] (optional) A string to be returned + when the menu item is selected. If \texttt{return} is not specified + or has no value, the value of the \texttt{title} key is returned. + There is a special return value; if \ameta{str} is the word + `\texttt{none}', the return value will be \texttt{null} (no + action). In this case, the value of the \texttt{title} key can be + used as a heading. (There is an example of the `\texttt{none}' value + in Section~\ref*{Exepu}.) +\end{description} +\end{quote} + +\paragraph*{Discussion of \env{submenu\darg{\ameta{KV-pairs}}}.} The argument of \env{submenu} +takes only two key-value pairs: \texttt{title} and \texttt{marked}, see descriptions above. + +\paragraph*{Placement of the \env{popupmenu} environment.} The environment may appear in the +preamble or in the body of the document. +\begin{itemize} + \item\textbf{In the preamble.} When one or more \env{popupmenu} + environments are declared in the preamble, their corresponding + menu-array can be placed as document JavaScript. To place one or + more menu-arrays in the document JavaScript section of the PDF, + insert the \cs{puUseMenus} command following the last + \env{popupmenu} environment in the preamble. +\bVerb\takeMeasure{\string\puUseMenus\darg{\ameta{menu-array-names}}}\par\noindent +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[frame=single,commandchars=!(),rulecolor=\color{red}] +\puUseMenus{!ameta(menu-array-names)} +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:puUseMenus} +\end{minipage}\end{minipage}\eVerb +where \ameta{menu-array-names} is a comma-delimited list of +menu-array names; for example, \cs{puUseMenus\darg{myMenu,yourMenu}}. + +Tracing can only occur when (1) the \env{popupmenu} environment appears in +the preamble; (2) and the \ameta{name} of the pop-up menu appears as one of +the arguments of \cs{puUseMenus}; and (3) the command \cs{puProcessMenu} is +used at the field level to open the pop-up, more on this in \hyperref[s:tracking]{Section~\ref*{s:tracking}}. + +\item\textbf{In the body of the document.} For \env{popupmenus} + environments declared in the body of the document, the corresponding + menu-arrays can still be used anywhere after the declaration. Refer to + \hyperref[s:notracking]{Section~\ref*{s:notracking}} for details. +\end{itemize} + +\section{Executing a pop-up menu}\label{Exepu} + +Two commands used to open a pop-up menu, \cs{popUpMenu} and \cs{puProcessMenu}: +\bVerb\takeMeasure{\string\puProcessMenu\darg{\ameta{name}}}% +\setlength\eflength{\bxSize}\def\1{\sffamily\rlap{\hskip\eflength(for no-tracking menus)}}% +\def\2{\sffamily\rlap{\hskip\eflength(for tracking menus)}}\par\noindent +\begin{minipage}{\linewidth} +\begin{minipage}{\bxSize} +\xdef\panelWidth{\the\linewidth}% +\begin{Verbatim}[frame=single,commandchars={!~@},rulecolor=\color{red}] +!1\popUpMenu(!ameta~name@) +!2\puProcessMenu(!ameta~name@) +\end{Verbatim} +\end{minipage}\hfill +\begin{minipage}{\linewidth-\panelWidth} +\setDisplayNumber\label{display:puCMDS} +\end{minipage}\end{minipage}\eVerb where \ameta{name} is the name given to some +\env{popupmenu} environment, refer to +\hyperref[display:puenv]{display~(\ref*{display:puenv})}, defined earlier in +the document. The first one is designed for no-tracking menus, the second is +for tracking menus. + +\paragraph*{The \texttt{Various} menu.}\label{para:Various} +In subsequent sections, we'll use the following pop-up menu, which is defined +in the preamble of this document. +\begin{Verbatim}[fontsize=\small,numbers=left] +\urlPath{\homeAtUA}{http://www.math.uakron.edu/~dpstory} +\urlPath{\homeAeB}{http://www.acrotex.net} +\urlPath{\blogAeB}{http://blog.acrotex.net} +\urlPath{\urlCTAN}{https://www.ctan.org} +\urlPath{\embedYT}{http://www.youtube.com/embed} +\urlPath{\watchYT}{http://www.youtube.com/watch?v} +\begin{popupmenu}{Various} + \item{title=Various AcroTeX Links,return=none} % return value of 'none' + \item{title=-} + \begin{submenu}{title=AeB at U of Akron} + \item{title=Home page,return=\homeAtUA/acrotex.html} + \item{title=Tutorials,return=\homeAtUA/acrotex.html\#educational} + \end{submenu} + \begin{submenu}{title=Commercial AcroTeX} + \item{title=AcroTeX main page,return=\homeAeB} + \item{title=AcroTeX blog,return=\blogAeB} + \end{submenu} + \begin{submenu}{title=AcroTeX on CTAN} + \item{title=Contributions: AcroTeX, + return=\urlCTAN/author/story} + \item{title=The popupmenu Package, + return=\urlCTAN/pkg/popupmenu} + \end{submenu} + \begin{submenu}{title=YouTube Videos} + \begin{submenu}{title=Action Videos} + \item{title=Kung-Fu fighting (Bruce Lee version), + return=\embedYT/GZ9e3Dy7obA} + \item{title=Rocket Jump,return=\embedYT/7XzdZ4KcI8Y} + \end{submenu} + \begin{submenu}{title=Miscellaneous} + \item{title=J\"{u}rgen's favorite song, + return={\watchYT=mLDF5MBMWHE}} + \item{title=\Esc"Sea Hunt\Esc" US TV series (1958-61) lead-in, + return=\embedYT/Lz0aMoWh8Q4} + \item{title=Learn \cs{LaTeX} in one video, + return=\embedYT/VhmkLrOjLsw} + \end{submenu} + \end{submenu} +\end{popupmenu} +\end{Verbatim} +\textbf{Notes:} +\begin{itemize} +\item In lines~(1)--(6), several URLs are declared using + \cs{urlPath}\FmtMP{\cs{urlPath}}, which is defined in \pkg{popupmenu} + package. +\item Line~(8) The `\texttt{none}; return value is used. +\item Line~(12) The fragment (\texttt{\#}) is escaped (\verb~\#~). +\item Line~(31) The value of the \texttt{title} key is passed through the + \pkg{hyperref} command \cs{pdfstringdef}, consequently, you can use + standard {\LaTeX} markup for Latin-1 characters. +\item Line~(32) The return value has an equal sign (\texttt{=}), the return value + is enclosed in braces to avoid a \pkg{xkeyval} parsing error. +\item Line~(33) The double quote needs to be escaped (because ultimately, + the value will appear within double quotes. We use a special + \cs{Esc}\FmtMP{\cs{Esc}} command of \pkg{popupmenu}. +\item Line~(35) To place a backslash(`\texttt\eqbs'), use the \cs{cs}\FmtMP{\cs{cs}} command. +\end{itemize} + +\newtopic\noindent +The \env{popupmenu} can be placed in the preamble or in the body of the document. Let's begin with the +one declared in the body. + +\subsection{Declaring \tops{\protect\env}{}{popupmenu} in the body}\label{s:notracking} + +%\previewOn + +\begin{popupmenu}{LocalMenu} + \item {title=First Item} + \item {title=Second Item} +\end{popupmenu} + +Here, in the body, we declare a (simple) menu: \pushButton[\CA{My Menu}\AAmouseenter{% +\LocalMenu\r +var cChoice = \popUpMenu(LocalMenu);\r +if ( cChoice != null ) app.alert("You chose the \\""+cChoice+"\\""); +}]{LocalMenuBtn}{}{11bp}\begingroup +\def\1{\llap{\rlap{\ding{182}}\hskip\amtIndent\relax}}% +\def\2{\llap{\rlap{\ding{183}}\hskip\amtIndent\relax}}% +\def\3{\llap{\rlap{\ding{184}}\hskip\amtIndent\relax}}% +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars={|~@}] +|1\begin{popupmenu}{LocalMenu} + \item {title=First Item} + \item {title=Second Item} +\end{popupmenu} +\pushButton[\CA{My Menu}\AAmouseenter{% +|2\LocalMenu\r //|sffamily Expand the command version of the menu-array +|3var cChoice = \popUpMenu(LocalMenu);\r //|sffamily use \popUpMenu +if ( cChoice != null ) + app.alert("You chose the \\""+cChoice+"\\""); +}]{LocalMenuBtn}{}{11bp} +\end{Verbatim} +\endgroup\noindent +In line~\ding{182} we decare our simple menu. In line~\ding{183} we expand +the command version of the \emph{menu-array}. (Refer to comment \ding{182} of +\hyperref[display:puenv]{display~(\ref*{display:puenv})} on +page~\pageref*{display:puenv}.) Finally, in line~\ding{184}, we execute +\cs{popUpMenu(LocalMenu)} (See +\hyperref[display:puCMDS]{display~(\ref*{display:puCMDS})} on +page~\pageref*{display:puCMDS}, and the comments that follow). Using this +technique, there is \emph{no tracking}; that is, the menu item chosen is not +checked. + +The \env{popupmenu} can be declared in the preamble to obtain the same +results, but still no tracking. To obtain tracking of the menu items, you +must (1) declare \env{popupmenu} in the preamble; (2) include its name +(\texttt{LocalMenu}) in the list of \ameta{menu-array-names} of the +\cs{puUseMenus} command of +\hyperref[display:puUseMenus]{display~(\ref*{display:puUseMenus})}; (3) +delete line~\ding{183}; (4) replace \cs{popUpMenu} in line~\ding{184} with +\cs{puProcessMenu}; and (5) the \opt{tracking} option must be specified. +Details of setting up tracking are found in the +\hyperref[{s:tracking}]{Section~\ref*{s:tracking}}. + +\subsection{Declaring \tops{\protect\env}{}{popupmenu} in the preamble}\label{s:tracking} + +A \env{popupmenu} environment can be declared anywhere \emph{before} its first use in +field Java\-Script to actually display the menu to the user; however, to obtain +tracking of the menu items chosen you must (1) specify +\cs{usepackage[tracking]\darg{popupmenu}}, the \opt{tracking} option; (2) +declare the menu (that is, the \env{popupmenu} environment) in the preamble; (3) list the menu name +amongst the arguments of the \cs{puUseMenus} command; (4) use +\cs{puProcessMenu} in lieu of \cs{popUpMenu} in the field JavaScript. + +\newtopic\noindent A bare-bones push button is as follows: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars={|~@}] +\pushButton[|ameta~KV-pairs@\AAmouseenter{% + var cChoice = \puProcessMenu(|ameta~name@);\r + if ( cChoice != null ) |ameta~some-action@ +}}]{|ameta~btnName@}{|ameta~wd@}{|ameta~ht@} +\end{Verbatim} + + +\newtopic\noindent +For example, make a selection: \pushButton[\CA{My Menu}\BC{}\W0\S{S}\H{N}\AAmouseenter{% +var cChoice = \puProcessMenu(Various);\r +if ( cChoice != null ) {\r\t + if (PUdebug)\r\t\t + app.alert("URL: \\""+cChoice+"\\"");\r\t + else app.launchURL(cChoice);\r +}}]{mymenu}{}{11bp}\olBdry\, +\pushButton[\TU{Toggle Debug}\BC{}\W0\S{S}\H{N}\CA{Action}\AAmouseup{if(PUdebug){\r\t + PUdebug=false;event.target.buttonSetCaption("Action");}\r + else {PUdebug=true;event.target.buttonSetCaption("Debug");} +}]{DebugBtn}{.5in}{11bp} + +\newtopic\noindent The verbatim listing of the first push button follows: +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars={|~@}] +\pushButton[\CA{My Menu}\BC{}\W0\S{S}\H{N}\AAmouseenter{% +var cChoice = \puProcessMenu(Various);\r +if ( cChoice != null ) {\r\t + if (PUdebug)\r\t\t + app.alert("URL: \\""+cChoice+"\\"");\r\t + else app.launchURL(cChoice);\r +}}]{mymenu}{}{11bp} +\end{Verbatim} +This push button references the \texttt{Various} menu, tediously listed on +page~\pageref*{para:Various}. The second button, labeled \textsf{Action}, +allows you to play around with the pop-up menu without going to the web +sites. Click on it, and the caption now says \textsf{Debug}. Now, instead of +going to the web site, an alert box appears announcing your choice. Good for +testing things. + +\paragraph*{Multiple action types.} In all the examples of this document, as well as the demo files, +all actions are the same, either the return is a URL and the action is +\texttt{app.launchURL(URL)} or the return is text and results are reported in +an alert box. You can have multiple action types, as is illustrated in the +following local declaration. + +%\previewOff + +\newtopic\noindent Pick your choice: +\begin{popupmenu}{puMulti} + \item {title=Item 1,return=0} + \item {title=Item 2,return=1} + \begin{submenu}{title=Other items} + \item{title=Item 3,return=2} + \end{submenu} +\end{popupmenu} +\begin{defineJS}[\makeesc|]{\puMultiActn} +|puMulti +var cChoice = |popUpMenu(puMulti); +if ( cChoice != null ) { + switch (cChoice) { + case "0": + app.alert("You chose Item 1 from the menu"); + break; + case "1": + app.launchURL("|homeAeB"); + break; + default: + console.show() + console.println("Menu returned a value of \\""+cChoice+"\\""); + break; + } +} +\end{defineJS} +\pushButton[\CA{Multi}\AAmouseenter{\puMultiActn}]{MultiBtn}{}{11bp}\olBdry. +The verbatim list is, +\begin{Verbatim}[xleftmargin=\amtIndent,fontsize=\small,commandchars={*~@}] +%*textsf~ Use the *texttt~defineJS@ environment to define the action@ +\begin{defineJS}[\makeesc|]{\puMultiActn} +|puMulti +var cChoice = |popUpMenu(puMulti); +if ( cChoice != null ) { + switch (cChoice) { + case "0": + app.alert("You chose Item 1 from the menu");break; + case "1": + app.launchURL("|homeAeB");break; + default: console.show(); + console.println("Menu returned a value of \\""+cChoice+"\\""); + break; + } +} +\end{defineJS} +*goodbreak +%*textsf~ Declare *texttt~popupmenu@ environment, return values are integers@ +\begin{popupmenu}{puMulti} + \item {title=Item 1,return=0} + \item {title=Item 2,return=1} + \begin{submenu}{title=Other items} + \item{title=Item 3,return=2} + \end{submenu} +\end{popupmenu} +%*textsf~ Now execute the pop-up menu as a mouse enter event@ +\pushButton[\CA{Multi}\AAmouseenter{\puMultiActn}]{MultiBtn}{}{11bp} +\end{Verbatim} + +\section{Remarks on \tops{\protect\app}{}{ps2pdf}}\label{ps2pdf} + +To use the \app{dvips\,->\,ps2pdf} workflow, document JavaScript needs to be avoided. +Do not use the \opt{tracking} option, do not use \cs{puUseMenus}, and use only the +\cs{popUpMenu} command in field JavaScript. A simple outline of an document is found below, +it is a working example. +\begin{Verbatim}[fontsize=\small,commandchars={*~@}] +\documentclass{article} +\usepackage{popupmenu} +\parindent0pt\parskip6pt +\begin{document} +%*textsf~ Declare in the body of the text, can use anywhere after this declaration@ +\begin{popupmenu}{LocalMenu} + \item {title=First Item} + \item {title=Second Item} +\end{popupmenu} + +Pop-up menu using \verb|\pushButton| of \textsf{eforms}: +\pushButton[\CA{My Menu}\AAmouseenter{\LocalMenu\r +var cChoice = \popUpMenu(LocalMenu);\r +if ( cChoice != null )\r\t + app.alert("You chose the \\""+cChoice+"\\" menu item"); +}]{LocalMenuBtn}{}{11bp}. + +Pop-up menu using \verb|\PushButton| of \textsf{hyperref}: +\PushButton[name=hyperbutton1,onenter={\LocalMenu + var cChoice = \popUpMenu(LocalMenu); + if ( cChoice != null ) + app.alert("You chose the \\""+cChoice+"\\" menu item");} +]{My Menu} +\end{document} +\end{Verbatim} + + +\paragraph*{Back to my retirement.} \dps + + +\end{document} diff --git a/macros/latex/contrib/popupmenu/docs/popupmenu.pdf b/macros/latex/contrib/popupmenu/docs/popupmenu.pdf Binary files differnew file mode 100644 index 0000000000..6c1e54b193 --- /dev/null +++ b/macros/latex/contrib/popupmenu/docs/popupmenu.pdf diff --git a/macros/latex/contrib/popupmenu/examples/pu-exmpls.pdf b/macros/latex/contrib/popupmenu/examples/pu-exmpls.pdf Binary files differnew file mode 100644 index 0000000000..cf2c80d0f0 --- /dev/null +++ b/macros/latex/contrib/popupmenu/examples/pu-exmpls.pdf diff --git a/macros/latex/contrib/popupmenu/examples/pu-exmpls.tex b/macros/latex/contrib/popupmenu/examples/pu-exmpls.tex new file mode 100644 index 0000000000..ba41a4b9f0 --- /dev/null +++ b/macros/latex/contrib/popupmenu/examples/pu-exmpls.tex @@ -0,0 +1,167 @@ +\documentclass{article} +%\usepackage{xkeyval} +\usepackage[designv]{web} +\usepackage[tracking]{popupmenu} + +\title{The \texorpdfstring{\textsf}{}{popupmenu} Package Test File} +\author{D. P. Story} +\subject{Test file for the popupmenu Package} +\keywords{LaTeX, popupmenu, Acrobat JavaScript, AcroTeX} + +\university{NORTHWEST FLORIDA STATE COLLEGE\\ + Department of Mathematics} +\email{dpstory@acrotex.net} +\version{1.0} + +\norevisionLabel + +\begin{popupmenu}{Intro} + \item{title=title,return=Title: The manual for the popupmenu package} + \item{title=author,return=Author: D. P. Story} + \item{title=package name,return=Package: popupmenu} +\end{popupmenu} + +\urlPath{\homeAtUA}{http://www.math.uakron.edu/~dpstory} +\urlPath{\homeAeB}{http://www.acrotex.net} +\urlPath{\blogAeB}{http://blog.acrotex.net} +\urlPath{\urlCTAN}{https://www.ctan.org} +\urlPath{\embedYT}{http://www.youtube.com/embed} +\urlPath{\watchYT}{http://www.youtube.com/watch?v} +\begin{popupmenu}{Various} + \item{title=Various AcroTeX Links,return=none} + \item{title=-} + \begin{submenu}{title=AeB at U of Akron} + \item{title=Home page,return=\homeAtUA/acrotex.html} + \item{title=Tutorials,return=\homeAtUA/acrotex.html\#educational} + \end{submenu} + \begin{submenu}{title=Commercial AcroTeX} + \item{title=AcroTeX main page,return=\homeAeB} + \item{title=AcroTeX blog,return=\blogAeB} + \end{submenu} + \begin{submenu}{title=AcroTeX on CTAN} + \item{title=Contributions: AcroTeX ,return=\urlCTAN/author/story} + \item{title=The popupmenu Package,return=\urlCTAN/pkg/popupmenu} + \end{submenu} + \begin{submenu}{title=YouTube Videos} + \begin{submenu}{title=Action Videos} + \item{title=Kung-Fu fighting (Bruce Lee version),return=\embedYT/GZ9e3Dy7obA} + \item{title=Rocket Jump,return=\embedYT/7XzdZ4KcI8Y} + \end{submenu} + \begin{submenu}{title=Miscellaneous} + \item{title=J\"{u}rgen's favorite song,return={\watchYT=mLDF5MBMWHE}} + \item{title=\Esc"Sea Hunt\Esc" US TV series (1958-61) lead-in,return=\embedYT/Lz0aMoWh8Q4} + \item{title=Learn \cs{LaTeX} in one video,return=\embedYT/VhmkLrOjLsw} + \end{submenu} + \end{submenu} +\end{popupmenu} + +\puUseMenus{Intro,Various} % Can track these menus + +%\previewOn + +\def\cs#1{\texttt{\eqbs#1}} +\def\pkg#1{\textsf{#1}} + +\parindent0pt\parskip6pt + +\begin{document} + +\maketitle + +\section{Examples of the documentation} + +Here is a simple example, pass your mouse pointer over the button: +\pushButton[\CA{Info}\BC{}\S{S}\H{N}\AAmouseenter{% + var cChoice = \popUpMenu(Intro);\r + if ( cChoice != null ) app.alert(cChoice); }]{intro}{}{11bp}, uses \cs{popUpMenu}, no tracking. + +Here is the same button \pushButton[\CA{Info}\BC{}\S{S}\H{N}\AAmouseenter{% + var cChoice = \puProcessMenu(Intro);\r + if ( cChoice != null ) app.alert(cChoice); }]{intro}{}{11bp}, but uses \cs{puProcessMenu}, will have tracking. + +For example, make a selection: \pushButton[\CA{My Menu}\AAmouseenter{% +%var cChoice = \popUpMenu(myMenu);\r +var cChoice = \puProcessMenu(Various);\r +if ( cChoice != null ) {\r\t + if (PUdebug)\r\t\t + app.alert("You chose the \\""+cChoice+"\\" menu item");\r\t + else app.launchURL(cChoice);\r +}}]{mymenu}{}{11bp}\olBdry +\pushButton[\TU{Toggle Debug}\CA{Action}\AAmouseup{if(PUdebug){\r\t + PUdebug=false;event.target.buttonSetCaption("Action");} + else {PUdebug=true;event.target.buttonSetCaption("Debug");} +}]{DebugBtn}{.5in}{11bp} (tracking) + +% Declare in the body of the text, can use anywhere after this declaration +\begin{popupmenu}{LocalMenu} + \item {title=First Item} + \item {title=Second Item} +\end{popupmenu} + +Here, in the body, we declare a (simple) menu: \pushButton[\CA{My Menu}\AAmouseenter{% +\LocalMenu\r +var cChoice = \popUpMenu(LocalMenu);\r +if ( cChoice != null ) app.alert("You chose the \\""+cChoice+"\\" menu item"); +}]{LocalMenuBtn}{}{11bp}. This is a locally defined menu, \texttt{popumenu} +declared in the body of the document. (Uses \cs{popUpMenu}, no tracking) + +Pick your choice: +\begin{popupmenu}{puMulti} + \item {title=Item 1,return=0} + \item {title=Item 2,return=1} + \begin{submenu}{title=Other items} + \item{title=Item 3,return=2} + \end{submenu} +\end{popupmenu} +\begin{defineJS}[\makeesc|]{\puMultiActn} +|puMulti +var cChoice = |popUpMenu(puMulti); +if ( cChoice != null ) { + switch (cChoice) { + case "0": + app.alert("You chose Item 1 from the menu"); + break; + case "1": + app.launchURL("|homeAeB"); + break; + default: console.show(); + console.println("Menu returned a value of \\""+cChoice+"\\""); + break; + } +} +\end{defineJS} +\pushButton[\CA{Multi}\AAmouseenter{\puMultiActn}]{MultiBtn}{}{11bp}\olBdry. Locally defined \texttt{popupmenu}, +no tracking. + +\section{Examples using push buttons of \texorpdfstring{\protect\textsf}{}{hyperref}} + +You can use the \cs{PushButton} command of \pkg{hyperref} to accomplish the same thing, but with less flair. +\begin{itemize} + \item Mouse over event: \PushButton[name=hyperbutton1,onenter={% + var cChoice = \puProcessMenu(Various); + if ( cChoice != null )app.launchURL(cChoice);}]{Various URLs} (tracking) + \item Mouse up event: \PushButton[name=hyperbutton2,onclick={% + var cChoice = \puProcessMenu(Various); + if ( cChoice != null )app.launchURL(cChoice);}]{Various URLs} (tracking) +\end{itemize} + +\section{Handling the `none' return value} + +The handling of a return value of `none' is automatic when \cs{puProcessMenu} is used. When +\cs{popUpMenu} is employed, some special attention is needed. The topmost item of the +menu \texttt{Various} has a return value of `none'. +\begin{itemize} + \item With tracking: \pushButton[\CA{My Menu}\AAmouseenter{% + var cChoice = \puProcessMenu(Various);\r + if ( cChoice != null ) app.launchURL(cChoice); + }]{mymenu}{}{11bp} + \item Without tracking: \pushButton[\CA{My Menu}\AAmouseenter{% + % \popUpMenu returns the string "null", so we must test if "null" is the return value, + % if so, we make cChoice=null + var cChoice = \popUpMenu(Various);\r + if (cChoice=="null") cChoice=null;\r + if ( cChoice != null ) app.launchURL(cChoice); + }]{mymenu}{}{11bp} +\end{itemize} + +\end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/popupmenu/examples/pumen_ex.pdf b/macros/latex/contrib/popupmenu/examples/pumen_ex.pdf Binary files differdeleted file mode 100644 index c576f2842d..0000000000 --- a/macros/latex/contrib/popupmenu/examples/pumen_ex.pdf +++ /dev/null diff --git a/macros/latex/contrib/popupmenu/examples/pumen_ex.tex b/macros/latex/contrib/popupmenu/examples/pumen_ex.tex deleted file mode 100644 index 6f0acc7a5f..0000000000 --- a/macros/latex/contrib/popupmenu/examples/pumen_ex.tex +++ /dev/null @@ -1,108 +0,0 @@ -\documentclass{article} -\usepackage[designv]{web} -\usepackage{eforms} -\usepackage{popupmenu} - -\title{The \texorpdfstring{\textsf{popupmenu}}{popupmenu} Package Test File} -\author{D. P. Story} -\subject{Test file for the popupmenu Package} -\keywords{LaTeX, popupmenu, Acrobat JavaScript, AcroTeX} - -\university{NORTHWEST FLORIDA STATE COLLEGE\\ - Department of Mathematics} -\email{dpstory@acrotex.net} -\version{1.0} - -%\nocopyright -\norevisionLabel - -% -% This package can be used by users of pdftex, dvipdfm, dvips (with distiller) -% - -\urlPath{\aebhome}{http://www.math.uakron.edu/~dpstory} - -\begin{popupmenu}{AeBMenu} - \item{title=AeB, return=\aebhome/webeq.html} - \item{title=-} - \begin{submenu}{title=AeB Pro Family} - \item{title=Home page,return=\aebhome/aeb_pro.html} - \item{title=Graphicxsp,return=\aebhome/graphicxsp.html} - \end{submenu} - \item{title=eqExam,return=\aebhome/eqexam.html} -\end{popupmenu} - -\begin{popupmenu}{AeBMenuLocal} - \item{title=AeB, return=\aebhome/webeq.html} - \item{title=-} - \begin{submenu}{title=AeB Pro Family,enabled=false} - \item{title=Home page,return=\aebhome/aeb_pro.html} - \item{title=Graphicxsp,return=\aebhome/graphicxsp.html} - \end{submenu} - \item{title=eqExam,return=\aebhome/eqexam.html} -\end{popupmenu} - -% -% This menu was taken from the Acrobat JavaScript API Reference -% as a test of the new popupmenu and submenu environments. -% -\begin{popupmenu}{myMenu} - \item{title=Item 1, marked, enabled=false} - \item{title=-} - \begin{submenu}{title=Item 2} - \item{title={Item 2, Submenu 1}} - \begin{submenu}{title={Item 2, Submenu 2}} - \item{title={Item 2, Submenu 2, Subsubmenu 1}} - \end{submenu} - \end{submenu} - \item{title=Item 3} - \item{title=Item 4} -\end{popupmenu} - -\begin{insDLJS}[AeBMenu]{md}{Menu Data} -\AeBMenu -\myMenu -\end{insDLJS} - -\parindent0pt\parskip6pt - -\begin{document} - -\maketitle - -This file uses the \textsf{eforms} package to create push buttons, -the push button of \textsf{hyperref} can also be used. - -Here is an example taken from the Acrobat JavaScript API Reference: -\pushButton[\CA{My Menu}\AA{\AAMouseEnter{\JS{% -var cChoice = \popUpMenu(myMenu);\r -if ( cChoice != null ) app.alert("You chose the \\""+cChoice+"\\" menu item"); -}}}]{mymenu}{}{11bp} - -We can add a push button with a rollover effect -\pushButton[\CA{Packages}\AA{\AAMouseEnter{\JS{% -var cChoice = \popUpMenu(AeBMenu);\r -if ( cChoice != null ) app.launchURL(cChoice); -}}}]{menu}{}{11bp} - -You can also open the menu with a link: -\setLinkText[\A{\JS{% -var cChoice = \popUpMenu(AeBMenu);\r -if ( cChoice != null ) app.launchURL(cChoice); -}}]{Package}. Links do not have a rollover effect, however, you can use buttons like so: {\setbox0=\hbox{\textcolor{red}{Packages}}% -\makebox[0pt][l]{\pushButton[\W0\BG{}\BC{}\S{S}\AA{\AAMouseEnter{\JS{% -var cChoice = \popUpMenu(AeBMenu);\r if ( cChoice != null ) -app.launchURL(cChoice); }}}]{menu}{\wd0}{\ht0+\dp0}}\unhbox0}. - -This is a version that has a local version of the menu array: -{\setbox0=\hbox{\textcolor{red}{Packages}}% -\makebox[0pt][l]{\pushButton[\W0\BG{}\BC{}\S{S}\AA{\AAMouseEnter{\JS{% -\AeBMenuLocal\r -var cChoice = \popUpMenu(AeBMenuLocal);\r if ( cChoice != null ) -app.launchURL(cChoice);}}}]{menu}{\wd0}{\ht0+\dp0}}\unhbox0} -\end{document} - -This is a version that has a local version of the menu array: -\PushButton[name=hyperbutton,onmouseover={\AeBMenuLocal -var cChoice = \popUpMenu(AeBMenuLocal); if ( cChoice != null ) -app.launchURL(cChoice); }]{Packages} diff --git a/macros/latex/contrib/popupmenu/examples/pumen_ex_pdftex.tex b/macros/latex/contrib/popupmenu/examples/pumen_ex_pdftex.tex deleted file mode 100644 index 3254570dc5..0000000000 --- a/macros/latex/contrib/popupmenu/examples/pumen_ex_pdftex.tex +++ /dev/null @@ -1,111 +0,0 @@ -\documentclass{article} -\usepackage[designv,pdftex]{web} -\usepackage{eforms} -\usepackage{popupmenu} - -\title{The \texorpdfstring{\textsf{popupmenu}}{popupmenu} Package Test File} -\author{D. P. Story} -\subject{Test file for the popupmenu Package} -\keywords{LaTeX, popupmenu, Acrobat JavaScript, AcroTeX} - -\university{NORTHWEST FLORIDA STATE COLLEGE\\ - Department of Mathematics} -\email{dpstory@acrotex.net} -\version{1.0} - -%\nocopyright -\norevisionLabel - -% -% This package can be used by users of pdftex, dvipdfm, dvips (with distiller) -% - -\urlPath{\aebhome}{http://www.math.uakron.edu/~dpstory} - -\begin{popupmenu}{AeBMenu} - \item{title=AeB, return=\aebhome/webeq.html} - \item{title=-} - \begin{submenu}{title=AeB Pro Family} - \item{title=Home page,return=\aebhome/aeb_pro.html} - \item{title=Graphicxsp,return=\aebhome/graphicxsp.html} - \end{submenu} - \item{title=eqExam,return=\aebhome/eqexam.html} -\end{popupmenu} - -\begin{popupmenu}{AeBMenuLocal} - \item{title=AeB, return=\aebhome/webeq.html} - \item{title=-} - \begin{submenu}{title=AeB Pro Family,enabled=false} - \item{title=Home page,return=\aebhome/aeb_pro.html} - \item{title=Graphicxsp,return=\aebhome/graphicxsp.html} - \end{submenu} - \item{title=eqExam,return=\aebhome/eqexam.html} -\end{popupmenu} - -% -% This menu was taken from the Acrobat JavaScript API Reference -% as a test of the new popupmenu and submenu environments. -% -\begin{popupmenu}{myMenu} - \item{title=Item 1, marked, enabled=false} - \item{title=-} - \begin{submenu}{title=Item 2} - \item{title={Item 2, Submenu 1}} - \begin{submenu}{title={Item 2, Submenu 2}} - \item{title={Item 2, Submenu 2, Subsubmenu 1}} - \end{submenu} - \end{submenu} - \item{title=Item 3} - \item{title=Item 4} -\end{popupmenu} - -\begin{insDLJS}[AeBMenu]{md}{Menu Data} -\AeBMenu -\myMenu -\end{insDLJS} - -\newcommand{\cs}[1]{\texttt{\char`\\#1}} - - -\parindent0pt\parskip6pt - -\begin{document} - -\maketitle - -This file uses the \textsf{hyperref} package to create push buttons, -the push button of \textsf{eforms} can also be used. - - -Here is an example taken from the Acrobat JavaScript API Reference, it uses -the \cs{PushButton} command of \textsf{hyperref}. The script is implemented as -a mouse up event, rather than a rollover event as it appears \cs{PushButton} does not -support rollover. There is a \texttt{onmouseover} key that is supposed to work, but it doesn't. -\PushButton[name=mymenu, -onclick={var cChoice = \popUpMenu(myMenu); -if ( cChoice != null ) app.alert("You chose the \eqbs\eqbs""+cChoice+"\eqbs\eqbs" menu item"); -}]{My Menu} - - -Here is the same example, but using \cs{pushButton}, the button command from the eforms package. -It is implemented as a rollover event. -\pushButton[\CA{My Menu}\AA{\AAMouseEnter{\JS{% -var cChoice = \popUpMenu(myMenu);\r -if ( cChoice != null ) app.alert("You chose the \\""+cChoice+"\\" menu item"); -}}}]{mymenu}{}{11bp} - -We can add a push button with a rollover effect -\pushButton[\CA{Packages}\AA{\AAMouseEnter{\JS{% -var cChoice = \popUpMenu(AeBMenu);\r -if ( cChoice != null ) app.launchURL(cChoice); -}}}]{menu}{}{11bp} - -This is a version that has a local version of the \texttt{AeBMenuLocal} array. -If we place the array as field-level JavaScript, we don't need the \textsf{eforms} package. -Again, this is an \texttt{onclick} event. -\PushButton[name=mymenu,onclick={\AeBMenuLocal; -var cChoice = \popUpMenu(AeBMenuLocal); -if ( cChoice != null ) app.launchURL(cChoice);}]{AeB Local Menu} - -Fancier examples can be found at the \textcolor{blue}{AeB Blog} (\url{www.math.uakron.edu/~dpstory/aebblog.html}). -\end{document} diff --git a/macros/latex/contrib/popupmenu/popupmenu.dtx b/macros/latex/contrib/popupmenu/popupmenu.dtx index 4ca46a31cc..f454e67abe 100644 --- a/macros/latex/contrib/popupmenu/popupmenu.dtx +++ b/macros/latex/contrib/popupmenu/popupmenu.dtx @@ -1,10 +1,9 @@ % \iffalse %<*copyright> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% popupmenu.sty package, 2009-10-15 %% -%% Copyright (C) 2009 D. P. Story %% +%% popupmenu.sty package, %% +%% Copyright (C) 2009--2020 %% %% dpstory@acrotex.net %% -%% storyd@nwfsc.edu %% %% %% %% This program can redistributed and/or modified under %% %% the terms of the LaTeX Project Public License %% @@ -15,13 +14,47 @@ %</copyright> %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{popupmenu} -%<package> [2010/09/18 v1.0 Provides support for popup menus (dps)] +%<package> [2020/07/26 v1.2 Provides support for popup menus (dps)] %<*driver> \documentclass{ltxdoc} -\usepackage[colorlinks,hyperindex]{hyperref} -\pdfstringdefDisableCommands{\let\\\textbackslash}% -\EnableCrossrefs \CodelineIndex +\usepackage[colorlinks,hyperindex=false]{hyperref} +\usepackage{fancyvrb} +%\def\texorpdfstring#1#2{#1} +%\pdfstringdefDisableCommands{\let\\\textbackslash} \OnlyDescription % comment out for implementation details +\EnableCrossrefs +\CodelineIndex +\RecordChanges +\InputIfFileExists{aebdocfmt.def}{\PackageInfo{popupmenu}{Inputting aebdocfmt.def}} + {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax + \PackageInfo{popupmenu}{aebdocfmt.def cannot be found}} +\EnableCrossrefs \CodelineIndex \RecordChanges +\makeatletter +\renewcommand{\paragraph} + {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt} + {\normalfont\normalsize\bfseries}} +\renewenvironment{quote}[1][] + {\def\@rgi{#1}\ifx\@rgi\@empty + \let\rghtm\@empty\else\def\rghtm{\rightmargin\leftmargin}\fi + \list{}{\rghtm} %{\rightmargin\leftmargin}% + \item\relax} + {\endlist} +\makeatother +\bgroup\ttfamily +\gdef\brpr#1{\char123\relax#1\char125\relax}\egroup +\let\darg\brpr +\let\env\texttt +\let\opt\texttt +\let\app\textsf +\let\tops\texorpdfstring +\def\nmpsep#1{\hskip-\marginparsep\texttt{#1}} +\def\visispace{\symbol{32}} +\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}} +\def\meta#1{\textsl{\texttt{#1}}} +\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}} +\def\ltag{<}\def\rtag{>} +\def\EXCL{!} +\let\app\textsf\let\pkg\textsf \begin{document} \GetFileInfo{popupmenu.sty} \title{The \textsf{popupmenu} Package} @@ -32,95 +65,146 @@ \tableofcontents \let\Email\texttt \DocInput{popupmenu.dtx} - \PrintIndex +\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} The index goes here. Execute,\\ + \texttt{popupmenu -s gind.ist -o popupmenu.ind popupmenu.idx} on the command line and recompile + \texttt{popupmenu.dtx}.} +\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here. Execute,\\ + \texttt{makeindex -s gglo.ist -o popupmenu.gls popupmenu.glo} on the command line and recompile + \texttt{popupmenu.dtx}.} \end{document} %</driver> % \fi +% \MakeShortVerb{|} +% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{ltx4yt}{Inputting aebdonotindex.def}} +% {\PackageInfo{ltx4yt}{cannot find aebdonotindex.def}} +% \DoNotIndex{\g@addto@macro,\divide,\box,\setbox,\x,\y,\z} +% % \begin{macrocode} %<*package> % \end{macrocode} +% \section{Instroduction} % This is a short package that provides environments and commands for building % a popup menu using JavaScript. The command \cs{popUpMenu} uses the Acrobat JavaScript % method \texttt{app.popUpMenuEx}. This latter method requires you to pass to it a % structured menu listing of the menu items to be displayed in the popup menu, and the actions % to be taken when a menu item is selected. The environments \texttt{popupmenu} and % \texttt{submenu} are defined for the purpose of creating this hierarchical structure. +% \changes{v1.1}{2020/07/21}{explicitly require \string\pkg{eforms}} +% \changes{v1.2}{2020/07/26}{Added \string\opt{tracking} option} +% \section{Package Options} % \begin{macrocode} \RequirePackage{xkeyval} +\newif\iftrackingPU \trackingPUfalse +\DeclareOptionX{tracking}{\trackingPUtrue\def\puTracking{true}} +\DeclareOptionX{!tracking}{\trackingPUfalse\def\puTracking{false}} +\def\puTracking{false} +\ProcessOptionsX\relax +\edef\pu@restoreCats{% + \catcode`\noexpand\"=\the\catcode`\"\relax + \catcode`\noexpand\'=\the\catcode`\'\relax + \catcode`\noexpand\,=\the\catcode`\,\relax + \catcode`\noexpand\!=\the\catcode`\!\relax +} +\@makeother\"\@makeother\'\@makeother\,\@makeother\! % \end{macrocode} +% \section{Required packages} +% \begin{macrocode} +\RequirePackage{eforms} +% \end{macrocode} +% \section{The \texorpdfstring{\protect\env}{}{popupmenu} environment} % According to the JavaScript manual, the \texttt{app.popUpMenuEx} method takes % one or more \texttt{MenuItem} objects. The {\LaTeX} access to the properties of this object are documented -% as follows (taken verbatim from the JavaScript reference): -% \begin{macro}{title} +% as follows. This set of keys becomes the \pkg{xkeyval} family \texttt{menustruct} of keys for this package:\par\medskip\noindent +% \leavevmode\IndexKey{title}\nmpsep{=\ameta{string\upshape\string|-}} % The menu item name, which is the string to appear on the menu item. The value of -% \texttt{"-"} is reserved to draw a separator line in the menu. -% \begin{macro}{marked} +% \texttt{"-"} is reserved to draw a separator line in the menu.\par\medskip\noindent +% \leavevmode\IndexKey{marked}\nmpsep{=\ameta{\upshape{true\string|false}}} % (optional) A Boolean value specifying whether the item is to be marked with a -% check. The default is \texttt{false} (not marked). -% \begin{macro}{enabled} +% check. The default is \texttt{false} (not marked).\par\medskip\noindent +% \leavevmode\IndexKey{enabled}\nmpsep{=\ameta{\upshape{true\string|false}}} % (optional) A Boolean value specifying whether the item is to appear enabled or -% grayed out. The default is \texttt{true} (enabled). -% \begin{macro}{return} -% (optional) A string to be returned when the menu item is selected. The default is the -% value of cName. +% grayed out. The default is \texttt{true} (enabled).\par\medskip\noindent +% \leavevmode\IndexKey{return}\nmpsep{=\ameta{string}} +% (optional) A string to be returned when the menu item is selected. If \texttt{return} +% is not specified or has no value, the value of the \texttt{title} key is returned. +% \changes{v1.1}{2020/07/21}{Insert \string\cs{pdfstringdef} in title definition} % \begin{macrocode} -\define@key{menustruct}{title}[]{\def\menustruct@title{#1}} +\def\title@dash{-}\def\puNone{none} +\define@key{menustruct}{title}[]{\Hy@unicodefalse + \let\btitle@dash\ef@NO + \def\@rgi{#1}\ifx\@rgi\title@dash\let\btitle@dash\ef@YES\fi + \pdfstringdef\menustruct@title{#1}} \define@boolkey{menustruct}{marked}[true]{} \define@boolkey{menustruct}{enabled}[true]{} -\define@key{menustruct}{return}[]{\def\menustruct@return{#1}} +\define@key{menustruct}{return}[]{\def\menustruct@return{#1}\relax + \ifx\menustruct@return\puNone\def\menustruct@return{null}\fi} % \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} % We use the command \cs{pum@holdtoks} to hold the menu items as they are processed % in the environment, and use \cs{@AddToMenuToks} to add to the items. % \begin{macrocode} \let\pum@holdtoks\@empty -\newcommand{\@AddToMenuToks}{\g@addto@macro\pum@holdtoks} +\let\pum@holdtoksEx\@empty +\def\@AddToMenuToks{\g@addto@macro\pum@holdtoks} +\def\@AddToMenuToksEx{\g@addto@macro\pum@holdtoksEx} % \end{macrocode} -% \begin{environment}{popupmenu} +% \begin{environment}{popupmenu}\nmpsep{\,\darg{\ameta{name}}} The \ameta{name} argument should be +% consist of letters only, for \ameta{name} will be made into the command \cs{\ameta{name}}. The \ameta{name} +% has a duel rule, \cs{\ameta{name}} is a macro that expands to a JavaScript array of menu items; and +% the name itself \ameta{name} is the name of a JavaScript variable. % We begin by defining our menu structure using the % \texttt{popupmenu} environment. Within this environment, % we list the items in the menu using \cs{item} and -% the \texttt{submenu} menu if there are sub menus. +% the \texttt{submenu} menu if there are sub-menus. % % The \texttt{popupmenu} command requires one parameter, this command is % used to create both a command and a JavaScript variable. The name is % passed to the \cs{popUpMenu} command, while the command version of the -% name expands to the menu structure. The menu structure can be placed -% at the document level, or as part of a push button action. -% Here is an example of usage:\par -% \begin{verbatim} +% name expands to the menu structure (an array). +% +%There are two ways of passing the array that is the menu structure to \cs{popUpMenu}: +% \begin{enumerate} +% \item From the document level: The arrays are declared at the document level, the +% name of the array is passed as the argument of \cs{popUpMenu(\ameta{menu-array})}. +% \item From the field level: Within the script for a push button, for example, use +% the command version of the array name to expand first, then it can be referenced. +% \end{enumerate} +%\begin{Verbatim}[xleftmargin=\parindent,codes={\catcode`\%=9},commandchars={!()}] %\urlPath{\aebhome}{http://www.math.uakron.edu/~dpstory} %\begin{popupmenu}{myMenu} -% \item{title=AeB,return=\aebhome/webeq.html} -% \item{title=-} -% \begin{submenu}{title=AeB Pro Family} -% \item{title=Home page, return=\aebhome/aeb_pro.html} -% \item{title=Graphicxsp, return=\aebhome/graphicxsp.html} -% \end{submenu} -% \item{title=eqExam, return=\aebhome/eqexam.html} +% \item{title=AeB,return=\aebhome/webeq.html} +% \item{title=-} +% \begin{submenu}{title=AeB Pro Family} +% \item{title=Home page, return=\aebhome/aeb_pro.html} +% \item{title=Graphicxsp, return=\aebhome/graphicxsp.html} +% \end{submenu} +% \item{title=eqExam, return=\aebhome/eqexam.html} %\end{popupmenu} -%\end{verbatim} +%\puUseMenus{myMenu} !% preamble +%\end{Verbatim} +%The \cs{puUseMenus} declares that \texttt{myMenu} is to be embedded in the PDF as document JavaScript. +%If \cs{puUseMenus} is not expanded in the preamble %The above definition can be conveniently placed in the preamble, though it can % appear anywhere before it is used, obviously. Now to use the menu structure, % all we need is a push button or link to create a JavaScript action: -%\begin{verbatim} -% \pushButton[\CA{Packages}\AA{\AAMouseEnter{\JS{% -% \myMenu\r -% var cChoice = \popUpMenu(myMenu);\r -% if ( cChoice != null ) app.launchURL(cChoice); -% }}}]{menu}{}{11bp} -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,codes={\catcode`\%=9},commandchars={|~@}] +%\pushButton[\CA{Packages}\AAmouseenter{|% +% var cChoice = \popUpMenu(myMenu);\r +% if ( cChoice != null ) app.launchURL(cChoice); +%}]{menu}{}{11bp} +%\end{Verbatim} % The above example uses the \textsf{eforms} package, but a push button from \textsf{hyperref} will do too. % The \texttt{app.popUpMenuEx} method returns the return value, which we, in turn, process. In this % case, the return is a URL, which we launch. % -% If we have placed \cs{myMenu} at the document level, the line \verb!\myMenu\r! would not be needed. -% If you are using the same menu several times in the document, put it at the document level to reduce -% file size. -% +% Now, if we did not place \cs{puUseMenus\darg{myMenu}} in the preamble, it can be used at the field level. +% The push button above would then need to be, +%\begin{Verbatim}[xleftmargin=\parindent,codes={\catcode`\%=9},commandchars={|~@}] +%\pushButton[\CA{Packages}\AAmouseenter{|% +% \myMenu\r +% var cChoice = \popUpMenu(myMenu);\r +% if ( cChoice != null ) app.launchURL(cChoice); +%}]{menu}{}{11bp} +%\end{Verbatim} % Also, in the above example, you see how the name, \texttt{myMenu}, passed as an argument % of the popupmenu environment is used as a name and as a command: The name is passed to % \cs{popUpMenu}, while the command expands to the menu structure that is referenced by the name. @@ -131,7 +215,7 @@ % the index of the menu structure array; for example, % \cs{itemindex} might expand to \texttt{[0]}, \texttt{[1].oSubMenu[3]}, or \texttt{[2].oSubMenu[3].oSubMenu[0]}. % If \cs{itemindex} is included in the return value (possibly as an array entry), we can -% know the item the use selected +% know the item the user selected. %\begin{verbatim} %var aChoice=processMenu(AeBMenu); %if (aChoice!=null) { @@ -141,49 +225,79 @@ %} %\end{verbatim} % The above code gets the return array, then uses it to get the title of the item -% selected, +% selected. % \begin{macrocode} \newcount\pum@cnt \def\pum@updateindex{\global\advance\pum@cnt\@ne \edef\pum@rc{\pum@topindex[\the\pum@cnt]}\edef\itemindex{'\pum@rc'}} -\def\pum@initIndexMenu#1{\global\pum@cnt=-1\relax\edef\pum@rc{#1}% +\def\pum@initIndexMenu#1{\global\pum@cnt=\m@ne\edef\pum@rc{#1}% \edef\pum@topindex{\pum@rc}} % \end{macrocode} % \end{macro} % We are now ready to define the \texttt{popupmenu} environment. The environment % takes one required parameter, a name that is used as a JavaScript variable. % This name is also used to create a command. +% \changes{v1.1}{2020/07/21}{Local definition of \string\cs{Esc} and \string\cs{cs}} % \begin{macrocode} -\newenvironment{popupmenu}[1]{\pum@initIndexMenu{}% - \let\pum@holdtoks\@empty - \toks@={\pum@mytab}\@makeother\~ +\newcount\submenuLevel \submenuLevel\z@ +\newenvironment{popupmenu}[1]{\pum@initIndexMenu{}\submenuLevel\z@ + \ifpdfmarkup + \def\textbackslash{\eqbs}\relax + \def\Esc{\textbackslash}\relax + \def\csiv{\eqbs\eqbs}\relax + \def\cs##1{\csiv\csiv##1}\else + \def\Esc{\eqbs\eqbs}\def\cs{\Esc\Esc}\fi + \let\pum@holdtoks\@empty\let\pum@holdtoksEx\@empty + \toks@={\pum@mytab}\@temptokena={\pum@mytab}\@makeother\~% % \end{macrocode} % We initialize with a \cs{@gobble}, which eats up the leading comma (,) % that is placed there by the code below. % \begin{macrocode} - \gdef\msarg{#1}\@AddToMenuToks{\@gobble}% - \let\item\pum@item -}{% - \expandafter\xdef\csname\msarg\endcsname{% - var \msarg\space = [ \pum@holdtoks^^J];}% -} + \gdef\msarg{#1}\gdef\msargEx{#1Ex}\@AddToMenuToks{\@gobble}% + \@AddToMenuToksEx{\@gobble}\let\item\pum@item +\ignorespaces}{% + \csarg\xdef{\msarg}{var \msarg\space = [ \pum@holdtoks^^J];}% + \iftrackingPU + \csarg\xdef{\msargEx}{var \msargEx\space = [ \pum@holdtoksEx^^J];}\fi +\aftergroup\ignorespaces} % \end{macrocode} % \end{environment} -% \begin{macro}{\pum@item} -% At the startup of the \texttt{popupmenu} environment, we \verb|\let\item\pum@item|. -% The definition of \cs{pum@item} takes one argument, the properties described above. +% \begin{macro}{\item}\nmpsep{\small\,\darg{title=\ameta{string},marked=\ameta{\upshape{true\string|false}},enabled=\ameta{\upshape{true\string|false}},return=\ameta{string}}}\\ +% Below is the definition of \cs{pum@item}, at the startup of the +% \env{popupmenu} environment, we \verb|\let\item\pum@item|. +% The definition of \DescribeMacro\pum@item\cs{pum@item} takes one argument, the properties described above. % \begin{macrocode} \newcommand{\pum@item}[1]{\pum@updateindex - \edef\tmp@exp{\noexpand - \setkeys{menustruct}{title,marked=false,enabled,return,#1}}\tmp@exp - \edef\tmp@exp{,^^J\the\toks@ - {cName: "\menustruct@title"% - \ifKV@menustruct@marked, bMarked: true\fi% - \ifKV@menustruct@enabled\else, bEnabled: false\fi% - \ifx\menustruct@return\@empty\else, - cReturn: "\menustruct@return"\fi}}% - \expandafter\@AddToMenuToks\expandafter{\tmp@exp}% -} +% \edef\tmp@exp{\noexpand +% \setkeys{menustruct}{title,marked=false,enabled,return,#1}}\tmp@exp + \setkeys{menustruct}{title,marked=false,enabled,return,#1}\relax + \ifx\menustruct@title\@empty + \PackageWarning{popupmenu} + {A value of the key 'title' is required,\MessageBreak + putting in a place keeper title}% + \def\menustruct@title{This title is undefined}\fi + \edef\tmp@exp{,^^J\the\toks@ + {cName: "\menustruct@title"% + \ifKV@menustruct@marked, bMarked: true\fi% + \ifKV@menustruct@enabled\else, bEnabled: false\fi% +% \ifx\btitle@dash\ef@NO, cItem: \itemindex\fi% + \ifx\menustruct@return\@empty\else,% + cReturn: "\menustruct@return"\fi}}\expandafter + \@AddToMenuToks\expandafter{\tmp@exp}% +% \end{macrocode} +%\changes{v1.1}{2020/07/21}{create extended arrays} +% \begin{macrocode} + \edef\tmp@expEx{,^^J\the\@temptokena + {cName: "\menustruct@title"% + \ifKV@menustruct@marked, bMarked: true\fi% + \ifKV@menustruct@enabled\else, bEnabled: false\fi% +% \ifx\btitle@dash\ef@NO, cItem: \itemindex\fi% + \ifx\btitle@dash\ef@NO + \ifx\menustruct@return\@empty,% + cReturn:"[\itemindex,'\menustruct@title']"% + \else,cReturn:"[\itemindex,'\menustruct@return']"\fi\fi}}% + \expandafter\@AddToMenuToksEx\expandafter{\tmp@expEx}% +\ignorespaces} % \end{macrocode} % \end{macro} % Some technical matters, we need unmatched braces, so we define @@ -195,60 +309,175 @@ \endgroup \def\pum@mytab{\space\space\space\space} % \end{macrocode} -% \begin{environment}{submenu} +% \begin{environment}{submenu}\nmpsep{\,\darg{title=\ameta{title},marked=\ameta{\upshape{true\string|false}}}}\\ % Used to create a submenu of a menu item. The top level menu item has no return value, -% it can be marked but cannot be dis-enabled (\texttt{enabled=false}). +% it can be marked but cannot be disabled (\texttt{enabled=false}). % % The argument of \texttt{submenu} are any of the menu item properties, however, only % \texttt{title} and \texttt{marked} will be recognized. % % The JavaScript property, \texttt{oSubMenu}, of the menu structure passed to % the method \texttt{app.popUpMenuEx} has no {\LaTeX} counterpart. This property -% key-value pair is automatically inserted by the \texttt{submenu} +% key-value pair is automatically inserted by the \env{submenu} % environment. % \begin{macrocode} -\newenvironment{submenu}[1]{\pum@updateindex - \xdef\saved@pum@cnt{\the\pum@cnt}% - \pum@initIndexMenu{\pum@rc.oSubMenu}\edef\temp@toks{\the\toks@}% - \toks@=\expandafter{\temp@toks\pum@mytab}% - \setkeys{menustruct}{title,marked=false,enabled,return,#1}% - \edef\tmp@exp{,^^J\the\toks@ - \noexpand\pum@lbrace cName: "\menustruct@title"% - \ifKV@menustruct@marked, bMarked: true\fi% - \ifKV@menustruct@enabled\else, bEnabled: false\fi, - oSubMenu:^^J\the\toks@[}% +\newenvironment{submenu}[1]{\pum@updateindex\advance\submenuLevel\@ne + \csarg\xdef{pum@cntLevel\the\submenuLevel}{\the\pum@cnt}% +% \xdef\saved@pum@cnt{\the\pum@cnt}\relax + \pum@initIndexMenu{\pum@rc.oSubMenu}\edef\temp@toks{\the\toks@}% + \def\temp@toksEx{\the\@temptokena}% + \toks@=\expandafter{\temp@toks\pum@mytab}% + \@temptokena=\expandafter{\temp@toksEx\pum@mytab}% + \setkeys{menustruct}{title,marked=false,enabled,return,#1}% + \edef\tmp@exp{,^^J\the\toks@ + \noexpand\pum@lbrace cName: "\menustruct@title"% + \ifKV@menustruct@marked, bMarked: true\fi% + \ifKV@menustruct@enabled\else, bEnabled: false\fi, + oSubMenu:^^J\the\toks@[}% % \end{macrocode} % Again, we \cs{@gobble} up the leading comma (,). % \begin{macrocode} - \expandafter\@AddToMenuToks\expandafter{\tmp@exp\@gobble}% -}{% - \edef\tmp@exp{^^J\the\toks@ ]\pum@rbrace}% - \expandafter\@AddToMenuToks\expandafter{\tmp@exp}% - \global\pum@cnt\saved@pum@cnt -} + \expandafter\@AddToMenuToks\expandafter{\tmp@exp\@gobble}% +% \end{macrocode} +% \begin{macrocode} + \edef\tmp@expEx{,^^J\the\@temptokena + \noexpand\pum@lbrace cName: "\menustruct@title"% + \ifKV@menustruct@marked, bMarked: true\fi% + \ifKV@menustruct@enabled\else, bEnabled: false\fi, + oSubMenu:^^J\the\@temptokena[}% + \expandafter\@AddToMenuToksEx\expandafter{\tmp@expEx\@gobble}% +\ignorespaces}{% + \edef\tmp@exp{^^J\the\toks@ ]\pum@rbrace}% + \edef\tmp@expEx{^^J\the\@temptokena ]\pum@rbrace}% + \expandafter\@AddToMenuToks\expandafter{\tmp@exp}% + \expandafter\@AddToMenuToksEx\expandafter{\tmp@expEx}% + \global\pum@cnt\@nameuse{pum@cntLevel\the\submenuLevel}% +\aftergroup\ignorespaces} % \end{macrocode} % \end{environment} -% \begin{macro}{\popUpMenu} -% The \cs{popUpMenu} command takes one argument, the name pass to a -% popupmenu environment. The command expands to the \texttt{app.popUpMenuEx} -% method. The document author must then process the return value in some way. +% \begin{macro}{\popUpMenu}\nmpsep{(\ameta{name})} +% The \cs{popUpMenu} command takes one argument, the \ameta{name} that had +% earlier been passed to a \env{popupmenu} environment. The command expands to the +% \texttt{app.popUpMenuEx} method. The document author must then process the return value in some way. % The argument is enclosed in parentheses, this is so we can use \cs{popUpMenu} % at the document level, we can pass it an argument there. % \begin{macrocode} \def\popUpMenu(#1){app.popUpMenuEx.apply( app, #1 )} % \end{macrocode} % \end{macro} -% \begin{macro}{\urlPath} +% \begin{macro}{\puProcessMenu}\nmpsep{(\ameta{name})} +% When the \opt{tracking} option is taken, use the \cs{puProcessMenu} command to execute +% a menu item with tracking. If \opt{tracking} is not in effect, \cs{puProcessMenu} is the +% same as \cs{popUpMenu}. +% \begin{macrocode} +\def\puProcessMenu(#1){\iftrackingPU + puProcessMenu("#1")\else\popUpMenu(#1)\fi} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\urlPath}\nmpsep{\darg{\ameta{path}}} % A convenience command to save a url path. The string is normalized using % the \textsf{hyperref} command \cs{hyper@normalise}. Though we don't require -% any other packages, you can't do much unless you use \textsf{hyperref} as well. +% any other packages, you can't do much unless you use \textsf{hyperref}. % \begin{macrocode} \providecommand{\urlPath}[1]{\def\pum@urlName{#1}% - \hyper@normalise\pum@urlPath} + \hyper@normalise\pum@urlPath} +%\def\pum@urlPath#1{\csarg\xdef\pum@urlName{#1}} \def\pum@urlPath#1{\expandafter\xdef\pum@urlName{#1}} % \end{macrocode} % \end{macro} +% \leavevmode\DescribeMacro\puUseMenus\nmpsep{\ameta{list-arrays}}, where \ameta{list-arrays} +% is a comma-delimited list of \ameta{name}s that have been declared earlier as an argument +% of a \env{popupmenu} environment. The arrays listed in \ameta{list-arrays} will be defined at +% the document level. +% \begin{macrocode} +\def\puUseTheseMenus{// No pop-up data defined^^J} +\let\puMenuCmds\@empty +\newcommand{\puUseMenus}[1]{\bgroup + \@for\pu@menu:=#1\do{\ifx\puMenuCmds\@empty + \def\puUseTheseMenus{// popupmenu: Begin popup menu data^^J}\fi + \expandafter\g@addto@macro\expandafter + \puMenuCmds\expandafter{% + \csname\pu@menu\endcsname^^J}\relax +% \end{macrocode} +% \begin{macrocode} + \iftrackingPU + \expandafter\g@addto@macro\expandafter + \puMenuCmds\expandafter{% + \csname\pu@menu Ex\endcsname^^J}\relax + \fi +% \end{macrocode} +% \begin{macrocode} + \edef\x{\expandafter\noexpand\@nameuse{\pu@menu}}% + \toks@=\expandafter{\x^^J}% + \expandafter\g@addto@macro\expandafter + \puUseTheseMenus\expandafter{\the\toks@}% +% \end{macrocode} +% \begin{macrocode} + \iftrackingPU + \edef\x{\expandafter\noexpand\@nameuse{\pu@menu Ex}}% + \toks@=\expandafter{\x^^J}% + \expandafter\g@addto@macro\expandafter + \puUseTheseMenus\expandafter{\the\toks@}% + \fi + }\g@addto@macro\puUseTheseMenus + {// popupmenu: End of popup menu data}\egroup + \ifx\puUseTheseMenus\@empty + \def\puUseTheseMenus{// No pop-up data defined}\fi +} +% \end{macrocode} +% A small \env{insDLJS} environment to create the menu arrays at the document level. +% The command \cs{puUseTheseMenus} will expand to the array declarations. +% \begin{macrocode} +\iftrackingPU +\begin{insDLJS}{pujs}{Pop-up Menu Data} +\puUseTheseMenus +\end{insDLJS} +\@onlypreamble\puUseMenus +\begin{insDLJS*}{pumenu} +\begin{newsegment}{popupmenu: Menu tracking support} +var trackingPU=\puTracking; +var PUdebug=false; +var aPULastChoice=new Array; +var bPULastChoice=false; +var bIsMarked=false; +%var aChoice; // make local +function puProcessMenu(cMenu) { // aMenu->cMenu now a string + var cMenuEx=(trackingPU)?cMenu+"Ex":cMenu; + var aMenuEx=eval(cMenuEx); + var cChoice = app.popUpMenuEx.apply( app, aMenuEx ); + if (trackingPU) { + if ( cChoice != null ) { + aChoice=eval(cChoice); + if (aChoice[1]==""||aChoice[1]=="null") return null; + var puRtn=aChoice[1]; + var thisChoice=aChoice[0]; +// eval(cMenuEx+thisChoice).bMarked=true; + if (!bPULastChoice) { + eval(cMenuEx+aChoice[0]).bMarked=true; + } else { + var structLoc=aPULastChoice[1]; + if(aPULastChoice[0]+structLoc==cMenuEx+aChoice[0]) { + bIsMarked = eval(cMenuEx+aChoice[0]).bMarked; + eval(cMenuEx+aChoice[0]).bMarked=!(bIsMarked); + bPULastChoice=false; + if (bIsMarked) var puRtn=null + } else { + eval(aPULastChoice[0]+structLoc).bMarked=false; + eval(cMenuEx+aChoice[0]).bMarked=true; + } + } + aPULastChoice=[cMenuEx,aChoice[0]]; + bPULastChoice=true; + return puRtn; + } else return null; + } else return cChoice; +} +\end{newsegment} +\end{insDLJS*} +\fi +% \end{macrocode} % \begin{macrocode} +\pu@restoreCats %</package> % \end{macrocode} % \Finale diff --git a/macros/latex/contrib/popupmenu/popupmenu.pdf b/macros/latex/contrib/popupmenu/popupmenu.pdf Binary files differdeleted file mode 100644 index daf3bbeab8..0000000000 --- a/macros/latex/contrib/popupmenu/popupmenu.pdf +++ /dev/null |