diff options
author | Norbert Preining <norbert@preining.info> | 2021-04-27 03:00:54 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-04-27 03:00:54 +0000 |
commit | 95b070aee1a6351879af117f723c84d50b48338d (patch) | |
tree | 214e27cd933a5d3216ef0d0db495cbca43415e3c /macros | |
parent | 03117c94362b2fed2fd4aabe50f3106fbf1e0a70 (diff) |
CTAN sync 202104270300
Diffstat (limited to 'macros')
90 files changed, 2261 insertions, 1109 deletions
diff --git a/macros/latex/contrib/acrotex/README.md b/macros/latex/contrib/acrotex/README.md index 65a27dbc5e..ac967ad3f1 100644 --- a/macros/latex/contrib/acrotex/README.md +++ b/macros/latex/contrib/acrotex/README.md @@ -1,6 +1,6 @@ The AcroTeX eDucation Bundle (AeB) Author: D. P. Story -Dated: 2021-02-28 +Dated: 2021-04-24 AeB contains the following: @@ -19,6 +19,11 @@ AeB contains the following: 6) Documentation for AeB (AcroTeX eDucatation Bundle) and eforms (including insdljs and dljslib). +What's New (2021-04-24) + exerquiz: Options usemcfi and userbmintrvl, bug fixes. + dljslib: Revised useGermanNums, created alias of useDeNums; new option + useEnNums, a companion to useDeNums. + What's New (2021-02-28) exerquiz: bug fix to \rbtAAKey. web: removed legacy code. What's New (2021-02-17) exerquiz: Added an optional fourth argument to the JavaScript diff --git a/macros/latex/contrib/acrotex/dljslib.dtx b/macros/latex/contrib/acrotex/dljslib.dtx index 9d1d1dfe4b..53f7f5d62e 100644 --- a/macros/latex/contrib/acrotex/dljslib.dtx +++ b/macros/latex/contrib/acrotex/dljslib.dtx @@ -2,7 +2,7 @@ %<*copyright> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% dljsLib.sty package, %% -%% Copyright (C) 2001-2018 D. P. Story %% +%% Copyright (C) 2001-2021 D. P. Story %% %% dpstory@uakron.edu %% %% %% %% This program can redistributed and/or modified under %% @@ -14,7 +14,7 @@ %</copyright> %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{dljslib} -%<package> [2017/08/11 v2.1 Manage a Library of Document Level JavaScripts (dps)] +%<package> [2021/04/04 v2.2 Manage a Library of Document Level JavaScripts (dps)] %<*driver> \documentclass{ltxdoc} \usepackage[colorlinks,hyperindex=false]{hyperref} @@ -23,6 +23,23 @@ \EnableCrossrefs \CodelineIndex \RecordChanges +\makeatletter +\let\@latex@warning@no@line\@gobble +\makeatother +\def\darg#1{\texttt{\char123\relax#1\char125\relax}} +\def\CMD#1{\textbackslash#1} +\let\pkg\textsf +\let\opt\texttt +\let\env\texttt +\let\app\textsf +\let\uif\textsf +\def\STRUT{\rule{0pt}{14pt}} +\def\negSTRUT{\rule[-8pt]{0pt}{0pt}} +\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}}}} \InputIfFileExists{aebdocfmt.def}{\PackageInfo{dljslib}{Inputting aebdocfmt.def}} {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax \PackageInfo{dljslib}{aebdocfmt.def cannot be found}} @@ -88,12 +105,17 @@ % \begin{macrocode} \dljsRegister[y]{dljslib} % \end{macrocode} -% \subsection{Library Card Catalog} -% \IndexOpt{equations} -% \IndexOpt{vectors} -% \IndexOpt{indefIntegral} -% \IndexOpt{ImplMulti} -% \IndexOpt{nodec} +% \subsection{Library Card Catalog}\leavevmode +% \IndexOpt{equations}^^A% +% \IndexOpt{vectors}^^A% +% \IndexOpt{indefIntegral}^^A% +% \IndexOpt{ImplMulti}^^A% +% \IndexOpt{nodec}^^A% +% \IndexOpt{noBinFac}^^A% +% \IndexOpt{limitArith}^^A% +% \IndexOpt{combinatorics}^^A% +% \IndexOpt{setSupport}^^A% +% \noindent % The arguments of the \cs{DeclareAndRegister} command are the options of this package, and % their names represent JavaScript functions in the library. % \begin{macrocode} @@ -102,41 +124,38 @@ \DeclareAndRegister{indefIntegral} \DeclareAndRegister{ImplMulti} \DeclareAndRegister{nodec} -% \end{macrocode} -% \IndexOpt{noBinFac} -% \IndexOpt{limitArith} -% \IndexOpt{combinatorics} -% \IndexOpt{setSupport} -% More options. -% \begin{macrocode} \DeclareAndRegister{noBinFac} \DeclareAndRegister{limitArith} \DeclareAndRegister{combinatorics} \DeclareAndRegister{setSupport} % \end{macrocode} -% \IndexOpt{unordered} -% \IndexOpt{complex} -% \IndexOpt{satisfyEq} -% \IndexOpt{useGermanNums} -% \IndexOpt{factors} -% More options still. +% \leavevmode +% Additional registered names. +% \IndexOpt{unordered}^^A% +% \IndexOpt{complex}^^A% +% \IndexOpt{satisfyEq}^^A% +% \IndexOpt{useGermanNums}^^A% +% \IndexOpt{useDeNums}^^A% +% \IndexOpt{useEnNums}^^A +% \IndexOpt{factors}^^A% +% \IndexOpt{point}^^A% +% \IndexOpt{intervals}^^A% % \begin{macrocode} \DeclareOption{unordered}{\PackageWarning{dljslib} - {The `unordered' option is now combined with the\MessageBreak - `setSupport' option, will use the `setSupport' option\MessageBreak - instead}\ExecuteOptions{setSupport}} + {The `unordered' option is now combined with the\MessageBreak + `setSupport' option, will use the `setSupport' option\MessageBreak + instead}\ExecuteOptions{setSupport}} %\DeclareAndRegister{unordered} \DeclareAndRegister{complex} \DeclareAndRegister{satisfyEq} \DeclareAndRegister{useGermanNums} +\DeclareOption{useDeNums}{\ExecuteOptions{useGermanNums}} +\DeclareAndRegister{useEnNums} \DeclareAndRegister{factors} -% \end{macrocode} -% \IndexOpt{point} -% \IndexOpt{intervals} -% The final set of options. -% \begin{macrocode} \DeclareAndRegister{point} \DeclareAndRegister{intervals} +% \end{macrocode} +% \begin{macrocode} \def\includeOptions#1{\@for\@option:=#1\do{\dljsRegister[y]{\@option}}} \InputIfFileExists{libcusopt.opt}{}{} % \end{macrocode} @@ -238,6 +257,8 @@ % this of this as the ``front wrapper'' or ``front cover'' of your library selections. It contains the % ``name'' of the library from which you checked out your selections. % \begin{macrocode} +\newcommand{\SyntaxErrorAuthor}{"Syntax error in author's answer! + Check console."} \begin{library@holding}{dljslib} \begin{insDLJS*}[dljslib]{dljslib} \begin{newsegment}{dljslib: AcroTeX DLJS Library} @@ -333,7 +354,7 @@ function ProcRespEq(flag,CorrAns,n,epsilon,domain,indepVars,oComp) } zCorrAns = ParseInput(zCorrAns); if (!ok2Continue) { - eqAppAlert("Syntax error in author's answer! Check console.", 3); + eqAppAlert(\SyntaxErrorAuthor,3); console.println("Syntax Error: " + CorrAns); return null; } @@ -341,10 +362,10 @@ function ProcRespEq(flag,CorrAns,n,epsilon,domain,indepVars,oComp) if (!ok2Continue) return null; % convert vars to new format, if needed indepVars = TypeParameters(indepVars); - var lambda = getNonZeroRatio (domain, indepVars, zCorrAns, zUserAns); + var lambda = getNonZeroRatio(domain,indepVars,zCorrAns,zUserAns); if ( lambda == null ) { eqAppAlert(\eqSyntaxErrorUndefVar,3); return null; }; - if ( !ok2Continue ) return notifyField(false, flag, fieldname); + if ( !ok2Continue ) return notifyField(false,flag,fieldname); zCorrAns = lambda + "*(" + zCorrAns + ")"; success=randomPointCompare (n,domain,indepVars,epsilon, zCorrAns,zUserAns,comp) @@ -508,7 +529,7 @@ typeof oComp.priorParse != "undefined" ) { for (i=0; i<aCorrAns.length; i++) { aCorrAns[i] = ParseInput(aCorrAns[i]); if (!ok2Continue) { - eqAppAlert("Author Syntax error!", 3); + eqAppAlert(\SyntaxErrorAuthor, 3); return null; } aUserAns[i] = ParseInput(aUserAns[i]); @@ -1204,7 +1225,6 @@ domain,indepVars,oComp) { % \end{macrocode} % Modified for multi-letter variables: remove one line, insert two. (2017/08/09) % \begin{macrocode} -% dps17 var UserAns=(arguments.length>7)?arguments[7]:event.value; var retn=_ProcRespEvalEq(false,flag,CorrAns,n,epsilon, indepVars,UserAns); @@ -1273,7 +1293,6 @@ indepVars,oComp) { % \end{macrocode} % Modified for multi-letter variables: remove one line, insert two. (2017/08/09) % \begin{macrocode} -% dps17 var UserAns=(arguments.length>7)?arguments[7]:event.value; var retn=_ProcRespEvalEqList(true,flag,CorrAns,n,epsilon,% indepVars,UserAns); @@ -1446,15 +1465,74 @@ return syntaxError(), null; \end{newsegment} \end{library@holding} % \end{macrocode} -% \subsubsection{\texttt{useGermanNums}} +% \subsubsection{\texttt{useGermanNums} (\texttt{useDeNums})} +% \leavevmode % \IndexOpt{useGermanNums}A simple \texttt{ProcResp()} for processing numbers entered in a German format: 1234,56. % The Germans have a block delimiter of period or space (1.234,56 or 1 234,56). % The period is not supported and causes an alert box. %\changes{v1.9g}{2014/01/14}{Added a proc to accept the comma for the decimal mark} +%\changes{v2.2}{2021/04/04}{Modified useGermanNums, created alias useDeNums} +%\changes{v2.2}{2021/04/04}{Modified proc to warn about English decimal point only} % \begin{macrocode} \@ifcheckedout{useGermanNums} -\newcommand{\noDecPtGerMsg}{"A period (.) is not allowed in answer, - use German notation for numbers"} +% \end{macrocode} +%\leavevmode\DescribeMacro{\noDecPtDeMsg} A general alert message for responses that +% contain a point (.). +% \begin{macrocode} + \dlJSStr[noquotes]{\noDecPtDeMsg}{% + "German Notation Syntax Error: A point (.) was found + in your response \"" + UserAns + "\". + Please remove the point, or this answer will be marked as wrong."} +% \end{macrocode} +% \DescribeMacro{\MsgDei} An alert message when German decimal notation +% is expected. +% \begin{macrocode} + \flJSStr*[noquotes]{\MsgDei}{"German decimal notation is expected, +for example: 12,3456."} + \flJSStr*[noquotes]{\MsgDeiAlt}{"German decimal notation is expected, +for example: 12,3456." +((warnDecDeOnly)?"\n\n +The English decimal notation (12.2345) is also accepted, +however.":"")} +% \end{macrocode} +% \DescribeMacro{\MsgDeii} An alert message when two decimal places are expected. +% \begin{macrocode} + \flJSStr*[noquotes]{\MsgDeii}{"A decimal number is required, +rounded to two decimal places, for example: 12,34"} +% \end{macrocode} +% When \DescribeMacro{\warnDecDeOnlyOn}\cs{warnDefDeOnlyOn} is declared in the preamble, the use of +% the decimal point (.) is accepted but a warning message appears. On the downside, +% the student can enter \texttt{1.00,10}, which will, no doubt, lead to an +% incorrect answer. +% \begin{macrocode} + \def\warnDecDeOnlyOn{\def\warnDecDeOnly{true}} + \def\warnDefDeOnlyOff{\def\warnDecDeOnly{false}} + \warnDefDeOnlyOff +% \end{macrocode} +% \DescribeMacro{\numDe}\nmpsep{\darg{\ameta{Msg}}} is a command that supports +% the German decimal notation point (,). For this command, the decimal point (,) +% is optional; that is, an integer response is accepted. \ameta{Msg} is a message +% that appears on error of syntax. +% \begin{macrocode} + \def\numDe#1{{priorParse:\Array(% + \preReqForm(/\rebstr\rechrclass{+-}?\redigit*,?% + \redigit*\reestr/,(#1)))}} +% \end{macrocode} +% \DescribeMacro{\rndNumDeReq}\nmpsep{\darg{\ameta{nDec-pl}}\darg{\ameta{Msg}}} +% For numbers that are required to be rounded to \emph{exactly} \ameta{nDec-pl} decimal places. +% \ameta{Msg} is an error message. Decimal point (,) is required. +% \begin{macrocode} + \def\rndNumDeReq#1#2{{priorParse:\Array(% + \preReqForm(/\rebstr\rechrclass{+-}?\redigit*,% + \redigit{#1}\reestr/,(#2)))}} +% \end{macrocode} +% \DescribeMacro{\rndNumDeOpt}\nmpsep{\darg{\ameta{nDec-pl}}\darg{\ameta{Msg}}} +% For numbers that are required to be rounded to \emph{at most} \ameta{nDec-pl} decimal places. +% \ameta{Msg} is an error message. Decimal point (,) optional (integer respose +% accepted). +% \begin{macrocode} + \def\rndNumDeOpt#1#2{{priorParse:\Array(% at most two decimal places + \preReqForm(/\rebstr\rechrclass{+-}?% + \redigit*,?\redigit{0,#1}\reestr/,(#2)))}} \fi \begin{library@holding}{useGermanNums} \begin{newsegment} @@ -1463,6 +1541,7 @@ return syntaxError(), null; % \DescribeMacro{ProcRespNumsDe} This segment only has one ProcResp function in it, % this is named \texttt{ProcRespNumsDe}. % \begin{macrocode} +var warnDecDeOnly=\warnDecDeOnly; function ProcRespNumsDe (flag,CorrAns,n,epsilon,% domain,indepVars,oComp) { if (!ProcessIt) return null; @@ -1471,8 +1550,7 @@ domain,indepVars,oComp) { % \end{macrocode} % Modified for multi-letter variables: remove one line, insert two. (2017/08/09) % \begin{macrocode} -% var UserAns = event.value; - var bSubstVars=(arguments.length>7); // dps17 + var bSubstVars=(arguments.length>7); var UserAns=(bSubstVars)?arguments[7]:event.value; % \end{macrocode} % This is the only change over the \texttt{ProcResp}, we call @@ -1489,7 +1567,7 @@ domain,indepVars,oComp) { ok2Continue = true; CorrAns = ParseInput(CorrAns); if (!ok2Continue) { - eqAppAlert("Syntax error in author's answer! Check console.", 3); + eqAppAlert(\SyntaxErrorAuthor,3); return null; } % \end{macrocode} @@ -1502,8 +1580,8 @@ domain,indepVars,oComp) { % \end{macrocode} % Deny use of the traditional decimal point (.) % \begin{macrocode} - if ( reDec.test(UserAns) ) { - eqAppAlert(\noDecPtGerMsg,3); + if ( (!warnDecDeOnly) && (reDec.test(UserAns)) ) { + eqAppAlert(\noDecPtDeMsg,3); return -1; } % \end{macrocode} @@ -1519,13 +1597,13 @@ domain,indepVars,oComp) { % We pass \texttt{UserAnsSave} in case author uses \texttt{priorParse} etc. % \begin{macrocode} var retn=processSpecialParse(oComp.priorParse,UserAnsSave); - if (retn==null) return -1; - } - var reComma=/,/; - if ( reComma.test(UserAns) ) { - eqAppAlert(\eqSyntaxErrorComma,3); - return -1; + if ( (!warnDecDeOnly) && (retn==null) ) return -1; } +% var reComma=/,/; +% if ( reComma.test(UserAns) ) { +% eqAppAlert(\eqSyntaxErrorComma,3); +% return -1; +% } UserAns = ParseInput(UserAns); indepVars = TypeParameters(indepVars); if (!ok2Continue) return null; @@ -1542,6 +1620,59 @@ epsilon,CorrAns,UserAns,comp); % The following functions, which are \texttt{ProcResp}-types, were written for an online % grading system being developed by Drs.\ Bruce Wagner and David Arnold, and Mr. % Jacob Miles-Prystowsky. The descriptions given below were provided by the authors. +% +% \subsubsection{\texttt{useEnNums}} +% \leavevmode +% \IndexOpt{useEnNums}A simple \texttt{ProcResp()} for processing numbers entered in a EN-U format: 1234.56. +% \begin{macrocode} +\@ifcheckedout{useEnNums} +% \end{macrocode} +%\leavevmode\DescribeMacro{\noDecPtEnMsg} A general alert message for responses that +% contain a comma (,). +% \begin{macrocode} + \dlJSStr[noquotes]{\noDecPtEnMsg}{% + "Syntax Error: A comma (,) was found + in your response \"" + UserAns + "\". + Please remove the comma, or this answer will be marked as wrong."} +% \end{macrocode} +% \DescribeMacro{\MsgEni} An alert message when German decimal notation +% is expected. +% \begin{macrocode} + \flJSStr*[noquotes]{\MsgEni}{"English decimal notation is expected, +for example: 12.3456."} +% \end{macrocode} +% \DescribeMacro{\MsgEnii} An alert message when two decimal places are expected. +% \begin{macrocode} + \flJSStr*[noquotes]{\MsgEnii}{"A decimal number is required, +rounded to two decimal places, for example: 12.34"} +% \end{macrocode} +% \DescribeMacro{\numEn}\nmpsep{\darg{\ameta{Msg}}} is a command that supports +% the En decimal notation point (.). For this command, the decimal point (.) +% is optional; that is, an integer response is accepted. \ameta{Msg} is a message +% that appears on error of syntax. +% \begin{macrocode} + \def\numEn#1{{priorParse:\Array(% + \preReqForm(/\rebstr\rechrclass{+-}?\redigit*\\.?% + \redigit*\reestr/,(#1)))}} +% \end{macrocode} +% \DescribeMacro{\rndNumEnReq}\nmpsep{\darg{\ameta{nDec-pl}}\darg{\ameta{Msg}}} +% For numbers that are required to be rounded to \emph{exactly} \ameta{nDec-pl} decimal places. +% \ameta{Msg} is an error message. Decimal point (.) is required. +% \begin{macrocode} + \def\rndNumEnReq#1#2{{priorParse:\Array(% + \preReqForm(/\rebstr\rechrclass{+-}?\redigit*\\.% + \redigit{#1}\reestr/,(#2)))}} +% \end{macrocode} +% \DescribeMacro{\rndNumEnOpt}\nmpsep{\darg{\ameta{nDec-pl}}\darg{\ameta{Msg}}} +% For numbers that are required to be rounded to \emph{at most} \ameta{nDec-pl} decimal places. +% \ameta{Msg} is an error message. Decimal point (.) optional (integer response +% accepted). +% \begin{macrocode} + \def\rndNumEnOpt#1#2{{priorParse:\Array(% at most two decimal places + \preReqForm(/\rebstr\rechrclass{+-}?% + \redigit*\\.?\redigit{0,#1}\reestr/,(#2)))}} +\fi +% \end{macrocode} % \begin{macrocode} \begin{library@holding}{unordered} % \end{macrocode} @@ -1895,7 +2026,7 @@ function ProcPoint(flag,CorrAns,n,epsilon,domain,indepVars,oComp) for (i=0; i<aCorrAns.length; i++) { aCorrAns[i] = ParseInput(aCorrAns[i]); if (!ok2Continue) { - eqAppAlert("Author Syntax error!", 3); + eqAppAlert(\SyntaxErrorAuthor, 3); return null; } aUserAns[i] = ParseInput(aUserAns[i]); @@ -1961,7 +2092,8 @@ function ProcPoint(flag,CorrAns,n,epsilon,domain,indepVars,oComp) %\end{flushleft} % \begin{macrocode} \begin{newsegment}{dljslib: Contrib - Processing Interval Responses} -function ProcRespIntervals(flag,CorrAns,n,epsilon,domain,indepVars,oComp) +function ProcRespIntervals(flag,CorrAns,n,epsilon,domain,% +indepVars,oComp) { ok2Continue = true; if (!ProcessIt) return null; @@ -2341,57 +2473,56 @@ function NoExpAllowed (UserAns) { % \begin{macrocode} function NoTrigAllowed (UserAns) { - UserAns = stripWhiteSpace(UserAns); - if ( !ok2Continue ) return null; - var aTrigfuncs = new Array - ( "acos","asin","atan","cos", "sin", "tan","sec","csc","cot", - "arcsin", "arccos", "arctan" - ); - var re, regexp; - re = /[a-zA-Z]{2,}/g; - aF = UserAns.match(re); - if ( aF != null ) { - for (var i=0; i < aF.length; i++) - { - for(var j=0; j < aTrigfuncs.length; j++) { - if ( aF[i].indexOf(aTrigfuncs[j]) != -1 ) - return eqAppAlert(\NoTrigAllowedErrorMsg,3), null; - } - } - } - return true; + UserAns = stripWhiteSpace(UserAns); + if ( !ok2Continue ) return null; + var aTrigfuncs = new Array + ( "acos","asin","atan","cos", "sin", "tan","sec","csc","cot", + "arcsin", "arccos", "arctan" + ); + var re, regexp; + re = /[a-zA-Z]{2,}/g; + aF = UserAns.match(re); + if ( aF != null ) { + for (var i=0; i < aF.length; i++) { + for(var j=0; j < aTrigfuncs.length; j++) { + if ( aF[i].indexOf(aTrigfuncs[j]) != -1 ) + return eqAppAlert(\NoTrigAllowedErrorMsg,3), null; + } + } + } + return true; } function NoPiAllowed(UserAns) { - UserAns = stripWhiteSpace(UserAns); - if ( !ok2Continue ) return null; - var re=/PI|pi/; - if ( re.test(UserAns) ) - return eqAppAlert(\NoPiAllowedErrorMsg,3), null; - return true; + UserAns = stripWhiteSpace(UserAns); + if ( !ok2Continue ) return null; + var re=/PI|pi/; + if ( re.test(UserAns) ) + return eqAppAlert(\NoPiAllowedErrorMsg,3), null; + return true; } function NoTrigLogAllowed (UserAns) { - UserAns = stripWhiteSpace(UserAns); - if ( !ok2Continue ) return null; - var aTrigfuncs = new Array - ( "acos","asin","atan","cos", "sin", - "tan","sec","csc","cot", "arcsin", "arccos", "arctan", - "logc","log", "ln" - ); - var re, regexp; - re = /[a-zA-Z]{2,}/g; - aF = UserAns.match(re); - if ( aF != null ) { - for (var i=0; i < aF.length; i++) - { - for(var j=0; j < aTrigfuncs.length; j++) { - if ( aF[i].indexOf(aTrigfuncs[j]) != -1 ) - return eqAppAlert(\NoTrigLogAllowedErrorMsg,3), null; - } - } + UserAns = stripWhiteSpace(UserAns); + if ( !ok2Continue ) return null; + var aTrigfuncs = new Array + ( "acos","asin","atan","cos", "sin", + "tan","sec","csc","cot", "arcsin", "arccos", "arctan", + "logc","log", "ln" + ); + var re, regexp; + re = /[a-zA-Z]{2,}/g; + aF = UserAns.match(re); + if ( aF != null ) { + for (var i=0; i < aF.length; i++) + { + for(var j=0; j < aTrigfuncs.length; j++) { + if ( aF[i].indexOf(aTrigfuncs[j]) != -1 ) + return eqAppAlert(\NoTrigLogAllowedErrorMsg,3), null; + } } - return true; + } + return true; } % \end{macrocode} %\changes{v1.9a}{2011/07/15}{Added \texttt{sciNotResp} and \texttt{SciNotResp}} diff --git a/macros/latex/contrib/acrotex/doc/acrobat-in-workflow.pdf b/macros/latex/contrib/acrotex/doc/acrobat-in-workflow.pdf Binary files differindex 9821c49870..48751ef44d 100644 --- a/macros/latex/contrib/acrotex/doc/acrobat-in-workflow.pdf +++ b/macros/latex/contrib/acrotex/doc/acrobat-in-workflow.pdf diff --git a/macros/latex/contrib/acrotex/doc/acrobat-in-workflow.tex b/macros/latex/contrib/acrotex/doc/acrobat-in-workflow.tex index bd12bdd607..c5449528a0 100644 --- a/macros/latex/contrib/acrotex/doc/acrobat-in-workflow.tex +++ b/macros/latex/contrib/acrotex/doc/acrobat-in-workflow.tex @@ -6,12 +6,13 @@ \usepackage{graphicx} \usepackage{fancyvrb} -\ifpdf\else -\def\x{% +\ifpdf\def\x{% + \usepackage[T1]{fontenc} + \usepackage{lucidabr}} +\else\def\x{% \usepackage[altbullet]{lucidbry} \usepackage[active]{srcltx} -}\expandafter\x -\fi +}\fi\x \usepackage{pifont} diff --git a/macros/latex/contrib/acrotex/doc/aeb_man.pdf b/macros/latex/contrib/acrotex/doc/aeb_man.pdf Binary files differindex 9c2b41edc5..7d065627ff 100644 --- a/macros/latex/contrib/acrotex/doc/aeb_man.pdf +++ b/macros/latex/contrib/acrotex/doc/aeb_man.pdf diff --git a/macros/latex/contrib/acrotex/doc/aeb_man.tex b/macros/latex/contrib/acrotex/doc/aeb_man.tex index 3afad031bf..eb0ab08c35 100644 --- a/macros/latex/contrib/acrotex/doc/aeb_man.tex +++ b/macros/latex/contrib/acrotex/doc/aeb_man.tex @@ -9,8 +9,14 @@ exerquiz={nocorrections},aebxmp, dljslib={ImplMulti,limitArith,nodec,satisfyEq} ]{aeb_pro} -%\usepackage{myriadpro} \usepackage[altbullet]{lucidbry} +%\usepackage[LY1]{fontenc} +%\usepackage{myriadpro} +%\usepackage[scaled=0.93]{helvet} +%\usepackage[noTS1]{mtpro} +%%\usepackage{times} +%\usepackage{timesNRMT} + \usepackage{aeb_mlink} \usepackage{longtable,colortbl} \usepackage{graphicx} @@ -235,10 +241,10 @@ \university{{\AcroT} Software Development Team} \email{dpstory@acrotex.net} \versionLabel{Dated:} -\version{2021/02/28} +\version{2021/04/24} \copyrightyears{1999-\the\year} \nocopyright -\prepared{2021/02/28} +\prepared{2021/04/24} \revisionLabel{Distribution Dated:} \copyrightStatus{True} @@ -1592,11 +1598,13 @@ specified with \cs{selectColors}, see \subsection{Basic Information Commands}\label{ss:BIM} -The basic information commands allows you a convenient way to enter the title and author -of the document, as well as other information. To enter this basic information, -just fill in the values of all the basic macros briefly described below. +The basic information commands allows you a convenient way to enter the title +and author of the document, as well as other information. To enter this basic +information, just fill in the values of all the basic macros briefly +described below. -For example, the following is a copy of the title information for this document: +For example, the following is a copy of the title information for this +document: \begin{Verbatim}[xleftmargin=\amtIndent] % \title,\author,\subject,\keywords are sent to DocInfo \title{The Web and Exerquiz Packages Manual of Usage} @@ -2819,9 +2827,9 @@ descriptionwriter={A good, well-liked guy} customProperties={name=Developer,value={D. P. Story, Esq.}} {name=Motivator,value=J\u00FCrgen Gilg} \end{Verbatim} -Executing \texttt{this.info.Developer} returns the value of -\texttt{"D. P. Story, Esq."}, while, \texttt{this.info.Motivator} returns -\texttt{"J\"{u}rgen Gilg"}. +Executing \texttt{this.info.Developer} returns the string value of \uif{D. P. +Story, Esq.}, while, \texttt{this.info.Motivator} returns \uif{J\"{u}rgen +Gilg}. \end{enumerate} @@ -4127,6 +4135,36 @@ continues on the next page. Further documentation can be found in feature is \texttt{contsolns\_ex.tex}, found in the \texttt{examples} folder. +\subsection{The \texttt{usemcfi} Option}\label{eq:usemcfi} + +The \opt{usemcfi} option inputs special code for creating a MC/math fill-in +question, a type of question suggested to me by Stefka K.\ of Bulgaria. In +this MCFI-type question, a question is posed with a multiple of choices +offered; if the correct choice is not present, the student can enter his/her +response in a text field (\cs{RespBoxMath}). + +\exAeBBlogPDF{p=1152} Read the \href{\urlAcroTeXBlog/?p=1152}{Illustrating the +MCFI-type question} article at the {\AcroBlog} web site for more on +this topic. + +\subsection{The \texttt{userbmintrvl} Option}\label{eq:userbmintrvl} + +The \opt{userbmintrvl} option defines \cs{rbmIntrvl} command, the syntax of which is, +\settowidth{\aebdimen}{\cs{rbmIntrvl\darg{[a,b]}\ameta{\textsf{arguments of \cs{RespBoxMath}}}}}% +\begin{dCmd}[commandchars=!()]{\aebdimen+2\fboxsep+2\fboxrule} +\rbmIntrvl{[a,b]}!ameta(!textsf(arguments of !cs(RespBoxMath))) +\end{dCmd} +\newtopic +The \cs{rbmIntrvl} command is a variation on \cs{RespBoxMath}, were some of +the parameters of \cs{RespBoxMath} are set by the interval \texttt{[a,b]}. +Here, any response that falls into the specified interval is accepted as +correct. This approach was suggest to me by Thor G.\ of Germany. + +\exAeBBlogPDF{p=1482} Read the \href{\urlAcroTeXBlog/?p=1482}{The +\texttt{userbmintrvl} option} article at the {\AcroBlog} web site for more on +this topic. + + \section{The \texttt{exercise} Environment}\label{ss:online} The \textsf{exerquiz} package defines \texttt{exercise} and @@ -10756,6 +10794,15 @@ The latter definition takes a delimited argument, necessary since it executes within a verbatim environment where braces \texttt{\{} and \texttt{\}} are not grouping delimiters. +\subsubsection{\texttt{useDeNums} (\texttt{useGermanNums}}\label{useDeNums} + +An option to support the use of the German number system (1234,56), where, in that system +the comma (,) is used as the decimal point. + +\exAeBBlogPDF{p=1039} Refer to the {\AcroTeX} Blog article +\textit{\href{\urlAcroTeXBlog/?p=1129}{The \pkg{dljslib} package: German +number format}} for more information and working examples. + \subsection{Compare Functions} \label{compareFuncs} Compare functions are used to compare the author's answer with the @@ -11095,6 +11142,17 @@ Convert 123.4 to scientific notation. keep working!"} \end{Verbatim} +\subsubsection{\texttt{useEnNums}} + +This is an analog to \texttt{useDeNums}, but no new response function is +defined. It deals with filtering the users' responses to a specified number +of decimal places. + +\exAeBBlogPDF{p=1470} Refer to the {\AcroTeX} Blog article +\textit{\href{\urlAcroTeXBlog/?p=1470}{The \pkg{dljslib} package: English +number format}} for more information and working examples. + + \subsection{Extending Numerical Functions} \label{extNumerFuncs} These JavaScript functions extend the collection of built-in diff --git a/macros/latex/contrib/acrotex/doc/eformman.pdf b/macros/latex/contrib/acrotex/doc/eformman.pdf Binary files differindex 3264428650..c51de3837b 100644 --- a/macros/latex/contrib/acrotex/doc/eformman.pdf +++ b/macros/latex/contrib/acrotex/doc/eformman.pdf diff --git a/macros/latex/contrib/acrotex/doc/eformman.tex b/macros/latex/contrib/acrotex/doc/eformman.tex index 82bea44f5a..4291651cb8 100644 --- a/macros/latex/contrib/acrotex/doc/eformman.tex +++ b/macros/latex/contrib/acrotex/doc/eformman.tex @@ -81,7 +81,7 @@ subject={Documentation for the eforms and insdljs packages}, talksite={\url{www.acrotex.net}}, version={2.0}, - prepared={2021/02/17}, + prepared={2021/04/24}, preparedLabel={Distribution Dated:}, keywords={LaTeX, hyperref, PDF, exercises, quizzes}, copyrightStatus=True, @@ -118,7 +118,7 @@ \makeatletter -\let\bslash=\@backslashchar +\let\bslash\@backslashchar \renewcommand{\paragraph}{\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\bfseries}} % Begin definition of \appendixsubsection diff --git a/macros/latex/contrib/acrotex/eforms.dtx b/macros/latex/contrib/acrotex/eforms.dtx index bc21d96c72..9b4520e336 100644 --- a/macros/latex/contrib/acrotex/eforms.dtx +++ b/macros/latex/contrib/acrotex/eforms.dtx @@ -4,7 +4,7 @@ %<*copyright> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% eForms package, %% -%% Copyright (C) 2002-2020 D. P. Story %% +%% Copyright (C) 2002-2021 D. P. Story %% %% dpstory@uakron.edu %% %% %% %% This program can redistributed and/or modified under %% @@ -16,7 +16,7 @@ %</copyright> %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{eforms} -%<package> [2020/12/14 v2.4.1 Provides general eforms support (dps)] +%<package> [2021/03/11 v2.4.2 Provides general eforms support (dps)] %<*driver> \documentclass{ltxdoc} \usepackage[colorlinks,hyperindex=false]{hyperref}[2012/10/12] @@ -95,18 +95,18 @@ % \textsf{web}; in this case, the options below must explicitly included. % Set the driver dependent code for the |quiz| environments. % -% \changes{v2.2v2.2}{2019/06/12}{Added fields to fields dict, conforming to hyperref} +% \changes{v2.2v2.2}{2019/06/12}{Added fields to fields dict, conforming to \string\pkg{hyperref}} % \changes{v2.13}{2019/06/10}{Added various fields to the fields dictionary so they % can get appearances in non-conforming PDF viewers.} -% \changes{v2.5o}{2012/06/18}{Added required package \string\textsf{ifpdf}} -% \changes{v2.9m}{2017/09/03}{Added the ifluatex package} +% \changes{v2.5o}{2012/06/18}{Added required package \string\pkg{ifpdf}} +% \changes{v2.9m}{2017/09/03}{Added the \string\pkg{ifluatex} package} % \begin{macrocode} \RequirePackage{ifpdf}[2006/02/20] \RequirePackage{ifxetex}[2006/08/21] \RequirePackage{ifluatex} % \end{macrocode} % The \pkg{calc} package is now required (2014/02/18). -% \changes{v2.6c}{2014/02/18}{Added the \string\textsf{calc} package as required package.} +% \changes{v2.6c}{2014/02/18}{Added the \string\pkg{calc} package as required package.} % \begin{macrocode} \RequirePackage{calc} % \end{macrocode} @@ -131,7 +131,7 @@ } % \end{macrocode} % Set the driver for \texttt{pdftex}\IndexOpt{pdftex} -% \changes{v2.9b}{2016/07/22}{Do not pass pdftex driver to insdljs or hyperref} +% \changes{v2.9b}{2016/07/22}{Do not pass pdftex driver to \string\pkg{insdljs} or \string\pkg{hyperref}} % \begin{macrocode} \DeclareOption{pdftex}{% \def\eq@drivernum{1}\def\eq@driver{pdftex}% @@ -139,7 +139,7 @@ } % \end{macrocode} % Added \textsf{luatex} option -% \changes{v2.9m}{2017/09/03}{Add luatex option} +% \changes{v2.9m}{2017/09/03}{Add \string\opt{luatex} option} % \begin{macrocode} \DeclareOption{luatex}{% \def\eq@drivernum{1}\def\eq@driver{luatex}% @@ -190,7 +190,7 @@ % The \texttt{preview}\IndexOpt{preview} option displays the bounding box of each form field with a frame box. % Useful for laying out field with a dvi previewer. % \changes{v2.5n}{2012/04/30}{Changed \string\cs{ifpreview} to a conditional -% definition; this allows the \string\textsf{spdef} package to control the state +% definition; this allows the \string\pkg{spdef} package to control the state % of \cs{ifpreview}.} % \begin{macrocode} \DeclareOption{preview}{\previewtrue} @@ -211,7 +211,7 @@ % Use\IndexOpt{useui} the \textsf{xkeyval} package to specify the options for the links and % forms, key-values are enclosed in the \cs{ui} command inside the option list. % \changes{v2.0}{2008/03/14} -% { +% {% % Added the \string\texttt{useui} option, which inputs \string\textsf{xkeyval} package, % and defines a user-friendly interface to the option arguments. % } @@ -268,18 +268,15 @@ % To support a variations of \app{dvipdfm}, we change the logic from % \cs{ifxetex} to |\ifnum\eq@drivernum=2\relax|, a driver number of 2 % includes \app{dvipdfm} and all its variants. -% \changes{v2.3.4}{2020/07/05}{Change logic from \string\cs{ifxetex} to -% \string\cs{ifnum}\string\cs{eq@drivernum=2\string\relax}} +% \changes{v2.3.4}{2020/07/05}{Change logic for \string\cs{ifxetex}} % \begin{macrocode} \@ifundefined{ifpdfmarkup}{\newif\ifpdfmarkup}{}\pdfmarkupfalse -\ifpdf\else\ifnum\eq@drivernum=2\relax\else\pdfmarkuptrue\fi\fi +\ifpdf\else\ifnum\eq@drivernum=\tw@\else\pdfmarkuptrue\fi\fi \RequirePackage{hyperref} % \end{macrocode} -% Changed \textsf{hyperref} definitions/parameters to add \texttt{1bp} rather than \texttt{1pt} around a form field -% or link. +% Changed \textsf{hyperref} definitions/parameters to add \texttt{1bp} +% rather than \texttt{1pt} around a form field or link. % \changes{v2.9e}{2016/12/22}{Changed hyperref to add 1bp rather than 1pt} -% \changes{v2.3.4}{2020/07/05}{Change logic from \string\cs{ifxetex} to -% \string\cs{ifnum}\string\cs{eq@drivernum=2\string\relax}} % \begin{macrocode} \ifnum\eq@drivernum=2\relax \else @@ -297,7 +294,7 @@ \RequirePackage{insdljs}[2019/02/11] % incl conv-xkv % \end{macrocode} % \changes{v1.0a}{2006/10/03} -% { +% {% % If \string\pkg{exerquiz} is not loaded, we do an automatic begin and end of Form. % Also, if \string\textsf{exerquiz} is loaded, then we use the driver declared in % \string\pkg{exerquiz}; otherwise, we set the default to 0 @@ -320,11 +317,11 @@ \let\ef@YES=y \let\ef@NO=n \let\ef@One=1 \let\ef@Zero=0 \ifnum\eq@drivername<2\relax -\let\to@usepdfmark\ef@One -\RequirePackage[structure]{taborder}\else -\let\to@usepdfmark\ef@Zero -\RequirePackage{taborder} -\fi + \let\to@usepdfmark\ef@One + \def\reqPkg{\RequirePackage[structure]{taborder}}\else + \let\to@usepdfmark\ef@Zero + \def\reqPkg{\RequirePackage{taborder}}\fi +\reqPkg % \end{macrocode} % \begin{macrocode} %</package> @@ -439,7 +436,21 @@ % For example, expanding |\efsave\x\as\y| (eg, |\let\y\x|), the definition of the macro |\y| % has the same definition as |\x| does. Now |\x| is free to be redefined. Later in the document, % we can say |\efrestore\x\from\y| (eg, |\let\x\y|). Now the -% definition of |\x| has its original definition (at the time when it was saved). +% definition of |\x| has its original definition (at the time when it was saved).\medskip +% +% \noindent The two commands \DescribeMacro\txtRef\cs{txtRef} and \DescribeMacro\labelRef\cs{labelRef} +% return pure text: The first returns the value of \cs{ref} as plain text; similarly, \cs{labelRef} returns +% the true destination name of a reference. +% \changes{v2.4.2}{2021/03/11}{Defined \string\cs{txtRef}, also defined in \string\pkg{exerquiz}; +% moved \string\cs{labelRef} from the \string\textsf{userinterface} section of this DTX.} +% \begin{macrocode} +\def\txtRef#1{\@ifundefined{r@#1} + {??}{\aeb@exiii\@firstoffive\csname r@#1\endcsname}} +\def\labelRef#1{\@ifundefined{r@#1}{Doc-Start} + {\aeb@exiii\@fourthoffive\csname r@#1\endcsname}} +\def\aeb@exiii{\expandafter\expandafter\expandafter} +\def\noexpandiii{\noexpand\noexpand\noexpand} +% \end{macrocode} % \begin{macrocode} %</package> % \end{macrocode} @@ -1213,7 +1224,7 @@ % \end{macrocode} % \DescribeMacro{\RV} Rich text value %\changes{v2.5l}{2011/01/28}{% -% Wrap the \cs{RV} key in an XHTML \string\texttt{{\string\ltag}body\string\rtag} element, part of adding +% Wrap the \string\cs{RV} key in an XHTML \string\texttt{{\string\ltag}body\string\rtag} element, part of adding % better support for rich text strings for form fields. %} % \begin{macrocode} @@ -1255,7 +1266,7 @@ % we pass the argument through \cs{pdfstringdef} to get the octal encoding, % which is the method hyperref uses. % \changes{v2.7}{2014/07/08}{Removed the use of \string\cs{ifHy@unicode}, now pass all PDF text strings -% through \cs{pdfstringdef}.} +% through \string\cs{pdfstringdef}.} % \changes{v2.8a}{2015/07/12}{Added \string\cs{ef@isunicode} to automatically detect % unicode} % (2015/07/12) Added \cs{ef@isunicode} to automatically detect @@ -1850,7 +1861,7 @@ %multi-line hyperlinks. Recognizable values are \texttt{y} and \texttt{n}. contiguous boxes %are combined by default. There are command versions of \cs{mlfix}, these are %\DescribeMacro{\mlfixOn} and \DescribeMacro{\mlfixOff} -%\changes{v2.9.16}{2018/03/08}{Added \string\cs{mlfix} for multiline links} +%\changes{v2.9.16}{2018/03/08}{Added \string\cs{mlfix} for multi-line links} %\changes{v2.9.19}{2018/03/22}{Added \string\cs{relax} following width dimension % in \string\cs{@eqmlstrut}} % \begin{macrocode} @@ -3028,7 +3039,7 @@ \long\def\g@addto@macrogobble#1#2{\g@addto@macro{#1}{#2}\@gobbleto@@nil} % \end{macrocode} % \changes{v2.8a}{2015/07/15}{New def for \string\cs{passthruCLOpts}, and modified -% \cs{ef@pdfstrCLOpts} and its spawn.} +% \string\cs{ef@pdfstrCLOpts} and its spawn.} % (2015/07/15) New def for \cs{passthruCLOpts}, and modified \cs{ef@pdfstrCLOpts} and its spawn. % \begin{macrocode} \def\passthruCLOpts{*} @@ -3122,7 +3133,7 @@ % \end{macrocode} % \subsubsection{List Box}\label{listbox} % -%\changes{v2.4}{2020/11/28}{Allow \cs{list@@Box} to obey \string\cs{pdfStringsOn}} +%\changes{v2.4}{2020/11/28}{Allow \string\cs{list@@Box} to obey \string\cs{pdfStringsOn}} % % The main list box code that can be used to build list box commands, such as % \cs{listBox}, defined below. Within @@ -3191,7 +3202,7 @@ % \end{macro} % \subsubsection{Combo Box}\label{combobox} % -%\changes{v2.4}{2020/11/28}{Allow \cs{combo@@Box} to obey \string\cs{pdfStringsOn}} +%\changes{v2.4}{2020/11/28}{Allow \string\cs{combo@@Box} to obey \string\cs{pdfStringsOn}} % % Within the optional argument, the following aliases are used: \cs{nameuse} for \cs{@nameuse} % and \cs{tops} for \cs{texorpdfstring}. @@ -4167,12 +4178,8 @@ % we'll define them here as well. % \begin{macrocode} \def\getargs#1#2{\def\aeb@argi{#1}\def\aeb@argii{#2}} -\def\labelRef#1{\@ifundefined{r@#1}{Doc-Start} - {\aeb@exiii\@fourthoffive\csname r@#1\endcsname}} -\def\aeb@exiii{\expandafter\expandafter\expandafter} \newtoks\ef@flagtoks \newtoks\ef@jstoks -\def\noexpandiii{\noexpand\noexpand\noexpand} % \end{macrocode} % % \subsection{The Appearance Tab} diff --git a/macros/latex/contrib/acrotex/examples/jquiztst.pdf b/macros/latex/contrib/acrotex/examples/jquiztst.pdf Binary files differindex 4508bafbce..945de6c227 100644 --- a/macros/latex/contrib/acrotex/examples/jquiztst.pdf +++ b/macros/latex/contrib/acrotex/examples/jquiztst.pdf diff --git a/macros/latex/contrib/acrotex/examples/jquiztst.tex b/macros/latex/contrib/acrotex/examples/jquiztst.tex index 053bd25487..e6d3a0aa29 100644 --- a/macros/latex/contrib/acrotex/examples/jquiztst.tex +++ b/macros/latex/contrib/acrotex/examples/jquiztst.tex @@ -8,7 +8,7 @@ ]{web} \usepackage{exerquiz} \usepackage[ImplMulti]{dljslib} -\usepackage{pifont} +\usepackage{pifont} % \previewOn \pmpvOn diff --git a/macros/latex/contrib/acrotex/examples/webeqtst.pdf b/macros/latex/contrib/acrotex/examples/webeqtst.pdf Binary files differindex c9d4357f7d..9007fa24b2 100644 --- a/macros/latex/contrib/acrotex/examples/webeqtst.pdf +++ b/macros/latex/contrib/acrotex/examples/webeqtst.pdf diff --git a/macros/latex/contrib/acrotex/exerquiz.dtx b/macros/latex/contrib/acrotex/exerquiz.dtx index 1b65b91b18..7a7a0fdb5d 100644 --- a/macros/latex/contrib/acrotex/exerquiz.dtx +++ b/macros/latex/contrib/acrotex/exerquiz.dtx @@ -22,7 +22,7 @@ %<randomize>\ProvidesFile{aebrandom.def} %<sumrytbls>\ProvidesFile{aebsumrytbls.def} %<template>\ProvidesFile{template.def} -%<package|driver|aebjs|eqexam|randomize|sumrytbls|template> [2021/02/21 v8.6.5 % +%<package|driver|aebjs|eqexam|randomize|sumrytbls|template> [2021/04/24 v8.7 % %<package> Exerquiz: Exercises and Quizzes for LaTeX/PDF package (dps)] %<driver> Exerquiz documentation driver file (dps)] %<aebjs> Exerquiz document level JavaScript (dps)] @@ -56,8 +56,9 @@ \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\meta#1{\textit{\texttt{#1}}} \def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}} +\def\GT{\string>} \pdfstringdefDisableCommands{\let\\\textbackslash} \OnlyDescription % comment out for implementation details \EnableCrossrefs @@ -105,7 +106,7 @@ % \changes{v8.0}{2017/08/08}{Introduce multi-letter variables and alternate appearances. Changes % made are marked by `\texttt{dps17}' throughout the DTX.} % \changes{v7.7k}{2016/04/18}{Minor bug fixes, improved driver recognition} -% \changes{v7.7j}{2016/04/05}{Change in eforms to 2016/04/05 v2.8f} +% \changes{v7.7j}{2016/04/05}{Change in \string\pkg{eforms} to 2016/04/05 v2.8f} % % \section{Introduction} % @@ -123,7 +124,7 @@ \usepackage{keyval} % \end{macrocode} % Some early required packages. -%\changes{v6.4t}{2012/06/18}{Added ifpdf as a required package} +%\changes{v6.4t}{2012/06/18}{Added \string\pkg{ifpdf} as a required package} %\changes{v8.1a}{2017/09/03}{Added check for luatex} % \begin{macrocode} \RequirePackage{ifpdf}[2006/02/20] @@ -145,8 +146,8 @@ % Pass the \opt{monochrome} option to the color package %\changes{v6.06a}{2007/04/09} %{ -% Added the \texttt{forcolorpaper} option for those using -% \textsf{exerquiz} without \textsf{web}. +% Added the \string\texttt{forcolorpaper} option for those using +% \string\textsf{exerquiz} without \string\textsf{web}. %} % \begin{macrocode} \DeclareOption{forpaper}{% @@ -206,7 +207,7 @@ % \end{macrocode} % \leavevmode\IndexOpt{solutionsonly}^^A % Here is a highly specialized option, put in at the request of a former friend. -%\changes{v6.2f}{2007/12/21}{Added a solutionsonly option} +%\changes{v6.2f}{2007/12/21}{Added a \string\opt{solutionsonly} option} % \begin{macrocode} \DeclareOption{solutionsonly}{\solutionsonlytrue\answerkeytrue \therearesolutionstrue\AtEndOfPackage{\let\exerSolnsHeadnToc\relax}} @@ -251,7 +252,7 @@ % \textsf{eqexam}, but can be used in \textsf{exerquiz}. The switch % \cs{ifvspacewithsolns} is defined in \textsf{eqexam}, and we only % define it here if \textsf{eqexam} is not loaded. -% \changes{v6.3x}{2011/04/05}{Added \texttt{vspacewithsolns}} +% \changes{v6.3x}{2011/04/05}{Added \string\opt{vspacewithsolns}} % \begin{macrocode} \@ifundefined{ifvspacewithsolns}{% \DeclareOption{vspacewithsolns}{\vspacewithsolnstrue} @@ -328,7 +329,17 @@ % \begin{macrocode} \newif\ifwithinMCFI\withinMCFIfalse % \end{macrocode} -% +% The \IndexOpt{userbmintrvl}\opt{userbmintrvl} option defines \cs{rbmIntrvl} command, which +% is a special \cs{RespBoxMath} command were some of the parameters are set by an +% interval. Refer to Section~\ref{ss:rbmi} for details. +% \changes{v8.7}{2021/04/24}{Added the option \string\opt{userbmintrvl}} +% \begin{macrocode} +\DeclareOption{userbmintrvl}{% + \def\inputRBMICode{\InputIfFileExists{rbmintrvl.def} + {\PackageInfo{exerquiz}{Inputting rbmintrvl.def}}% + {cannot find rbmintrvl.def}}} +\let\inputRBMICode\relax +% \end{macrocode} % \subsection{Driver Options} % The \textsf{web} package passes these driver options to \textsf{exerquiz}. % These options are needed is \textsf{exerquiz} is used without @@ -409,7 +420,7 @@ % Passes the unicode option to \textsf{hyperref}. % \changes{v6.3}{2008/03/19} % { -% Added the \texttt{unicode} option, which is passed to hyperref. +% Added the \string\opt{unicode} option, which is passed to \string\pkg{hyperref}. % } % \begin{macrocode} \DeclareOption{unicode}{\PassOptionsToPackage{unicode}{hyperref}} @@ -419,7 +430,7 @@ % the key-value pairs \textsl{\'{a} la xkeyval} can be used. % \changes{v6.3}{2008/03/19} % { -% Added the \texttt{useui} option, which is passed to eforms. +% Added the \string\opt{useui} option, which is passed to eforms. % } % \begin{macrocode} \DeclareOption{useui}{\PassOptionsToPackage{useui}{eforms}} @@ -617,7 +628,7 @@ \@ifundefined{if@eqalignfilllinestoleft} {\newif\if@eqalignfilllinestoleft\@eqalignfilllinestoleftfalse}{} % \end{macrocode} -% \changes{v6.3z}{2011/04/28}{Created a switch \cs{ifkeepdeclaredvspacing}, +% \changes{v6.3z}{2011/04/28}{Created a switch \string\cs{ifkeepdeclaredvspacing}, % used primarily by \textsf{eqexam}} % (4/28/11) A switch to control whether the declared vertical space % for the \texttt{solution} environment is preserved during the \texttt{answerkey} @@ -761,9 +772,9 @@ % so we need to load in the AcroForm Dictionary---unless the % \texttt{dviwindo} (\cmd{\eq@noformstrue}) option is requested. %\changes{v6.3y}{2011/04/23}{% -% As per Heiko's suggestion, I've change the \texttt{Form} environment +% As per Heiko's suggestion, I've change the \string\env{Form} environment % no longer creates a grouping. This was causing problems with -% the \textsf{atveryend} package. +% the \string\pkg{atveryend} package. %} % \begin{macrocode} \AtBeginDocument{\ifeq@noforms\else\Form\fi} @@ -810,7 +821,7 @@ \ProcessOptions % \end{macrocode} % Input required packages. -% \changes{v7.03}{2015/03/02}{Added the \texttt{array} package, mostly +% \changes{v7.03}{2015/03/02}{Added the \string\pkg{array} package, mostly % for use in the tabular setup of parts in tabular mode.} % \begin{macrocode} \RequirePackage{array} @@ -866,7 +877,7 @@ {\def\fleqnOn{\@fleqntrue}\def\fleqnOff{\@fleqnfalse}} % \end{macrocode} % \changes{v7.7o}{2016/07/08}{Added Boolean \string\cs{if@inclkey} in support of the -% \string\textsf{eq2db} package} +% \string\pkg{eq2db} package} % \begin{macrocode} \@ifundefined{if@inclkey}{\newif\if@inclkey\@inclkeytrue}{} %</package> @@ -965,9 +976,9 @@ % not change the default value. %\changes{v6.05g}{2007/01/28} %{ -% Added to commands for use in exerquiz or in \textsf{eqexam}. They are -% \cs{renameSolnAfterTo} for conveniently changing the solution -% after label, and \cs{resetSolnAfterToDefault} for resetting +% Added to commands for use in exerquiz or in \string\pkg{eqexam}. They are +% \string\cs{renameSolnAfterTo} for conveniently changing the solution +% after label, and \string\cs{resetSolnAfterToDefault} for resetting % back to the default. %} % \begin{macrocode} @@ -1401,8 +1412,9 @@ % use of \cs{count0}/\cs{count\cs{z@}}, possibly not used within a group. As a fix, % replaced this usage with the counter \cs{eqtmpcnta}. % \changes{v8.5.7}{2020/01/01}{added public counter \string\cs{eqtmpcnta}} -% \changes{v8.5.8}{2020/01/01}{Replaced \string\cs{count\cs{z@}} and \cs{count0} with \string\cs{eqtmpcnta}, -% this fixed the page number leakage problem} +% \changes{v8.5.8}{2020/01/01}{Replaced \string\cs{count\string\cs{z@}} and +% \string\cs{count0} with \string\cs{eqtmpcnta}, this fixed the page number +% leakage problem} % \begin{macrocode} \newcount\eqtmpcnta %</package|eqexam> @@ -1571,7 +1583,7 @@ \newcommand\belowexsolnskip{\protect\medskip} %\let\eqafterexersolnskip\belowexsolnskip % \end{macrocode} -% \changes{v7.4}{2015/03/23}{added \cmd\removelastparskip} +% \changes{v7.4}{2015/03/23}{added \string\cs{removelastparskip}} % \DescribeMacro\removelastparskip removes last \cmd\parskip, as needed. % \begin{macrocode} \def\removelastparskip{\ifdim\parskip>0pt\vskip-\parskip\fi} @@ -1585,8 +1597,8 @@ % has been used % \changes{v6.05a}{2006/05/08} % { -% Changed \cs{nolinkcolor} into a text fill-in. Now, the command \cs{nolinkcolor} -% fills in \cs{@nolinkcolor}, which holds the named color. +% Changed \string\cs{nolinkcolor} into a text fill-in. Now, the command \string\cs{nolinkcolor} +% fills in \string\cs{@nolinkcolor}, which holds the named color. % } % \begin{macrocode} \newcommand{\nolinkcolor}[1]{\def\@nolinkcolor{#1}} @@ -1922,7 +1934,7 @@ % \end{macrocode} % Inform the system that the definition of \cs{eqterminex} is changing. This to prevent % writing the same line multiple times. -% \changes{v8.2.8}{2018/12/13}{write \cs{declareterminex} only if not solutionsafter} +% \changes{v8.2.8}{2018/12/13}{write \string\cs{declareterminex} only if not solutionsafter} % \begin{macrocode} \global\terminexchangedtrue % dps cq \ifeq@solutionsafter\else @@ -1939,7 +1951,7 @@ % \end{macrocode} % \cs{restoreNormalSolns}\DescribeMacro{\restoreNormalSolns} restores \cs{eqterminex} to its % default definition. It is place between exercises. -% \changes{v8.2.8}{2018/12/13}{write \cs{declareterminex} only if not solutionsafter} +% \changes{v8.2.8}{2018/12/13}{write \string\cs{declareterminex} only if not \string\opt{solutionsafter}} % \begin{macrocode} \newcommand\restoreNormalSolns{\ifeq@solutionsafter\else \writeT@ExSolns{\protect\decleqterminex{\protect @@ -2031,7 +2043,7 @@ % \begin{macrocode} \newif\ifeq@exerciseheading \eq@exerciseheadingtrue % \end{macrocode} -% \changes{v6.7q}{2013/12/15}{Added this hook for use by \textsf{contsolns.dtx}} +% \changes{v6.7q}{2013/12/15}{Added this hook for use by \string\textsf{contsolns.dtx}} % \changes{v8.5.10}{2020/03/14}{Added \string\cs{priorexlabelheader} to support \string\pkg{eqexam}} % \begin{macrocode} \let\prior@exerSolnHeaderHook\@empty @@ -2062,7 +2074,7 @@ % set up to have two required arguments, usually both empty. The arguments are % used for filtering. The first might be a number, so we can filter out even numbered % exercises from odd ones. The second one is a keyword, we can filter by keyword. -%\changes{v6.7}{2013/04/07}{Changing \cs{eqEXt} so that it has two +%\changes{v6.7}{2013/04/07}{Changing \string\cs{eqEXt} so that it has two %required arguments} % \begin{macrocode} \let\eqEXt\@gobbletwo @@ -2085,7 +2097,7 @@ %!quad... %\ReturnTo{qex.1}{\hbox {$\square $}}\endeqEXt\par\medskip %\end{Verbatim} -% \changes{v6.7a}{2013/05/03}{Change name of \cs{eq@writeexheader} to \cs{eqExerSolnHeader}} +% \changes{v6.7a}{2013/05/03}{Change name of \string\cs{eq@writeexheader} to \string\cs{eqExerSolnHeader}} % \begin{macrocode} \let\eqExerSolnHeader\@empty % \end{macrocode} @@ -2094,7 +2106,7 @@ % \begin{macrocode} \let\solutionparshape\@empty % \end{macrocode} -%\changes{v7.2}{2015/03/22}{added \cs{setPrbSolnAftrIndent}} +%\changes{v7.2}{2015/03/22}{added \string\cs{setPrbSolnAftrIndent}} % \DescribeMacro{\setPrbSolnAftrIndent}\cmd{\setPrbSolnAftrIndent} sets the amount of indent % for the statement of problem and the solution-after solution. The command saves its argument % in \cs{eq@pslnaindnt} (default \texttt{0pt}) and sets the hook @@ -2108,7 +2120,7 @@ \edef\eq@pslnaindnt{#1}\edef\eq@setPrbSolnAftrIndnt{\expandafter \noexpand\expandafter\parindent#1\noexpand\relax}\fi} % \end{macrocode} -%\changes{v7.2}{2015/03/22}{added \cs{restorejustify}} +%\changes{v7.2}{2015/03/22}{added \string\cs{restorejustify}} %The command \DescribeMacro\restorejustify\cmd{\restorejustify} is designed %for use in the \texttt{solution} environment of an \cs{item} within the %\texttt{parts} environment in \texttt{tabular} mode. By default, @@ -2193,7 +2205,7 @@ \def\eqterminexDEF{\relax\ignorespaces} \decleqterminex{\eqterminexDEF} % \end{macrocode} -%\changes{v6.7}{2013/04/07}{Inserted another argument into \cs{eqEXt}} +%\changes{v6.7}{2013/04/07}{Inserted another argument into \string\cs{eqEXt}} % (2013/04/07) Added another argument into \cs{eqEXt}, used for filtering.\par\medskip % \noindent % (2018/02/13) When solutions are written to the SOL file, they are not normally in a group. @@ -2220,7 +2232,7 @@ \immediate\write\verbatim@out{\eqExerSolnHeaderSngl}% \set@typeset@protect\fi\fi} % \end{macrocode} -%\changes{v6.7}{2013/04/07}{Inserted another argument into \cs{eqEXt}} +%\changes{v6.7}{2013/04/07}{Inserted another argument into \string\cs{eqEXt}} % Added another argument into \cs{eqEXt}, used for filtering. % \begin{macrocode} \def\eqExerSolnHeaderList{% @@ -2258,7 +2270,7 @@ % \cs{noSolnOpt} turns off the check for the option argument % of the \texttt{solution} environment for the \texttt{exercise} % environment. Designed for use with \textsf{eqexam}. -% \changes{v6.4v}{2012/07/27}{Added \cs{ckSolnOpt} and \cs{noSolnOpt} +% \changes{v6.4v}{2012/07/27}{Added \string\cs{ckSolnOpt} and \string\cs{noSolnOpt} % to switch on and off checking for the optional vertical space in the % \texttt{solution} environment.} % \begin{macrocode} @@ -2349,7 +2361,7 @@ }\expandafter\leavevspace \fi} % \end{macrocode} -% \changes{v6.8g}{2014/04/08}{Added key-val here for \textsf{eqexam}.} +% \changes{v6.8g}{2014/04/08}{Added key-val here for \string\pkg{eqexam}.} % New option for the \texttt{solution} environment, \IndexKey{nLines}\texttt{nLines}. % \begin{macrocode} \define@key{soln@keys}{nLines}[]{\def\soln@keys@nLines{#1}} @@ -2393,7 +2405,7 @@ \restoreNormalSolns\fi\fi % dps cq \global\cqIsActivefalse % \end{macrocode} -% \changes{v6.3z}{2011/04/28}{Added definition of \cs{sameVspace} for the cases +% \changes{v6.3z}{2011/04/28}{Added definition of \string\cs{sameVspace} for the cases % where there is no vertical space specified.} % Is the argument \cs{null}? If yes, same as \texttt{0pt}. % \begin{macrocode} @@ -2401,7 +2413,7 @@ \ifx\eq@argi\@empty\gdef\sameVspace{0pt}\else \ifx\eq@argi\eq@null\gdef\sameVspace{0pt}\else % \end{macrocode} -% \changes{v6.8g}{2014/04/08}{Added key-val here for \textsf{eqexam}.} +% \changes{v6.8g}{2014/04/08}{Added key-val here for \string\pkg{eqexam}.} % Now, if the optional argument is non-null, we must discern the argument: % is it a vertical space or a key-value? % \begin{macrocode} @@ -2466,8 +2478,8 @@ } % \end{macrocode} %\changes{v6.4b}{2011/06/30}{% -% Save the definitions of \cs{comment} and \cs{endcomment}. For some reason, -% yet to be determined, there are problems when using the \texttt{fortextbook} +% Save the definitions of \string\cs{comment} and \string\cs{endcomment}. For some reason, +% yet to be determined, there are problems when using the \string\opt{fortextbook} % option when hiding solutions. %} %\changes{v8.2.9}{2019/02/11}{\string\cs{eqSavedComment}\string\cs{dlcomment}, \string\cs{dlcomment}\space @@ -2476,7 +2488,7 @@ \let\eqSavedComment\dlcomment \let\endeqSavedComment\enddlcomment % \end{macrocode} -%\changes{v7.4}{2015/03/23}{added \cs{setTabulrSolnEnv}} +%\changes{v7.4}{2015/03/23}{added \string\cs{setTabulrSolnEnv}} % \begin{macrocode} \def\setTabulrSolnEnv{% \@ifundefined{@listii@SAVE}{\global\let\@listii@SAVE\@listii}{}% @@ -2673,7 +2685,7 @@ % the \texttt{flextended} option from \textsf{eqexam}. See the placement % of this command below its default definition of \cs{relax}. % \changes{v8.1i}{2018/01/20}{Added \string\cs{kdvsp@Restore} to support -% the \texttt{flextended} option from \string\textsf{eqexam}} +% the \string\opt{flextended} option from \string\pkg{eqexam}} % \begin{macrocode} \let\kdvsp@Restore\relax \def\eq@clearMrkCpy{\if@targetforextr @@ -2708,7 +2720,7 @@ % to preserve the vertical space declared by the \textsf{solution} environment when % \cs{ifeq@solutionsafter} is true. % \changes{v6.3z}{2011/04/28}{if \string\cs{ifkeepdeclaredvspacing} is true, we attempt -% to preserve the vertical space declared by the \textsf{solution} environment when +% to preserve the vertical space declared by the \string\env{solution} environment when % \string\cs{ifeq@solutionsafter} is true.} % \begin{macrocode} \ifx\minVspacet@bs\@empty @@ -2720,10 +2732,10 @@ \@tempdima\pagetotal \advance\@tempdima-\eq@startSoln % \end{macrocode} -% \changes{v6.4w}{2012/26/27}{Added \cs{relax} following the assignment.} +% \changes{v6.4w}{2012/26/27}{Added \string\cs{relax} following the assignment.} % {\TeX} was looking ahead looking for the rest of the dimension, this caused % problems because later code was expanded when it should not have been. Inserted -% \cs{relax}, \verb~\@tempdimb\sameVspace\relax~. +% \cs{relax}, |\@tempdimb\sameVspace\relax|. % \begin{macrocode} \@tempdimb\sameVspace\relax % \end{macrocode} @@ -2777,8 +2789,8 @@ % \cs{endexercise}. %\changes{v6.07}{2007/05/05} %{ -% Created the \texttt{exercise*} environment, this is equivalent to the \texttt{*} option of the -% \texttt{exercise} environment. You can use either version, but now, \texttt{exercise*} is preferred. +% Created the \string\texttt{exercise*} environment, this is equivalent to the \string\texttt{*} option of the +% \string\env{exercise} environment. You can use either version, but now, \string\env{exercise*} is preferred. %} % \begin{macrocode} \let\eq@exerstarEnv\relax @@ -2857,8 +2869,8 @@ % \begin{macro}{\setPartsWidth} % Convenience macro to set \cs{part@indent}. %\changes{v6.4h}{2011/07/28}{% -% Added \cs{setPartsWidth} to set \cs{part@indent}. Also -% defined \cs{eqe@prtsepPrb}. +% Added \string\cs{setPartsWidth} to set \string\cs{part@indent}. Also +% defined \string\cs{eqe@prtsepPrb}. %} % \begin{macrocode} \newcommand{\setPartsWidth}[1]{\def\parts@indent{\normalfont#1}% @@ -3052,11 +3064,11 @@ % Now for the tabular style of multi-part exercise, the argument % \#1 is the number of columns requested.\medskip % -% \noindent(2017/02/09) Added \pkg{xkeyval} to optional argument of \texttt{parts}. Syntax is now +% \noindent(2017/02/09) Added \pkg{xkeyval} to optional argument of \env{parts}. Syntax is now %\begin{verbatim} % \begin{parts}[<num>|nCols=<num>,minVspace=<length>] %\end{verbatim} -% \changes{v7.8e}{2017/02/09}{Added xkeyval to optional argument of \string\texttt{parts}} +% \changes{v7.8e}{2017/02/09}{Added xkeyval to optional argument of \string\env{parts}} % \begin{macrocode} \define@key{tabp@rts}{nCols}{\def\exerwparts@cols{#1}} \define@key{tabp@rts}{minVspace}{\def\minVspacet@bs{#1}} @@ -3227,9 +3239,9 @@ \noindent\normalbaselines\kern0pt \prior@parts@hook\abovepartshook % \end{macrocode} -%\changes{v7.03}{2015/03/02}{Added \texttt{>\{\cs{strut}\}}, this gives +%\changes{v7.03}{2015/03/02}{Added \string\texttt{\string\GT{\string\cs{strut}}}, this gives % better control over vertical spacing.}% -% \changes{v7.4}{2015/03/23}{inserted \cmd\setTabulrSolnEnv}% +% \changes{v7.4}{2015/03/23}{inserted \string\cs{setTabulrSolnEnv}}% % \begin{macrocode} \tablrIndent\tabular[t]{@{}*{\exerwparts@cols}{>{\setTabulrSolnEnv \parskip\eqeques@parsep\relax @@ -3239,7 +3251,7 @@ \global\let\@listii@SAVE\relax}% \post@parts@hook\belowpartshook % \end{macrocode} -% \changes{v7.4}{2015/03/23}{added an adjustment to the command \cs{endexercise@parts@tabular}} +% \changes{v7.4}{2015/03/23}{added an adjustment to the command \string\cs{endexercise@parts@tabular}} % A vertical space adjustment\par\medskip\noindent % (201/05/09) There is a problem of communicating the totals through % the \cs{mark} command (use in \textsf{eqexam}). In \textsf{eqexam} @@ -3318,9 +3330,9 @@ {\let\save@@xtabularcr\@xarraycr} {\let\save@@xtabularcr\@xtabularcr}} % \end{macrocode} -%\changes{v7.0}{2014/11/05}{Added \cs{tabControlOn} and \cs{tabControlOff}. +%\changes{v7.0}{2014/11/05}{Added \string\cs{tabControlOn} and \string\cs{tabControlOff}. % Tab control is interfering with regular tabular environments, or anywhere -% \texttt{d} is used.} +% \string\texttt{d} is used.} % \begin{macrocode} \def\tabControlOff{\@ifundefined{@xtabularcr} {\let\@xarraycr\save@@xtabularcr} @@ -3365,7 +3377,7 @@ % to \cs{setkeys}; therefore you can pass a command of key-value options through % the optional argument: % |\def\myOpts{topsep=0pt}|, |\begin{exEnumerate}[\myOpts]|. -% \changes{v8.2.6}{2018/12/03}{Inserted \string\cs{eqprior} prior to exEnumerate env} +% \changes{v8.2.6}{2018/12/03}{Inserted \string\cs{eqprior} prior to \string\env{exEnumerate} env} % The \cs{eqprior} command normally does nothing unless it is redefined. % \begin{macrocode} \newenvironment{exEnumerate}[1][]{\everypar{}% @@ -3555,7 +3567,7 @@ \fi } % \end{macrocode} -%\changes{v6.4q}{2012/03/23}{define \cs{eq@defaultlheader}} +%\changes{v6.4q}{2012/03/23}{define \string\cs{eq@defaultlheader}} % Determine whether \textsf{web} package is loaded, and define \cs{eq@normallheader} % and \cs{eq@defaultlheader}. These are designed to fix a problem of disappearing % headers in the solutions section of the document. @@ -3593,7 +3605,7 @@ % \end{macrocode} % If there are solutions and this is not the \texttt{solutionsonly} option, % we start a new page, clear the right mark and start a normal header. -% \changes{v6.4q}{2012/03/23}{Inserted \cs{eq@normalheader} after \cs{newpage} +% \changes{v6.4q}{2012/03/23}{Inserted \string\cs{eq@normalheader} after \string\cs{newpage} % to get running headers to appear on each page of solutions}% % Inserted |\markright{}| and \cs{eq@normalheader} to fix a problem with % disappearing running headers. @@ -3683,7 +3695,7 @@ % %\changes{v6.2a}{2007/11/10 } %{ -% Added \cs{expdfbookmark} to bookmark exercises. +% Added \string\cs{expdfbookmark} to bookmark exercises. %} % We have to increase the \texttt{tocdepth} so hyperref will create the bookmark at the % subsection level. @@ -3755,7 +3767,7 @@ % Here, we include a few commands common to both % quiz environments. %\medskip\par\noindent -% Colors used by \textsf{exerquiz}: \texttt{webgreen} normally defined in \textsf{web}. +% Colors used by \pkg{exerquiz}: \texttt{webgreen} normally defined in \pkg{web}. % \begin{macrocode} \definecolor{webgreen}{rgb}{0,.6,0} % \end{macrocode} @@ -3765,20 +3777,20 @@ % \changes{v6.05b}{2006/05/12} % { % added a command to change the color of the proofing symbol -% changed the definition of \cs{proofingsymbol} to a text fillin. This creates the command -% \cs{@proofingsymbol}. Can now control the symbol and the color (through \cs{proofingsymbolColor} +% changed the definition of \string\cs{proofingsymbol} to a text fillin. This creates the command +% \string\cs{@proofingsymbol}. Can now control the symbol and the color (through \string\cs{proofingsymbolColor} % } % \begin{macrocode} \newcommand{\proofingsymbolColor}[1]{\def\@proofingsymbolColor{#1}} \proofingsymbolColor{red} -\let\@proofsymbolredefined=0 -\newcommand{\proofingsymbol}[1]{\let\@proofsymbolredefined=1% - \def\@proofingsymbol{\textcolor{\@proofingsymbolColor}{#1}}} +\let\@proofsymbolredefined\eq@Zero +\newcommand{\proofingsymbol}[1]{\let\@proofsymbolredefined\eq@One + \def\@proofingsymbol{\textcolor{\@proofingsymbolColor}{#1}}} \def\@proofingsymbol{\textcolor{\@proofingsymbolColor}{\ding{52}}} -\def\setproofingsymbol{% - \if\@proofsymbolredefined1\else - \@ifpackageloaded{pifont}{\proofingsymbol{\ding{52}}} - {\proofingsymbol{$\bullet$}}\fi} +\def\setproofingsymbol{\ifx\@proofsymbolredefined\eq@One\else + \@ifpackageloaded{pifont}{\proofingsymbol{\ding{52}}} + {\proofingsymbol{$\bullet$}}\fi +} \AtBeginDocument{\setproofingsymbol} % \end{macrocode} % \end{macro} @@ -3804,22 +3816,22 @@ \newcommand{\quesNumColor}[1]{\def\eq@quesNumCol{#1}} \quesNumColor{blue} \renewcommand{\theeqquestionnoi}{\arabic{eqquestionnoi}} -\newcommand{\labeleqquestionnoi}{% - \color{\eq@quesNumCol}\bfseries\theeqquestionnoi.} +\newcommand{\labeleqquestionnoi}{\color{\eq@quesNumCol}\bfseries + \theeqquestionnoi.} \renewcommand\theeqquestionnoii{(\alph{eqquestionnoii})} -\newcommand{\labeleqquestionnoii}{% - \color{\eq@quesNumCol}\bfseries\theeqquestionnoii} +\newcommand{\labeleqquestionnoii}{\color{\eq@quesNumCol}\bfseries + \theeqquestionnoii} \renewcommand\theeqquestionnoiii{(\roman{eqquestionnoiii})} -\newcommand{\labeleqquestionnoiii}{% - \color{\eq@quesNumCol}\bfseries\theeqquestionnoiii} +\newcommand{\labeleqquestionnoiii}{\color{\eq@quesNumCol}\bfseries + \theeqquestionnoiii} % \end{macrocode} % \paragraph*{Properties of the questions environment.} (2013/07/10) These include % \IndexKey{labelwidthTo}\texttt{labelwidthTo} and % \IndexKey{labelwidth}\texttt{labelwidth}. % \begin{macrocode} \define@key{props@ques}{labelwidthTo}% - [\normalsize\normalfont\bfseries00.]% - {\def\propQ@labelwidthTo{#1}} + [\normalsize\normalfont\bfseries00.]% + {\def\propQ@labelwidthTo{#1}} \define@key{props@ques}{labelwidth}[]{\def\propQ@labelwidth{#1}} \let\propQ@labelwidth\@empty % \end{macrocode} @@ -3864,17 +3876,20 @@ \insE@rlyAtQues\gdef\eqPTs{1}% \global\let\eqQT\eq@na% % \end{macrocode} -% (06/06/10) We create a macro \cs{@currentQues} that holds the current -% problem number 2(a)(i), for example. +% (06/06/10) We create a macro, \cs{@currentQues}, that holds the current +% problem number; 2(a)(i), for example. +% \changes{v8.6.7}{2021/04/12}{Remove the misplaced \string\cs{endcsname} +% \string\cs{@thispr@b}, within the \string\env{questions} environment.} % \begin{macrocode} - {\@tempcnta=0 \let\@thispr@b\@empty + {\@tempcnta\z@\let\@thispr@b\@empty \@whilenum\@tempcnta<\@eqquestiondepth\do{\advance\@tempcnta\@ne - \ifx\@thispr@b\@empty\edef\@thispr@b{% - \csname theeqquestionno\romannumeral\the\@tempcnta\endcsname}\else - \edef\@thispr@b{\@thispr@b% - \csname theeqquestionno\romannumeral\the\@tempcnta\endcsname}\fi + \ifx\@thispr@b\@empty\edef\@thispr@b{\@nameuse + {theeqquestionno\romannumeral\the\@tempcnta}}\else + \edef\@thispr@b{\@thispr@b\@nameuse + {theeqquestionno\romannumeral\the\@tempcnta}}\fi }\xdef\@currentQues{\@thispr@b}}% - \makebox[\labelwidth][r]{\normalfont\@nameuse{label\@quesctr}}% + \makebox[\labelwidth][r]{\normalfont + \@nameuse{label\@quesctr}}% format label \xdef\eq@pageThisQ{\the\c@page}% \post@questionsHook}{\usecounter{\@quesctr}% % \end{macrocode} @@ -3928,9 +3943,10 @@ % the \texttt{shortquiz} %\par\medskip\noindent % After all the parsing is done, the parameters for this environment are -%\begin{verbatim} -% \begin{shortquiz}*[<basename>] -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] +%\begin{shortquiz}*[!ameta(basename)] +%\end{Verbatim} %The `\texttt{*}' is optional and signals that forms should be used instead %of links. This option is regressed. The user should use the \texttt{shortquiz*} % environment. The \verb![<basename>]! is the basename of any form fields @@ -3946,7 +3962,7 @@ \abovesqskip{\par\medskip} % \end{macrocode} %\changes{v6.4a}{2011/05/11}{% -% Added \cs{sq@afterhook} for use by \textsf{eqexam}, but may be useful elsewhere. +% Added \string\cs{sq@afterhook} for use by \string\pkg{eqexam}, but may be useful elsewhere. %} %\DescribeMacro\endsqhook\cmd\endsqhook is a late hook % \begin{macrocode} @@ -3959,8 +3975,7 @@ % \begin{macrocode} \let\sqhspace\space \let\ListOfSQuizNames\@empty -\newenvironment{shortquiz} -{% +\newenvironment{shortquiz}{\def\eqPTs{1}% % \end{macrocode} % (06/08/10) The next two lines initialize the macros for registering the % question label, i.e., \texttt{2(a)(ii)}. These two lines are repeated for @@ -3980,15 +3995,15 @@ % The \texttt{shortquiz*} is a short quiz that uses forms. %\par\medskip\noindent % The parameter for this environment is -%\begin{verbatim} -% \begin{shortquiz}[<basename>] -%\end{verbatim} -% The \verb![<basename>]! is the basename of any form fields +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] +%\begin{shortquiz}[!ameta(basename)] +%\end{Verbatim} +% The \texttt{[\ameta{basename}]} is the basename of any form fields % generated. If not present, an base fieldname is generated based on the % \cs{@shortquizCnt} macro (not a counter). The actual name is given in \cs{@sqGenBaseName}. % \begin{macrocode} -\newenvironment{shortquiz*} -{% +\newenvironment{shortquiz*}{% \xdef\eq@pageThisQ{\the\c@page}% {\eqtmpcnta\@shortquizCnt\relax\advance\eqtmpcnta\@ne \xdef\@shortquizCnt{\the\eqtmpcnta}}% @@ -4191,8 +4206,8 @@ if (typeof !oField=="undefined") % \end{answers} % \end{shortquiz} %\end{verbatim} -% To further complicate matters, the \texttt{shortquiz} can be -% used with the \texttt{questions} environment to create a series of +% To further complicate matters, the \env{shortquiz} can be +% used with the \env{questions} environment to create a series of % numbered short question quizzes. See the manual for examples. % \texttt{solution} environment is defined next. % \begin{macro}{solution} @@ -4204,8 +4219,8 @@ if (typeof !oField=="undefined") % option. In this case, solutions are separated by a % \cmd{\medskip} rather then put on a separate page. It also % obeys the \texttt{solutionsafter} option -% \changes{v6.4s}{2012/06/03}{Added hooks \cmd{\sqPostHeaderHook} and -% \cmd{\qPostHeaderHook}} +% \changes{v6.4s}{2012/06/03}{Added hooks \string\cs{sqPostHeaderHook} and +% \string\cs{qPostHeaderHook}} %\par\medskip\noindent % Hooks \DescribeMacro\sqPostHeaderHook\cmd{\sqPostHeaderHook}, % \DescribeMacro\qzPriorSolutionAfterHook\cmd\qzPriorSolutionAfterHook, @@ -4276,20 +4291,19 @@ if (typeof !oField=="undefined") \expandafter\verbatimwrite\fi } \let\qzSolutionsAfterHook\@empty -\def\endsolution@sq -{% - \ifeq@solutionsafter - \eq@fititin{\mbox{\sqslrtnlabel}}\par\qzSolutionsAfterHook - \aftergroup\ignorespaces - \else - \endverbatimwrite - \eq@clearMrkCpy - \ifx\@qzsolndest\@empty\else\set@display@protect - \immediate\write\verbatim@out{\eqSqSolnTrailer}% - \set@typeset@protect - \fi +\def\endsolution@sq{% + \ifeq@solutionsafter + \eq@fititin{\mbox{\sqslrtnlabel}}\par\qzSolutionsAfterHook + \aftergroup\ignorespaces + \else + \endverbatimwrite + \eq@clearMrkCpy + \ifx\@qzsolndest\@empty\else\set@display@protect + \immediate\write\verbatim@out{\eqSqSolnTrailer}% + \set@typeset@protect \fi - \global\let\@qzsolndest\@empty + \fi + \global\let\@qzsolndest\@empty } %</package|eqexam> %<*package> @@ -4298,9 +4312,9 @@ if (typeof !oField=="undefined") % a new page. The argument is a vertical skip. If there is \texttt{\#1} % or more space remaining on the page, the command does nothing, otherwise % it issues a \cs{newpage}. -% \changes{v6.4s}{2012/06/03}{Added \cs{promoteNewPageHere}} +% \changes{v6.4s}{2012/06/03}{Added \string\cs{promoteNewPageHere}} % \changes{v6.8a}{2014/01/01}{Made an optional argument, but test for required argument as swell.} -% \changes{v8.5.6}{2020/01/01}{\string\promoteNewPageHere: added condition, first arg must be greater +% \changes{v8.5.6}{2020/01/01}{\string\cs{promoteNewPageHere}: added condition, first arg must be greater % then 0pt; otherwise, do nothing} % \begin{macrocode} \newcommand\pnphDflt{.1\textheight} @@ -4323,9 +4337,9 @@ if (typeof !oField=="undefined") % re-emitting it later, just prior to the solution. Useful for grouped questions. % \begin{macrocode} \newcommand{\saveDest}[1][]{% - \def\sd@arg{#1}\ifx\sd@arg\@empty - \xdef\holdDest{\@qzsolndest}\else - \xdef\@qzsolndest{#1}\xdef\holdDest{#1}\fi} + \def\sd@arg{#1}\ifx\sd@arg\@empty + \xdef\holdDest{\@qzsolndest}\else + \xdef\@qzsolndest{#1}\xdef\holdDest{#1}\fi} \def\useDest{\def\@qzsolndest{\holdDest}} \let\holdDest\@empty %</package> @@ -4334,17 +4348,17 @@ if (typeof !oField=="undefined") \let\eqSqSolnTrailerHook\@empty \let\eqQzSolnTrailerHook\@empty \newcommand\eqSqSolnTrailer{% - \if\eqQuizType\isQZ - \eqQzSolnTrailerHook - \protect\ReturnTo{page.\eq@pageThisQ}% - {\protect\mbox{\sqslrtnlabel}}\string\endeqQt - \else - \eqSqSolnTrailerHook - \protect\ReturnTo{page.\eq@pageThisQ}% - {\protect\mbox{\sqslrtnlabel}}\string\endeqSQt% - \fi - \ifeqforpaper\protect\fpAfterSolutionsSkip\fi^^J% - \ifmakeQzSlLocal\protect\endgroup^^J\fi + \if\eqQuizType\isQZ + \eqQzSolnTrailerHook + \protect\ReturnTo{page.\eq@pageThisQ}% + {\protect\mbox{\sqslrtnlabel}}\string\endeqQt + \else + \eqSqSolnTrailerHook + \protect\ReturnTo{page.\eq@pageThisQ}% + {\protect\mbox{\sqslrtnlabel}}\string\endeqSQt% + \fi + \ifeqforpaper\protect\fpAfterSolutionsSkip\fi^^J% + \ifmakeQzSlLocal\protect\endgroup^^J\fi } %</package|eqexam> %<*package> @@ -4356,8 +4370,9 @@ if (typeof !oField=="undefined") % \begin{macro}{\endeqSQt} % The \cmd{\eqQt} and \cmd{\eqSQt} are markers at the beginning of each % quiz (short quiz, respectively) solution. These markers, along with -% ``end'' versions, \cmd{\endeqQt} and \cmd{\endeqSQt}, respectively, can be used to filter out the quiz solutions or the -% short quiz solutions. The following example removes all short quizzes. +% ``end'' versions, \cmd{\endeqQt} and \cmd{\endeqSQt}, respectively, +% can be used to filter out the quiz solutions or the +% short-quiz solutions. The following example removes all short quizzes. %\begin{verbatim} %\long\def\eqSQt#1\endeqSQt{} %\begin{document} @@ -4380,13 +4395,13 @@ if (typeof !oField=="undefined") % \begin{macro}{\quizSolnHeader} % Each solution begins with \cmd{\quizSolnHeader}. This can be redefined % for whatever reason. It takes three arguments, one of which is optional. -% \#1 is the \cmd{\noPeek} parameters; \#2 is the named destination to this -% solution; \#3 is the \cmd{\sqsllabel}. +% \texttt{\#1} is the \cmd{\noPeek} parameters; \texttt{\#2} is the named destination to this +% solution; \texttt{\#3} is the \cmd{\sqsllabel}. % % If you want to typeset solutions separately, you can redefine % \cmd{\quizSolnHeader} as desired, and used in conjunction with % \cmd{eqQt}. -% \changes{v6.7q}{2013/12/15}{Added this hook for use by \textsf{contsolns.dtx}} +% \changes{v6.7q}{2013/12/15}{Added this hook for use by \string\textsf{contsolns.dtx}} % \begin{macrocode} \let\prior@quizSolnHeaderHook\@empty \newcommand\quizSolnHeader[3][]{% @@ -4490,14 +4505,12 @@ if (typeof !oField=="undefined") % \end{macrocode} % \DescribeMacro{\quizSolnsHeadnToc} sets up the quiz solution title. % \begin{macrocode} -\def\quizSolnsHeadnToc -{% +\def\quizSolnsHeadnToc{% \edef\eq@mkCmd{\expandafter\noexpand \csname\eq@QzSolnsLevel\endcsname\eq@QzSolnsStar}% \eq@mkCmd{\sqslsectitle}\if!\eq@QzSolnsLabel!\else \label{\eq@QzSolnsLabel}\fi \if\eq@QzSolnsStar*% -% \addtocontents{toc}{\protect\def\protect\web@finalDot{}} \addcontentsline{toc}{\eq@QzSolnsLevel}{% \@ifundefined{web@latextoc}{}{% \ifx\web@latextoc\eq@YES\else @@ -4512,8 +4525,7 @@ if (typeof !oField=="undefined") % \changes{v8.2.6}{2018/12/03}{Placed \string\cs{endinput} at the end of % the quiz solutions file} % \begin{macrocode} -\newcommand{\quizSolnInput} -{% +\newcommand{\quizSolnInput}{% \global\let\webnewpage\relax \bgroup\OKToWriteExamDatatrue \writeT@QzSolns{\string\endinput}\egroup @@ -4648,24 +4660,27 @@ if (typeof !oField=="undefined") % The \texttt{quiz} environment takes an optional `\texttt*' % and one required argument. There are two styles of quizzes: % links or checkboxes. Beginning with v6.08, the use of the \texttt*-option -% is discouraged, use the quiz* environment instead. -%\begin{verbatim} -%\begin{quiz}[*]{<base_name>} +% is discouraged, use the \env{quiz*} environment instead. +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] +%\begin{quiz}[*]{!ameta(base-name)} % ... %\end{quiz} -%\end{verbatim} +%\end{Verbatim} +%Brief description of parameters: % \begin{itemize} -% \item optional \texttt{*} $=$ use checkboxes, otherwise use links -% \item \texttt{<base\_name>}: required argument $=$ base name of quiz. +% \item optional \texttt{*} means to use checkboxes, otherwise use links; +% \item \texttt{\ameta{base-name}}: required argument is the base name of quiz. % \end{itemize} -% -% Note that I set \verb!\tabcolsep=0pt! in preparation for a tabular environment. +% Note that I set \cs{tabcolsep=0pt} in preparation for a tabular environment. % If authors wants to use a tabular environment within a question, he/she must -% reset this value to its default, \verb!\setlength{\tabcolsep}{6pt}!. +% reset this value to its default, |\setlength{\tabcolsep}{6pt}|. % \begin{macrocode} -\newenvironment{quiz} -{\goodbreak\@ifstar{\gdef\qstar{*}\@quiz*f}{\gdef\qstar{x}\@quiz*l}} - {\aeb@endquiz} +\newenvironment{quiz}{\goodbreak + \@ifstar + {\gdef\qstar{*}\@quiz*f} + {\gdef\qstar{x}\@quiz*l}% +}{\aeb@endquiz} \def\@quizCnt{0} % \end{macrocode} % \cs{ListOfQuizNames} and \cs{ListOfSQuizNames} are master lists of all @@ -4712,9 +4727,9 @@ if (typeof !oField=="undefined") \gdef\eqPTs{1}\global\let\eqQT\eq@na % \end{macrocode} % \changes{v6.3u}{2010/11/04}{% -% Added \cs{xdef}\cs{oField}\texttt{\{\#2\}}, this is -% needed for \textsf{apb.dtx}} -% Add \cs{listOfQuizNames} to track quizzes +% Added \string\cs{xdef}\string\cs{oField}\string\darg{\#2}, this is +% needed for \string\textsf{apb.dtx}} +% Add \string\cs{listOfQuizNames} to track quizzes % \changes{v7.8k}{2017/07/25}{Added \string\cs{listOfQuizNames} to track quizzes} % \begin{macrocode} \g@addto@macro\ListOfQuizNames{,#2}% @@ -5115,7 +5130,7 @@ if (isEndQuizPushed("@eqBaseName")){ \fi } % \end{macrocode} -% \changes{v6.7n}{2013/09/17}{\cs{CorrButton} is now an alias for \cs{eqButton}} +% \changes{v6.7n}{2013/09/17}{\string\cs{CorrButton} is now an alias for \string\cs{eqButton}} % \DescribeMacro{\CorrButton} is a name better suited for the task of this button % than the \cs{eqButton} name. % \begin{macrocode} @@ -5369,8 +5384,8 @@ if (isEndQuizPushed("@eqBaseName")){ % \changes{v6.05c}{2006/05/19} % { % Added a convenience macro for setting the name of the quiz. This command defines the -% text macro \cs{currQuiz} which contains the quiz name. Can be used in conjunction -% with \cs{floatQuiz} and \cs{startQuizHere}. +% text macro \string\cs{currQuiz} which contains the quiz name. Can be used in conjunction +% with \string\cs{floatQuiz} and \string\cs{startQuizHere}. % } % \changes{v8.1k}{2018/02/04}{Added \string\cs{oField} to list in \string\cs{DeclareQuiz}} % \begin{macrocode} @@ -5388,12 +5403,12 @@ if (isEndQuizPushed("@eqBaseName")){ % \texttt{quiz} environment. % \changes{v6.05c}{2006/05/19} % { -% Added \cs{floatQuiz}, \cs{dockQuiz} and \cs{startQuizHere} to start a quiz in an +% Added \string\cs{floatQuiz}, \string\cs{dockQuiz} and \string\cs{startQuizHere} to start a quiz in an % arbitrary place prior to the beginning of the quiz. % } %\par\medskip\noindent Usage: %\begin{verbatim} -%\Quiz{myQuiz} +%\DeclareQuiz{myQuiz} %\floatQuiz %........ %\begin{center} @@ -5522,8 +5537,8 @@ if (isEndQuizPushed("@eqBaseName")){ %quizzes only---the title of the quiz is used for the definition of %\cs{sqlabel}. Note that \cs{makeatletter} is invoked before the % parameters are read. -% \changes{v6.7o}{2013/11/25}{Changed \cs{aeb@@titleQuzi} to \cs{aebTitleQuiz}} -% \changes{v6.7p}{2013/12/11}{Added optional parameter to \cs{titleQuiz} +% \changes{v6.7o}{2013/11/25}{Changed \string\cs{aeb@@titleQuzi} to \string\cs{aebTitleQuiz}} +% \changes{v6.7p}{2013/12/11}{Added optional parameter to \string\cs{titleQuiz} % to execute a command, such as incrementing a counter.} % \begin{macrocode} \let\tqhspace\space @@ -5588,11 +5603,11 @@ if (isEndQuizPushed("@eqBaseName")){ % %\changes{v6.2c}{2007/11/14} %{ -% Added the commands \cs{showCreditMarkup} and \cs{hideCreditMarkup} to show partial credit markup +% Added the commands \string\cs{showCreditMarkup} and \string\cs{hideCreditMarkup} to show partial credit markup %} %\changes{v6.3k}{2008/01/09} %{ -% Added \cs{ptsLabel} and \cs{ptLabel} to localize the markup in the margin of a quiz +% Added \string\cs{ptsLabel} and \string\cs{ptLabel} to localize the markup in the margin of a quiz %} % \begin{macrocode} \newcounter{qMarkCnt} @@ -5719,7 +5734,7 @@ if (isEndQuizPushed("@eqBaseName")){ % within a quiz. %\changes{v6.2a}{2007/11/10} %{ -% Added \cs{quizpdfbookmark} to bookmark quizzes. +% Added \string\cs{quizpdfbookmark} to bookmark quizzes. %} % \begin{macrocode} \newcommand{\sqbookmarkfmt}{Short Quiz \@shortquizCnt.\space} @@ -5829,7 +5844,7 @@ if (isEndQuizPushed("@eqBaseName")){ % \changes{v6.05e}{2006/18/06 v6.05e} % { % Added control over the separation between the MC label and subsequent text: -% \cs{setMClabelsep} and \cs{resetMClabelsep}. +% \string\cs{setMClabelsep} and \string\cs{resetMClabelsep}. % } % \begin{macro}{\resetMClabelsep} % \begin{macro}{\eq@hspanner} @@ -6004,7 +6019,7 @@ if (isEndQuizPushed("@eqBaseName")){ % \begin{macrocode} \expandafter\tabular\sq@TabPos{@{}*{#1}{p{\eq@tmpdima}}@{}}}% % \end{macrocode} -% \changes{v7.4}{2015/03/23}{added \cmd{\reset@doendpe}} +% \changes{v7.4}{2015/03/23}{added \string\cs{reset@doendpe}} % \DescribeMacro{\reset@doendpe} attempts to restore the \cs{parshape} % following a list environment. It appears in several locations, includeing % \cs{endanswers}, \cs{endmanswers}, and \cs{setTabulrSolnEnv}. @@ -6134,7 +6149,7 @@ if (isEndQuizPushed("@eqBaseName")){ % For the link multiple choice type question. The driver independent stuff starts % here, then goes to |\Ans@sq@f@driver| the rest of the code that depends on the % driver. -% \changes{v7.7d}{2015/11/15}{Changed mc.\cs{oFields} so it is printable} +% \changes{v7.7d}{2015/11/15}{Changed mc.\string\cs{oFields} so it is printable} % \begin{macrocode} \def\@@Ans@sq@f@Defaults {% @@ -6258,7 +6273,7 @@ if( qzSolnDest!="") updateTally("*oField.*thequestionno");% \PBS\raggedright %</package|eqexam> % \end{macrocode} -%\changes{v6.7d}{2013/05/27}{added \cs{rbf@Opts} to hardwire choices.} +%\changes{v6.7d}{2013/05/27}{added \string\cs{rbf@Opts} to hardwire choices.} % \begin{macrocode} %<*package> \if\Ans@choice\eq@One @@ -6485,9 +6500,9 @@ updateTally("*oField.*thequestionno");*fi% % in the sections that follow. % \changes{v6.2}{2007/11/08 } %{ -% Added the \texttt{manswers} environment, and supporting elements, both {\LaTeX} -% and JavaScript. This \texttt{manswers} environment is for the \texttt{quiz} environment -% only. There is a \texttt{manswers} environment for the \texttt{shortquiz} environment, but +% Added the \string\texttt{manswers} environment, and supporting elements, both {\string\LaTeX} +% and JavaScript. This \string\texttt{manswers} environment is for the \string\texttt{quiz} environment +% only. There is a \string\texttt{manswers} environment for the \string\texttt{shortquiz} environment, but % this is used by \textsf{eqExam} only. %} % @@ -6797,8 +6812,8 @@ updateTally("*oField.*thequestionno");*fi% % \end{macrocode} % \changes{v6.05d}{2007/04/14} % { -% Added the command \cs{insertGrayLetters}. This can be defined to place symbols under -% the multiple choice form boxes. The command \cs{bottomOfAnsfStack} is there as a +% Added the command \string\cs{insertGrayLetters}. This can be defined to place symbols under +% the multiple choice form boxes. The command \string\cs{bottomOfAnsfStack} is there as a % hook for whatever purposes are desired. % } % \begin{macrocode} @@ -6806,7 +6821,7 @@ updateTally("*oField.*thequestionno");*fi% %</package> %<*package|eqexam> % \end{macrocode} -% \changes{v7.7}{2015/06/04}{Added \cs{graylettersColor}} +% \changes{v7.7}{2015/06/04}{Added \string\cs{graylettersColor}} % \DescribeMacro\graylettersColor sets the color of the gray letters, the default is % \texttt{gray}. % \begin{macrocode} @@ -6847,9 +6862,9 @@ updateTally("*oField.*thequestionno");*fi% \def\Ans@c@f@Choice{\Ff{\FfReadOnly}}% \fi % \end{macrocode} -% \changes{v6.7h}{2013/08/19}{When the \cs{useMCCircles} is used, the boundary +% \changes{v6.7h}{2013/08/19}{When the \string\cs{useMCCircles} is used, the boundary % color is transparent. We try a fix for this to show the colored solution -% boundary. The fix uses the \cs{late@options} commands.} +% boundary. The fix uses the \string\cs{late@options} commands.} % \begin{macrocode} \ifaeb@usecircles\def\late@options{\BC{}}\fi \if\Ans@choice\eq@One @@ -7056,7 +7071,7 @@ updateTally("*oField.*thequestionno");*fi% } % \end{macrocode} % \changes{v6.3x}{2011/04/05}{% -% Added \texttt{label} parameter to \cs{bChoices}. +% Added \string\texttt{label} parameter to \string\cs{bChoices}. %} % A new key, \IndexKey{label}\texttt{label}, if this label is specified, then we keep track of all the % correct alternatives, put them into a commands to make them accessible by the user. @@ -7100,8 +7115,9 @@ updateTally("*oField.*thequestionno");*fi% } % \end{macrocode} % \changes{v6.3x}{2011/04/05}{% -% Supporting commands that use the value of the \texttt{label} parameter -% of \cs{bChoices}: \cs{eq@saveAns}, \cs{eq@displayAns}, \cs{eq@displayAlts}, etc. +% Supporting commands that use the value of the \string\texttt{label} parameter +% of \string\cs{bChoices}: \string\cs{eq@saveAns}, \string\cs{eq@displayAns}, +% \string\cs{eq@displayAlts}, etc. %} % \texttt{4/5} We begin an experimental series of commands. The idea is to be able to % conveniently reference a multiple choice problem when the @@ -7188,7 +7204,7 @@ updateTally("*oField.*thequestionno");*fi% % \begin{macro}{\useSavedAltsAns} % \begin{macro}{\useSavedNumAns} % \changes{v6.3x}{2011/04/05}{% -% Added \cs{useSavedAns}, \cs{useSavedAlts}, and \cs{useSavedAltsAns}. +% Added \string\cs{useSavedAns}, \string\cs{useSavedAlts}, and \string\cs{useSavedAltsAns}. %} % These three commands hold the correct alternatives and answers to a multiple choice % or multiple selection problem. The optional first argument allows you to display @@ -7302,7 +7318,7 @@ updateTally("*oField.*thequestionno");*fi% }{\expandafter\@findendans\@gobble}}% % \end{macrocode} % The command that processes the alternatives. -% \changes{v6.7g}{2013/08/09}{Changed \texttt{\#1} to \cs{the}\cs{@temptokena} Fixing +% \changes{v6.7g}{2013/08/09}{Changed \string\texttt{\string\#1} to \string\cs{the}\string\cs{@temptokena} Fixing % a nasty bug. Reported by Christopher C.} % \begin{macrocode} \def\defineEachAns#1{\advance\eqtmpcnta\@ne @@ -7398,7 +7414,7 @@ updateTally("*oField.*thequestionno");*fi% \nextrandom \nextrandom \nextrandom % \end{macrocode} % Save the initial seed value to \cs{eqInitSeedValue}. -% \changes{v6.7f}{2013/08/03}{Save the initial seed value to \cs{eqInitSeedValue}.} +% \changes{v6.7f}{2013/08/03}{Save the initial seed value to \string\cs{eqInitSeedValue}.} % \begin{macrocode} \xdef\InitSeedValue{\the\randomi}% \fi @@ -7433,8 +7449,8 @@ updateTally("*oField.*thequestionno");*fi% % \cs{@ansChoices}. % \changes{v6.1}{2007/10/28} % {% -% Added support for randomizing the multiple choices, requires the use of \cs{bChoices} -% and \cs{eChoices}. +% Added support for randomizing the multiple choices, requires the use of \string\cs{bChoices} +% and \string\cs{eChoices}. % } % \changes{v8.6.2}{2021/01/20}{Incorporated \string\cs{if@DoNotRandomize} % into the \string\cs{@ansChoices} macro for MC and MS questions} @@ -7669,10 +7685,10 @@ updateTally("*oField.*thequestionno");*fi% % equivalent to \cs{ref}. %\changes{v6.06c}{2007/04/26} %{ -% Added \cs{REF} in support of the \texttt{showgrayletters} option. +% Added \string\cs{REF} in support of the \string\texttt{showgrayletters} option. %} %\changes{v6.4d}{2011/07/14}{% -% Correct \cs{REF} so that a link is created. +% Correct \string\cs{REF} so that a link is created. %} % \begin{macrocode} \def\REF{\@ifstar{\let\isREFstar\eq@One\aeb@REFstar} @@ -7714,7 +7730,7 @@ updateTally("*oField.*thequestionno");*fi% % %\changes{v6.3j}{2008/12/08} %{ -% Added \cs{useMCCircles} and \cs{useMCCRects}. +% Added \string\cs{useMCCircles} and \string\cs{useMCCRects}. %} % \par\medskip\noindent We use a switch to keep track of ``circle mode.'' If the % document author invokes \cs{useMCCircles} when we are already in circle mode, @@ -7829,8 +7845,8 @@ updateTally("*oField.*thequestionno");*fi% % in the preamble, we allow the score to go below zero. %\changes{v6.3i}{2008/10/22} %{ -% Added \cs{negPointsAllowed} to allow negative scores on quizzes. This is only relevant -% when the quiz has a \texttt{manswers} environment. +% Added \string\cs{negPointsAllowed} to allow negative scores on quizzes. This is only relevant +% when the quiz has a \string\texttt{manswers} environment. %} % \begin{macrocode} \def\negPointsAllowed{\def\negpointsallowed{true}} @@ -7846,7 +7862,7 @@ updateTally("*oField.*thequestionno");*fi% % and multiple choice questions. %\changes{v6.3m}{2010/01/27} %{ -% Added \cs{requireAlertBox} to turn off the ``Do not show this message again'' checkbox for objective questions. +% Added \string\cs{requireAlertBox} to turn off the ``Do not show this message again'' checkbox for objective questions. %} %The alert box displays the message \cs{doNotShowAgainMsg} which by default is %``Do not show this message again'' @@ -8008,8 +8024,8 @@ updateTally("*oField.*thequestionno");*fi% \ifShowAppr\altApprOn\let\eqAddAAFormat\@empty\fi} % \end{macrocode} % Get any changes in the appearance of the text box -% \changes{v6.4c}{2011/07/01}{\cs{RespBoxMath} now records its lists of -% independent variables under the global variable \texttt{\_mathVars}.} +% \changes{v6.4c}{2011/07/01}{\string\cs{RespBoxMath} now records its lists of +% independent variables under the global variable \string\texttt{\_mathVars}.} % \begin{macrocode} \begin{defineJS}[\makeesc\*\makecmt\%]{\AAKqRespBoxMath} % \end{macrocode} @@ -8489,6 +8505,57 @@ if(event.willCommit) { % \end{macro} % \end{macro} % \end{macro} +% \begin{macrocode} +%</package> +%<*rbmIntrvl> +% \end{macrocode} +% \subsubsection{The \texorpdfstring{\protect\cs}{\textbackslash}{rbmIntrvl} command}\label{ss:rbmi} +% This code segment is input into \pkg{exerquiz} when the \opt{userbmintrvl} is specified. +% The commands of this section are motivated by an {Acro\negthinspace\TeX} user (Thor G). He +% wants to ask his students to make a series of calculations, the result of +% which is to be entered into a \cs{RespBoxMath} input box. He is willing to +% accept the response as correct if the response falls into a designated +% interval $[a,b]$. +% +% Two commands are defined, one internal (\cs{c@lcEPInfo}) and the other public {\cs{rbmIntrvl}}. +% +% The first command \cs{c@lcEPInfo} takes as its parameters an (closed) interval of numbers. +% It calculates the midpoint \DescribeMacro\intrCAns\cs{intrCAns} and +% \DescribeMacro\intrPrec\cs{intrPrec}. The first number can be used as a (representative) point +% value of the answer; the second is used as the precision parameter of \cs{RespBoxMath}. +% \changes{v8.7}{2021/04/24}{Added \string\cs{rbmIntrvl}} +% \begin{macrocode} +\def\c@lcEPInfo[#1,#2]{% + \setlength{\eflength}{(#1pt+#2pt)/2}% + \edef\intrCAns{\strip@pt\eflength}% + \setlength{\eflength}{(#2pt-#1pt)/2}% + \edef\intrPrec{\strip@pt\eflength}% +} +% \end{macrocode} +% \DescribeMacro\rbmIntrvl\hskip-\marginparsep\texttt{\darg{[\meta{a{\upshape,}b}]}} +% This macro takes as its first argument the interval you want the student response +% to fall into. The command expands \cs{c@lcEPInfo} then \cs{RespBoxMath}. Use \cs{intrCAns} and \cs{intrPrec} +% in the arguments of \cs{RespBoxMath}. +% \begin{macrocode} +\newcommand{\rbmIntrvl}[1]{\c@lcEPInfo#1\RespBoxMath} +% \end{macrocode} +% \cs{rbmIntrvl} has implied arguments, those of \cs{RespBoxMath}. Below is a simple example. +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small,codes={\catcode`\%=9}] +%\rbmIntrvl{[6.40,6.90]}{\intrCAns}{1}{\intrPrec}{[0,1]} +%\end{Verbatim} +%Following the interval declaration are the parameters of \cs{RespBoxMath}. The first +%one following the interval is the correct answer (\cs{intrCAns}), the midpoint of the interval; +%the third argument following the interval is the precision parameter of \cs{RespBoxMath}, +%which is taken to be \cs{intrPrec}, the half-width of the interval. +% \begin{macrocode} +%</rbmIntrvl> +%<*package> +% \end{macrocode} +% We input the definition of \cs{rbmIntrvl} here, if the \opt{userbmintrvl} +% option is taken. +% \begin{macrocode} +\inputRBMICode +% \end{macrocode} %\subsection{Text Fill-In} % \begin{macro}{\RespBoxTxt} % \begin{macro}{\RespBoxTxtNT} @@ -8726,8 +8793,8 @@ if(event.willCommit) { % \end{macro} % \DescribeMacro{\txtRef}\hskip-\marginparsep\texttt{\darg{\ameta{label}}} % The \cs{RespBoxTxt} can be used for a matching-type question. We define a special -% \cs{ref}-type command that produces plain text. Refer to demo file \texttt{qz-matching.tex} for -% details. +% \cs{ref}-type command that produces plain text. Refer to demo file +% \texttt{qz-matching.tex} for details. % \changes{v8.6.4}{2021/02/15}{Support for matching-type question based in % \string\cs{RespBoxTxt}} % \begin{macrocode} @@ -9173,7 +9240,7 @@ else !processJSfunc("obj.!oField.!thequestionno","!CorrectAns",% %{% % Fixed a problem with the clear button not setting the boundary color % back to the default. I must have changed the name of an objective field, -% now, we say \texttt{this.getField("obj.\cs{oField}")}. +% now, we say \string\texttt{this.getField("obj.\string\cs{oField}")}. %} % \begin{macrocode} \def\sqClearButtonDefaults @@ -10298,8 +10365,8 @@ aCorrectAns[!currQuiz.Grp["!thequestionno"].offset],!oField);!fi % %\changes{v6.3b}{2008/06/29} %{ -% Added the \cs{AddAAKeystroke} to the recognizable set of keys. This will be obeyed -% within the optional arguments of \cs{RespBoxMath} and \cs{RespBoxTxt}. +% Added the \string\cs{AddAAKeystroke} to the recognizable set of keys. This will be obeyed +% within the optional arguments of \string\cs{RespBoxMath} and \string\cs{RespBoxTxt}. %} % \begin{macrocode} \def\@eqAddAAKeystroke#1{\def\argi{#1}\ifx\argi\@empty @@ -10491,9 +10558,9 @@ var aDlLibSpecResp=new Array(\dlLibSpecRespJS); % JSf is an array of supported mathematical functions. %\changes{v6.06}{2007/02/23} %{ -% Separated the \texttt{JSf} array into \texttt{JSfBuiltIn} and \texttt{JSfCustom}. This +% Separated the \string\texttt{JSf} array into \string\texttt{JSfBuiltIn} and \string\texttt{JSfCustom}. This % allows us to identify the built-in JavaScript functions. I concatenate these two -% into \texttt{JSf}. +% into \string\texttt{JSf}. %} % \begin{macrocode} var JSfBuiltIn = new Array @@ -10516,7 +10583,7 @@ var JSfBuiltIn = new Array % recognized properly when implmulti from dljslib is active. I think that % the problem is caused by the fact that arcsin(x) follows sin(x) in the % field of known functions and converted into arc*sin(x) and then into -% a*r*c*sin(x). I enclose the patch for the exerquiz.dtx file which in my +% a*r*c*sin(x). I enclose the patch for the \textsf{exerquiz.dtx} file which in my % opinion solves the problem.'' %} % \begin{macrocode} @@ -10636,8 +10703,8 @@ function CkBalVert(UserInput) % \texttt{UserInput}: a string\\ % Returns: 1 (if there is a match); 0 (if no match) % also sets the global variable \texttt{ok2Continue} to \texttt{false}. -% \changes{v6.4c}{2011/07/01}{Ckfunc now uses a global variable \texttt{\_mathVars} which -% holds the variables of the current \cs{RespBoxMath} being processed. We search +% \changes{v6.4c}{2011/07/01}{Ckfunc now uses a global variable \string\texttt{\_mathVars} which +% holds the variables of the current \string\cs{RespBoxMath} being processed. We search % all substrings containing 2 or more letters; if it consists only of the variables % that substring is OK.} % \begin{macrocode} @@ -11009,8 +11076,8 @@ function ParseInput(UserInput) %\changes{v6.06}{2007/02/23} %{ % Now, just before we return the parsed expression, we append all built-in -% JavaScript functions and constants with \texttt{Math.}, this is to avoid -% having to use the \texttt{with(Math)} construct. These changes are in support +% JavaScript functions and constants with \string\texttt{Math.}, this is to avoid +% having to use the \string\texttt{with(Math)} construct. These changes are in support % of using scientific notation. %} % \begin{macrocode} @@ -11533,7 +11600,7 @@ function reldiffCompare(_a,_c,_v,_F,_G) { % ]\CorrAnsButton{-4z^3(3z+4)^2} %\end{verbatim} % where \cs{refac}, \cs{repow}, \cs{redigit}, and \cs{rediv} are convenience macros defined -% earlier in \texttt{exerquiz.dtx}. The regular expression describe the form of the answer +% earlier in \textsf{exerquiz.dtx}. The regular expression describe the form of the answer % acceptable. % % There seems to be a redundancy in the usage of \cs{Array}, but this is by design. @@ -11859,8 +11926,8 @@ function eqFilter(filterMethod) { case 3: default: % \end{macrocode} -%\changes{v6.4k}{2011/08/17}{Within the function eqFilter, changed \texttt{this} to -% \texttt{this.toString()}. The comparisons were returning false when they shouldn't +%\changes{v6.4k}{2011/08/17}{Within the function eqFilter, changed \string\texttt{this} to +% \string\texttt{this.toString()}. The comparisons were returning false when they shouldn't % this is because in this case, we were comparing objects to objects} % \begin{macrocode} return this.toString(); @@ -11954,23 +12021,31 @@ function ProcUserResp(key,userresp,probno,notify) fieldPopTbl(a[1]); } } +% \end{macrocode} +% (2021/04/04) Added try/catch to catch exceptions. +% \changes{v8.6.6}{2021/04/04}{Added some try/catch pairs to avoid tossing cookies} +% \begin{macrocode} function ProcUserNoResp(key,userresp,probno,notify) { if ( arguments.length > 4 ) { - RightWrong[probno][arguments[4]] = undefined; - Responses[probno][arguments[4]] = undefined; + try{ + RightWrong[probno][arguments[4]] = undefined; + Responses[probno][arguments[4]] = undefined; + } catch(e){}; var bVoidArray=true; - for (var i=0; i<Responses[probno].length; i++) { - if ( typeof Responses[probno][i] != "undefined") { - bVoidArray=false; - break; - } - } - if (bVoidArray) { - Responses[probno]=undefined; - RightWrong[probno]=undefined; + try { + for (var i=0; i<Responses[probno].length; i++) { + if ( typeof Responses[probno][i] != "undefined") { + bVoidArray=false; + break; + } + } + } catch(e){}; + if (bVoidArray) { + Responses[probno]=undefined; + RightWrong[probno]=undefined; ProbValue[probno]=undefined; - } + } } else { RightWrong[probno] = undefined; Responses[probno] = undefined; @@ -12204,7 +12279,7 @@ function DisplayQuizResults(qtfield,nPointTotal,nQuestions) % be either \texttt{true} or \texttt{false}; if \texttt{true}, \texttt{DisplayQuizResults()} % does not display quiz results; the default is \texttt{false}. This feature is used in the % demo file \texttt{qz-pin-to-correct.tex} found on the {Acro\!\TeX} Blog. -% \changes{v8.6.4}{2021/02/17}{Added conditional (\texttt{\_bSilent})} +% \changes{v8.6.4}{2021/02/17}{Added conditional (\string\texttt{\_bSilent})} % \begin{macrocode} var _bSilent=(arguments.length > 3 ) ? arguments[3] : false; if (!_bSilent) { diff --git a/macros/latex/contrib/acrotex/exerquiz.ins b/macros/latex/contrib/acrotex/exerquiz.ins index f8e05e4265..24bd038e43 100644 --- a/macros/latex/contrib/acrotex/exerquiz.ins +++ b/macros/latex/contrib/acrotex/exerquiz.ins @@ -50,6 +50,7 @@ \file{aebrandom.def}{\from{exerquiz.dtx}{copyright,randomize}} \file{aebsumrytbls.def}{\from{exerquiz.dtx}{copyright,sumrytbls}} \file{usemcfi.def}{\from{exerquiz.dtx}{copyright,mcfi}} + \file{rbmintrvl.def}{\from{exerquiz.dtx}{copyright,rbmIntrvl}} \file{eqcolor.def}{\from{exerquiz.dtx}{copyright,eqcolor}} \file{template.def}{\from{exerquiz.dtx}{copyright,template}} \file{eqfr.def}{\from{exerquiz.dtx}{copyright,eqfr}} diff --git a/macros/latex/contrib/acrotex/insdljs.dtx b/macros/latex/contrib/acrotex/insdljs.dtx index a13d72c43c..df525e1c2c 100644 --- a/macros/latex/contrib/acrotex/insdljs.dtx +++ b/macros/latex/contrib/acrotex/insdljs.dtx @@ -20,6 +20,11 @@ %<*driver> \documentclass{ltxdoc} \usepackage[colorlinks,hyperindex=false]{hyperref} +\usepackage{fancyvrb} +\makeatletter +\let\@latex@warning@no@line\@gobble +\renewcommand{\paragraph}{\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}{\bfseries}} +\makeatother \usepackage{makeidx} \makeindex \def\EXPT{!} @@ -33,6 +38,7 @@ \let\opt\texttt \let\app\textsf \let\pkg\textsf +\let\uif\textsf \def\visispace{\symbol{32}} \def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}} \def\meta#1{\textsl{\texttt{#1}}} @@ -84,31 +90,26 @@ % \subsection{The \texttt{insDLJS} Environment} % % The following is a quick illustration of the use of the new environment. -% \begin{verbatim} -% \documentclass{article} -% \usepackage[pdftex]{hyperref} -% \usepackage[pdftex]{insdljs} -% -% \newcommand\tugHello{Welcome to TUG 2001!} -% -% \begin{insDLJS}[HelloWorld]{mydljs}{My Private DLJS} -% function HelloWorld() -% { -% app.alert("\tugHello", 3); -% } -% \end{insDLJS} -% \begin{document} -% \begin{Form} % needed for \PushButton -% -% \section{Test of the \texttt{insDLJS} Package} -% -% % use built in form button of hyperref -% Push \PushButton[name=myButton, -% onclick={HelloWorld();}]{Button} -% -% \end{Form} -% \end{document} -% \end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!~@},codes={\catcode`\%=9}] +%\documentclass{article} +%\usepackage{hyperref} +%\usepackage{insdljs} +%\newcommand\tugHello{Welcome to TUG 2001!} +%\begin{insDLJS}[HelloWorld]{mydljs}{My Private DLJS} +%function HelloWorld(){app.alert("\tugHello", 3);} +%\end{insDLJS} +%\begin{document} +%\begin{Form} !%!textsf~ needed for !cs~PushButton@@ +% +%\section{Test of the \textsf{insDLJS} Package} +% +%!%!textsf~ use the built-in form button of hyperref@ +%Push \PushButton[name=myButton,onclick={HelloWorld();}]{Button} +% +%\end{Form} +%\end{document} +%\end{Verbatim} % This environment takes three parameters, the first of which is required % for users of \texttt{dvips} and \texttt{dvipsone} and optional otherwise. % Within the environment, `|\|', is the escape character, and `|%|' is the comment @@ -122,16 +123,16 @@ % within the JavaScript. When the \texttt{debug} option is used, the markers % show up in the document level JavaScript; otherwise, they are not written % to the PDF document. Here is a simple example, -% \begin{verbatim} -%\begin{insDLJS}[HelloWorld]{mydljs}{My Private DLJS} -%function HelloWorld() -%{ -% app.alert("\tugHello", 3); -% var x = "\\"; -%\db console.println("Entered HelloWorld function and x = " + x);\db% +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] +%\begin{insDLJS}{mydljs}{My Private DLJS} +%function HelloWorld() { +%*1app.alert("\tugHello", 3); +%*1var x = "\\"; +%\db console.println("Entered HelloWorld function and x = " + x);\db!% %} %\end{insDLJS} -%\end{verbatim} +%\end{Verbatim} % The last line of the function will appear in the DLJS if compiled under % the \texttt{debug} option; otherwise, it is removed. Additional discussion % of this debugging device is given below. @@ -141,34 +142,34 @@ % This package also defines an \cs{OpenAction} command to introduce actions that are % executed when the PDF document is opened on page~1. The open action command only % applies to page~1. -% \begin{flushleft} -% \textbf{Usage} -%\begin{verbatim} +%\paragraph*{Usage} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\catcode`\%=9}] %\OpenAction{/S/JavaScript/JS(app.alert("Hello World!");)} -%\end{verbatim} -% \end{flushleft} -% The package defines a |\JS| that takes one argument. The code |\JS{#1}| expands to -% |/S/JavaScript/JS (#1)|, and so the above example may be written as -% \begin{flushleft} -%\begin{verbatim} +%\end{Verbatim} +% The package defines a \cs{JS} command that takes one argument. The code |\JS{#1}| expands to +% |/S/JavaScript/JS (#1)|, and so the above example may be written as, +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\catcode`\%=9}] %\OpenAction{\JS{app.alert("Hello World!");}} -%\end{verbatim}% -%\end{flushleft} +%\end{Verbatim}% % Multiple JavaScript commands can be entered. For nice formatting use \cs{r} % and \cs{t} for carriage return and tab, respectively. %\goodbreak -%\begin{verbatim} -%\OpenAction{\JS{% -% app.alert("Hello World!");\r -% app.alert("Good Day to You!"); +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] +%\OpenAction{\JS{*% +%*1app.alert("Hello World!");\r +%*1app.alert("Good Day to You!"); %}} -%\end{verbatim} +%\end{Verbatim} % The open actions are placed in a token list. Additional actions are added to the token list, so % you say -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] %\OpenAction{\JS{app.alert("Hello World!");}} %\OpenAction{\JS{app.alert("Good Day to You!");}} -%\end{verbatim} +%\end{Verbatim} % the two messages will appear each time you open page~1 of the document. % % In the case of users of the distiller, \textsf{insdljs} uses this mechanism to @@ -181,15 +182,15 @@ % % Let me describe in rough terms what goes on behind the scenes. In the discussion % below, the following example will be used: -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] %\newcommand\tugHello{"Hello World!"} -%\begin{insDLJS}[HelloWorld]{mydljs}{My Private DLJS} -%function HelloWorld() -%{ -% app.alert("\tugHello", 3); +%\begin{insDLJS}{mydljs}{My Private DLJS} +%function HelloWorld(){ +%*1app.alert("\tugHello", 3); %} %\end{insDLJS} -%\end{verbatim} +%\end{Verbatim} % % \subsubsection{For the \texttt{pdftex} and \texttt{dvipdfm} Options} % @@ -251,16 +252,16 @@ % that function. However, if you can declare variables and initialize them at the document level outside % of a function, these variables will have document wide scope. Throughout the document, the values of these % global variables are known. For example -%\begin{verbatim} -%\begin{insDLJS}[HelloWorld]{mydljs}{My Private DLJS} -%var myVar = 17; // defined outside a function, global scope -%function HelloWorld() -%{ -% var x = 3; // defined inside a function, local scope -% app.alert("\tugHello", 3); +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] +%\begin{insDLJS}{mydljs}{My Private DLJS} +%var myVar = 17; //*textsf~ defined outside a function, global scope@ +%function HelloWorld(){ +%*1var x = 3; //*textsf~ defined inside a function, local scope@ +%*1app.alert("\tugHello", 3); %} -% \end{insDLJS} -%\end{verbatim} +%\end{insDLJS} +%\end{Verbatim} % Both the function \texttt{HelloWorld()} and the variable \texttt{myVar} are known throughout % the document. The function \texttt{HelloWorld()} can be called by a mouse up button action; % some form field, executing some JavaScript, may access the value of \texttt{myVar} and/or @@ -348,34 +349,36 @@ % % The following environment, defines a command \cs{myCmd} what expands to the verbatim % contents of the environment. -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %\begin{defineJS}{\myCmd} -% ... -% <JavaScript code> -% ... +%... +%!ameta(JavaScript code) +%... %\end{defineJS} -%\end{verbatim} +%\end{Verbatim} % % There is also a \textsf{localJS} environment that makes any definitions within the % environment local. % %The following examples uses some macros from the \textsf{eforms} package: -%\begin{verbatim} -% % Define a text macro that will be expanded from within the -% % defineJS environment +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~$},codes={\def\1{\quad}\catcode`\%=9}] +%*%*uif~ Define a text macro that will be expanded from within$ +%*%*uif~ the *env~defineJS$ environment$ %\def\HelloWorld{Hello World} -% % Now define some JavaScript to execute with a button to be created. -% % We enclose the defineJS and the \pushButton in the localJS environment -% % That way, the macro definitions, \JSA, \JSAAE, \JSAAX will be local to -% % this group +%*%*uif~ Now define some JavaScript to execute with a button to be created.$ +%*%*uif~ We enclose the *env~defineJS$ and the *cs~pushButton$ in the *env~localJS$ environment$ +%*%*uif~ That way, the macro definitions, *cs~JSA$, *cs~JSAAE$, *cs~JSAAX$ will be local to$ +%*%*uif~ this group$ %\begin{localJS} -% % Make @ the escape so we can demonstrate the optional parameter. -%\begin{defineJS}[\catcode`\@=0\relax]{\JSA} +%*%*uif~ Make @ the escape so we can demonstrate the optional parameter.$ +%\begin{defineJS}[\makeesc\@]{\JSA} %var sum = 0; %for (var i = 0; i < 10; i++) %{ -% sum += i; -% console.println("@HelloWorld i = " + i ); +%*1sum += i; +%*1console.println("@HelloWorld i = " + i ); %} %console.println("sum = "+sum); %\end{defineJS} @@ -385,13 +388,14 @@ %\begin{defineJS}{\JSAAX} %console.println("Exiting the button area"); %\end{defineJS} -%\pushButton[% -% \A{\JS{\JSA}} -% \AA{\AAMouseEnter{\JS{\JSAAE}} -% \AAMouseExit{\JS{\JSAAX}}} +%\pushButton[*% +%*1\A{\JS{\JSA}} +%*1\AA{\AAMouseEnter{\JS{\JSAAE}} +%*1*1 \AAMouseExit{\JS{\JSAAX}} +%*1} %]{myButton}{30bp}{15bp} %\end{localJS} -%\end{verbatim} +%\end{Verbatim} % % See the section \Nameref{defineJS} for details of these two environments. % \section{Package Options and Requirements} @@ -531,7 +535,7 @@ % The option \texttt{!reqis} turns off this feature; that is, there is no notification % via the \textsf{YMB} (\textsf{Yellow Message Bar}) that Javascripts are used in the document, and the % document may not function as designed. -% \changes{v2.2d}{2016/04/06}{Added \texttt{reqjs} and \texttt{{\string\quotechar}reqjs}.} +% \changes{v2.2d}{2016/04/06}{Added \string\texttt{reqjs} and \string\texttt{{\string\EXPT}reqjs} options.} % \begin{macrocode} \DeclareOptionX{reqjs}{\let\dl@reqJS\dl@YES} \let\dljs@reqJS\dl@YES @@ -659,7 +663,7 @@ % \end{macrocode} % If \texttt{reqjs} is in effect, we execute the following code, otherwise, we % do not. The \textbf{\textsf{Requirements}} dictionary goes in the document \textbf{\textsf{Catalog}}. -% \changes{v2.2d}{2016/04/06}{Code to support \texttt{reqjs} and \texttt{{\string\EXPT}reqjs} options.} +% \changes{v2.2d}{2016/04/06}{Code to support \string\texttt{reqjs} and \string\texttt{{\string\EXPT}reqjs} options.} % \begin{macrocode} \def\AEB@psMrk{[%] \space} @@ -671,7 +675,7 @@ \fi % \end{macrocode} % Added switch to mark whether djs is inserted -% \changes{v2.4}{2018/07/21}{Added switch}{Added \cs{ifthereisdjs}} +% \changes{v2.4}{2018/07/21}{Added switch}{Added \string\cs{ifthereisdjs}} % \begin{macrocode} \newif\ifthereisdjs \thereisdjsfalse \def\applydljs#1{\ifthereisdjs\else#1 @@ -738,19 +742,16 @@ % % Again, both JavaScript and \TeX, certain punctuation marks have special meaning; in the case of % JavaScript, punctuation has a special meaning within regular expressions: -%\begin{flushleft} -%\textbf{Special Punctuation in Regular Expressions} +%\paragraph*{Special Punctuation in Regular Expressions} %\begin{verbatim} % ^ $ . * + ? = ! : | \ / ( ) [ ] { } %\end{verbatim} -%\end{flushleft} -% % Complications continued. The distiller method (the \texttt{dvipsone} or the % \texttt{dvips} option), and the \textsf{pdftex}/\textsf{dvipdfm} applications % handle the backslash differently. The following example illustrates the problem. % {\small %\begin{verbatim} -%dvipsone/dvips +%dvips %LaTeX Source As appears in PDF %var x = "\"; --> var x = "\"; (SyntaxError: Unterminated string literal) %var x = "\\"; --> var x = "\\"; (Correct) @@ -761,7 +762,7 @@ % `\verb+\\+' to get the single backslash. % {\small %\begin{verbatim} -%pdftex/dvipdfm +%pdftex/xetex %LaTeX Source As appears in PDF %var x = "\"; --> var x = ""; (\" is the literal ") %var x = "\\"; --> var x = "\"; (SyntaxError: Unterminated string literal) @@ -776,16 +777,17 @@ % and to adjust their definitions depending on the driver option. As a result, of these % background definitions, the JavaScript writer does not worry too much about these details, % for example -%\begin{verbatim} -%\begin{insDLJS}[HelloWorld]{mydljs}{My Private DLJS} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] +%\begin{insDLJS}{mydljs}{My Private DLJS} %function HelloWorld() %{ -% app.alert("\tugHello", 3); -% var x = "\\"; -% app.alert("x = " + x); +%*1app.alert("\tugHello", 3); +%*1var x = "\\"; +%*1app.alert("x = " + x); %} %\end{insDLJS} -%\end{verbatim} +%\end{Verbatim} % So much for the complication. % %\subsection{Begin Code} @@ -828,7 +830,7 @@ % \end{macrocode} % \end{macro} % \begin{macro}{\Thread}\hskip-\marginparsep\texttt{\darg{\ameta{thread-title}}} -% \changes{v2.4.9}{2020/07/09}{Added \string\Thread} +% \changes{v2.4.9}{2020/07/09}{Added \string\cs{Thread}} % A thread action; this command is used in the \pkg{artthreads} package. % \begin{macrocode} \providecommand{\Thread}[1]{/S/Thread/D(#1)} @@ -841,7 +843,7 @@ % \end{macrocode} % \end{macro} % \begin{macro}{\Launch}\hskip-\marginparsep\texttt{\darg{\ameta{file-spec}}} -% \changes{v2.5}{2020/12/20}{Added \string\Launch} +% \changes{v2.5}{2020/12/20}{Added \string\cs{Launch}} % A launch action % \begin{macrocode} \providecommand{\Launch}[1]{/Launch/F(#1)} @@ -894,7 +896,7 @@ % A help macro to define \cs{dfnJSR} in a convenient way; \cs{dfnJSR} is % used in the \env{defineJS} environment. % \changes{v2.5}{2020/12/20}{Helper commands \string\cs{dfnJSCR} to define -% \string\cs{defineJSjsR} and \cs{dfnJSCRDef} to set default.} +% \string\cs{defineJSjsR} and \string\cs{dfnJSCRDef} to set default.} % \begin{macrocode} \def\dfnJSCR#1{\gdef\dfnJSR{#1}\gdef\defineJSjsR{#1}} \def\dfnJSCRDef{\dfnJSCR{\string\r\eqbs^^J}} @@ -903,7 +905,7 @@ % \end{macrocode} % \cs{r} is recognized by hyperref when \cs{pdfstringdef} is used. Hyperref % then modifies the expansion of \cs{r}. So, we'll use \cs{n} in those situations. -% \changes{v2.0l}{2012/11/10}{Added \cs{jsN}} +% \changes{v2.0l}{2012/11/10}{Added \string\cs{jsN}} % \begin{macrocode} \def\jsN{\string\n} {\catcode`\^^I\active % @@ -931,10 +933,10 @@ % should the need arise. %\changes{v2.0b}{2008/06/19} %{ -% A simple command for creating JS strings with unicode \cs{uXXXX}. +% A simple command for creating JS strings with unicode \string\cs{uXXXX}. %} -% \changes{v2.0m}{2013/12/23}{Added \cs{jscsDflt} and \cs{jscsDLJS}, incorporated into \cs{dl@defJSStr}.} -% Added \cs{jscsDflt} and \cs{jscsDLJS}, incorporated them into \cs{dl@defJSStr}. +% \changes{v2.0m}{2013/12/23}{Added \string\cs{jscsDflt} and \string\cs{jscsDLJS}, incorporated into \string\cs{dl@defJSStr}.} +% Added \string\cs{jscsDflt} and \string\cs{jscsDLJS}, incorporated them into \string\cs{dl@defJSStr}. % \begin{macrocode} \def\dl@lparen{(}\def\dl@rparen{)} \def\genericNL{^^J} @@ -1043,9 +1045,10 @@ % \begin{macro}{\db}\hskip-\marginparsep{\,\texttt{...\cs{db}}} % The \cs{db} macro can be used within the \texttt{insDLJS} to insert % addition JS commands to help debug the code. Usage: -%\begin{verbatim} -% \db console.println("myVal = " + myVal);\db% -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] +%\db console.println("myVal = " + myVal);\db*% +%\end{Verbatim} % Any material (on one line) that is between the two \verb+\db+ will either be % written to the DLJS (if \cmd{\dljs@debug} expands to \texttt y), or be removed from % the final output (if \cmd{\dljs@debug} does not expand to \texttt y). @@ -1171,9 +1174,10 @@ % direct (almost) all auxiliary files of insDLJS to the specified % path. The macro takes one parameter, a path on your local hard % disk. Usage: -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] %\insPath{c:/temp/} -%\end{verbatim} +%\end{Verbatim} % Be sure to use only forward slashes, and don't forget to finish % the string with a final forward slash, as illustrated above. % @@ -1195,7 +1199,7 @@ % or link (see \cs{eq@setButtonProps} and \cs{eq@setWidgetProps}). % They are used for formatting JavaScript code. The command % \cs{makespecialJS} is defined in \textsf{insdljs}. -% \changes{v2.1}{2015/06/15}{Moved \cs{makeJSspecials} from \textsf{eforms} +% \changes{v2.1}{2015/06/15}{Moved \string\cs{makeJSspecials} from \string\textsf{eforms} % to here.} % \begin{macrocode} \begingroup @@ -1207,13 +1211,13 @@ \def\\{\eqbs\eqbs}% % define \\ to be \\ \let\jslit\string % \end{macrocode} -% \changes{v2.0n}{2014/05/20}{Remake the definition of \cs{\char`\{} and \cs{\char`\}}} +% \changes{v2.0n}{2014/05/20}{Remake the definition of \string\cs{\char`\{} and \string\cs{\char`\}}} % In an attempt to avoid the use of \verb~\jslit\{~ and \verb~\jslit\}~, we remake % the definition of \verb~\{} and \verb~\}~. % \begin{macrocode} \let\{\dl@lBrace\let\}\dl@rBrace % \end{macrocode} -% \changes{v2.1}{2015/07/12}{\cs{let} \cs{u} to \cs{@empty}.} +% \changes{v2.1}{2015/07/12}{\string\cs{let} \string\cs{u} to \string\cs{@empty}.} % \cs{let} \cs{u} to \cs{@empty}. % \begin{macrocode} \let\u\@empty @@ -1226,8 +1230,8 @@ % various action-types may be executed. These actions occur before the document JavaScripts % are read and before any pages are opened. We give support for this event, originally part % of the \textsf{aeb\_pro} package. -%\changes{v2.1}{2015/06/15}{Moved definition of \cs{addToDocOpen} from -% \textsf{aeb\_pro} to \textsf{insdljs}, added support for \texttt{pdftex} and \texttt{xetex} +%\changes{v2.1}{2015/06/15}{Moved definition of \string\cs{addToDocOpen} from +% \textsf{aeb\_pro} to \textsf{insdljs}, added support for \string\texttt{pdftex} and \string\texttt{xetex} % options.} % \paragraph*{Page views} % The view can be set when the page key is used. Possible values are @@ -1263,10 +1267,11 @@ % with different action-types. Must be executed in the preamble or it has no effect. % It populates the value of the key \textbf{/OpenAction} in the \textbf{Catalog} of the % PDF file. -%\begin{verbatim} -% \addToDocOpen{\JS{console.println("Open the doc!");}} -% \addToDocOpen{/S/GoTo/D[\Page{2}\fitpage]} -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] +%\addToDocOpen{\JS{console.println("Open the doc!");}} +%\addToDocOpen{/S/GoTo/D[\Page{2}\fitpage]} +%\end{Verbatim} % \begin{macrocode} \newcommand{\addToDocOpen}[1]{% \ifx\aebpFA\dl@NO @@ -1309,7 +1314,7 @@ % If \textsf{aeb\_pro} is not loaded, we set the open actions. If \textsf{aeb\_pro} % is loaded, we do nothing for \textsf{aeb\_pro} has its own contributions to the % PDF \textbf{Catalog}. -% \changes{v2.3d}{2017/01/08}{Use \cs{aebpFA} to detect open actions} +% \changes{v2.3d}{2017/01/08}{Use \string\cs{aebpFA} to detect open actions} % \begin{macrocode} \@ifpackageloaded{aeb_pro}{} {\AtBeginDocument{\ifx\aebpFA\dl@YES\expandafter @@ -1384,10 +1389,11 @@ % Distiller (dvipsone and dvips users of the distiller), if additional open page action % is needed on the first page, you can insert this action using the \cmd{\nextOAction} command. % -%\medskip\noindent Usage -%\begin{verbatim} -% \OpenAction{\JS{app.beep(-1); app.alert("Welcome to my Page!",3);}} -%\end{verbatim} +%\paragraph*{Usage} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] +%\OpenAction{\JS{app.beep(-1); app.alert("Welcome to my Page!",3);}} +%\end{Verbatim} % The macro takes two parameters, the \cmd{\Next} followed by the desired action, in this % case it is a JavaScript action. % @@ -1395,17 +1401,19 @@ % is a \cmd{\Next}, additional code is entered into the open page action. Thus, for example, the % following code is effectively the same as the above example, but the individual lines are % listed separately in the GUI action dialog of Acrobat. -%\begin{verbatim} -% \OpenAction{\JS{app.beep(-1);}} -% \Next{\JS{app.alert("Welcome to my Page!",3);}} -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] +%\OpenAction{\JS{app.beep(-1);}} +%\Next{\JS{app.alert("Welcome to my Page!",3);}} +%\end{Verbatim} % In the above example, several open page actions are ``chained'' together. % % You are not restricted to JavaScript actions, for example, you can perform a \texttt{Named} % action: -%\begin{verbatim} -% \OpenAction{/S/Named/N/Open} -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={*~@},codes={\def\1{\quad}\catcode`\%=9}] +%\OpenAction{/S/Named/N/Open} +%\end{Verbatim} % There is a |\Named| command that expands to |/S /Named /N#1|, so the above % example can be written %\begin{verbatim} @@ -1554,40 +1562,39 @@ % within the environment, eventually ends up in the DLJS section of the % PDF document % -% The environment takes the \texttt{<base\_name>} and writes the -% file \texttt{<base\_name>.djs}. This file contains a verbatim +% The environment takes the \texttt{\ameta{base\_name}} and writes the +% file \texttt{\ameta{base\_name}.djs}. This file contains a verbatim % listing of the JS within the environment, plus some changing of % catcodes. This file is then input back into the document at % \cmd{\AtBeginDocument} with the necessary code for % \textsf{pdftex} and \textsf{dvipdfm} properly place the JS. % % The case of \textsf{dvipsone} and \textsf{dvips} is a little different. A -% \texttt{<base\_name>.djs} is written and input back, and a second file -% \texttt{<base\_name>.fdf} is written. This second file is later input +% \texttt{\ameta{base\_name}.djs} is written and input back, and a second file +% \texttt{\ameta{base\_name}.fdf} is written. This second file is later input % into the PDF document after distillation. % % The syntax of usage for this environment, which takes three -% arguments, is given next. -%\begin{verbatim} -% \begin{insDLJS}[<function>]{<base_name>}{<script_name>} -% <JavaScript functions or exposed code> -% ... -% ... -% \end{insDLJS} -%\end{verbatim} +% arguments, is given next.\goodbreak +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\def\1{\quad}\catcode`\%=9}] +%\begin{insDLJS}[!ameta(function)]{!ameta(base_name)}{!ameta(script_name)} +%!1!ameta(JavaScript functions or exposed code) +%\end{insDLJS} +%\end{Verbatim} % where, % \begin{description} -% \item[\texttt{\#1:}] This optional parameter, \texttt{<function>}, -% is \emph{required} for the \texttt{dvipsone} and \texttt{dvips} -% options; otherwise it is ignored. Its value must be the name of +% \item[\texttt{\#1:}] This optional legacy parameter, its use is discouraged. +% Its value must be the name of % one of the functions defined in the environment. This is used to -% detect whether the DLJS has already be loaded by Acrobat. -% \item[\texttt{\#2}:] This parameter, \texttt{<base\_name>}, is an +% detect whether the DLJS has already be loaded by Acrobat. This parameter +% is now automatically created. +% \item[\texttt{\#2}:] This parameter, \ameta{base\_name}, is an % alphabetic word with no spaces and limited to eight characters. It % is used to build the names of auxiliary files and to build the % names of macros used by the environment. -% \item[\texttt{\#3}:] The \texttt{<script\_name>} of your JavaScript. -% This title will appear in the Documentlevel JavaScript dialog of +% \item[\texttt{\#3}:] The \ameta{script\_name} of your JavaScript. +% This title will appear in the document-level JavaScript dialog of % Acrobat. % \end{description} % Within the insDLJS environment, there are two types of comment characters: @@ -1598,7 +1605,7 @@ % the percent character in a JavaScript statement, for example % |app.alert("\%.2f", 3.14159);|, this statement will appear within your JavaScript % code as |app.alert("%.2f", 3.14159);|. -% \changes{v2.2c}{2015/11/13}{Turned \cs{Hy@unicodefalse} so unicode is not written +% \changes{v2.2c}{2015/11/13}{Turned \string\cs{Hy@unicodefalse} so unicode is not written % in the name of the script.} % \begin{macrocode} \let\insdljsloadVar\@empty @@ -1625,20 +1632,20 @@ \ifx\csname dljs\dljsBase\endcsname\relax \else\@insjserrDuplicate\fi \ifcase\dljs@drivernum - \let\insert@DLJS=\insert@DLJS@pdfmark - \let\endinsDLJS=\endinsert@DLJS@pdfmark - \let\newsegment=\newsegment@pdfmark - \let\endnewsegment=\endnewsegment@pdfmark + \let\insert@DLJS\insert@DLJS@pdfmark + \let\endinsDLJS\endinsert@DLJS@pdfmark + \let\newsegment\newsegment@pdfmark + \let\endnewsegment\endnewsegment@pdfmark \or - \let\insert@DLJS=\insert@DLJS@pdftex - \let\endinsDLJS=\endinsert@DLJS@pdftex - \let\newsegment=\newsegment@pdftex - \let\endnewsegment=\endnewsegment@pdftex + \let\insert@DLJS\insert@DLJS@pdftex + \let\endinsDLJS\endinsert@DLJS@pdftex + \let\newsegment\newsegment@pdftex + \let\endnewsegment\endnewsegment@pdftex \or - \let\insert@DLJS=\insert@DLJS@dvipdfm - \let\endinsDLJS=\endinsert@DLJS@dvipdfm - \let\newsegment=\newsegment@dvipdfm - \let\endnewsegment=\endnewsegment@dvipdfm + \let\insert@DLJS\insert@DLJS@dvipdfm + \let\endinsDLJS\endinsert@DLJS@dvipdfm + \let\newsegment\newsegment@dvipdfm + \let\endnewsegment\endnewsegment@dvipdfm \fi \insert@DLJS }{} @@ -1659,23 +1666,22 @@ % different \textsl{script names}. % % The syntax is -%\begin{verbatim} -% \begin{insDLJS*}[<function>]{<base_name>} -% \begin{newsegment}{<script_name>} -% <JavaScript functions or exposed code> -% \end{newsegment} -% \begin{newsegment}{<script_name>} -% <JavaScript functions or exposed code> -% \end{newsegment} -% ... -% ... -% <JavaScript functions or exposed code> -% \end{newsegment} -% \begin{newsegment}{<name_name>} -% <JavaScript functions or exposed code> -% \end{newsegment} -% \end{insDLJS*} -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\def\1{\quad}\catcode`\%=9}] +%\begin{insDLJS*}[!ameta(function)]{!ameta(base_name)} +%\begin{newsegment}{!ameta(script_name)} +%!1!ameta(JavaScript functions or exposed code) +%\end{newsegment} +%\begin{newsegment}{!ameta(script_name)} +%!1!ameta(JavaScript functions or exposed code) +%\end{newsegment} +%... +%... +%\begin{newsegment}{<script_name>} +%!1!ameta(JavaScript functions or exposed code) +%\end{newsegment} +%\end{insDLJS*} +%\end{Verbatim} % where, % \begin{description} % \item[\texttt{\#1:}] This optional parameter, \texttt{<function>}, @@ -1712,20 +1718,20 @@ \expandafter\ifx\csname dljs\dljsBase\endcsname\relax \else\@insjserrDuplicate\fi \ifcase\dljs@drivernum - \let\insert@DLJS=\insert@DLJS@pdfmark\expandafter + \let\insert@DLJS\insert@DLJS@pdfmark\expandafter \let\csname endinsDLJS*\endcsname\endinsert@DLJS@pdfmark - \let\newsegment=\newsegment@pdfmark - \let\endnewsegment=\endnewsegment@pdfmark + \let\newsegment\newsegment@pdfmark + \let\endnewsegment\endnewsegment@pdfmark \or - \let\insert@DLJS=\insert@DLJS@pdftex\expandafter + \let\insert@DLJS\insert@DLJS@pdftex\expandafter \let\csname endinsDLJS*\endcsname\endinsert@DLJS@pdftex - \let\newsegment=\newsegment@pdftex - \let\endnewsegment=\endnewsegment@pdftex + \let\newsegment\newsegment@pdftex + \let\endnewsegment\endnewsegment@pdftex \or - \let\insert@DLJS=\insert@DLJS@dvipdfm\expandafter + \let\insert@DLJS\insert@DLJS@dvipdfm\expandafter \let\csname endinsDLJS*\endcsname\endinsert@DLJS@dvipdfm - \let\newsegment=\newsegment@dvipdfm - \let\endnewsegment=\endnewsegment@dvipdfm + \let\newsegment\newsegment@dvipdfm + \let\endnewsegment\endnewsegment@dvipdfm \fi \insert@DLJS }{} @@ -1759,8 +1765,8 @@ \endgroup \def\ckivspace#1{\if\noexpand#1\space\else\expandafter#1\fi} % \end{macrocode} -% \changes{v2.2b}{2015/08/03}{Added a hook \cs{DLspecialDefs} into the DJS file} -% (2015/08/03) Added the \cs{DLspecialDefs} hook into the DJS file, used in +% \changes{v2.2b}{2015/08/03}{Added a hook \string\cs{DLspecialDefs} into the DJS file} +% (2015/08/03) Added the \string\cs{DLspecialDefs} hook into the DJS file, used in % \textsf{aeb\_pro}. % \begin{macrocode} \let\DLspecialDefs\@empty @@ -1778,8 +1784,8 @@ \iwvo{endobj} \iwvo{2 0 obj} % \end{macrocode} -% When a non-Distiller workflow, ensure execJSs are listed first. -% \changes{v2.2h}{2016/06/09}{When a non-Distiller workflow, ensure execJSs are listed first} +% When a non-Distiller workflow, ensure \env{execJS}s are listed first. +% \changes{v2.2h}{2016/06/09}{When a non-Distiller workflow, ensure \string\env{execJS}s are listed first} % \begin{macrocode} \let\x\@empty \applydljs{\def\x{^^Jvar _thereisdjs=true;}}% @@ -1953,7 +1959,7 @@ % \end{macrocode} % \DescribeMacro{\dlcontig}\hskip-\marginparsep\texttt{(\#1)} Perhaps a better method than % just described (\cs{dlcombine}) is to have a single argument delimited by parentheses. -% Thus \verb|@currQuiz@dlcontig(MyField)| also produces \texttt{q1MyField}. +% Thus |@currQuiz@dlcontig(MyField)| also produces \texttt{q1MyField}. % \begin{macrocode} \def\dlcontig(#1){#1} % \end{macrocode} @@ -1990,27 +1996,30 @@ % need to be handled carefull so as not to produce any specious spaces. Normally, there is % a comment character declared (|\makecmt\%|). Use the comment character to suppress the beginning % of a new line until it is known whether there is content on that next line. Eg, -%\begin{verbatim} -%\begin{defineJS}[\makeesc\*\makecmt\%]{\X} -%var w=1;% +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\def\1{\quad}\catcode`\%=9}] +%\begin{defineJS}[\makeesc\*\makecmt\!%]{\X} +%var w=1;!% %*ifx*Y*@empty*else %var x=1; %var y=1;*fi %var z=1; %\end{defineJS} -%\end{verbatim} -%When \cs{Y} is empty, the content expands to -%\begin{verbatim} +%\end{Verbatim} +%When \cs{Y} is empty, the content expands to, +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\def\1{\quad}\catcode`\%=9}] %var w=1; %var z=1; -%\end{verbatim} +%\end{Verbatim} %and when \cs{Y} is nonempty, it expands to, -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\def\1{\quad}\catcode`\%=9}] %var w=1; %var x=1; %var y=1; %var z=1; -%\end{verbatim} +%\end{Verbatim} % The following two commands are no longer used by this package. % \changes{v2.4.8}{2019/10/30}{Added \string\cs{dlgobToFi} to help format % \string\env{defineJS} code} @@ -2231,7 +2240,7 @@ % If the user has not passed the optional % name, we generated one for him, now we insert it into the \texttt{stream}. %\changes{v2.0k}{2012/06/21}{If the user has not passed the optional -% name, we generated one for him, now we insert it into the \texttt{stream}.} +% name, we generated one for him, now we insert it into the \string\texttt{stream}.} % \begin{macrocode} \ifx\insdljsloadVar\@empty\else \iwvo{\insdljsloadVar} @@ -2363,14 +2372,6 @@ if(typeof \detectdljs\space == "undefined")\jsR\jsT {\uccode`c=`\%\uppercase{% \iwvo{\string\obeyspaces\string\obeylines \string\let\string^\string^M=\string\jsR c}}} -% \end{macrocode} -% (2014/08/09) For pdftex and xetex, this global let messages up -% the \texttt{Verbatim} environment. Not sure why this is global anyway -%\begin{verbatim} -% \iwvo{\string\obeyspaces\string\obeylines\string -% \global\string\let\string^\string^M=\string\jsR c}}} -%\end{verbatim} -% \begin{macrocode} {\escapechar=-1 \lccode`C=`\%\lowercase{% \iwvo{\string\\catcode`\string\\"=12C}}} } @@ -2387,7 +2388,7 @@ if(typeof \detectdljs\space == "undefined")\jsR\jsT \def\enddljs{\iwvo{\string\endgroup}} % \end{macrocode} %\changes{v2.0j}{2011/06/27}{made some changes as suggested by Christian Feuersaenger, who reported some -% problem clashes between \textsf{babel} (spanish) and \textsf{insdljs}.} +% problem clashes between \string\textsf{babel} (spanish) and \string\textsf{insdljs}.} % \begin{macrocode} \def\@roman#1{\romannumeral#1} \def\write@objs{% @@ -2579,20 +2580,22 @@ if(typeof \detectdljs\space == "undefined")\jsR\jsT % % The \cs{ckivspace} (``check for space'') macro sees whether the next token is a space, % if yes, it absorbs it, if not, it replaces it. I implemented this in order to get -% final output identical to the JavaScript. For example, the following is legal JavaScript -%\begin{verbatim} -% var str = "First line.\r\rSkip a line. // (1) -%\end{verbatim} +% final output identical to the JavaScript. For example, the following is legal JavaScript: +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\def\1{\quad}\catcode`\%=9}] +%var str = "First line.\r\rSkip a line. // (1) +%\end{Verbatim} % This is a problem for \TeX. In order to delimit the macro, \TeX{} users need to write the -% above line as -%\begin{verbatim} +% above line as, +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\def\1{\quad}\catcode`\%=9}] % var str = "First line.\r\r Skip a line. // (2) -%\end{verbatim} +%\end{Verbatim} % which then introduces a spurious space into the JavaScript code. The \cs{ckivspace} solves this % problem, I hope. With the definition of \cs{r} given below, after expansion of the line (2) % occurs, we have line (1), the space following the second \cs{r} gets absorbed. Note: (2014/05/20) % I moved this to the main code thread of \textsf{insdljs}. -% \changes{v2.0n}{2014/05/20}{Moved code for \cs{ckivspace} to main code thread of \textsf{insdljs}.} +% \changes{v2.0n}{2014/05/20}{Moved code for \string\cs{ckivspace} to main code thread of \string\textsf{insdljs}.} % \begin{macrocode} %\def\ckivspace#1{\if\noexpand#1\space\else\expandafter#1\fi} % \end{macrocode} @@ -2763,15 +2766,17 @@ if(typeof \detectdljs\space == "undefined")\jsR\jsT % Braces are a problem when they are unbalanced. In a regular expression, |\{| works properly, but |\\{| works % for the distiller options but not otherwise. For example, if I wanted to replace every instance % of \texttt{\{} with \texttt{(}, we can do this by -%\begin{verbatim} -% myString = myString.replace( /\{/, "\("); -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\def\1{\quad}\catcode`\%=9}] +%myString = myString.replace( /\{/, "\("); +%\end{Verbatim} % This works for all options, even though the braces are not balanced. However, when the constructor % function is used, we must double-escape: -%\begin{verbatim} -% var re = new RegExp("\\{", "g"); -% myString = myString.replace( re, "\("); -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\def\1{\quad}\catcode`\%=9}] +%var re = new RegExp("\\{", "g"); +%myString = myString.replace( re, "\("); +%\end{Verbatim} % This works for the distiller options, but not for \texttt{pdftex/dvipdfm}. The reason |\{| works is that % it is a control sequence, defined by the \cmd{\definebraces} command below. Where as |\\{| consists % of the control sequence |\\|, which is defined below, followed by a left brace. @@ -2789,16 +2794,18 @@ if(typeof \detectdljs\space == "undefined")\jsR\jsT % unbalanced braces, one workaround is to balance out the left % brace with a right brace in the form of a JavaScript comment. % This ``fools'' \TeX! For example, -%\begin{verbatim} -% var re = new RegExp("\\{", "g"); // } -% myString = myString.replace( re, "\("); -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\def\1{\quad}\catcode`\%=9}] +%var re = new RegExp("\\{", "g"); // } +%myString = myString.replace( re, "\("); +%\end{Verbatim} % Finally, we have\par\medskip % \noindent\textbf{The Recommended Workaround:} Use |\\\{| and |\\\}|, e.g., -%\begin{verbatim} -% var re = new RegExp("\\\{", "g"); -% myString = myString.replace( re, "\("); -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\def\1{\quad}\catcode`\%=9}] +%var re = new RegExp("\\\{", "g"); +%myString = myString.replace( re, "\("); +%\end{Verbatim} % This is more verbose than needed, but it works for all options! These comments are only for regular expression % strings within the constructor function. Note the replacement text, |\(|, is only escaped. % @@ -2815,39 +2822,44 @@ if(typeof \detectdljs\space == "undefined")\jsR\jsT % once again \textsf{pdftex} and \textsf{dvipdfm} are causing (me) problems. % % No problems when the regular expression uses the literal string format -%\begin{verbatim} -% myString = myString.replace(/\(/g, "\["); -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\def\1{\quad}\catcode`\%=9}] +%myString = myString.replace(/\(/g, "\["); +%\end{Verbatim} % The above code works for all options. However, for the constructor function we have some problems % in non-distiller options. If we type instead -%\begin{verbatim} -% var re = new RegExp("\\(", "g"); -% myString = myString.replace(re, "\["); -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\def\1{\quad}\catcode`\%=9}] +%var re = new RegExp("\\(", "g"); +%myString = myString.replace(re, "\["); +%\end{Verbatim} % The above code works for the distiller folks, but not for the % others. In the case of \textsf{pdftex}, I cannot access the UI to % the document level JavaScripts, and the script is undefined. I suspect % the lack of balanced parentheses is the curprit. For example, % consider the code -%\begin{verbatim} -% var re = new RegExp("\\(|\\)", "g"); -% myString = myString.replace(re, "\["); -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\def\1{\quad}\catcode`\%=9}] +%var re = new RegExp("\\(|\\)", "g"); +%myString = myString.replace(re, "\["); +%\end{Verbatim} % works. I can access the UI to the DLJS from Acrobat, and the script is defined. Another % example, we can fool the JavaScript interpreter as we did the \TeX{} compiler: -%\begin{verbatim} -% var re = new RegExp("\\(", "g"); // ) -% myString = myString.replace(re, "\["); -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\def\1{\quad}\catcode`\%=9}] +%var re = new RegExp("\\(", "g"); // ) +%myString = myString.replace(re, "\["); +%\end{Verbatim} % Here I have placed a balancing right parenthesis as a JavaScript comment. Both sets of code % work correctly. %\par\medskip %\noindent\texttt{Recommended Workaround:} As in the case of parentheses, a more verbose version % of the script works of all options. -%\begin{verbatim} -% var re = new RegExp("\\\(", "g"); -% myString = myString.replace(re, "\["); -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%codes={\def\1{\quad}\catcode`\%=9}] +%var re = new RegExp("\\\(", "g"); +%myString = myString.replace(re, "\["); +%\end{Verbatim} % This is only for the case of the constructor function. % \begin{macrocode} \def\({\eqesc\eqesci(} diff --git a/macros/latex/contrib/acrotex/web.dtx b/macros/latex/contrib/acrotex/web.dtx index d423a0681a..76375a62d5 100644 --- a/macros/latex/contrib/acrotex/web.dtx +++ b/macros/latex/contrib/acrotex/web.dtx @@ -36,6 +36,8 @@ \let\env\texttt \let\app\textsf \let\uif\textsf +\def\STRUT{\rule{0pt}{14pt}} +\def\negSTRUT{\rule[-8pt]{0pt}{0pt}} \def\nmpsep#1{\hskip-\marginparsep\texttt{#1}} \def\visispace{\symbol{32}} \def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}} @@ -88,7 +90,7 @@ % \texttt{dvipdfm}, \texttt{dvipdfmx}, \texttt{xetex}, and \texttt{textures}. %\par\medskip\noindent % We introduce these two packages early. We use them to automatically -% detect pdftex and xetex. +% detect \app{pdf(la)tex} and \app{xe(la)tex}. %\changes{v4.2k}{2012/06/18}{New requirement \string\textsf{ifpdf}}% % \begin{macrocode} \RequirePackage{ifpdf}[2006/02/20] @@ -131,10 +133,10 @@ % Below is the original definition of \cs{web@set@paper}, this has now % changed with \texttt{v4.2j} to accommodate \cs{addtoWebHeight} and % \cs{addtoWebWidth}. -%\begin{verbatim} -% \def\web@set@paper{% -% \special{papersize=\the\paperwidth,\the\paperheight}}% -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] +%\def\web@set@paper{\special{papersize=\the\paperwidth,\the\paperheight}}% +%\end{Verbatim} % \changes{v4.2j}{2012/05/11}{In support of \string\cs{addtoWebHeight}, we introduce % the pagesize special at the beginning of the document. Changes are in the % \string\texttt{dvipsone} and \string\texttt{dvips} options only.} @@ -182,10 +184,11 @@ \def\i@web@ddtoHyOpts{setpagesize=false}% % \end{macrocode} % The old definition of \cs{web@set@paper} -%\begin{verbatim} -% \def\web@set@paper{% -% \special{papersize=\the\paperwidth,\the\paperheight}} -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] +%\def\web@set@paper{!% +%!quad\special{papersize=\the\paperwidth,\the\paperheight}} +%\end{Verbatim} % New definitions (\texttt{v4.2j}). See comments for the \texttt{dvipsone} option. % \begin{macrocode} \let\web@set@paper\@empty @@ -880,9 +883,10 @@ % \end{macrocode} % \subsection{Load Configuration File: web.cfg} % Look for configuration file, \texttt{web.cfg}, for example -%\begin{verbatim} -% \ExecuteOptionsX{dvips} -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] +%\ExecuteOptionsX{dvips} +%\end{Verbatim} % sets \texttt{dvips} as the default driver. % \begin{macro}{\minPanelWidth} % This definition is moved here so a user can set the minimal @@ -1122,11 +1126,12 @@ \addtolength{\textheight}{-\@Topmargin} \addtolength{\textheight}{-\@Bottommargin} % \end{macrocode} -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!~$},codes={\catcode`\%=9}] %\topmargin = \web@Topmargin - 1in %\@Topmargin = \web@Topmargin + \headheight + \headsep -% so \headsep = \@Topmargin - \headheight - \web@Topmargin (\topmargin) -%\end{verbatim} +%!textsf~so $\headsep = \@Topmargin - \headheight - \web@Topmargin (\topmargin) +%\end{Verbatim} % \begin{macrocode} \setlength{\headsep}{\@Topmargin} \addtolength\headsep{-\headheight} @@ -1192,13 +1197,12 @@ % press quality have this parameter at 2400. The second and third parameters are the % width and height, respectively, of the \textbf{/PageSize}. For greatest accuracy, the values of % width and height should be entered in printers points (without dimensions). For example, -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %\setPageDevice{1400}{1400} -%\end{verbatim} -% is preferred to -%\begin{verbatim} +%!STRUT!negSTRUT!textsf(is preferred to) %\setPageDevice{20in}{20in} -%\end{verbatim} +%\end{Verbatim} % \texttt{20in} gets converted to \texttt{1439.9965}. The conversion, if necessary, is done % by \cs{@convLtoP} % @@ -1238,11 +1242,12 @@ % and \cs{paperheight} will be the default values set by the class, but take \cs{textwidth} to be % the value of \#2. The second and third parameters are the width and height, respectively, as measured % in printer points ($72\,\mbox{points} = 1\,\mbox{inch}$, or measures in the \texttt{bp} points of \TeX.) -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %Parameters: -% #1 = \paperheight (height of the display screen to be created) -% #2 = \paperwidth (width of the display screen to be created) -%\end{verbatim} +%!quad#1 = \paperheight (height of the display screen to be created) +%!quad#2 = \paperwidth (width of the display screen to be created) +%\end{Verbatim} % \begin{macrocode} \def\screensize#1#2{% \def\webSaveSSDim{{#1}{#2}}% @@ -1281,22 +1286,24 @@ % cannot be deformed to fit one of the standard designs. The solution is to % create a screen size matching the graphic, then using that graphic as a template. % Example usage, -%\begin{verbatim} -% \margins{1in}{1in}{24pt}{.25in} -% \setScreensizeFromGraphic{acro_30} -% \template{acro_30} -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] +%!quad\margins{1in}{1in}{24pt}{.25in} +%!quad\setScreensizeFromGraphic{acro_30} +%!quad\template{acro_30} +%\end{Verbatim} % This command takes two arguments, the first is optional and is passed % to the \cs{includegraphics} command, the second it the path to the file. % % It may become necessary with some graphics to use the % \texttt{hiresbb} option for \cs{includegraphics}, both in % \cs{setScreensizeFromGraphic} and \cs{template} like so, -%\begin{verbatim} -% \margins{1in}{1in}{24pt}{.25in} -% \setScreensizeFromGraphic[hiresbb]{acro_30} -% \template[hiresbb]{acro_30} -%\end{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] +%!quad\margins{1in}{1in}{24pt}{.25in} +%!quad\setScreensizeFromGraphic[hiresbb]{acro_30} +%!quad\template[hiresbb]{acro_30} +%\end{Verbatim} % \changes{v4.0f}{2007/06/11} % { % This command measures the dimensions of an EPS file, and sets the @@ -1387,7 +1394,8 @@ % \subsubsection{\texorpdfstring{\protect\cs{margins}}{\CMD{margins}}} % \begin{macro}{\margins} % Sets the left, right, top and bottom margins. -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %Parameters: % [#1] = width of panel to be used if a panel option % is specified (default is 1in) @@ -1395,7 +1403,7 @@ % #3 = right margin % #4 = top margin % #5 = bottom margin -%\end{verbatim} +%\end{Verbatim} % \begin{macrocode} \newcommand{\@margins}[5][\web@minpanelwidth]{% \def\webSaveMargDim{[#1]{#2}{#3}{#4}{#5}}% @@ -1422,9 +1430,10 @@ % |\addtoWebWidth| and |\addtoWebHeight|, this command readjusts % the margins. Within the arguments \cs{incby} % refer to the current dimension. -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %\resetsmargins{\incby+.25in}{\incby+.25in}{}{} -%\end{verbatim} +%\end{Verbatim} % This line adds .25in to each of the side margins. % \begin{macrocode} \newcommand\get@MargDim[5][]{% @@ -1955,7 +1964,7 @@ \@ifundefined{aeb@talksite}{\webversion} {\ifx\aeb@talksite\@empty\webversion \else\aeb@talksite\fi}% - }% + }% }% }% \bigskip @@ -2161,7 +2170,8 @@ % \begin{macro}{\@newNaviIconMenu} % This command uses the hyperref command \cs{Acrobatmenu} to create navigation link button. The % action for this type is restricted to named menu actions. -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %Parameters % [#1] = optional parameter for setting the highlight, N (none), % I (invert, the default), O (outline), P (push, also called Inset) @@ -2170,7 +2180,7 @@ % #4 = height of icon % #5 = text to appear in the center of the icon. % #6 = named menu action, e.g., NextPage, PrevPage, etc. -%\end{verbatim} +%\end{Verbatim} % The color of the text is controlled by \cs{navibarTextColor}, and the background color % is determined by \cs{@menuBgColor}. % \begin{macrocode} @@ -2188,7 +2198,8 @@ % \end{macro} % \begin{macro}{\@newNaviIconJS} % Another navigation icon/button, but this one allows for arbitrary JavaScript actions. -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %Parameters % [#1] = optional parameter for setting the highlight, N (none), % I (invert, the default) O (outline), P (push, also called Inset) @@ -2197,7 +2208,7 @@ % #4 = height of icon % #5 = text to appear in the center of the icon. % #6 = JavaScript commands to be executed when the button is clicked. -%\end{verbatim} +%\end{Verbatim} % The color of the text is controlled by \cs{navibarTextColor}, and the background color % is determined by \cs{@menuBgColor}. % \begin{macrocode} @@ -2242,7 +2253,8 @@ % \end{macrocode} % \end{macro} % Another navigation icon/button, this one allows jumping to a named destination. -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %Parameters % [#1] = optional parameter for setting the highlight, N (none), % I (invert, the default), O (outline), P (push, also called Inset) @@ -2251,12 +2263,13 @@ % #4 = height of icon % #5 = text to appear in the center of the icon. % #6 = \hyperlink or \href with its first argument -%\end{verbatim} +%\end{Verbatim} % For example, -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %\newNaviIcon[l]{\Home}{40pt}{15pt}{\footnotesize Home} % {\href{http://www.math.uakron.edu/}} -%\end{verbatim} +%\end{Verbatim} % The color of the text is controlled by \cs{navibarTextColor}, and the background color % is determined by \cs{@menuBgColor}. % \begin{macrocode} @@ -2452,9 +2465,10 @@ % \begin{macro}{\ArrowUp} % \begin{macro}{\ArrowDown} % Pre-Fab Rule Icons \cs{Uparrow} and \cs{Downarrow}, for example, -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %\insertnaviiconhere{\ArrowUp{\href{http://www.adobe.com/}}} -%\end{verbatim} +%\end{Verbatim} % \begin{macrocode} \newcommand\ArrowUp[1]{% \normalsize\ifeqforpaper @@ -3067,11 +3081,12 @@ \begingroup % \end{macrocode} % Sample line from .aux -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] % \contentsline {section}{\numberline {1}Introduction}{4}{section.1} % \contentsline {section}{\numberline {}References}{56}{section*.1} % #1 #2 #3 -%\end{verbatim} +%\end{Verbatim} % \begin{macrocode} \global\let\isChapter\web@NO \parskip0pt\parindent\toc@indent\relax @@ -3217,9 +3232,10 @@ % is optional. Use any of the \emph{boolean keys} of the % \cs{includegraphics} command. Do not use the \texttt{width} or % \texttt{height} keys in this optional argument. For example, -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] % \template[hiresbb]{myBG} -%\end{verbatim} +%\end{Verbatim} % Causes the driver to import the graphic using the high resolution bounding % box. % It is assumed that a graphic defined by \cs{template} is intended to fill the entire @@ -3948,8 +3964,9 @@ % in the \texttt{web} package. This command should appear in the preamble. % %\medskip\noindent Example usage: -%\begin{verbatim} -%\DeclareDocInfo{% +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] +%\DeclareDocInfo{!% % title=My First Presentation, % author=D. P. Speaker, % university=My University, @@ -3958,7 +3975,7 @@ % talksite=The Talking University, % subject=The Art of Talking %} -%\end{verbatim} +%\end{Verbatim} % \begin{macrocode} \newcommand{\DeclareDocInfo}[1]{\setkeys{aebDocInfo}{#1}% \ifx\web@talkdate@value\@empty\else\let\webversion\webtalkdate\fi} @@ -4048,15 +4065,16 @@ % ignored when the \texttt{forpaper} option is in effect. % %\medskip\noindent Example usage: -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %\DeclarePageLayout -%{% +%{!% % screensizeOf=designv, % margins={.75in}{.75in}{.75in}{.75in}, % topmargin=40pt, % webfootskip=30pt %} -%\end{verbatim} +%\end{Verbatim} % This sets the \texttt{\texttt{screensize}} to the same as the % \texttt{screensize} of \texttt{designv}. We then adjust the % margins, the \texttt{topmargin} key is used to position the running @@ -5186,9 +5204,10 @@ % The \cs{selectColors} is a convenience command for setting % many of the colors involved in the design of an \textsf{APB} document. % The default colors are \dots -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %\selectColors -%{ +%{!% % universityColor = blue, % titleColor = black, % authorColor = black, @@ -5199,7 +5218,7 @@ % linkColor = webgreen, % fileColor = webbrown %} -%\end{verbatim} +%\end{Verbatim} % \begin{macrocode} \newcommand{\selectColors}[1]{\setkeys{aebcolordesign}{#1}} % \end{macrocode} @@ -5235,14 +5254,15 @@ % \begin{macro}{\selectTocDings} % This is an \textsf{xkeyval} interface to setting the dings used by % the structured lists and the table of contents. Usage: -%\begin{verbatim} +%\begin{Verbatim}[xleftmargin=\parindent,fontsize=\small, +%commandchars={!()},codes={\catcode`\%=9}] %\selectTocDings -%{ +%{!% % dDing=\ding{082}, % ddDing=\ding{079}, % dddDing=\ding{254} %} -%\end{verbatim} +%\end{Verbatim} % \begin{macrocode} \newcommand{\selectTocDings}[1]{\setkeys{aebDings}{#1}} % \end{macrocode} @@ -5265,10 +5285,8 @@ % comment environments one \texttt{forpaper} and another for % \texttt{forscreen}. % \begin{macrocode} - \includecomment{forpaper}\excludecomment{forscreen} -\else - \includecomment{forscreen}\excludecomment{forpaper} -\fi + \includecomment{forpaper}\excludecomment{forscreen}\else + \includecomment{forscreen}\excludecomment{forpaper}\fi % \end{macrocode} % \end{environment} % \end{environment} diff --git a/macros/latex/contrib/grundgesetze/README b/macros/latex/contrib/grundgesetze/README index 52a2479823..b887187f8e 100644 --- a/macros/latex/contrib/grundgesetze/README +++ b/macros/latex/contrib/grundgesetze/README @@ -9,11 +9,11 @@ The file grundgesetze.sty is a derivative work of begriff.sty (Copyright (c) 2005 Josh Parsons, Richard G. Heck Jr.) and so, like it, is released under the GNU General Public License (version 2). -The remainder of this work is Copyright (c) 2008-2014 Richard +The remainder of this work is Copyright (c) 2008-2021 Richard G. Heck Jr., J.J. Green, Agustin Rayo, and Marcus Rossberg. Further information can be found at http://www.frege.info/ -Marcus Rossberg 2014
\ No newline at end of file +Marcus Rossberg 2021
\ No newline at end of file diff --git a/macros/latex/contrib/grundgesetze/grundgesetze.dtx b/macros/latex/contrib/grundgesetze/grundgesetze.dtx index 84005cb1da..f1b7b86e9a 100644 --- a/macros/latex/contrib/grundgesetze/grundgesetze.dtx +++ b/macros/latex/contrib/grundgesetze/grundgesetze.dtx @@ -3,14 +3,18 @@ % grundgesetze: LaTeX2e package for typesetting begriffsschrift % in the of Gottlob Frege's _Grundgesetze der Arithmetik_ (Jena 1893/1903) % -% Copyright (C) 2003-2014 by Josh Parsons <josh.parsons@ccc.ox.ac.uk>, +% Copyright (C) 2003-2021 by Josh Parsons <josh.parsons@ccc.ox.ac.uk>, % Marcus Rossberg <marcus.rossberg@uconn.edu>, % J.J. Green <j.j.green@gmx.co.uk>, -% Richard G. Heck, Jr. <richard_heck@brown.edu>, +% Richard Kimberly Heck <richard_heck@brown.edu>, % and Agustn Rayo <arayo@mit.edu> % % This package is based on begriff.sty, originally written by % Josh Parsons in 2003, 2005. +% +% New in this update (Marcus Rossberg, 2021-04-26): +% \baselineskip in \GGconditional replaced by \normalbaselineskip +% to allow use in tabular and array environments % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by @@ -50,15 +54,16 @@ % %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{grundgesetze} -%<package> [2014/06/16 1.02 grundgesetze package] +%<package>[2021/04/26 v1.03 grundgesetze package] % %<*driver> -\documentclass[a4paper,10pt,draft]{ltxdoc} +\documentclass[a4paper,10pt]{ltxdoc} \OnlyDescription % <- comment out to include style code listing at the end of the document \usepackage[bguq=5]{grundgesetze} % \usepackage{grundgesetze} \usepackage{begriff} \usepackage{fge} +\usepackage{hyperref} \usepackage{amsfonts} \usepackage{amstext} \usepackage{amsmath} @@ -82,28 +87,27 @@ % \setcounter{StandardModuleDepth}{1} % % \noindent -% \emph{Grundgesetze.sty} is a \LaTeX2e\ package for typesetting -% Gottlob Frege's \emph{begriffs\-schrift} [concept-script] formalism +% \emph{grundgesetze.sty} is a \LaTeX2e\ package for typesetting +% formulae in Gottlob Frege's \emph{begriffsschrift} [concept-script] % in the style of his \emph{Grundgesetze der Arithmetik} -% (1893/1903). \emph{Grundgesetze.sty} was developed for the 2013 English +% (Jena 1893/1903). The package was developed for the 2013 English % edition.\footnote{Gottlob Frege: \emph{Basic Laws of Arithmetic}. -% Translated and edited by Philip A. Ebert and Marcus Rossberg. Oxford 2013.} +% Translated and edited by Philip A.\ Ebert and Marcus Rossberg. Oxford 2013.} % The package is based on Josh Parsons's \emph{begriff.sty} which renders % the formalism in the style of Frege's earlier work, -% \emph{Begriffsschrift} (1879). It was amended by Richard~G.~Heck~Jr., -% J.\,J.~Green, Agust\'in~Rayo, and Marcus~Rossberg. Thanks to -% Philip Ebert for testing and suggestions. Note that Frege's +% \emph{Begriffsschrift} (Halle a.S.\ 1879). It was amended by Richard Kimberly Heck, +% J.J.\ Green, Agust\'in Rayo, and Marcus Rossberg. Thanks to +% Philip Ebert and Sanford Shieh for testing and suggestions. Frege's % defined function symbols are not rendered by this package, but -% by J.\,J.~Green's \emph{fge.sty}. +% by J.J.\ Green's \emph{fge.sty}. % % \section{Options} % % At present the only package option is |bguq|, which causes the package -% to use the |bguq| font for an alternative universal quantifier -% (concavity), and this option accepts a value (being the size to be used, -% as in |bguq=6|, the default being 5). Of course, one must have the -% |bguq| font installed to use this option, but it is included in recent -% versions of the big \TeX\ distributions. +% to use the |bguq| font for an alternative universal quantifier (concavity), +% and this option accepts a value (corresponding to the size to be used, +% as in |bguq=6|; default is 5). The |bguq| font is required for this +% option. It is included in recent versions of the big \TeX\ distributions. % % \section{Basic Commands} % @@ -114,13 +118,12 @@ % The negation-stroke, $\GGnot$ % % \DescribeMacro{\GGconditional} -% Conditional-stroke: called as |\GGconditional{p}{q}}| yields -% $\GGconditional{p}{q}$ (i.e., `$p\supset q$') +% Conditional-stroke: called as |\GGconditional{p}{q}| yields +% $\GGconditional{p}{q}$ % % \DescribeMacro{\GGquant} % Concavity: called as |\GGquant{\mathfrak a}| gives -% $\GGquant{\mathfrak a}$ (i.e., universal quantifier, -% `$\mathfrak{a}$' is the quantified variable) +% $\GGquant{\mathfrak a}$ % % \DescribeMacro{\GGjudge} % Judgement-stroke, $\GGjudge$ @@ -130,7 +133,7 @@ % % \DescribeMacro{\GGbracket} % Automatically scaling brackets, |\GGbracket{\ldots}| yields -% $\GGbracket{\ldots}$ (see examples) +% $\GGbracket{\ldots}$ (see examples below) % % \DescribeMacro{\GGsqbracket} % Analogous square brackets, $\GGsqbracket{\ldots}$ @@ -187,8 +190,8 @@ % % \end{itemize} % -% There are further examples, including Frege's basic laws of logic, -% available for download on \texttt{www.frege.info}. +% There are further examples, including Frege's six basic laws of logic, +% available for download on \url{http://www.frege.info/}. % % % \section{Advanced Typesetting} @@ -283,16 +286,16 @@ % determined by adding up the lengths % of the embedded symbols, as given in Table~\ref{table:embedded}, % or by using a GUI that allows producing \LaTeX\ and XML code for -% \emph{begriffsschrift} formulae via mouse-click and that will -% calculate and output the correct values. The GUI is available for -% download on \texttt{www.frege.info}. +% \emph{begriffsschrift} formulae by mouse-click. The GUI will +% calculate and output the correct values. It is available for +% download on \url{http://www.frege.info/}. % % \subsection{Adding horizontal lengths manually: % \texttt{\textbackslash GGnonot}, etc.} % % Readability is sometimes aided by moving, e.g., negations to the % right end of the horizontal in a complex formula. For instance, -% Frege nearly always preferred the rendering displayed on the right +% Frege nearly always prefers the rendering displayed on the right % in these types of formulae: % % \begin{center} @@ -322,7 +325,7 @@ % The right-hand formulae are produced by inserting commands % for horizontals of the appropriate length directly at the % position where the ``space'' should appear. The three -% right-hand formulae above are created in this way: +% right-hand formulae above are created thus, respectively: % \begin{itemize} % \item[(a)] \begin{verbatim}\GGjudge \GGconditional % {\GGquant{\mathfrak a} \GGnot f(\mathfrak a)} @@ -340,7 +343,7 @@ % % Josh Parsons's \emph{begriff.sty}, on which \emph{grundgesetze.sty} % is based, is closer in appearance to Frege's formalism as it is -% presented in Frege's first book, \emph{Begriffs\-schrift} (1879). +% presented in Frege's first book, \emph{Begriffs\-schrift} (Halle a.S.\ 1879). % The corresponing commands were given different names so that both % pack\-ages can be used in the same \TeX~document; see Table~\ref{table:compat}. % @@ -414,8 +417,8 @@ % % A straightforward way to convert the a \LaTeX\ document that uses % \emph{begriff.sty} into one that uses \emph{grundgesetze.sty} without -% manually exchanging the commands is to find and replace (using wrap -% search) ``|\BG|" by ``|\GG|". Synonyms have been added to +% manually exchanging the commands is to find and replace +% ``|\BG|" by ``|\GG|". Synonyms have been added to % \emph{grundgesetze.sty} to allow the use of all \emph{begriff.sty} % commands ``translated" in this way (see Table~\ref{table:allmacros}). % @@ -590,7 +593,7 @@ % % \subsection{The main part of the code} % \begin{macrocode} -\typeout{Grundgesetze Begriffsschrift: June 2014} +\typeout{Grundgesetze Begriffsschrift: April 2021} \ifx\grundgesetze@bguq\@empty \typeout{Universal quantifier by qbezier} \else @@ -648,7 +651,7 @@ \setbox0=\hbox{% \addtolength{\GGlinewidth}{-\GGafterlen}% \raisebox{\GGlift}{% -\vrule height 0.49\baselineskip depth 0.425\baselineskip width 0pt +\vrule height 0.49\normalbaselineskip depth 0.425\normalbaselineskip width 0pt \vrule height \GGthickness width \GGafterlen depth 0pt }% \ensuremath{\hskip\GGspace #1}% @@ -657,7 +660,7 @@ \addtolength{\GGlinewidth}{-\GGafterlen}% % strut -- depth of conditional here! \raisebox{\GGlift}{% -\vrule height 0pt depth 0.425\baselineskip width 0pt% +\vrule height 0pt depth 0.425\normalbaselineskip width 0pt% \vrule height \GGthickness width \GGafterlen depth 0pt}% \ensuremath{\hskip\GGspace #2}% }% diff --git a/macros/latex/contrib/grundgesetze/grundgesetze.pdf b/macros/latex/contrib/grundgesetze/grundgesetze.pdf Binary files differindex 10f3cef32d..6d521d73cd 100644 --- a/macros/latex/contrib/grundgesetze/grundgesetze.pdf +++ b/macros/latex/contrib/grundgesetze/grundgesetze.pdf diff --git a/macros/latex/contrib/todonotes/examples/alterAppearenceOfListOfTodos.pdf b/macros/latex/contrib/todonotes/examples/alterAppearenceOfListOfTodos.pdf Binary files differindex 9c5ad84d16..1bf726bc39 100644 --- a/macros/latex/contrib/todonotes/examples/alterAppearenceOfListOfTodos.pdf +++ b/macros/latex/contrib/todonotes/examples/alterAppearenceOfListOfTodos.pdf diff --git a/macros/latex/contrib/todonotes/examples/externalize.pdf b/macros/latex/contrib/todonotes/examples/externalize.pdf Binary files differindex 13fc64975f..f22dec514d 100644 --- a/macros/latex/contrib/todonotes/examples/externalize.pdf +++ b/macros/latex/contrib/todonotes/examples/externalize.pdf diff --git a/macros/latex/contrib/todonotes/examples/saveColorByUsingLayers.pdf b/macros/latex/contrib/todonotes/examples/saveColorByUsingLayers.pdf Binary files differindex d0544a53ec..3f3dc73c5e 100644 --- a/macros/latex/contrib/todonotes/examples/saveColorByUsingLayers.pdf +++ b/macros/latex/contrib/todonotes/examples/saveColorByUsingLayers.pdf diff --git a/macros/latex/contrib/todonotes/todonotes.dtx b/macros/latex/contrib/todonotes/todonotes.dtx index 484d825eb3..0ca23696c6 100644 --- a/macros/latex/contrib/todonotes/todonotes.dtx +++ b/macros/latex/contrib/todonotes/todonotes.dtx @@ -20,14 +20,14 @@ %<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01] %<package>\ProvidesPackage{todonotes} %<*package> - [2020/08/18 v1.1.3 Todonotes source and documentation.] + [2021/04/26 v1.1.4 Todonotes source and documentation.] %</package> % %<*driver> \documentclass{ltxdoc} \usepackage{wrapfig} \usepackage[colorlinks, linkcolor=black, urlcolor=blue]{hyperref} -\usepackage[colorinlistoftodos]{todonotes}[2020/08/18] +\usepackage[colorinlistoftodos, loadshadowlibrary]{todonotes}[2021/04/26] \usepackage{amsmath} \usepackage{setspace} \usepackage{soul} @@ -45,7 +45,7 @@ %</driver> % \fi % -% \CheckSum{721} +% \CheckSum{731} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -207,6 +207,8 @@ % \changes{1.1.2}{2019/01/24}{Fix issue 36 and 37.} % \changes{1.1.3}{2020/08/18}{Fix issue 48 and make colors used in the last todo % globally available.} +% \changes{1.1.4}{2021/04/26}{Fix issue 51 by avoid loading the tikz shadows +% library by default.} % \GetFileInfo{todonotes.dtx} % % \DoNotIndex{\newcommand,\newenvironment} @@ -394,9 +396,15 @@ % |caption=val| option for the todo command, where the given value % |val| is inserted in the inserted todonote. % +% \DescribeMacro{loadshadowlibrary} +% If given, the |shadows| tikz library will be loaded. This is required +% for adding shadows to the inserted todonotes. +% % \DescribeMacro{shadow} -% If the |shadow| option is given, the inserted todonotes will be -% displayed with a gray shadow. +% If the |shadow| option is given, the inserted todonotes will by +% default be displayed with a gray shadow. +% For this to work, the package option |loadshadowlibrary| must be +% provided. % I expect that the option will trigger problems with tikz versions % prior to 2.0. % @@ -1251,7 +1259,6 @@ \RequirePackage{xcolor} \RequirePackage{tikz} \usetikzlibrary{positioning} -\usetikzlibrary{shadows} \RequirePackage{calc} % \end{macrocode} % Implement a function for setting up the todonotes package. @@ -1480,8 +1487,14 @@ prior to loading the todonotes package.} \else\fi% % \end{macrocode} % Add option for shadows behind the inserted notes % \begin{macrocode} +\newif\if@todonotes@shadowlibraryloaded +\@todonotes@shadowlibraryloadedfalse +\DeclareOptionX{loadshadowlibrary}{% + \usetikzlibrary{shadows}% + \@todonotes@shadowlibraryloadedtrue} \newcommand{\@todonotes@shadowenabledbydefault}{noshadow} -\DeclareOptionX{shadow}{\renewcommand{\@todonotes@shadowenabledbydefault}{shadow}} +\DeclareOptionX{shadow}{% + \renewcommand{\@todonotes@shadowenabledbydefault}{shadow}} % \end{macrocode} % Add option for the default width of the figure inserted with % |\missingfigure|. @@ -1723,10 +1736,17 @@ prior to loading the todonotes package.} \else\fi% % Add shadows to the inserted todonotes. % \begin{macrocode} \if@todonotes@useshadow% +\if@todonotes@shadowlibraryloaded% \tikzstyle{notestyle} = [notestyleraw,% general shadow={shadow xshift=0.5ex, shadow yshift=-0.5ex,% opacity=1,fill=black!50}]% \else% +\PackageWarning{todonotes}{Trying to put a shadow below a todonote, + but the loadshadowlibrary option was not given when loading + the todonotes package} +\tikzstyle{notestyle} = [notestyleraw]% +\fi% +\else% \tikzstyle{notestyle} = [notestyleraw]% \fi% % \end{macrocode} diff --git a/macros/latex/contrib/todonotes/todonotes.pdf b/macros/latex/contrib/todonotes/todonotes.pdf Binary files differindex a3f20cdf2b..ea1dc3e6b0 100644 --- a/macros/latex/contrib/todonotes/todonotes.pdf +++ b/macros/latex/contrib/todonotes/todonotes.pdf diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md index 6d8f47c18c..8a954ea3ee 100644 --- a/macros/latex/required/babel/base/README.md +++ b/macros/latex/required/babel/base/README.md @@ -1,4 +1,4 @@ -## Babel 3.57 +## Babel 3.58 This package manages culturally-determined typographical (and other) rules, and hyphenation patterns for a wide range of languages. Many @@ -8,9 +8,9 @@ is a set of ini files for about 250 languages. The latest stable version is available on <https://ctan.org/pkg/babel>. -Changes in version 3.57 are described in: +Changes in version 3.58 are described in: -https://github.com/latex3/babel/blob/master/news-guides/news/whats-new-in-babel-3.57.md +https://github.com/latex3/babel/blob/master/news-guides/news/whats-new-in-babel-3.58.md Apart from the manual, you can find information on some aspects of babel at: @@ -46,6 +46,20 @@ respective authors. ### Summary of Latest changes ``` +3.58 2021-04-26 + * More predefined transforms (lua): + - doubleletter.hyphen: Norsk + - oneletter.nobreak: Czech, Polish, Slovak + - hyphen.repeat: Czech, Polish, Portuguese, Slovak, Spanish + - punctuation.space: Hindi, Sanskrit + - transliteration.hk: Sanskrit + - transliteration.gajica: Serbian + * 'prehyphenation' transforms are now disabled in verbatim. + * New line breaking mode ‘unhyphenated’. + * Fix: \shorthandoff*{^} was not revertible (#126). + * Experimental code for Arabic justification (with elongated + forms: lua). + 3.57 2021-04-07 * Predefined transforms (lua): - Arabic: transliteration.dad diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx index b21384f6a0..745cf11406 100644 --- a/macros/latex/required/babel/base/babel.dtx +++ b/macros/latex/required/babel/base/babel.dtx @@ -31,7 +31,7 @@ % % \iffalse %<*filedriver> -\ProvidesFile{babel.dtx}[2021/04/07 v3.57 The Babel package] +\ProvidesFile{babel.dtx}[2021/04/26 v3.58 The Babel package] \documentclass{ltxdoc} \GetFileInfo{babel.dtx} \usepackage{fontspec} @@ -80,6 +80,13 @@ \usepackage{multicol} \usepackage{color,colortbl} \usepackage[linkcolor=blue,urlcolor=blue,colorlinks=true]{hyperref} +\hypersetup{% + pdfsubject={LaTeX Multilingual documents and localization for pdfTeX, LuaTex and + XeTeX.}, + pdfauthor={Johannes Braams, Javier Bezos}, + pdftitle={Babel}, + pdfkeywords={TeX, LaTeX, pdfTeX, LuaTeX, XeTeX, internationalization, + localization}} \newcommand\New[1]{% \colorbox[rgb]{.92, .86, .73}{New #1}\enspace\ignorespaces} \definecolor{thered} {rgb}{0.65,0.04,0.07} @@ -89,6 +96,7 @@ \makeatletter \def\@begintheorem#1#2{% \list{}{}% + \small \global\advance\@listdepth\m@ne \item[{\sffamily\bfseries\color{messages}\hspace*{1.3em}% \MakeUppercase{#1}}]}% @@ -238,9 +246,9 @@ Xe\largetex \begin{description} \item[\sffamily\color{messages}What is this document about?] This user guide focuses on internationalization and localization with \LaTeX{} -and \pdftex, \xetex{} and \luatex{} with the \babel{} package. There are -also some notes on its use with Plain \TeX. Part II describes the code, -and usually it can be ignored. +and \pdftex, \xetex{} and \luatex{} with the \babel{} package. There +are also some notes on its use with e-Plain and pdf-Plain \TeX . Part II +describes the code, and usually it can be ignored. \item[\sffamily\color{messages}What if I’m interested only in the latest changes?] Changes and new features with relation to version 3.8 @@ -631,7 +639,7 @@ modifiers are a more general mechanism. \subsection{Plain} -In Plain, load languages styles with |\input| and then use +In e-Plain and pdf-Plain, load languages styles with |\input| and then use |\begindocument| (the latter is defined by \babel): \begin{verbatim} \input estonian.sty @@ -640,9 +648,10 @@ In Plain, load languages styles with |\input| and then use \begin{warning} Not all languages provide a |sty| file and some of them are not - compatible with Plain.\footnote{Even in the \babel{} kernel there - were some macros not compatible with plain. Hopefully these issues - have been fixed.} + compatible with those formats. Please, refer to + \href{https://github.com/latex3/babel/blob/% + master/news-guides/guides/using-babel-with-plain.md}{Using babel with + Plain} for further details. \end{warning} \subsection{Basic language selectors} @@ -1298,7 +1307,7 @@ required for a locale. |ini| files are not meant only for \babel, and they has been devised as a resource for other packages. To easy interoperability between \TeX{} and other systems, they are identified with the BCP 47 codes as -preferred by the Unicode Common Language Data Repository, which was +preferred by the Unicode Common Locale Data Repository, which was used as source for most of the data provided by these files, too (the main exception being the |\...name| strings). @@ -1408,7 +1417,7 @@ need to set explicitly the script to either |deva| or |dev2|, eg: \begingroup \setmonofont[Script=Lao,Scale=MatchLowercase]{DejaVu Sans Mono} \begin{verbatim} -\babelprovide[import,hyphenrules=+]{lao} +\babelprovide[import, hyphenrules=+]{lao} \babelpatterns[lao]{1ດ 1ມ 1ອ 1ງ 1ກ 1າ} % Random \end{verbatim} \endgroup @@ -2490,6 +2499,9 @@ for example: In other engines it just suppresses hyphenation (because the pattern list is empty). +\New{3.58} Another special value is |unhyphenated|, which activates a +line breking mode that allows spaces to be stretched to arbitrary amounts. + \Describe{main}{} This valueless option makes the language the main one (thus overriding that set when \babel\ is loaded). Only in newly defined languages. @@ -3034,11 +3046,13 @@ in future releases.) \begingroup \def\trans#1#2#3{% - \vspace{1mm}% - \parbox[t]{2.4cm}{\strut#1}% - \parbox[t]{4.2cm}{\strut\ttfamily#2}% + \vspace{1.5mm}% + \parbox[t]{2.2cm}{\raggedright\strut#1}% + \hspace{2mm}% + \parbox[t]{4.0cm}{\strut\ttfamily#2}% + \hspace{2mm}% \parbox[t]{6.6cm}{\strut#3}\par} -\bigskip\hrule\nobreak\vspace{1mm} +\bigskip\hrule\nobreak\vspace{.5mm} % \strut\hfil Transforms % \medskip\hrule\nobreak @@ -3052,18 +3066,37 @@ devised by Yannis Haralambous for \textsf{dad} (simple and recommended way to make these transformations (the best way is with OTF features), but it can get you out of a hurry.} +\trans{Czech, Polish, Portuguese, Slovak, +Spanish}{hyphen.repeat}{Explicit hyphens behave like +|\string\babelhyphen|\allowbreak|\{repeat\}|.} + +\trans{Czech, Polish, Slovak}{oneletter.nobreak}{Converts a space after +a non-syllabic preposition or conjunction into a non-breaking space.} + \trans{Greek}{diaeresis.hyphen}{Removes the diaeresis above iota and upsilon if hyphenated just before. It works with the three variants.} -\trans{Hindi}{transliteration.hk}{The Harvard-Kyoto system to romanize -Devanagari.} +\trans{Hindi, Sanskrit}{transliteration.hk}{The Harvard-Kyoto system to +romanize Devanagari.} + +\trans{}{punctuation.space}{Inserts a space before the following +four characters: \textit{!?:;}\,.} \trans{Hungarian}{digraphs.hyphen}{Hyphenates the long digraphs \textit{ccs}, \textit{ddz}, \textit{ggy}, \textit{lly}, \textit{nny}, \textit{ssz}, \textit{tty} and \textit{zzs} as \textit{cs-cs}, \textit{dz-dz}, etc.} +\trans{Norsk}{doubleletter.hyphen}{Hyphenates the doble-letter groups +\textit{bb}, \textit{dd}, \textit{ff}, \textit{gg}, \textit{ll}, +\textit{mm}, \textit{nn}, \textit{pp}, \textit{rr}, \textit{ss}, +\textit{tt} as \textit{bb-b}, \textit{dd-d}, etc.} + +\trans{Serbian}{transliteration.gajica}{(Note |serbian| with |ini| +files refers to the Cyrillic script, which is here the target.) The +standard system devised by Ljudevit Gaj.} + \vspace{2mm}\hrule\nobreak \endgroup @@ -3147,6 +3180,21 @@ This feature is activated with the first |\babelposthyphenation| or \end{verbatim} \end{example} +\begin{note} + With \luatex{} there is another approach to make text + transformations, with the function |fonts.handlers.otf.addfeature|, + which adds new features to an OTF font (substitution and + positioning). These features can be made language-dependent, and + \babel{} by default recognizes this setting if the font has been + declared with |\babelfont|. The \textit{transforms} mechanism + supplements rather than replaces OTF features. + + With \xetex{}, where \textit{transforms} are not available, there is + still another approach, with font mappings, mainly meant to perform + encoding conversions and transliterations. Mappings, however, are + linked to fonts, not to languages. +\end{note} + \subsection{Selection based on BCP 47 tags} \label{bcp47} @@ -4910,8 +4958,8 @@ help from Bernd Raichle, for which I am grateful. % \section{Tools} % % \begin{macrocode} -%<<version=3.57>> -%<<date=2021/04/07>> +%<<version=3.58>> +%<<date=2021/04/26>> % \end{macrocode} % % \textbf{Do not use the following macros in \texttt{ldf} files. They @@ -7104,8 +7152,10 @@ help from Bernd Raichle, for which I am grateful. \count@#1\relax \def\bbl@elt##1##2##3##4{% \ifnum\count@=##2\relax - \bbl@info{\string#1 = using hyphenrules for ##1\\% - (\string\language\the\count@)}% + \edef\bbl@tempa{\expandafter\@gobbletwo\string#1}% + \bbl@info{Hyphen rules for '\expandafter\@gobble\bbl@tempa' + set to \expandafter\string\csname l@##1\endcsname\\% + (\string\language\the\count@). Reported}% \def\bbl@elt####1####2####3####4{}% \fi}% \bbl@cs{languages}% @@ -7597,14 +7647,23 @@ help from Bernd Raichle, for which I am grateful. \fi \fi \let\bbl@hymapsel\@cclv - % hyphenation - select patterns - \bbl@patterns{#1}% - % hyphenation - allow stretching with babelnohyphens - \ifnum\language=\l@babelnohyphens + % hyphenation - select rules + \ifnum\csname l@\languagename\endcsname=\l@unhyphenated + \edef\bbl@tempa{u}% + \else + \edef\bbl@tempa{\bbl@cl{lnbrk}}% + \fi + \bbl@xin@{/u}{/\bbl@tempa}% + \ifin@ + % 'unhyphenated' = allow stretching + \language\l@unhyphenated \babel@savevariable\emergencystretch \emergencystretch\maxdimen \babel@savevariable\hbadness \hbadness\@M + \else + % other = select patterns + \bbl@patterns{#1}% \fi % hyphenation - mins \babel@savevariable\lefthyphenmin @@ -8877,10 +8936,13 @@ help from Bernd Raichle, for which I am grateful. % or |\normal@char|\m{char} in the case of |\bbl@deactivate|. % % \begin{macrocode} +\chardef\bbl@activated\z@ \def\bbl@activate#1{% + \chardef\bbl@activated\@ne \bbl@withactive{\expandafter\let\expandafter}#1% \csname bbl@active@\string#1\endcsname} \def\bbl@deactivate#1{% + \chardef\bbl@activated\tw@ \bbl@withactive{\expandafter\let\expandafter}#1% \csname bbl@normal@\string#1\endcsname} % \end{macrocode} @@ -9152,12 +9214,25 @@ help from Bernd Raichle, for which I am grateful. {\bbl@error {I cannot switch `\string#2' on or off--not a shorthand}% {This character is not a shorthand. Maybe you made\\% - a typing mistake? I will ignore your instruction}}% - {\ifcase#1% + a typing mistake? I will ignore your instruction.}}% + {\ifcase#1% off, on, off* \catcode`#212\relax \or \catcode`#2\active + \bbl@ifunset{bbl@shdef@\string#2}% + {}% + {\bbl@withactive{\expandafter\let\expandafter}#2% + \csname bbl@shdef@\string#2\endcsname + \bbl@csarg\let{shdef@\string#2}\relax}% + \ifcase\bbl@activated\or + \bbl@activate{#2}% + \else + \bbl@deactivate{#2}% + \fi \or + \bbl@ifunset{bbl@shdef@\string#2}% + {\bbl@withactive{\bbl@csarg\let{shdef@\string#2}}#2}% + {}% \csname bbl@oricat@\string#2\endcsname \csname bbl@oridef@\string#2\endcsname \fi}% @@ -10628,8 +10703,8 @@ help from Bernd Raichle, for which I am grateful. \chardef\l@english\z@ \fi % The following is used to cancel rules in ini files (see Amharic). -\ifx\l@babelnohyhens\@undefined - \newlanguage\l@babelnohyphens +\ifx\l@unhyphenated\@undefined + \newlanguage\l@unhyphenated \fi % \end{macrocode} % @@ -10712,6 +10787,7 @@ help from Bernd Raichle, for which I am grateful. \let\bbl@KVP@script\@nil \let\bbl@KVP@language\@nil \let\bbl@KVP@hyphenrules\@nil + \let\bbl@KVP@linebreaking\@nil \let\bbl@KVP@mapfont\@nil \let\bbl@KVP@maparabic\@nil \let\bbl@KVP@mapdigits\@nil @@ -11112,7 +11188,7 @@ help from Bernd Raichle, for which I am grateful. % Load the basic parameters (ids, typography, counters, and a few % more), while captions and dates are left out. But it may happen some % data has been loaded before automatically, so we first discard the -% saved values. +% saved values. (TODO. But preserving previous values would be useful.) % % \begin{macrocode} \def\bbl@load@basic#1{% @@ -12089,6 +12165,14 @@ help from Bernd Raichle, for which I am grateful. \BabelEnsureInfo} \@namedef{bbl@ADJ@bcp47.toname@off}{% \bbl@bcptonamefalse} +\@namedef{bbl@ADJ@prehyphenation.disable@nohyphenation}{% + \directlua{ Babel.ignore_pre_char = function(node) + return (node.lang == \the\csname l@nohyphenation\endcsname) + end }} +\@namedef{bbl@ADJ@prehyphenation.disable@off}{% + \directlua{ Babel.ignore_pre_char = function(node) + return false + end }} % TODO: use babel name, override % % As the final task, load the code for lua. @@ -12875,8 +12959,8 @@ help from Bernd Raichle, for which I am grateful. \bbl@csarg\gdef{xeipn@\languagename}% {\XeTeXlinebreakpenalty #1\relax}} \def\bbl@provide@intraspace{% - \bbl@xin@{\bbl@cl{lnbrk}}{s}% - \ifin@\else\bbl@xin@{\bbl@cl{lnbrk}}{c}\fi + \bbl@xin@{/s}{/\bbl@cl{lnbrk}}% + \ifin@\else\bbl@xin@{/c}{/\bbl@cl{lnbrk}}\fi \ifin@ \bbl@ifunset{bbl@intsp@\languagename}{}% {\expandafter\ifx\csname bbl@intsp@\languagename\endcsname\@empty\else @@ -13581,7 +13665,7 @@ help from Bernd Raichle, for which I am grateful. \def\bbl@provide@intraspace{% \bbl@ifunset{bbl@intsp@\languagename}{}% {\expandafter\ifx\csname bbl@intsp@\languagename\endcsname\@empty\else - \bbl@xin@{\bbl@cl{lnbrk}}{c}% + \bbl@xin@{/c}{/\bbl@cl{lnbrk}}% \ifin@ % cjk \bbl@cjkintraspace \directlua{ @@ -13867,7 +13951,11 @@ end end Babel.fetch_subtext = {} - + + Babel.ignore_pre_char = function(node) + return (node.lang == \the\l@nohyphenation) + end + &% Merging both functions doesn't seen feasible, because there are too &% many differences. Babel.fetch_subtext[0] = function(head) @@ -13891,7 +13979,11 @@ end if lang == locale or lang == nil then lang = lang or locale - word_string = word_string .. unicode.utf8.char(item.char) + if Babel.ignore_pre_char(item) then + word_string = word_string .. Babel.us_char + else + word_string = word_string .. unicode.utf8.char(item.char) + end word_nodes[#word_nodes+1] = item else break diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins index ddedf2c667..3a073878ba 100644 --- a/macros/latex/required/babel/base/babel.ins +++ b/macros/latex/required/babel/base/babel.ins @@ -26,7 +26,7 @@ %% and covered by LPPL is defined by the unpacking scripts (with %% extension .ins) which are part of the distribution. %% -\def\filedate{2021/04/07} +\def\filedate{2021/04/26} \def\batchfile{babel.ins} \input docstrip.tex diff --git a/macros/latex/required/babel/base/babel.pdf b/macros/latex/required/babel/base/babel.pdf Binary files differindex 540babb7bb..4eca976233 100644 --- a/macros/latex/required/babel/base/babel.pdf +++ b/macros/latex/required/babel/base/babel.pdf diff --git a/macros/latex/required/babel/base/bbcompat.dtx b/macros/latex/required/babel/base/bbcompat.dtx index ea7e8ecc5a..a69fa73b3e 100644 --- a/macros/latex/required/babel/base/bbcompat.dtx +++ b/macros/latex/required/babel/base/bbcompat.dtx @@ -30,7 +30,7 @@ % % \iffalse %<*dtx> -\ProvidesFile{bbcompat.dtx}[2021/04/07 v3.57] +\ProvidesFile{bbcompat.dtx}[2021/04/26 v3.58] %</dtx> % %% File 'bbcompat.dtx' diff --git a/macros/optex/README b/macros/optex/README index b8f925e47c..d3a5becec4 100644 --- a/macros/optex/README +++ b/macros/optex/README @@ -19,6 +19,17 @@ doc/ ... PDF version of the OpTeX documentation and sources. History: +<1.02> Apr. 2021 + Location CTAN:macros/luatex/optex moved to CTAN:macros/optex (similarly for TDS). + NewComputerModern font support added. + Microtypography support added. + Various colors for links can be declared by \def\_<type>linkolor. + unimath-codes: \nabla math-code set similar as \Delta. + Actual version of UnicodeData.txt read during format generation. + Reading mathclacss.opm improved. + slides: hyperlink destinations allowed in \slideshow mode too. + \bibpart allows to create independent bib-lists in single document. + \setwordspace: format of the parameter improved. <1.01> Mar. 2021 Minor code fixes (thanks to reports from users). LibreCaslon font file added. diff --git a/macros/optex/base/bib-iso690.opm b/macros/optex/base/bib-iso690.opm index c58709ce83..696084d8bb 100644 --- a/macros/optex/base/bib-iso690.opm +++ b/macros/optex/base/bib-iso690.opm @@ -1,6 +1,6 @@ % This is part of the OpTeX project, see http://petr.olsak.net/optex -% bibliography style (iso690), version <2020-03-10>, loaded on demand by \usebib +\_codedecl \_undefined {BIB style (iso690) <2021-04-07>} % loaded on demand by \usebib \_ifx\_optexbibstyle\_undefined \_errmessage {This file can be read by: \_string\usebib/? (iso690) bibfiles command only} @@ -33,8 +33,6 @@ \_toks1=\_ea{\_biboptionsi}% \_edef\_biboptionsi{\_space \_the\_toks1 \_space \_the\_biboptions \_space}% } -\_newtoks\_biboptions -\_public \biboptions ; \_doc ----------------------------- Formating of Author/Editor lists. @@ -399,12 +397,12 @@ If `aumin` is unused then `aumax` authors are printed in this case. All authors are printed if `aumax:<number>` option isn't given. There is no internal limit. But you can set the global options in -your document by setting the `\biboptions` tokens list. For example: +your document by setting the \^`\biboptions` tokens list. For example: \begtt \biboptions={aumax:7 aumin:1} % if there are 8 or more authors then only the first author is printed. -\entdd +\endtt Examples: \begtt @@ -904,3 +902,8 @@ nowarn ... no mandatory fields \endtt Other options in the option field are silently ignored. + +\_endinput + +2021-04-07 ... \biboptions toks declaration moved, bug fixed. +2020-03-10 ... released diff --git a/macros/optex/base/bib-simple.opm b/macros/optex/base/bib-simple.opm index dff747bd57..ad1fde28bc 100644 --- a/macros/optex/base/bib-simple.opm +++ b/macros/optex/base/bib-simple.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -% bibliography style (simple), version <2020-03-10>, loaded on demand by \usebib +\_codedecl \_undefined {BIB style (simple) <2020-03-10>} % loaded on demand by \usebib \_ifx\_optexbibstyle\_undefined \_errmessage {This file can be read by: \_string\usebib/? (simple) bibfiles command only} diff --git a/macros/optex/base/cite-bib.opm b/macros/optex/base/cite-bib.opm index 26a5b17bd4..56954a4ee0 100644 --- a/macros/optex/base/cite-bib.opm +++ b/macros/optex/base/cite-bib.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \cite {Cite, Biblioraphy <2020-03-09>} % loaded in format +\_codedecl \cite {Cite, Biblioraphy <2021-04-13>} % loaded in format \_doc ----------------------------- Registers used by `\cite`, `\bib` macros are declared here. @@ -14,6 +14,15 @@ \_public \bibnum \bibmark ; \_doc ----------------------------- + \`\_bibp` expands to \^`\bibpart``/`. + By default, \^`\bibpart` is empty, so internal links are in the form + `cite:/<number>`. If \^`\bibpart` is set to `<bibpart>`, then internal + links are `cite:<bibpart>/<number>`. + \_cod ----------------------------- + +\_def\_bibp{\_the\_bibpart/} % unique name for each bibliography list + + \_doc ----------------------------- \`\cite` `[<label>,<label>,...,<label>]` manages <labes> using `\_citeA` and prints `[<bib-marks>]` using `\_printsavedcites`. \nl @@ -35,7 +44,7 @@ \_def\_nocite[#1]{{\_citeA#1,,,}} \_def\_rcite[#1]{{\_citeA#1,,,\_printsavedcites}} \_def\_ecite[#1]{\_bgroup\_citeA#1,,,\_ea\_eciteB\_savedcites;} -\_def\_eciteB#1,#2;#3{\_if?#1\_relax #3\_else \_ilink[cite:#1]{#3}\_fi\_egroup} +\_def\_eciteB#1,#2;#3{\_if?#1\_relax #3\_else \_ilink[cite:\_bibp#1]{#3}\_fi\_egroup} \_def\_savedcites{} \_public \cite \nocite \rcite \ecite ; @@ -45,39 +54,42 @@ It depends on \`\nonumcitations` and on used bib-style. The mapping from <label> to <bib-mark> is done when `\bib` or `\usebib` is processed. These macros store the information to - \`\_Xbib``{<label>}{<number>}{<nonumber>}` where <number> and <nonumber> are + \`\_Xbib``{<bibpart>}{<label>}{<number>}{<nonumber>}` + where <number> and <nonumber> are two variants of <bib-mark> (numbered or text-like). This information is read from `.ref` file and it is saved to macros - `\_bib:<label>` and `\_bibm:<number>`. First one includes number and second - one includes <nonumber>. The `\_lastbibnum` macro includes last number of - bib-entry used in the document. A designer can use it to set appropriate + `\_bib:<bibpart>/<label>` and `\_bim:<bibpart>/<number>`. + First one includes <number> and second one includes <nonumber>. + The `\_lastbn:<bibpart>` macro includes last number of + bib-entry used in the document with given <bibpart>. + A designer can use it to set appropriate indentation when printing the list of all bib-entries. \_cod ----------------------------- -\_def\_Xbib#1#2#3{\_sdef{_bib:#1}{\_bibnn{#2}&}% - \_if^#3^\_else\_sdef{_bim:#2}{#3}\_fi\_def\_lastbibnum{#2}} +\_def\_Xbib#1#2#3#4{\_sxdef{_bib:#1/#2}{\_bibnn{#3}&}% + \_if^#4^\_else\_sxdef{_bim:#1/#3}{#4}\_fi\_sxdef{_lastbn:#1}{#3}} \_doc ----------------------------- \`\_citeA` `<label>,` processes one label from the list of labels given in the parameter of `\cite`, `\nocite`, `\rcite` or `\ecite` macros. It adds the - <label> to global list `\_citelist` which will be used by `\usebib` (it + <label> to a global list `\_ctlst:<bibpart>/` which will be used by `\usebib` (it must know what <labels> are used in the document to pick-up only relevant bib-entries from the database. Because we want to save - space and not to save the same <label> to `\_citelist` twice, we + space and to avoid duplications of <label> in the `\_ctlst:<bibpart>/`, we distinguish four cases: \begitems - * `<label>` was not declared by \^`\_Xbib` and it is first such <label> in the - document: Then `\_bib:<label>` is undefined and we save label using - `\_addcitlist`, write warning on the terminal and define - `\_bib:<label>` as empty. - * `<label>` was not declared by \^`\_Xbib` but it was used previously in the - document: Then `\_bib:<label>` is empty and we do nothing (only data to + * `<label>` was not declared by \^`\_Xbib` before and it is first such a <label> in the + document: Then `\_bib:<bibpart>/<label>` is undefined and we save label using + \^`\_addcitelist`, write warning on the terminal and define + `\_bib:<bibpart>/<label>` as empty. + * `<label>` was not declared by \^`\_Xbib` before but it was used previously in the + document: Then `\_bib:<bibpart>/<label>` is empty and we do nothing (only data to `\_savedcites` are saved). - * `<label>` was declared by \^`\_Xbib` and it is first such <label> in the - document: Then `\_bin:<label>` includes `\_bibnn{<number>}&` and we - test this case by `\if &\_bibnn{<number>}&`. This is true when `\_bibnn{<number>}` - expands to empty. The <label> is saved by `\_addcitelist` and - `\_bib:<label>` is re-defined directly as <number>. + * `<label>` was declared by \^`\_Xbib` before and it is first such <label> + used in the document: Then `\_bib:<bibpart>/<label>` includes \`\_bibnn``{<number>}&` and we + test this case by the command `\if &\_bibnn{<number>}&`. This is true when `\_bibnn{<number>}` + expands to empty. The <label> is saved by \^`\_addcitelist` and + `\_bib:<bibpart>/<label>` is re-defined directly as <number>. * `<label>` was declared by \^`\_Xbib` and it was used previously in the document. Then we do nothing (only data to `\_savedcites` are saved. \enditems @@ -86,28 +98,53 @@ \_def\_citeA #1#2,{\_if#1,\_else \_if *#1\_addcitelist{*}\_ea\_skiptorelax \_fi - \_ifcsname _bib:#1#2\_endcsname \_else + \_ifcsname _bib:\_bibp#1#2\_endcsname \_else \_addcitelist{#1#2}% - \_opwarning{\_noexpand\cite [#1#2] unknown. Try to TeX me again}\_openref + \_opwarning{{\_the\_bibpart} \_noexpand\cite [#1#2] unknown. Try to TeX me again}\_openref \_incr\_unresolvedrefs \_addto\_savedcites{?,}\_def\_sortcitesA{}\_lastcitenum=0 - \_ea\_gdef \_csname _bib:#1#2\_endcsname {}% + \_ea\_gdef \_csname _bib:\_bibp#1#2\_endcsname {}% \_ea\_skiptorelax \_fi - \_ea\_ifx \_csname _bib:#1#2\_endcsname \_empty + \_ea\_ifx \_csname _bib:\_bibp#1#2\_endcsname \_empty \_addto\_savedcites{?,}\_def\_sortcitesA{}\_lastcitenum=0 \_ea\_skiptorelax \_fi \_def\_bibnn##1{}% - \_if &\_csname _bib:#1#2\_endcsname + \_if &\_csname _bib:\_bibp#1#2\_endcsname \_def\_bibnn##1##2{##1}% \_addcitelist{#1#2}% - \_sxdef{_bib:#1#2}{\_csname _bib:#1#2\_endcsname}% + \_sxdef{_bib:\_bibp#1#2}{\_csname _bib:\_bibp#1#2\_endcsname}% \_fi - \_edef\_savedcites{\_savedcites \_csname _bib:#1#2\_endcsname,}% + \_edef\_savedcites{\_savedcites \_csname _bib:\_bibp#1#2\_endcsname,}% \_relax \_ea\_citeA\_fi } -\_def\_addcitelist#1{\_global\_addto\_citelist{\_citeI[#1]}} -\_def\_citelist{} +\_let\_bibnn=\_relax + + \_doc ---------------------------- + Because we implement possibility of more independent bibliography lists + distinguished by <bibpart>, the \`\_addcitelist``{<label>}` macro + must add the <label> to given `\_ctlst:<bibpart>/`.\nl + When `\_addcitelist` is processed before \^`\usebib`, + then \`\_citeI``[<label>]` is added. \^`\usebib` will use this list for selecting + right records from `.bib` file. Then \^`\usebib` sets + `\_ctlst:<bibpart>/` to `\_write`.\nl + If `\_addcitelist` is processed after \^`\usebib`, then + \`\_Xcite``{<bibpart>/}{<label>}` is saved to the `.ref` + file. The `\_Xcite` creates `\_ctlstB:<bibpart>/` as a list of saved + `\_citeI[<label>]`. Finally, \^`\usebib` concats boths lists `\_ctlst:<bibpart>/` + and `\_ctlstB:<bibpart>/` in the second \TeX/ run. + \_cod ---------------------------- + +\_def\_addcitelist#1{% + \_unless \_ifcsname _ctlst:\_bibp\_endcsname \_sxdef{_ctlst:\_bibp}{}\_fi + \_ea \_ifx \_csname _ctlst:\_bibp\_endcsname \_write + \_openref \_immediate\_wref\_Xcite{{\_bibp}{#1}}% + \_else \_global \_ea\_addto \_csname _ctlst:\_bibp\_endcsname {\_citeI[#1]}\_fi +} +\_def\_Xcite#1#2{% + \_unless \_ifcsname _ctlstB:#1\_endcsname \_sxdef{_ctlstB:#1}{}\_fi + \_global \_ea\_addto \_csname _ctlstB:#1\_endcsname {\_citeI[#2]}% +} \_doc ----------------------------- The `<bib-marks>` (in numeric or text form) are saved in \^`\_savedcites` @@ -167,38 +204,47 @@ } \_def\_shortcitations{\_lastcitenum=1 } -\_def\_printcite#1{\_citesep\_ilink[cite:#1]{\_citelinkA{#1}}\_def\_citesep{,\_hskip.2em\_relax}} -\_def\_printdashcite#1{\_ifmmode-\_else\_hbox{--}\_fi\_ilink[cite:#1]{\_citelinkA{#1}}} +\_def\_printcite#1{\_citesep + \_ilink[cite:\_bibp#1]{\_citelinkA{#1}}\_def\_citesep{,\_hskip.2em\_relax}} +\_def\_printdashcite#1{\_ifmmode-\_else\_hbox{--}\_fi\_ilink[cite:\_bibp#1]{\_citelinkA{#1}}} \_def\_citesep{} \_def\_nonumcitations{\_lastcitenum=0\_def\_sortcitesA{}\_def\_etalchar##1{$^{##1}$}% - \_def\_citelinkA##1{\_isdefined{_bim:##1}\_iftrue \_csname _bim:##1\_endcsname - \_else ##1\_opwarning{\_noexpand\nonumcitations + empty bibmark. Maybe bad bib-style}\_fi}% + \_def\_citelinkA##1{\_trycs{_bim:\_bibp##1} + {##1\_opwarning{\_noexpand\nonumcitations + empty bibmark. Maybe bad bib-style}}}% } \_def\_citelinkA{} \_public \nonumcitations \sortcitations \shortcitations ; \_doc ----------------------------- - The \`\bib` `[<label>] {<optional bib-mark>}` prints one bib-entry - without reading any database. The bib-enty follows after this command. + The \`\bib` `[<label>]` or `\bib [<label>] ={<bib-mark>}` prints one bib-entry + without reading any database. The bib-entry follows after this command. This command counts the used `\bib`s from one by `\bibnum` counter and - saves \^`\_Xbib``{<label>}{\_the\_bibnum}{\_the\_bibmark}` into `.ref` file - immediately using `\_wbib`. This is the core of creation of mapping from - `<labels>` to `<bib-marks>`. + saves \^`\_Xbib``{<bibpart>}{<label>}{<number>}{<nonumber>}` into `.ref` file + immediately using \`\_wbib``{<label>}{<number>}{<nonumber>}`. + This is the core of creation of mapping from `<labels>` to `<number>` and + `<nonumber>`.\nl + \`\_bibA` and \`\_bibB` implement the scanner of the optional argument + with the \^`\bibmark`.\nl + \`\_bibgl` is `\relax` by default but \^`\slides` do `\let\_bibgl=\_global`.\nl + \`\_dbib``{<label>}` creates destination for hyperlinks. \_cod ----------------------------- \_def\_bib[#1]{\_def\_tmp{\_isnextchar={\_bibA[#1]}{\_bibmark={}\_bibB[#1]}}% \_ea\_tmp\_romannumeral-`\.} % ignore optional space \_def\_bibA[#1]=#2{\_bibmark={#2}\_bibB[#1]} \_def\_bibB[#1]{\_par \_bibskip - \_advance\_bibnum by1 - \_noindent \_def\_tmpb{#1}\_wbib{#1}{\_the\_bibnum}{\_the\_bibmark}% - \_printlabel{#1}% + \_bibgl\_advance\_bibnum by1 + \_noindent \_def\_tmpb{#1}\_dbib{#1}\_wbib{#1}{\_the\_bibnum}{\_the\_bibmark}% \_printbib \_ignorespaces } -\_def\_wbib#1#2#3{\_dest[cite:\_the\_bibnum]% - \_ifx\_wref\_wrefrelax\_else \_immediate\_wref\_Xbib{{#1}{#2}{#3}}\_fi} +\_def\_dbib#1{\_dest[cite:\_bibp\_the\_bibnum]\_printlabel{#1}} +\_def\_wbib#1#2#3{% + \_ifx\_wref\_wrefrelax\_else \_immediate\_wref\_Xbib{{\_the\_bibpart}{#1}{#2}{#3}}\_fi + \_unless \_ifcsname bib:\_bibp#1\_endcsname \_Xbib{\_the\_bibpart}{#1}{#2}{#3}\_fi +} +\_let\_bibgl=\_relax \_public \bib ; @@ -245,22 +291,6 @@ \_def\_nobibwarning[#1]{\_global\_addto\_nobibwarnlist{#1,}} \_public \nobibwarning ; - \_doc ----------------------------- - The macros above works if all `\cite` (or similar) commands are used - before the `\usebib` command is used because `\usebib` prints only such - bib-entries their <labels> are saved in the `\_citelist`. But if some - `\cite` is used after `\usebib`, then `\usebib` sets `\_addcitelist` to - \`\_writeXcite`, so such `\cite` saves the information to the - `.ref`file in the format \`\_Xcite``{<label>}`. Such information are copied - to `\_citelistB` during reading `.ref` file and `\usebib` concats two - lists of <labels> from `\_citelist` and `\_citelistB` and - uses this concatenated list. - \_cod ----------------------------- - -\_def\_Xcite#1{\_addto\_citelistB{\_citeI[#1]}} -\_def\_writeXcite#1{\_openref\_immediate\_wref\_Xcite{{#1}}} -\_def\_citelistB{} - \_endcode % ------------------------------------- See end of the `usebib.opm` file for documentation about creating style @@ -269,3 +299,7 @@ files `bib-<style>.opm`. See end of the `bib-iso690.opm` file for large documentation about `.bib` files structure and about the usage of `iso690` bib-style. +History: +2021-04-13 ... \bibpart implemented +2021-04-13 ... \_bibgl introduced (used in \slides) +2020-03-09 ... released diff --git a/macros/optex/base/f-adventor.opm b/macros/optex/base/f-adventor.opm index df22be1130..e6b5ebabbd 100644 --- a/macros/optex/base/f-adventor.opm +++ b/macros/optex/base/f-adventor.opm @@ -11,7 +11,7 @@ Modifier:^^J }} \_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/f-antt.opm b/macros/optex/base/f-antt.opm index 39d3d011ea..bd11e01138 100644 --- a/macros/optex/base/f-antt.opm +++ b/macros/optex/base/f-antt.opm @@ -19,7 +19,7 @@ Modifiers:^^J \_onlyif sfamy={}: {\_fvars Regular Bold Italic BoldItalic }} \_moddef \medium {\_fsetV sfamy=Med \_fvars Regular . Italic . } \_moddef \light {\_fsetV sfamy=Light \_fvars Regular . Italic . } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/f-baskerville.opm b/macros/optex/base/f-baskerville.opm index 4e6027d703..a0f5e3e99d 100644 --- a/macros/optex/base/f-baskerville.opm +++ b/macros/optex/base/f-baskerville.opm @@ -11,7 +11,7 @@ Modifier:^^J }} \_moddef \resetmod {\_fsetV caps={} \_fvars Regular Bold Italic BoldItalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/f-bonum.opm b/macros/optex/base/f-bonum.opm index a285021b2e..5a3518dfe0 100644 --- a/macros/optex/base/f-bonum.opm +++ b/macros/optex/base/f-bonum.opm @@ -11,7 +11,7 @@ Modifier:^^J }} \_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/f-cursor.opm b/macros/optex/base/f-cursor.opm index 80b2a29457..13e52758bd 100644 --- a/macros/optex/base/f-cursor.opm +++ b/macros/optex/base/f-cursor.opm @@ -11,7 +11,7 @@ Modifier:^^J }} \_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/f-ebgaramond.opm b/macros/optex/base/f-ebgaramond.opm index 63502c9b08..c83ffb413f 100644 --- a/macros/optex/base/f-ebgaramond.opm +++ b/macros/optex/base/f-ebgaramond.opm @@ -18,7 +18,7 @@ Variant:^^J \_moddef \resetmod {\_fsetV caps={},swa={} \_fvars Regular Bold Italic BoldItalic } \_moddef \medium {\_fvars Medium ExtraBold MediumItalic ExtraBoldItalic } \_moddef \semibold {\_fvars Regular SemiBold Italic SemiBoldItalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_moddef \nocaps {\_fsetV caps={} } \_moddef \swash {\_fsetV swa=+swsh; } \_moddef \noswash {\_fsetV swa={} } diff --git a/macros/optex/base/f-garamondl.opm b/macros/optex/base/f-garamondl.opm index d642aac98c..c01b79c131 100644 --- a/macros/optex/base/f-garamondl.opm +++ b/macros/optex/base/f-garamondl.opm @@ -13,7 +13,7 @@ Modifiers:^^J }} \_moddef \resetmod {\_fsetV caps={},swa={} \_fvars Regular Bold Italic Bolditalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum;-liga; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum;-liga; } \_moddef \nocaps {\_fsetV caps={} } \_moddef \swash {\_fsetV swa=+swsh; } \_moddef \noswash {\_fsetV swa={} } diff --git a/macros/optex/base/f-gfsbodoni.opm b/macros/optex/base/f-gfsbodoni.opm index d7d3494a9d..8399f9d4d6 100644 --- a/macros/optex/base/f-gfsbodoni.opm +++ b/macros/optex/base/f-gfsbodoni.opm @@ -11,7 +11,7 @@ Modifier:^^J }} \_moddef \resetmod {\_fsetV caps={} \_fvars {} Bold It BoldIt } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/f-heros.opm b/macros/optex/base/f-heros.opm index 767052cc45..2aec4b466a 100644 --- a/macros/optex/base/f-heros.opm +++ b/macros/optex/base/f-heros.opm @@ -12,7 +12,7 @@ Modifiers:^^J }} \_moddef \resetmod {\_fsetV caps={},cond={} \_fvars regular bold italic bolditalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_moddef \nocaps {\_fsetV caps={} } \_moddef \cond {\_fsetV cond=cn } \_moddef \nocond {\_fsetV cond={} } @@ -140,12 +140,12 @@ with obvious result `\def\_<word-a>V {<value-a>}\def\_<word-b>V {<value-b>}` etc \seccc Example 3 If both font modifiers `\caps`, `\cond` were applied in Heros -family, then `\def\_capsV{+smcp;+onum}` and `\def\_condV{cn}` were processed +family, then `\def\_capsV{+smcp;\_ffonum;}` and `\def\_condV{cn}` were processed by these font modifiers. If a user needs the `\bf` variant at 11\,pt now then the \begtt - \font {[texgyreheroscn-bold]:+smcp;+onum;+tlig;} at11pt + \font {[texgyreheroscn-bold]:+smcp;+onum;+pnum;+tlig;} at11pt \endtt % is processed. We assume that a font file `texgyreheroscn-bold.otf` is present diff --git a/macros/optex/base/f-kpfonts.opm b/macros/optex/base/f-kpfonts.opm index c030bea8e8..8b293ee49f 100644 --- a/macros/optex/base/f-kpfonts.opm +++ b/macros/optex/base/f-kpfonts.opm @@ -19,7 +19,7 @@ Modifiers:^^J \_moddef \sans {\_fsetV subfam=Sans \_RBIfvars } \_moddef \mono {\_fsetV subfam=Mono \_RBIfvars } \_moddef \light {\_fsetV subfam=Roman \_fvars Light Semibold LightItalic SemiboldItalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_moddef \nocaps {\_fsetV caps={} } \_moddef \swash {\_fsetV swa=+swsh; } \_moddef \noswash {\_fsetV swa={} } diff --git a/macros/optex/base/f-libertine-s.opm b/macros/optex/base/f-libertine-s.opm index 3cdc089312..751dd17622 100644 --- a/macros/optex/base/f-libertine-s.opm +++ b/macros/optex/base/f-libertine-s.opm @@ -19,7 +19,7 @@ Special variants:^^J \_moddef \resetmod {\_fsetV mainfam=Libertine,subfam={},caps={} \_fvars {} B I BI } \_moddef \sans {\_fsetV mainfam=Biolinum,subfam={} } \_moddef \mono {\_fsetV mainfam=Libertine,subfam={Mono } \_fvars {} . . . } -\_moddef \caps {\_fsetV caps=+smcp; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_moddef \nocaps {\_fsetV caps={} } \_famvardef \initials {\_fsetV mainfam=Libertine,subfam={Initials } \_fvars {} . . . \rm} diff --git a/macros/optex/base/f-libertine.opm b/macros/optex/base/f-libertine.opm index b25c2fc4f9..bd90bedf0f 100644 --- a/macros/optex/base/f-libertine.opm +++ b/macros/optex/base/f-libertine.opm @@ -21,7 +21,7 @@ Special variants:^^J \_moddef \sans {\_fsetV subfam=Biolinum \_fvars R RB RI RBO } \_moddef \mono {\_fsetV subfam=Libertine \_fvars M MB MO MBO } \_moddef \semibold {\_fsetV subfam=Libertine \_fvars R RZ RI RZI } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_moddef \nocaps {\_fsetV caps={} } \_famvardef \initials {\_fsetV subfam=Libertine \_fvars I . . . \rm} diff --git a/macros/optex/base/f-libertinus.opm b/macros/optex/base/f-libertinus.opm index 5f1329d286..a3b74cc6be 100644 --- a/macros/optex/base/f-libertinus.opm +++ b/macros/optex/base/f-libertinus.opm @@ -20,7 +20,7 @@ Special variants:^^J \_moddef \resetmod {\_fsetV subfam=Serif,caps={} \_fvars Regular Bold Italic BoldItalic } \_moddef \semibold {\_fsetV subfam=Serif \_fvars Regular Semibold Italic SemiboldItalic } \_moddef \sans {\_fsetV subfam=Sans \_fvars Regular Bold Italic . } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_moddef \nocaps {\_fsetV caps={} } \_famvardef \mono {\_fsetV subfam=Mono \_fvars Regular . . . \_rm} diff --git a/macros/optex/base/f-librecaslon.opm b/macros/optex/base/f-librecaslon.opm index 53f61834f1..459cc90d1f 100644 --- a/macros/optex/base/f-librecaslon.opm +++ b/macros/optex/base/f-librecaslon.opm @@ -12,7 +12,7 @@ Modifier:^^J \_moddef \resetmod {\_fsetV caps={},csl={CaslonText} \_fvars \_cslV-Regular \_cslV-Bold \_cslV-Italic Csln-Bolditalic } -\_moddef \onum {\_fsetV caps=+onum; } +\_moddef \onum {\_fsetV caps=\_ffonum; } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/f-lmfonts.opm b/macros/optex/base/f-lmfonts.opm index 13865890e2..3b1e0d0c40 100644 --- a/macros/optex/base/f-lmfonts.opm +++ b/macros/optex/base/f-lmfonts.opm @@ -21,7 +21,9 @@ Sub-modifiers (selects special variants of given subfamily):^^J \caps ...... caps & small caps (available only at limited shapes)^^J \slant ..... slanted (default in some subfamilies)^^J \nbold ..... normal bold (extended bold is default)^^J - \bolder .... extended bold^^J + \bolder .... extended bold^^J% +Note: Text fonts support optical sizes, but LatinModern-Math only for scripts.^^J + Use another CM-like family if optical sizes not wanted: \fontfam[NewCM]. }} \_def\_LMregfont #1 #2 #3{% diff --git a/macros/optex/base/f-merriweather.opm b/macros/optex/base/f-merriweather.opm index f2972aaafd..c4f977e46e 100644 --- a/macros/optex/base/f-merriweather.opm +++ b/macros/optex/base/f-merriweather.opm @@ -17,7 +17,7 @@ Extended variants:^^J }} \_moddef \resetmod {\_fsetV caps={},sans={} \_fvars Regular Bold Italic BoldItalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_moddef \nocaps {\_fsetV caps={} } \_moddef \sans {\_fsetV sans=Sans } \_moddef \serif {\_fsetV sans={} } diff --git a/macros/optex/base/f-newcm.opm b/macros/optex/base/f-newcm.opm new file mode 100644 index 0000000000..ba83b0d729 --- /dev/null +++ b/macros/optex/base/f-newcm.opm @@ -0,0 +1,37 @@ +%% This is part of the OpTeX project, see http://petr.olsak.net/optex + +\_famdecl [New Computer Modern] \NewCM {CM with Book variants, Cyrillic, Greek} + {\book \ttset \sans \caps} {\rm \bf \it \bi} {NewCMMath} + {[NewCM10-Regular]} + {\_def\_fontnamegen {[NewCM\_typfV-\_currV]:\_capsV\_fontfeatures}} + +\_wlog{\_detokenize{% +Modifiers:^^J + \book ...... slightly bolder \rm, \it^^J + \ttset ..... Typewriter variants^^J + \sans ...... Sans serif variants^^J + \caps ...... caps & small caps (not in Italic variants)^^J% +Note: use \book\normalmath if you want Math in book-style too. +}} + +\_moddef \resetmod {\_fsetV caps={},typf=10,book={} \_fvars Regular Bold {\_ncmI} {\_ncmBI} } +\_moddef \book {\_fsetV book=Book \_fvars Book Bold {\_ncmI} {\_ncmBI} + \_def\_unimathfont{NewCMMath-Book}} +\_moddef \ttset {\_fsetV typf=Mono10 } +\_moddef \sans {\_fsetV typf=Sans10 } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } + +\_def\_ncmtyprm{10} +\_def\_ncmtypsans{Sans10} +\_def\_ncmI {\_bookV \_ifx\_typfV\_ncmtypsans Oblique\_else Italic\_fi} +\_def\_ncmBI {Bold\_ifx\_typfV\_ncmtyprm Italic\_else Oblique\_fi} + +\_initfontfamily % new font family must be initialized + +\_loadmath {[NewCMMath-Regular]} + +\_endcode + +See the file `f-heros.opm` for information about principles of such +font-macro-files. + diff --git a/macros/optex/base/f-pagella.opm b/macros/optex/base/f-pagella.opm index a0e4eb8e30..135b242259 100644 --- a/macros/optex/base/f-pagella.opm +++ b/macros/optex/base/f-pagella.opm @@ -11,7 +11,7 @@ Modifier:^^J }} \_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/f-poltawski.opm b/macros/optex/base/f-poltawski.opm index ffc7e8474d..6ebf089a31 100644 --- a/macros/optex/base/f-poltawski.opm +++ b/macros/optex/base/f-poltawski.opm @@ -24,7 +24,7 @@ Modifiers:^^J \_moddef \expd {\_fsetV cond=semiexpd } \_moddef \cond {\_fsetV cond=semicond } \_moddef \ccond {\_fsetV cond=cond } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_moddef \nocaps {\_fsetV caps={} } \_moddef \osize {\_def\_fontnamegen{[antpolt\_liV\_optname{x}-\_currV]:\_capsV\_fontfeatures}% \_regoptsizes x ? expd <7 semiexpd <9 {} <11.1 semicond <15 cond <*} diff --git a/macros/optex/base/f-roboto.opm b/macros/optex/base/f-roboto.opm index 51dfffff25..2b810fcd53 100644 --- a/macros/optex/base/f-roboto.opm +++ b/macros/optex/base/f-roboto.opm @@ -40,7 +40,7 @@ Extended variants:^^J \_onlyif sub=Slab: {\_fvars Regular Bold . . }} \_moddef \bolder {\_onlyif sub={}: {\_fsetV w=b \_fvars Medium Black MediumItalic BlackItalic }} -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_moddef \nocaps {\_fsetV caps={} } \_famvardef \tf {\_thinM \_rm} diff --git a/macros/optex/base/f-schola.opm b/macros/optex/base/f-schola.opm index 067a6d0ce2..e0900b4de0 100644 --- a/macros/optex/base/f-schola.opm +++ b/macros/optex/base/f-schola.opm @@ -11,7 +11,7 @@ Modifier:^^J }} \_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/f-sourcepro.opm b/macros/optex/base/f-sourcepro.opm index a8e847104e..a8b1137c11 100644 --- a/macros/optex/base/f-sourcepro.opm +++ b/macros/optex/base/f-sourcepro.opm @@ -25,7 +25,7 @@ Modifiers:^^J \_moddef \elight {\_fvars ExtraLight Regular ExtraLightIt RegularIt } \_moddef \bolder {\_fvars Semibold Black SemiboldIt BlackIt } \_moddef \medium {\_fsetV typf=Code \_fvars Medium Bold MediumIt BoldIt } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_moddef \nocaps {\_fsetV caps={} } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/f-technika.opm b/macros/optex/base/f-technika.opm index 77b894e53b..b29b29ed0c 100644 --- a/macros/optex/base/f-technika.opm +++ b/macros/optex/base/f-technika.opm @@ -1,7 +1,7 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex \_famdecl [Technika] \Technika {Fonts from visual style of CTU in Prague} - {\caps \light} {\rm \bf \it \bi \stencil} {} + {\caps \light \book} {\rm \bf \it \bi \stencil} {} {[Technika-Regular]} {\_def\_fontnamegen {[Technika\_stencilV-\_currV]:\_capsV\_fontfeatures}} @@ -17,7 +17,7 @@ Special variant:^^J \_moddef \resetmod {\_fsetV stencil={},caps={} \_fvars Regular Bold Italic BoldItalic } \_moddef \light {\_fsetV stencil={} \_fvars Light Regular LightItalic Italic } \_moddef \book {\_fsetV stencil={} \_fvars Book Bold BookItalic BoldItalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp\_ffonum; } \_famvardef \stencil {\_fsetV stencil=Stencil \_fvars Bold . Bold . \rm} diff --git a/macros/optex/base/f-termes.opm b/macros/optex/base/f-termes.opm index 8cd6ee6d8a..877aa1ded0 100644 --- a/macros/optex/base/f-termes.opm +++ b/macros/optex/base/f-termes.opm @@ -11,7 +11,7 @@ Modifier:^^J }} \_moddef \resetmod {\_fsetV caps={} \_fvars regular bold italic bolditalic } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/f-xcharter.opm b/macros/optex/base/f-xcharter.opm index 9ad886d47f..b776582a1c 100644 --- a/macros/optex/base/f-xcharter.opm +++ b/macros/optex/base/f-xcharter.opm @@ -13,7 +13,7 @@ Modifiers:^^J \_moddef \resetmod {\_fsetV caps={} \_fvars Roman Bold Italic BoldItalic } \_moddef \slant {\_fvars Roman Bold Slanted BoldSlanted } -\_moddef \caps {\_fsetV caps=+smcp;+onum; } +\_moddef \caps {\_fsetV caps=+smcp;\_ffonum; } \_initfontfamily % new font family must be initialized diff --git a/macros/optex/base/fams-ini.opm b/macros/optex/base/fams-ini.opm index 3c8ded975e..1d4d9f5c59 100644 --- a/macros/optex/base/fams-ini.opm +++ b/macros/optex/base/fams-ini.opm @@ -49,6 +49,13 @@ \_famtext {Other fonts:} +\_famfrom{Antonis Tsolomitis} +\_faminfo [New Computer Modern] {CM with Book variants, Cyrillic, Greek} {f-newcm} + { -: {\rm\bf\it\bi} \book: {\rm\it} \ttset: {\rm\bf\it\bi} \book\ttset: {\rm\it} + \sans: {\rm\bf\it\bi} \book\sans: {\rm\it} + \caps: {\rm\bf} \book\caps: {\rm} } +\_famalias [NewCM] \_famalias [NewCMfonts] + \_famfrom {Philipp H. Poll} \_faminfo [Linux Libertine] {Free fonts typically installed on systems} {f-libertine} { -: {\rm\bf\it\bi} \semibold: {\bf\bi} @@ -153,7 +160,7 @@ \_endcode Once you have prepared a font family file with the name `f-<famname>.opm` and -\TeX/can see it in your filesystem then you can type \^`\fontfam``[<famname>]` and +\TeX/ can see it in your filesystem then you can type \^`\fontfam``[<famname>]` and the file is read, so the information about the font family is loaded. The name `<famname>` must be lowercase and without spaces in the file name `f-<famname>.opm`. On the other hand, the `\fontfam` command is more tolerant: @@ -178,7 +185,7 @@ declaration of Adobe's Times family in `fams-local.opm`. When a user writes `\fontfam[Times]` then the original Times (not Termes) is used. The `fams-ini.opm` and `fams-local.opm` files use the macros -`\_famifo`, `\_famalias` and `\_famtext`. See the example from +\~`\_faminfo`, \~`\_famalias` and \~`\_famtext`. See the example from `fams-ini.tex`: {\everytt={\typosize[8/10]\_let\_printverbline=\_printcodeline \medskip} diff --git a/macros/optex/base/fnotes.opm b/macros/optex/base/fnotes.opm index 612b32a17d..1445c57d4c 100644 --- a/macros/optex/base/fnotes.opm +++ b/macros/optex/base/fnotes.opm @@ -50,9 +50,9 @@ \_def \_printfnotemarkB {\_printfnotemark} % footnote marks used in front of footnotes \_def \_fnotelinks#1#2{% <inText color> <inFootnote color> - \_def\_printfnotemarkA{\_link[fnt:\_the\_gfnotenum]{\_localcolor#1}{\_printfnotemark}% + \_def\_printfnotemarkA{\_link[fnt:\_the\_gfnotenum]{#1}{\_printfnotemark}% \_dest[fnf:\_the\_gfnotenum]}% - \_def\_printfnotemarkB{\_link[fnf:\_the\_gfnotenum]{\_localcolor#2}{\_printfnotemark}% + \_def\_printfnotemarkB{\_link[fnf:\_the\_gfnotenum]{#2}{\_printfnotemark}% \_dest[fnt:\_the\_gfnotenum]}% } \public \fnotelinks ; diff --git a/macros/optex/base/fonts-resize.opm b/macros/optex/base/fonts-resize.opm index ac0064df10..7d1ce6cbed 100644 --- a/macros/optex/base/fonts-resize.opm +++ b/macros/optex/base/fonts-resize.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \setfontsize {Font resizing macros <2020-04-17>} % preloaded in format +\_codedecl \setfontsize {Font resizing macros <2021-04-17>} % preloaded in format \_doc ----------------------------- The \`\setfontsize` `{<sizespec>}` saves the `<sizespec>` to the \`\_sizespec` macro. @@ -34,27 +34,36 @@ \_doc ----------------------------- \`\_resizefont` `{<variant-name>}\<font switch>`, - for example `\resizefont{bf}\_tenbf` resizes the font given by the - variant. The variant `XX` have its font switch `\_tenXX`. - The \`\_doresizefont``\fontswitch` is used. It works in - TFM mode (\`\_doresizetfmfont`) or OTF mode (\^`\_doresizeunifont`). - In both modes, it does - \begtt \catcode`\<=13 - \_font \_tenXX = <fontname> \_sizespec + resizes the font given by the variant. + The <variant-name> is `rm` or `bf` or `it` or `bi`. + The new <font-switch> is declared (roughly speaking) by: + \begtt \catcode`<=13 + \_font <font switch> = <fontname of>\_ten<variant-name> \_sizepec + \endtt + If the \^`\_fontselector` is defined then it has priority before <font-switch> + and the font is loaded by: + \begtt \catcode`<=13 + \_ea\_font \_fontselector = <fontname of>\_ten<variant-name> \_sizepec \endtt - The `<fontname>` is generated by the `\fontname` \TeX/ primitive where - \`\_rfontskipat` removes the `at<dimen>` part of the `\_fontname` output. - The `<fontname>` is generated differently in OTF mode, see + The font is loaded by \`\_doresizefont``<font switch>`. This macro has + meaning \`\_doresizetfmfont` in TFM mode and it switches to + \^`\_doresizeunifont` when \^`\initunifonts` is used.\nl + The `<fontname of>` is generated by the `\fontname` \TeX/ primitive where + \`\_rfontskipat` removes the `at<dimen>` part of the `\fontname` output. + The `<fontname of>` is generated differently in OTF mode, see \^`\_doresizeunifont` macro.\nl - The \`\_whatresize` is defined as `<variant-name>`. + The \`\_whatresize` is defined as `<variant-name>`.\nl + The \^`\_fontloaded``<font switch>` is a macro which can be used for + post-processing when a font is loaded. \_cod ----------------------------- \_def\_resizefont#1#2{% - \_edef\_whatresize{#1}% - \_ifx \_fontselector \_undefined \_doresizefont#2% - \_else \_ea \_doresizefont \_fontselector \_fi - \_lastmagsize=\_zo - \_slet{_tryload#1}{_relax}% + \_edef\_whatresize{#1}% + \_ifx \_fontselector \_undefined + \_doresizefont#2\_relax \_ea\_fontloaded \_csname _ten#1\_endcsname + \_else \_ea\_doresizefont \_fontselector \_ea\_fontloaded \_fontselector \_fi + \_lastmagsize=\_zo + \_slet{_tryload#1}{_relax}% } \_def\_doresizetfmfont#1{\_logfont{#1}% \_ea\_font\_ea#1\_ea\_rfontskipat @@ -68,6 +77,24 @@ \_def\_rfskipatN #1 #2\_relax{\_whichtfm{#1}} \_doc ----------------------------- + If a font is loaded by \^`\_resizefont` or \^`\resizethefont` then the + \`\_fontloaded``<font switch>` is called immediately after it. If the font + is loaded first then its `\skewchar` is equal to $-1$. We run + \`\_newfontloaded``<font switch>` and set `\skewchar=-2` in this case. + A user can define a `\_newfontloaded` macro. We are sure that + `\_newfontloaded` macro is called only once for each instance of the font + given by its name, OTF features and size specification. The `\skewchar` value is + globally saved to the font (like `\fontdimen`). If it is used in math + typesetting then it is set to a positive value.\nl + The `\_newfontloaded` should be defined for micro-typographic configuration of + fonts, for example. See + \ulink[http://petr.olsak.net/optex/optex-tricks.html\#fontexpand]{OpTeX/ trick 0058}. + \_cod ----------------------------- + +\_def\_fontloaded #1{\_ifnum\_skewchar#1=-1 \_skewchar#1=-2 \_newfontloaded#1\_fi} +\_def\_newfontloaded #1{} + + \_doc ----------------------------- \`\fontdef` `<font switch>{<modifiers><variant selector>}` opens group, runs `<modifiers><variant selector>` (i.e.\ it runs `#2` parameter). The font switch `#1` saved in the \`\_fontselector` macro is re-declared @@ -110,7 +137,7 @@ \_def \_newcurrfontsize #1{% \newcurrfontsize{at25pt} \_edef\_tmp{\_ea\_csstring \_the\_font}% \_ea \_fontlet \_csname \_tmp\_ea\_endcsname \_the\_font \_space #1\_relax - \_csname \_tmp\_endcsname + \_ea\_fontloaded \_csname \_tmp \_ea\_endcsname \_csname \_tmp\_endcsname } \_protected\_def \_resizethefont{\_newcurrfontsize\_sizespec} @@ -127,7 +154,7 @@ \_loadf{it}\_tenit \_loadf{bi}\_tenbi } \_def\_loadf#1#2{\_sdef{_tryload#1}{\_ifmmode \_else \_resizefont{#1}#2\_fi}} -\_def\_tryloadtt{\_resizefont{tt}\_tentt} +\_def\_tryloadtt{\_resizefont{tt}\_tentt} % only in TFM mode \_let\_tryloadrm=\_relax \_let\_tryloadbf=\_relax @@ -350,5 +377,6 @@ and OTF Latin Modern fonts in the `f-lmfonts.opm` file. \_endinput +2021-04-17 \_fontloaded, \_newfontloaded introduced 2020-04-17 \resizethefont introduced 2020-03-17 released diff --git a/macros/optex/base/fonts-select.opm b/macros/optex/base/fonts-select.opm index 740b311a67..eab114fcc4 100644 --- a/macros/optex/base/fonts-select.opm +++ b/macros/optex/base/fonts-select.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \fontfam {Fonts selection system <2021-02-25>} % preloaded in format +\_codedecl \fontfam {Fonts selection system <2021-04-22>} % preloaded in format \_doc ----------------------------- \`\initunifonts` macro extends \LuaTeX's font capabalities, @@ -114,7 +114,10 @@ `<value-b>` or ... or `<value-z>`. \nl \`\_prepcommalist` `ab,{},cd,\_end,` expands to `ab,,cd,` (auxiliary macro - used in `\_onlyif`). + used in `\_onlyif`).\nl + \`\_ffonum` is a shortcut for oldstyle digits font features used in + font family files. You can do `\let\_ffonum=\ignoreit` if you don't want + to set old digits together with `\caps`. \_cod ----------------------------- \_def\_fvars #1 #2 #3 #4 {% @@ -137,6 +140,7 @@ \_iftrue #3\_fi } \_def\_prepcommalist#1,{\_ifx\_end#1\_empty\_else #1,\_ea\_prepcommalist\_fi} +\_def\_ffonum {+onum;+pnum} \_doc ----------------------------- The \`\moddef` `\<modifier> {<data>}` simply speaking does @@ -359,7 +363,7 @@ \_doc ----------------------------- The \`\setfontcolor` and \`\setletterspace` are macros based on the special font features provided by \LuaTeX/ (and by \XeTeX/ too but it is not - our business). The \`\setwordspace` recalulates the `\fontdimen2,3,4` + our business). The \`\setwordspace` recalculates the `\fontdimen2,3,4` of the font using the \`\setwsp` macro which is used by the \^`\_doresizeunifont` macro. It activates a dummy font feature `+Ws` too in order the font is reloded by the `\font` primitive (with independent @@ -381,12 +385,14 @@ } \_def \_setwordspace #1{% \_if^#1^\_def\_setwsp##1{}\_removefeature{+Ws}% - \_else \_def\_setwsp{\_setwspA{#1}}\_setff{+Ws}\_fi + \_else \_def\_setwsp{\_setwspA#1/}\_setff{+Ws}\_fi \_reloading } \_def\_setwsp #1{} -\_def\_setwspA #1#2{\_fontdimen2#2=#1\_fontdimen2#2% - \_fontdimen3#2=#1\_fontdimen3#2\_fontdimen4#2=#1\_fontdimen4#2} +\_def\_setwspA #1{\_ifx/#1\_ea\_setwspB \_else\_afterfi{\_setwspC#1}\_fi} +\_def\_setwspB #1/#2/#3/#4{\_fontdimen2#4=#1\_fontdimen2#4% + \_fontdimen3#4=#2\_fontdimen3#4\_fontdimen4#4=#3\_fontdimen4#4} +\_def\_setwspC #1/{\_setwspB #1/#1/#1/} \_def\_calculatefontcolor#1{\_trycs{_fc:#1}{#1}} % you can define more smart macro ... \_sdef{_fc:red}{FF0000FF} \_sdef{_fc:green}{00FF00FF} \_sdef{_fc:blue}{0000FFFF} @@ -774,19 +780,23 @@ empty parameter `<number>` means no letter spacing which is the default. \^`\setwordspace` `{<scaling>}` scales the default interword space (defined in the font) and its stretching and shrinking parameters by given `<scaling>` factor. For example `\setwordspace{2.5}` multiplies interword space by 2.5. +\^`\setwordspace` can use different multiplication factors if its parameter is in the +format `{/<default>/<stretching>/<shrinking>}`. For example, +`\setwordspace{/1/2.5/1}` enlarges only stretching 2.5~times. -If you need another font transformations, you can use `\setff` -with following font features provided by Lua\TeX/: +You can use `\setff` with other font features provided by Lua\TeX/ and `luaotfload` package +(see documentation of `loaotfload` package for more information): \begtt -\setff{embolden=1.5}\rm % font is bolder because outline has nonzero width -\setff{slant=0.2}\rm % font is slanted by a linear transformation -\setff{extend=1.2}\rm % font is extended by a linear transformation. -\setff{colr=yes}\rm % if the font includes colored characters, use colors -\setff{upper}\rm % to uppercase (lower=lowecase) conversion at font level +\setff{embolden=1.5}\rm % font is bolder because outline has nonzero width +\setff{slant=0.2}\rm % font is slanted by a linear transformation +\setff{extend=1.2}\rm % font is extended by a linear transformation. +\setff{colr=yes}\rm % if the font includes colored characters, use colors +\setff{upper}\rm % to uppercase (lower=lowecase) conversion at font level +\setff{fallback=name}\rm % use fonts from a list given by name if missing chars \endtt -Use font transformations mentioned above and \^`\setletterspace`, +Use font transformations `embolden`, `slant`, `extend` and \^`\setletterspace`, \^`\setwordspace` with care. The best setting of these values is the default setting in every font, of course. If you really need to set a different letter spacing then it is strongly recommended to add `\setff{-liga}` @@ -838,6 +848,8 @@ Luaotfload documentation for more information. \endinput +2021-04-22 \_ffonum introduced +2021-04-19 \setwordspace: parameter format {/A/B/C} implemented. 2021-02-25 \_ttunifont introduced 2021-01-27 lua hack (print function) removed because luaotfload 3.17 removes bug. 2020-12-12 \_modlist added, doc improved diff --git a/macros/optex/base/graphics.opm b/macros/optex/base/graphics.opm index afff1c1284..1adb444b4e 100644 --- a/macros/optex/base/graphics.opm +++ b/macros/optex/base/graphics.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \inspic {Graphics <2020-04-12>} % preloaded in format +\_codedecl \inspic {Graphics <2021-03-19>} % preloaded in format \_doc ----------------------------- \`\inspic` accepts old syntax `\inspic <filename><space>` @@ -40,13 +40,14 @@ \_def\_inkinspicA #1 {\_inkinspicB {#1}} \_def\_inkinspicB #1{% \_ifdim\_picwidth=0pt \_setbox0=\_hbox{\_inspic{#1}}\_picwidth=\_wd0 \_fi + \_tmptoks={#1}% \_the\_inkdefs \_opinput {\_the\_picdir #1_tex}% file with labels \_egroup} \_newtoks\_inkdefs \_inkdefs={% \_def\makeatletter#1\makeatother{}% - \_def\includegraphics[#1]#2{\_inkscanpage#1,page=,\_end \_inspic{#2}\_hss}% + \_def\includegraphics[#1]#2{\_inkscanpage#1,page=,\_end \_inspic{\_the\_tmptoks}\_hss}% \_def\_inkscanpage#1page=#2,#3\_end{\_ifx,#2,\_else\_def\_picparams{page#2}\_fi}% \_def\put(#1,#2)#3{\_nointerlineskip\_vbox to\_zo{\_vss\_hbox to\_zo{\_kern#1\_picwidth \_pdfsave\_hbox to\_zo{#3}\_pdfrestore\_hss}\_kern#2\_picwidth}}% @@ -440,6 +441,7 @@ the \^`\transformbox{<transformation>}{\copy\mypic}`. \_endinput +2021-03-19: \inkinspic: pictures in subdirectories, bug fixed 2020-12-21: \puttext: \box0 in goup, bugfix 2020-04-12: \_public \clipinoval \clipincircle ; added, bug fixed diff --git a/macros/optex/base/hyperlinks.opm b/macros/optex/base/hyperlinks.opm index 5fc8a32233..95fae3846b 100644 --- a/macros/optex/base/hyperlinks.opm +++ b/macros/optex/base/hyperlinks.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \ulink {Hyperlinks <2021-01-27>} % preloaded in format +\_codedecl \ulink {Hyperlinks <2021-04-17>} % preloaded in format \_doc ---------------------------- \`\dest``[<type>:<spec>]` creates a destination of internal links. The @@ -28,20 +28,30 @@ \`\link``[<type>:<spec>]{<color>}{<text>}` creates an internal link to \^`\dest` with the same `<type>:<spec>`. You can have more links with the same `<type>:<spec>` but only one `\dest` in the document. If \^`\hyperlinks` - command is not used, then `\link` only prints `<text>` else it is set to + command is not used, then `\link` only prints `<text>` else its meaning is set to `\_linkactive`. The \`\_linkactive` is implemented by `\_pdfstartlink...\_pdfendlink` - primitives. + primitives. The `<color>` is the color of the link text generated by + the `\_linkactive` macro. + The `<color>` parameter can be overwritten by definition of + `\_<type>linkcolor`. For example `\def\_toclinkcolor{\Red}` means that + links from table of contents are in red. This is similar concept as + `\_def\_tocborder`. \nl \`\ilink``[<type>:<spec>]{<text>}` is equivalent to `\_link` but - the `<color>` is used from \^`\hyperlinks` declaration. + the `<color>` is used from \^`\hyperlinks` declaration + (or it is overwriten by `\def\_<type>linkcolor`). + \nl + \`\_linkdimens` are default dimensions of the link area. \_cod ---------------------------- -\_protected\_def\_linkactive[#1:#2]#3#4{\_leavevmode\_pdfstartlink height.9em depth.3em - \_pdfborder{#1} goto name{#1:#2}\_relax {#3#4}\_pdfendlink +\_protected\_def\_linkactive[#1:#2]#3#4{\_leavevmode\_pdfstartlink \_linkdimens + attr{\_pdfborder{#1}} goto name{#1:#2}\_relax + {\_localcolor\_trycs{_#1linkcolor}{#3}#4}\_pdfendlink } \_protected\_def\_link[#1]#2#3{\_leavevmode{#3}} -\_protected\_def\_ilink[#1]#2{\_leavevmode{#2}} +\_def\_ilink[#1]#2{\_link[#1]{}{#2}} +\_def\_linkdimens{height.9em depth.3em} \_public \ilink \link ; \_doc ---------------------------- @@ -53,19 +63,18 @@ \_cod ---------------------------- \_protected\_def\_urlactive[#1:#2]#3#4{\_leavevmode{\_escapechar=-1 - \_pdfstartlink height.9em depth.3em \_pdfborder{#1}% + \_pdfstartlink \_linkdimens attr{\_pdfborder{#1}}% user{/Subtype/Link/A <</Type/Action/S/URI/URI(\_detokenize{#2})>>}\_relax - {#3#4}\_pdfendlink}% + {\_localcolor\_trycs{_#1linkcolor}{#3}#4}\_pdfendlink}% } \_def\_ulink[#1]#2{\_leavevmode{#2}} -\_def\_urlcolor{} \_public \ulink ; \_doc ---------------------------- - The `\_pdfstartlink` primitive uses `\_pdfborder{<type>}` in its parameter + The `\_pdfstartlink` primitive uses `attr{\_pdfborder{<type>}}` in its parameter (see \^`\_linkactive` or \^`\_urlactive` macros). The \`\_pdfborder``{<type>}` - expands to `attr{/C[? ? ?] /Border[0 0 .6]}` if the - `\_<type>border` (i.e.\ \`\_refborder`, \`\_citeborder`, \`\_tocborder`, + macro expands to `/C[? ? ?] /Border[0 0 .6]` if the + `\_<type>border` macro (i.e.\ \`\_refborder`, \`\_citeborder`, \`\_tocborder`, \`\_pgborder`, \`\_urlborder`, \`\_fntborder` or \`\_fnfborder`) is defined. Users can define it in order to create colored frames around active links. For example @@ -74,8 +83,7 @@ \_cod ---------------------------- \_def\_pdfborder#1{\_ifcsname _#1border\_endcsname - attr{/C[\_csname _#1border\_endcsname] /Border[0 0 .6]}% - \_else attr{/Border[0 0 0]}\_fi + /C [\_csname _#1border\_endcsname] /Border [0 0 .6]\_else /Border [0 0 0]\_fi } \_doc ---------------------------- @@ -86,8 +94,8 @@ \_def\_hyperlinks#1#2{% \_let\_dest=\_destactive \_let\_link=\_linkactive - \_def\_ilink[##1]##2{\_link[##1]{\_localcolor#1}{##2}}% - \_def\_ulink[##1]##2{\_urlactive[url:##1]{\_localcolor#2}{##2}}% + \_def\_ilink[##1]##2{\_link[##1]{#1}{##2}}% + \_def\_ulink[##1]##2{\_urlactive[url:##1]{#2}{##2}}% \_public \dest \ilink \ulink \link ;% } \_public \hyperlinks ; @@ -136,8 +144,8 @@ There are four types of internal links and one type of external link: see also the section \ref[maketoc]. * `pg:<gpageno>` -- the destination is created at beginning of each page, see also the section \ref[output]. -* `cite:<bibnum>` -- the destination is created in bibliography reference, - see also the section \ref[bib]. +* `cite:<bibpart>/<bibnum>` -- the destination is created in bibliography reference, + see section \ref[bib]. * `url:<url>` -- used by `\url` or `\ulink`, see also the end of this section. \enditems @@ -152,6 +160,8 @@ of internal links are created at the same destination place: \_endinput +2021-04-17 attr{\_pdfborder{...}} instead expanding \_pdfborder to attr{...} +2021-04-02 The possibility of \def\_toclinkcolor introduced, \localcolor moved 2021-01-27 \public \link added to \hyperlinks, bug fixed. 2020-04-22 \| in \url: bug fixed -2020-03-15 introduced
\ No newline at end of file +2020-03-15 introduced diff --git a/macros/optex/base/hyphen-lan.opm b/macros/optex/base/hyphen-lan.opm index dad0b26657..7a6c790d1f 100644 --- a/macros/optex/base/hyphen-lan.opm +++ b/macros/optex/base/hyphen-lan.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \langlist {Initialization of hypenation patterns <2020-03-10>} % preloaded in format +\_codedecl \langlist {Initialization of hypenation patterns <2021-03-29>} % preloaded in format \_doc ----------------------------- The <iso-code> means a shortcut of language name (mostly by ISO 639-1). @@ -208,6 +208,7 @@ \_preplang sv Swedish sv 239 22 \_preplang th Thai th 240 23 \_preplang ethi Ethiopic mul-ethi 241 11 +\_preplang fis schoolFinnish fi-x-school 242 11 \_doc ----------------------------- The \`\langlist` includes names of all languages which are ready to load @@ -243,3 +244,9 @@ The example shows how to declare such language-specific things. Note that you need not set language-specific phrases (like `\today`) by this code. Another concept is used for such tasks. See the section~\ref[langphrases] for more details. + +\_endinput + +2021-03-29 \_preplang schoolFinnish added +2020-11-11 load patterns without lua code +2020-03-10 released diff --git a/macros/optex/base/luatex-ini.opm b/macros/optex/base/luatex-ini.opm index e0526a48d6..1deeca2b80 100644 --- a/macros/optex/base/luatex-ini.opm +++ b/macros/optex/base/luatex-ini.opm @@ -49,9 +49,7 @@ \_protected\_def \_pdflastobj {\_numexpr\_pdffeedback lastobj\_relax} \_protected\_def \_pdflastannot {\_numexpr\_pdffeedback lastannot\_relax} \_def \_pdfxformname {\_pdffeedback xformname} -{\_outputmode=1 - \_xdef\_pdfcreationdate {\_pdffeedback creationdate} -} + \_def \_pdfcreationdate {\_pdffeedback creationdate} \_def \_pdffontname {\_pdffeedback fontname} \_def \_pdffontobjnum {\_pdffeedback fontobjnum} \_def \_pdffontsize {\_pdffeedback fontsize} diff --git a/macros/optex/base/math-macros.opm b/macros/optex/base/math-macros.opm index 2b090ee1b8..efb777a30a 100644 --- a/macros/optex/base/math-macros.opm +++ b/macros/optex/base/math-macros.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \sin {Math macros plus mathchardefs <2021-02-15>} % preloaded in format +\_codedecl \sin {Math macros plus mathchardefs <2021-04-25>} % preloaded in format \_doc ----------------------------- The category code of the character `_` remains as the letter (11) and the mathocode @@ -218,7 +218,7 @@ \_mathchardef\smallint="1273 \_mathchardef\triangleleft="212F \_private \triangleleft; -\_mathchardef\triangleright="212E \_private \trianglerigt; +\_mathchardef\triangleright="212E \_private \triangleright; \_mathchardef\bigtriangleup="2234 \_mathchardef\bigtriangledown="2235 \_mathchardef\wedge="225E \let\land=\wedge @@ -513,10 +513,13 @@ \_protected\_def\Downarrow{\_delimiter"322B37F } \_protected\_def\Updownarrow{\_delimiter"326D377 } \_protected\_def\backslash{\_delimiter"26E30F } % for double coset G\_backslash H -\_protected\_def\rangle{\_delimiter"526930B } \_protected\_def\langle{\_delimiter"426830A } -\_protected\_def\rbrace{\_delimiter"5267309 } \_let\}=\rbrace \_let\_rbrace=\rbrace -\_protected\_def\lbrace{\_delimiter"4266308 } \_let\{=\lbrace \_let\_lbrace=\lbrace +\_protected\_def\rangle{\_delimiter"526930B } +\_protected\_def\lbrace{\_delimiter"4266308 } \_let\_lbrace=\lbrace +\_protected\_def\rbrace{\_delimiter"5267309 } \_let\_rbrace=\rbrace +\_protected\_def\{{\_ifmmode \_lbrace\_else\_char`\{ \_fi} +\_protected\_def\}{\_ifmmode \_rbrace\_else\_char`\} \_fi} + \_protected\_def\rceil{\_delimiter"5265307 } \_protected\_def\lceil{\_delimiter"4264306 } \_protected\_def\rfloor{\_delimiter"5263305 } @@ -716,12 +719,12 @@ \_long\_def\_eqalignno#1{\_display \_tabskip=\_centering \_halign to\_displaywidth{\_hfil$\_elign\_displaystyle{##}$\_tabskip=\_zoskip &$\_elign\_displaystyle{{}##}$\_hfil\_tabskip\_centering - &\_llap{$\_elign##$}\_tabskip\_zoskip\_crcr + &\_hbox to\_zo{\_hss$\_elign##$}\_tabskip\_zoskip\_crcr #1\_crcr}} \_long\_def\_leqalignno#1{\_display \_tabskip=\_centering \_halign to\_displaywidth{\_hfil$\_elign\_displaystyle{##}$\_tabskip=\_zoskip &$\_elign\_displaystyle{{}##}$\_hfil\_tabskip=\_centering - &\_kern-\_displaywidth\_rlap{$\_elign##$}\_tabskip\_displaywidth\_crcr + &\_kern-\_displaywidth\_hbox to\_zo{$\_elign##$\_hss}\_tabskip\_displaywidth\_crcr #1\_crcr}} \_public \openup \eqalignno \leqalignno ; @@ -1063,6 +1066,9 @@ \_endcode %--------------------------------------------------- +2021-04-25 \triangleright: typo fixed +2021-03-22 \(l)eqalignno: \hbox instead \llap, \rlap (\par error suppressed) +2021-03-19 allow text mode \{ and \} 2021-02-15 \_mathbox redefines \_textmff etc. in order to respect optical sizes 2021-02-04 \_bordermatrixwithdelims introduced. 2021-01-23 better expession for math styles in \matrix diff --git a/macros/optex/base/math-unicode.opm b/macros/optex/base/math-unicode.opm index 96f9983380..e9ec87f30f 100644 --- a/macros/optex/base/math-unicode.opm +++ b/macros/optex/base/math-unicode.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \loadmath {Unicode Math fonts <2021-03-09>} % preloaded in format +\_codedecl \loadmath {Unicode Math fonts <2021-04-05>} % preloaded in format \_doc ----------------------------- \`\loadmath` `{<Unicode-math font>}` loads the given font. It does: @@ -88,9 +88,9 @@ \_delimitershortfall=0.5\_fontdimen6\_textfont3 \_nulldelimiterspace=0.12\_fontdimen6\_textfont3 \_scriptspace=0.05\_fontdimen6\_textfont3 - \_begingroup % correction for \choose - \_everymath{}\_global\_setbox0=\_hbox{$\_fam1\_displaystyle{0\_atop0}$}\_endgroup + \_setbox0=\_hbox{\_everymath{}$\_fam1\_displaystyle{0\_atop0}$}% \_Umathfractiondelsize\_displaystyle = \_dimexpr(\_ht0-\_Umathaxis\_displaystyle)*2\_relax + \_setbox0=\_box\_voidbox } \_doc ----------------------------- @@ -258,6 +258,7 @@ the section~\ref[math-macros]. \_endinput +2021-04-04 \_setunimathdimens: \setbox0=\box\voidbox added 2021-03-09 \_setunimathdimes: \_begin/end/group instead {}, bug fixed 2021-02-15 \_textmff, \_scriptmff and \_sscriptmff introduced 2021-02-15 \_expandafter -> \_ea diff --git a/macros/optex/base/more-macros.opm b/macros/optex/base/more-macros.opm index d5ce88c1a6..17e9bdd1e2 100644 --- a/macros/optex/base/more-macros.opm +++ b/macros/optex/base/more-macros.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \eoldef {OpTeX useful macos <2020-05-22>} % preloaded in format +\_codedecl \eoldef {OpTeX useful macros <2021-04-25>} % preloaded in format \_doc ----------------------------- We define \`\opinput` `{<file name>}` macro which @@ -51,17 +51,16 @@ `\_ctablelist` and uses it. \_cod ----------------------------- -\_newcount\_currctable \_currctable=0 \_catcodetable0 -\_def\_setctable#1{\_edef\_ctablelist{{\_the\_currctable}\_ctablelist}% - \_catcodetable#1\_relax \_currctable=#1\_relax +\_def\_setctable#1{\_edef\_ctablelist{{\_the\_catcodetable}\_ctablelist}% + \_catcodetable#1\_relax } \_def\_restorectable{\_ea\_restorectableA\_ctablelist\_relax} \_def\_restorectableA#1#2\_relax{% \_ifx^#2^\_opwarning {You can't use \_noindent\restorectable without previous \_string\setctable}% - \_else \_def\_ctablelist{#2}\_catcodetable#1\_relax \_currctable=#1\_relax \_fi + \_else \_def\_ctablelist{#2}\_catcodetable#1\_relax \_fi } \_def\_ctablelist{.} @@ -76,7 +75,7 @@ \_cod ----------------------------- \_def\_normalcatcodes {\_catcodetable\_optexcatcodes \_savecatcodetable0 \_catcodetable0 } -\_public \normalcatodes ; +\_public \normalcatcodes ; \_doc ----------------------------- The \`\load` `[<filename-list>]` loads files specfied in @@ -279,6 +278,8 @@ \_endcode % ------------------------------------- +2021-04-25 \normalcatcodes: typo fixed +2021-04-22 \the\_currctable replaced by \the\_catcodetable, bug fixed. 2020-05-22 robust \catcode newly defined in order \catcode\string.... be possible 2020-05-03 \load macro introduced 2020-03-15 released diff --git a/macros/optex/base/optex.ini b/macros/optex/base/optex.ini index c695b7d809..d50ffeccf7 100644 --- a/macros/optex/base/optex.ini +++ b/macros/optex/base/optex.ini @@ -21,7 +21,7 @@ % OpTeX version -\def\optexversion{1.01 Mar.2021} +\def\optexversion{1.02 Apr.2021} \def\fmtname{OpTeX} \let\fmtversion=\optexversion @@ -47,7 +47,7 @@ \message{OpTeX (Olsak's Plain TeX) initialization <\optexversion>^^J} \input prefixed.opm % prefixed primitives and code syntax -\input luatex-ini.opm % luaTeX initialization +\input luatex-ini.opm % LuaTeX initialization \input basic-macros.opm % basic macros \input alloc.opm % allocators for registers \input if-macros.opm % special \if-macros, \is-macros and loops @@ -74,7 +74,7 @@ \input sections.opm % titles, chapters, sections \input lists.opm % lists, \begitems, \enditems \input verbatim.opm % verbatim -\input hi-syntax.opm % syntax highlighting of verbatim listimgs +\input hi-syntax.opm % syntax highlighting of verbatim listings \input graphics.opm % graphics \input table.opm % table macro \input multicolumns.opm % more columns by \begmulti ...\endmulti @@ -86,10 +86,10 @@ \input uni-lcuc.opm % Setting lccodes and uccodes for Unicode characters \input hyphen-lan.opm % initialization of hyphenation patterns \input languages.opm % languages -\input others.opm % miscenaleous +\input others.opm % miscellaneous \_directlua{ - % preload OpTeX's lua code into format as bytecode + % preload OpTeX's Lua code into format as bytecode lua.bytecode[1] = assert(loadfile(kpse.find_file("optex", "lua"))) } diff --git a/macros/optex/base/parameters.opm b/macros/optex/base/parameters.opm index c8df6eec49..e03bef6ef3 100644 --- a/macros/optex/base/parameters.opm +++ b/macros/optex/base/parameters.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \normalbaselineskip {Parameter settings <2020-03-17>} % preloaded in format +\_codedecl \normalbaselineskip {Parameter settings <2021-04-13>} % preloaded in format \_doc ----------------------------- \secc Primitive registers @@ -335,11 +335,17 @@ processed after style file is loaded and before printing bib-entries. You can re-define a behavior of the style file here or you can modify the more declaration for printing (fonts, baselineskip, etc.) or you can - define specific macros used in your `.bib` file. + define specific macros used in your `.bib` file.\nl + The \`\biboptions` is used in the `iso690` bib-style for global options, + see section~\ref[isobib].\nl + The \`\bibpart` saves the name of bib-list if there are more bib-lists in + single document, see section~\ref[bib]. \_cod ----------------------------- \_newtoks\_bibtexhook -\_public \bibtexhook ; +\_newtoks\_biboptions +\_newtoks\_bibpart +\_public \bibtexhook \biboptions \bibpart ; \_doc ----------------------------- \`\everycapitonf` is used before printing caption in figures and @@ -584,5 +590,7 @@ a register then \OpTeX/ macros still work without change. \_endinput History: +2021-04-13 ... \bibpart added +2021-04-07 ... \biboptions added, bug from iso690 fixed 2020-04-04 ... \tabspaces added 2020-04-03 ... \hicolors added diff --git a/macros/optex/base/plain-macros.opm b/macros/optex/base/plain-macros.opm index b4569ee969..b878d96ce8 100644 --- a/macros/optex/base/plain-macros.opm +++ b/macros/optex/base/plain-macros.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \magstep {Macros from plain TeX <2020-02-14>} % preloaded in format +\_codedecl \magstep {Macros from plain TeX <2021-04-09>} % preloaded in format \_doc ----------------------------- The \`\dospecials` works like in plain TeX but does nothing with `_`. @@ -340,7 +340,9 @@ \_pretolerance=-1 \tolerance=-1 \hbadness=0 \showboxdepth=0 \ #1}} \_def \_bye {\_par \_vfill \_supereject \_byehook \_end} -\_public \bye ; +\_public \showhyphens \bye ; \_endcode % ------------------------------------- +2021-04-09 ... \_public\showhyphens, bug fixed +2020-02-14 ... released diff --git a/macros/optex/base/prefixed.opm b/macros/optex/base/prefixed.opm index 61df791ddb..f8edf5d135 100644 --- a/macros/optex/base/prefixed.opm +++ b/macros/optex/base/prefixed.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \public {Prefixing and code syntax <2020-02-14>} % preloaded in format +\_codedecl \public {Prefixing and code syntax <2020-02-25>} % preloaded in format \_doc --------- All \TeX/ primitives have alternative control sequence `\_hbox` `\_string`, ... @@ -27,6 +27,10 @@ \`\private` `<sequence> <sequence> ...;` does `\let \_<sequence> = \<sequence>` for all sequences. \nl + \`\_checkexists` `<where> <prefix><sequence>` prints error + if the control sequence propagated to + a new name space by `\public` etc. macros is not declared. + \nl \`\xargs` `<what> <sequence> <sequence> ... ;` does `<what><sequence>` for each sequences. \_cod ----------------- @@ -37,11 +41,18 @@ \_def \_pkglabel{} \_def \_public {\_xargs \_publicA} -\_def \_publicA #1{\_ea\_let \_ea#1\_csname _\_csstring #1\_endcsname} - +\_def \_publicA #1{% + \_checkexists \public _#1% + \_ea\_let \_ea#1\_csname _\_csstring #1\_endcsname +} \_def \_private {\_xargs \_privateA} -\_def \_privateA #1{\_ea\_let \_csname _\_csstring #1\_endcsname =#1} - +\_def \_privateA #1{% + \_checkexists \private {}#1% + \_ea\_let \_csname _\_csstring #1\_endcsname =#1% +} +\_def\_checkexists #1#2#3{\_unless \_ifcsname #2\_csstring#3\_endcsname + \_errmessage {\_string#1: \_bslash#2\_csstring#3 must be declared}\_fi +} \_public \public \private \xargs \ea ; \_doc ----------------------- @@ -101,12 +112,16 @@ \_def \_nspublic {\_xargs \_nspublicA} \_def \_nspublicA #1{% + \_checkexists \nspublic {\_pkglabel _}#1% \_unless\_ifx #1\_undefined \_opwarning{\_ea\_ignoreit\_pkglabel\_space redefines the meaning of \_string#1}\_fi - \_ea\_let \_ea#1\_csname \_pkglabel _\_csstring #1\_endcsname} - + \_ea\_let \_ea#1\_csname \_pkglabel _\_csstring #1\_endcsname +} \_def \_nsprivate {\_xargs \_nsprivateA} -\_def \_nsprivateA #1{\_ea\_let \_csname \_pkglabel _\_csstring #1\_endcsname =#1} +\_def \_nsprivateA #1{% + \_checkexists \nsprivate {}#1% + \_ea\_let \_csname \_pkglabel _\_csstring #1\_endcsname =#1% +} \_endcode %---------------------------------------------------- @@ -117,8 +132,8 @@ \secc Prefixing internal control sequences All control sequences used in \OpTeX/ are used and defined with `_` prefix. -The user can be sure that when he/she does `\def\foo` then internal macros of -\OpTeX/ nor \TeX/ primitives will be not damaged. For example +The user can be sure that when he/she does `\def\foo` then neither internal macros of +\OpTeX/ nor \TeX/ primitives will be damaged. For example `\def\if{...}` will not damage macros because \OpTeX/'s macros are using `\_if` instead of `\if`. @@ -127,18 +142,18 @@ sequences: `\word` and `\_word`, for example `\hbox` and `\_hbox`. The first alternative is reserved for users or such control sequences can be re-defined by a user. -\OpTeX/ sets the character `_` as the letter, so it can be used in +\OpTeX/ sets the character `_` as letter, so it can be used in control sequences. When a control sequence begins with this character then it means that it is a primitive or it is used in \OpTeX/ macros as internal. User can redefine such prefixed control sequence only -if he/she explicitly know what happens. +if he/she explicitly knows what happens. We never change catcode of `_`, so internal macros can be -redefined by user without problems if it is desired. We need not -something like `\makealetter` from \LaTeX/. +redefined by user without problems if it is desired. We don't need +something like `\makeatletter` from \LaTeX/. \OpTeX/ defines all new macros as prefixed. For public usage of such macros, -we need to set non-prefixed version. This is done by +we need to set their non-prefixed versions. This is done by \begtt \catcode`\<=13 \public <list of control sequences> ; @@ -147,9 +162,9 @@ we need to set non-prefixed version. This is done by For example \^`\public`` \foo \bar ;` does `\let\foo=\_foo`, `\let\bar=\_bar`. At the end of each code segment in \OpTeX/, the `\_public` macro is used. You -can see, what macros are defined for public usage in this code segment. +can see which macros are defined for public usage in that code segment. -The macro \^`\private` does a reverse job to `\public` with the same syntax. +The macro \^`\private` does the reverse job of `\public` with the same syntax. For example `\private \foo \bar ;` does `\let\_foo=\foo`, `\let\_bar=\bar`. This should be used when an unprefixed variant of a control sequence is declared already but we need the prefixed variant too. @@ -163,7 +178,7 @@ and then the \^`\public` (or `\_public`) macro is used. Users can define or declare any control sequence with a name without any `_`. This does not make any problem. Only one exception is the reserved control -sequence `\par`. It is generated by tokenizer (at empty lines) +sequence `\par`. It is generated by the tokenizer (at empty lines) and used as internal in \TeX/. User can define or declare control sequences with `_` character, for @@ -172,7 +187,7 @@ example `\my_control_sequence`, but with the following exceptions: \begitems * Control sequences which begin with `_` are reserved for \TeX/ primitives, \OpTeX/ internal macros and packages internal macros. -* Control sequences (terminated by non-letter) in the form +* Multiletter control sequences in the form `\<word>_` or `\<word>_<one-letter>`, where <word> is a sequence of letters, are inaccessible, because they are interpreted as `\<word>` followed by `_` or as `\<word>` followed by @@ -182,7 +197,7 @@ example `\my_control_sequence`, but with the following exceptions: \max-M ... is interpreted as \max _M \alpha-{ij} ... is interpreted as \alpha _{ij} \endtt - This feature is implemented using lua code at input processor level, see + This feature is implemented using Lua code at input processor level, see the section~\ref[math-macros] for more details. You can deactivate this feature by \^`\mathsboff`. After this, you can still write `$`$\int$`_a^b$` (Unicode) or `$\int _a^b$` % $∫_a^b$ (Unicode) or $\int _a^b$ @@ -226,7 +241,7 @@ Package writer should use internal names in the form `\_<pgk>_<sequence>`, where `<pkg>` is a package label. For example: `\_qr_utfstring` from `qrcode.opm` package. -The package writer needs not to write repeatedly `\_pkg_foo` `\_pkg_bar` +The package writer does not need to write repeatedly `\_pkg_foo` `\_pkg_bar` etc.\ again and again in the macro file.\fnote {We have not adopted the idea from expl3 language:)} When the \^`\_namespace` `{<pkg>}` @@ -265,8 +280,8 @@ If you are writing a macro file that is intended to be published for \begitems * Don't use control sequences from the user namespace in the macro - bodies if there is not explicit and documented reason to do this. -* Don't declare control sequences in the user namespace if there are not + bodies if there is no explicit and documented reason to do this. +* Don't declare control sequences in the user namespace if there are no explicit and documented reasons to do this. * Use control sequences from \OpTeX/ and primitive namespace in read-only mode, if there is not an explicit and documented reason to @@ -279,14 +294,19 @@ If you are writing a macro file that is intended to be published for twice if another macro or the user needs it explicitly too. * Use \^`\_codedecl` as your first command in the macro file and \^`\_endcode` to close the text of macros. -* Use \^`\_doc` ... \^`\_cod` pairs for documenting the code pieces and/or write - more documentation after the \^`\_endcode` command. +* Use \^`\_doc` ... \^`\_cod` pairs for documenting the code pieces. +* You can write more documentation after the \^`\_endcode` command. +* The \OpTeX/ catcodes are set when \^`\load` your package (i.e. plain \TeX/ + catcodes plus catcode of `_` is 11). If a catcode is changed during + loading your package then it is forgot because \^`\load` returns to catcodes + used before loading package. If you want to offer a catcode changing for + users then insert it to a macro which can be used after loading. \enditems If the macro file accepts these recommendations then it should be named by `<filename>.opm` where `<filename>` differs from file names used directly in \OpTeX/ and from other published macros. -This extension `opm` has precedence before `.tex` when +This extension `.opm` has precedence before `.tex` when the \^`\load` macro is used. The `qrcode.opm` is the first example of how an external macro file for \OpTeX/ @@ -294,5 +314,6 @@ can look like. \endinput +2021-04-25 \_checkexists introduced 2021-02-15 \_expandafter -> \_ea in \_codedecl 2020-02-14 released diff --git a/macros/optex/base/ref-file.opm b/macros/optex/base/ref-file.opm index d594bf88c0..8c459f7de5 100644 --- a/macros/optex/base/ref-file.opm +++ b/macros/optex/base/ref-file.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \openref {File for references <2021-02-05>} % preloaded in format +\_codedecl \openref {File for references <2021-04-13>} % preloaded in format \_doc -------------------------- The \`\_inputref` macro is used in `\everyjob`. It reads `\jobname.ref` file @@ -69,7 +69,7 @@ versa. \_cod ---------------------- -\_def\_REFversion{5} % actual version of .ref files in OpTeX +\_def\_REFversion{6} % actual version of .ref files in OpTeX \_def\_Xrefversion#1{\_ifnum #1=\_REFversion\_relax \_else \_endinput \_fi} \_public \Xrefversion ; % we want to ignore .ref files generated by OPmac @@ -139,3 +139,9 @@ in the document then `.ref` file is not created. For example, you only want to test a simple plain \TeX/ macro, you create `test.tex` file, you do `optex test` and you don't need to see an empty `test.ref` file in your directory. +\_endinput + +History: +2021-04-13 \Xrefversion incremented (6), new format of \_Xbib +2021-02-05 \_ewref introduced +2020-02-14 released diff --git a/macros/optex/base/references.opm b/macros/optex/base/references.opm index 03c8f6955c..a4c2e694db 100644 --- a/macros/optex/base/references.opm +++ b/macros/optex/base/references.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \ref {References <2020-03-03>} % preloaded in format +\_codedecl \ref {References <2021-04-13>} % preloaded in format \_doc ---------------------------- \`\_Xpage` `{<gpageno>}{<pageno>}` saves the parameter pair into \`\_currpage`. @@ -25,16 +25,17 @@ \_def\_bracketspg#1#2{[pg:#1]{#2}} \_doc ---------------------------- - \`\label``[<label>]` saves the decalred label to `\_lastlabel` and + \`\label``[<label>]` saves the declared label to `\_lastlabel` and \`\wlabel``{<text>}` uses the `\_lastlabel` and activates `\_wref\_Xlabel{<label>}{<text>}`. \_cod ---------------------------- \_def\_label[#1]{\_isempty{#1}\_iftrue \_global\_let \_lastlabel=\_undefined \_else \_isdefined{l0:#1}% - \_iftrue \_opwarning{duplicated label [#1], ignored}\_else \_xdef\_lastlabel{#1}\_fi + \_iftrue \_slideshook\_opwarning{Duplicated label [#1], ignored}\_else \_xdef\_lastlabel{#1}\_fi \_fi \_ignorespaces } +\_let \_slideshook=\_relax % redefined if \slides + \slideshow. \_def\_wlabel#1{% \_ifx\_lastlabel\_undefined \_else \_dest[ref:\_lastlabel]% @@ -92,3 +93,7 @@ is created later) or if the reference text is page number then we must read `.ref` file first in order to get appropriate information. See section \ref[ref-file] for more information about `.ref` file concept. +\_endinput + +2021-04-13 ... \_slideshook introduced (used by \slides) +2020-03-03 ... released diff --git a/macros/optex/base/slides.opm b/macros/optex/base/slides.opm index 94fa3afac8..a491d1f5ad 100644 --- a/macros/optex/base/slides.opm +++ b/macros/optex/base/slides.opm @@ -1,6 +1,6 @@ % This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \slideshow {Slides style for OpTeX <2021-03-10>} % loaded on demand by \slides +\_codedecl \slideshow {Slides style for OpTeX <2021-04-22>} % loaded on demand by \slides \_doc ----------------------------- Default margins and design is declared here. @@ -79,7 +79,7 @@ \_newcount\_gilevel \_def\*{*} -\_adef*{\_relax\_ifmmode*\_else\_ea\_startitem\_fi} +\_adef*{\_relax\_ifmmode*\_else\_ea\_startitem\_fi} % defined also in styles.opm \_sdef{_item:X}{\Blue\_raise.2ex\_fullrectangle{.8ex}\_kern.5em} \_sdef{_item:x}{\Blue\_raise.3ex\_fullrectangle{.6ex}\_kern.4em} \_style X @@ -98,7 +98,7 @@ \_sdef{_spg:+}{\_par} \_doc ----------------------------- - The \`\_endslides` is defined as `\_end` primitive, but + The \`\_endslides` is defined as `\_end` primitive (preceeded by `\_byehook`), but slide-designer can redefine it. For example, \ulink[http://petr.olsak.net/optex/optex-tricks.html\#slider]{OpTeX trick 0029} shows how to define clickable navigation to the pages and how to check @@ -107,7 +107,7 @@ The `\bye` macro is redefined here as an alternative to `\pg.`. \_cod ----------------------------- -\_def\_endslides{\_end} +\_def\_endslides{\_byehook \_end} \_def\bye{\_pg.} \_doc ----------------------------- @@ -139,9 +139,9 @@ The code is somewhat more complicated when \^`\layers` is used. Then `<layered-text>` is saved to the \`\_layertext` macro, the material before - it is in \`\_slidepage` box and the material after it is in `\_slidepageB` + it is in \`\_slidepage` box and the material after it is in \`\_slidepageB` box. The pages are completed in the `\loop` which increments the - \`\layernum` register. + \`\layernum` register and prints page by the \`\_printlayers` \_cod ----------------------------- \_newbox\_slidepage \_newbox\_slidepageB @@ -156,10 +156,8 @@ \_sdef{_spg:.}{\_closepage \_endslides} \_sdef{_spg:+}{\_closepage \_incr\_slidelayer \_decr\_pageno \_openslide} \_let\_layers=\_layersactive - \_destboxslide % to prevent hyperlink-dests duplication + \_slidelinks % to prevent hyperlink-dests duplication } -\_def\_destboxslide{\_def\_destbox[##1:##2]{\_isequal{##1}{ref}\_iffalse \_destboxori[##1:##2]\_fi}} - \_def\_openslide{\_setbox\_slidepage=\_vbox\_bgroup\_bgroup \_setilevel \_ifvoid\_slidepage \_else \_unvbox\_slidepage \_nointerlineskip\_lastbox \_fi} \_def\_setilevel{\_loop \_decr\_gilevel \_ifnum\_gilevel<0 \_else \_begitems \_repeat} @@ -186,9 +184,8 @@ } \_def\_layersenv{cannot be inside \_string\layers...\_string\endlayers, ignored} -\_def\_printlayers{\_unvcopy\_slidepage \_nointerlineskip\_lastbox - \_layertext \_endgraf - \_ifdim\_prevdepth>-1000pt \_kern-\_prevdepth \_kern\_dp\_strutbox \_fi +\_def\_printlayers{\_unvcopy\_slidepage \_prevdepth=\_dp\_slidepage + {\_layertext \_endgraf}% \_vskip\_parskip \_unvcopy\_slidepageB } @@ -198,19 +195,77 @@ \_maxlayers=0 \_long\_def\_layersactive #1 #2\endlayers{% - \_par\_penalty0\_egroup - \_gdef\_layertext{#2}% + \_par\_penalty0\_egroup\_egroup + \_gdef\_layertext{\_settinglayer#2}% \_global\_maxlayers=#1 - \_setbox\_slidepageB=\_vbox\_bgroup + \_setbox\_slidepageB=\_vbox\_bgroup\_bgroup + \_setbox0=\_vbox{{\_layernum=1 \_globaldefs=-1 \_layertext\_endgraf}}\_prevdepth=\_dp0 } +\_public \subtit \slideshow \pg \wideformat \use \pshow \layernum ; + + \_doc ----------------------------- + \`\slideopen` should be used instead \^`\slideshow` to deactivate it + but keep the borders of groups. + \_cod ----------------------------- + \_def\_slideopen{\_let\slideshow=\_relax % first wins \_sdef{_spg:;}{\_egroups\_vfil\_break \_lfnotenumreset\_bgroup \_setilevel} \_sdef{_spg:.}{\_egroups\_endslides} \_sdef{_spg:+}{\_egroups\_bgroup \_setilevel} + \_let\_layersopen=\_egroup \_let\_layersclose\_bgroup \_bgroup } +\_public \slideopen ; + + \_doc ----------------------------- + When \^`\slideshow` is active then the destinations of internal hyperlinks + cannot be duplicated to more \"virtual" pages because + hyperlink destinations have to be unique in the whole document. + + The \^`\slideshow` creates boxes of typesetting material and copies them to + more pages. So, we have to suppress creating destinations in these boxes. + This is done in the \`\_slidelinks` macro. We + can move creating these destinations to the output routine. \`\_sdestbox` is + saved value of the original `\_destbox` which is redefined to do only + `\addto\_destboxes{\_sdestbox[<label>]}`. All destinations saved to + \`\_destboxes` are created at the start of the next output routine in the + \^`\_pagedest` macro. The output routine removes `\_destboxes`, so each + destination is created only once. + + Limitations of this solution: destinations are only at the start of the + page, no at the real place where \^`\wlabel` was used. The first \"virtual" + page where \^`\wlabel` is used includes its destination. If you want to + go to the final page of the partially uncovering ideas then + use \^`\label``[<label>]`\^`\wlabel``{text}` in the last part of + the page (before `\pg;`) o use \^`\pgref` instead \^`\ref`. + \_cod ----------------------------- + +\_def\_slidelinks{% + \_def \_destbox[##1]{\_edef\_tmp{\_noexpand\_sdestbox[##1]}% + \_global\_ea\_addto\_ea\_destboxes\_ea{\_tmp}}% + \_def \_pagedest {% + \_hbox{\_def\_destheight{25pt}\_sdestbox[pg:\_the\_gpageno]\_destboxes}% + \_nointerlineskip \_gdef\_destboxes{}% + }% + \_ifx \_dest\_destactive \_else \_let\_pagedest=\_relax \_fi +} +\_let\_sdestbox = \_destbox +\_def\_destboxes{} % initial value of \_destboxes +\_let\_bibgl=\_global % \advance\bibnum must be global if they are at more pages -\_public \subtit \slideshow \slideopen \pg \wideformat \use \pshow \layernum ; + \_doc ----------------------------- + The \`\_settinglayer` is used in the \^`\_layertext` macro to prevent + printing \"Duplicate label" warning when it is expanded. It is done + by special value of \`\_slideshook` (used by the \^`\label` macro). + Moreower, the warning about illegal use of `\bib`, `\usebib` in `\layers` + environment is activated. + \_cod ----------------------------- + +\_def\_settinglayer{% + \_def\_slideshook ##1##2{}% + \_def\_bibB[##1]{\_nousebib}\_def\_usebib/##1 (##2) ##3 {\_nousebib}% +} +\_def\_nousebib{\_opwarning{Don't use \noexpand\bib nor \noexpand\usebib in \string\layers}} \_doc ----------------------------- Default \`\layers` `<num>` macro (when \^`\slideshow` is not activated) is simple. @@ -218,8 +273,10 @@ result after last layer is processed. \_cod ----------------------------- -\_def\_layers #1 {\_par\_layernum=\_numexpr#1+1\_relax} -\_let\endlayers=\_relax +\_long\_def\_layers #1 #2\endlayers{\_par + \_layersopen {\_layernum=\_numexpr#1+1\_relax #2\_endgraf}\_layersclose} +\_let\_layersopen=\_relax +\_let\_layersclose=\_relax \_def\layers{\_layers} @@ -240,6 +297,13 @@ The user manual of \OpTeX/ slides are in `op-slides.tex` file. +2021-04-22 \adef* moved back, bug fixed in more-macros.opm +2021-04-21 \adef* removed from slides.opm, bug fixed +2021-04-19 \_byehook added to \_endslides. +2021-04-13 hyperlinks destinations are moved to the output routine when \slideshow +2021-04-10 \layers: \prevdepth calculation added, {\_layertext} group added +2021-04-10 \layers: bug with \setbox\_slidepageB fixed +2021-04-10 \layers: \vskip\parskip added after \unvcopy\_slidepage 2021-03-10 \slideopen introduced, bug with colors in \setbox fixed 2021-03-10 \ifmmode* added to \adef* 2021-02-15 \_def\_decr removed diff --git a/macros/optex/base/table.opm b/macros/optex/base/table.opm index a4a6511958..f32bf311ab 100644 --- a/macros/optex/base/table.opm +++ b/macros/optex/base/table.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \table {Basic macros for OpTeX <2021-03-09>} % preloaded in format +\_codedecl \table {Basic macros for OpTeX <2021-04-12>} % preloaded in format \_doc ----------------------------- The result of the \`\table``{<declaration>}{<data>}` macro is inserted into @@ -213,7 +213,7 @@ \_def\_tabdeclarer{\_the\_tabiteml\_hfil##\_unsskip\_the\_tabitemr} \_def\_paramtabdeclarep#1{\_the\_tabiteml \_vtop{\_hsize=#1\_relax \_baselineskip=\_normalbaselineskip - \_lineskiplimit=\_zo \_noindent##\_unsskip + \_lineskiplimit=\_zo \_noindent \_hskip\_zo \_relax ##\_unsskip \_ifvmode\_vskip\_dp\_tstrutbox \_else\_lower\_dp\_tstrutbox\_hbox{}\_fi}\_the\_tabitemr} \_doc ----------------------------- @@ -512,6 +512,7 @@ after the second one. \_endinput +2021-04-12 p declarator: \hskip0pt added to allow first word hyphenated 2021-03-09 \_tablepxpreset introduced 2021-02-15 \_expandafter -> \_ea 2021-01-27 \_tableB: \long\def added, \vspan syntax improved diff --git a/macros/optex/base/uni-lcuc.opm b/macros/optex/base/uni-lcuc.opm index 2a99f52d66..e56b3b9228 100644 --- a/macros/optex/base/uni-lcuc.opm +++ b/macros/optex/base/uni-lcuc.opm @@ -1,12 +1,20 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -% Preloaded in format. A copy o uni-lcuc.tex fom csplain is here: +\_wterm{Setting lccodes and uccodes for Unicode characters <2021-04-07>} % preloaded in format. -% uni-lcuc.tex -- sets \lccodes and \uccodes for Unicode chars, nothing more -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Petr Olsak, Jul. 2014 +\_isfile{UnicodeData.txt}\_iftrue +\_begingroup + \_sdef{lc:Ll}#1#2#3#4{\_global\_lccode"#2="#2 \_global\_uccode"#2="0#3 } + \_sdef{lc:Lu}#1#2#3#4{\_global\_lccode"#2="0#4 \_global\_uccode"#2="#2 } + \_sdef{lc:Lo}#1#2#3#4{\_global\_lccode"#2="#2 \_global\_uccode"#2="#2 } + \_def\_pa#1;#2;#3;#4;#5;#6;#7;#8;#9;{\_ifx;#1;\_else\_ea\_pb\_fi{#1}{#3}} + \_def\_pb#1#2#3;#4;#5;#6;#7;#8 {\_csname lc:#2\_endcsname\_pc{#1}{#6}{#7}\_pa} + \_def\_pc#1#2#3{} % ignored if the character hasn't Ll, Lu, nor Lo type + \_everyeof={;;;;;;;;;} % end of file + \_ea\_pa\_input UnicodeData.txt +\_endgroup \_endinput \_fi % \endinput here, if UnicodeData.txt was loaded -\_wterm{Setting lccodes and uccodes for Unicode characters} +% If UnicodeData.txt not found, we have internal copy here from csplain, 2014: \_def\_tmp #1 #2 {\_ifx^#1^\_else \_lccode"#1="#1 @@ -15928,17 +15936,30 @@ E01EF . % end of file \_endcode -All codes in unicode table keep information about pairs lowecase-uppercase +All codes in Unicode table keep information about pairs lowecase-uppercase letters or single letter. We need to read such information and set appropriate `\lccode` and `\uccode`. The `\catcode` above the code 127 is not set, i.\,e.\ the `\catcode`=12 for all codes above 127. -The file `uni-lcuc.opm` does this work. It is not much interesting file, only -first few lines from 15928 lines in total is shown here. +The file `UnicodeData.txt` is read if this file exists in your \TeX/ +distribution. The format is specified +at \url{http://www.unicode.org/L2/L1999/UnicodeData.html}. We read only `Ll` +(lowercase letters), `Lu` (upperase letters) and `Lo` (other letters) and +set appopriate codes. The scanner of `UnicodeData.txt` is implemented here +in the group (lines 6 to 15). After the group is closed then +the file `uni-lcuc.opm` is leaved by `\endinput`. + +If the file `UnicodeData.txt` does not exsists then internal data are used. +They follow to the end of the file `uni-lcuc.opm`. {\everytt={\typosize[8/10]\_let\_printverbline=\_printcodeline \medskip}\ttline=-1 \def\docfile{uni-lcuc.opm} -\verbinput (3-30) uni-lcuc.opm +\verbinput (3-39) uni-lcuc.opm \vskip-\medskipamount -\noindent\typosize[8/]\dots etc. (see {\tt\Brown\docfile}) +\noindent\typosize[8/]\dots etc., 15900 similar lines (see {\tt\Brown\docfile}) } + +\_endinput + +2021-04-07 ... UnicodeData.txt scanner implemented +2020-03-10 ... released diff --git a/macros/optex/base/unimath-codes.opm b/macros/optex/base/unimath-codes.opm index 6e83ab94ad..d7f0d387ef 100644 --- a/macros/optex/base/unimath-codes.opm +++ b/macros/optex/base/unimath-codes.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \_ncharrmA {Uni math codes <2021-03-11>} % preloaded on demand by \loadmath +\_codedecl \_ncharrmA {Uni math codes <2021-04-25>} % preloaded on demand by \loadmath \_doc ----------------------------- The control sequences for `\alpha`, `\beta` etc are redefined here. @@ -68,12 +68,30 @@ \_protected\_def\_bigreek {\_umathrangegreek71\_greekbia} \_protected\_def\_bsansgreek {\_umathrangegreek71\_greeksna} \_protected\_def\_bisansgreek{\_umathrangegreek71\_greeksia} -\_protected\_def\_itGreek {\_umathrangeGREEK71\_greekitA} -\_protected\_def\_rmGreek {\_umathrangeGREEK71\_greekrmA} -\_protected\_def\_bfGreek {\_umathrangeGREEK71\_greekbfA} -\_protected\_def\_biGreek {\_umathrangeGREEK71\_greekbiA} -\_protected\_def\_bsansGreek {\_umathrangeGREEK71\_greeksnA} -\_protected\_def\_bisansGreek{\_umathrangeGREEK71\_greeksiA} +\_protected\_def\_itGreek {\_umathrangeGREEK71\_greekitA \_setnablait} +\_protected\_def\_rmGreek {\_umathrangeGREEK71\_greekrmA \_setnablarm} +\_protected\_def\_bfGreek {\_umathrangeGREEK71\_greekbfA \_setnablabf} +\_protected\_def\_biGreek {\_umathrangeGREEK71\_greekbiA \_setnablabi} +\_protected\_def\_bsansGreek {\_umathrangeGREEK71\_greeksnA \_setnablabsans} +\_protected\_def\_bisansGreek{\_umathrangeGREEK71\_greeksiA \_setnablabisans} + + \_doc ----------------------------- + \`\_setnabla` is used in order to `\nabla` behaves like uppercase Greek + letter, similar like `\Delta`. It depends on `\bf`, `\it` etc. selectors. + If you want to deactivate this behavior, use `\def\_setnabla#1 {}`. + \_cod ----------------------------- + +\_def \_setnabla {\_Umathcode"2207 = 7 1} +\_def \_setnablarm {\_setnabla"02207 } +\_def \_setnablabf {\_setnabla"1D6C1 } +\_def \_setnablait {\_setnabla"1D6FB } +\_def \_setnablabi {\_setnabla"1D735 } +\_def \_setnablabsans {\_setnabla"1D76F } +\_def \_setnablabisans {\_setnabla"1D7A9 } + + \_doc ----------------------------- + Digits are configured like math alphabets. + \_cod ----------------------------- \_chardef\_digitrmO=`0 \_chardef\_digitbfO="1D7CE @@ -90,8 +108,7 @@ \_protected\_def\_ttdigits {\_umathrange{0-9}71\_digitttO} \_doc ----------------------------- - The \`\cal`, \`\bbchar`, \`\frak`, \`\script` - and + The \`\cal`, \`\bbchar`, \`\frak`, \`\script` and the \`\rm`, \`\bf`, \`\it`, \`\bi`, \`\tt` are defined here. Their \"8bit definitions" from the file `math-preload.opm` (section~\ref[math-preload]) are removed.\nl @@ -114,7 +131,7 @@ % \bf and \bi behave as sans serif in math, ... \_protected\_def\_rm {\_tryloadrm \_tenrm \_inmath{\_rmvariables \_rmdigits}} -\_protected\_def\_it {\_tryloadit \_tenit \_inmath{\_itvariables}} +\_protected\_def\_it {\_tryloadit \_tenit \_inmath{\_itvariables \_itGreek}} \_protected\_def\_bf {\_tryloadbf \_tenbf \_inmath{\_bsansvariables \_bsansgreek \_bsansGreek \_bsansdigits}} \_protected\_def\_bi @@ -132,33 +149,28 @@ \_doc ----------------------------- Each Unicode slot carries information about math type. This is saved in - the file `mathclass.txt` which is copied to `mathclass.opm` The file + the file `MathClass-15.txt` which is copied to `mathclass.opm` The file has the following format: {\vitt{mathclass.opm}\verbinput (70-85) mathclass.opm } We have to read this information and convert it to the `\Umathcode`s. \_cod ----------------------------- \_begingroup % \input mathclass.opm (which is a copy of MathClass.txt): - \_def\_p#1;#2{\_edef\_tmp{\_pB#2}\_ifx\_tmp\_empty \_else\_pA#1....\_end#2\_fi} + \_long\_def\_p#1;#2 {\_ifx^#2^\_else + \_edef\_tmp{\_csname _c:#2\_endcsname}\_if\_relax\_tmp\_else \_pA#1....\_end#2\_fi + \_ea\_p \_fi } \_def\_pA#1..#2..#3\_end#4{% - \_ifx\_relax#2\_relax \_pset{"#1}{#4}\_else - \_umathnumA="#1 - \_loop - \_pset{\_umathnumA}{#4}% - \_ifnum\_umathnumA<"#2 \_advance\_umathnumA by1 - \_repeat - \_fi + \_ifx\_relax#2\_relax \_pset{"#1}{#4}\_else \_fornum "#1.."#2\_do{\_pset{##1}{#4}}\_fi } - \_def\_pB#1{\_if#1L1\_fi \_if#1B2\_fi \_if#1V2\_fi \_if#1R3\_fi \_if#1N0\_fi \_if#1U0\_fi - \_if#1F0\_fi \_if#1O4\_fi \_if#1C5\_fi \_if#1P6\_fi \_if#1A7\_fi} - \_def\_pset#1#2{\_global\_Umathcode#1=\_tmp\_space 1 #1\_relax - \_if#2O\_global\_Udelcode#1=1 #1\_relax\_fi - \_if#2C\_global\_Udelcode#1=1 #1\_relax\_fi - \_if#2F\_global\_Udelcode#1=1 #1\_relax\_fi + \_sdef{_c:L}{1}\_sdef{_c:B}{2}\_sdef{_c:V}{2}\_sdef{_c:R}{3}\_sdef{_c:N}{0}\_sdef{_c:U}{0} + \_sdef{_c:F}{0}\_sdef{_c:O}{4}\_sdef{_c:C}{5}\_sdef{_c:P}{6}\_sdef{_c:A}{7} + \_def\_pset#1#2{\_Umathcode#1=\_tmp\_space 1 #1\_relax + \_if#2O\_Udelcode#1=1 #1\_relax\_fi + \_if#2C\_Udelcode#1=1 #1\_relax\_fi + \_if#2F\_Udelcode#1=1 #1\_relax\_fi } - \_catcode`#=14 - \_everypar={\_setbox0=\_lastbox \_par \_p} - \_setbox0=\_vbox{\_input mathclass.opm } + \_catcode`#=14 \_everyeof={;{} } \_def\par{} + \_globaldefs=1 \_ea \_p \_input mathclass.opm \_endgroup \_doc ----------------------------- @@ -171,13 +183,13 @@ \_begingroup % \input unimath-table.opm (it is a copy of unicode-math-table.tex): \_def\UnicodeMathSymbol #1#2#3#4{% \_ifnum#1=\_Umathcodenum#1 % the code isn't set by mathclass.opm - \_global\_Umathchardef#2=0 1 #1 \_global\_Umathcode#1=0 1 #1 - \_else \_global\_Umathcharnumdef#2=\_Umathcodenum#1 \_fi - \_ifx#3\_mathopen \_gdef#2{\_Udelimiter 4 1 #1 }\_fi - \_ifx#3\_mathclose \_gdef#2{\_Udelimiter 5 1 #1 }\_fi - \_ifx#3\_mathaccent \_gdef#2{\_Umathaccent fixed 7 1 #1 }\_fi + \_Umathchardef#2=0 1 #1 \_Umathcode#1=0 1 #1 + \_else \_Umathcharnumdef#2=\_Umathcodenum#1 \_fi + \_ifx#3\_mathopen \_def#2{\_Udelimiter 4 1 #1 }\_fi + \_ifx#3\_mathclose \_def#2{\_Udelimiter 5 1 #1 }\_fi + \_ifx#3\_mathaccent \_def#2{\_Umathaccent fixed 7 1 #1 }\_fi } - \_input unimath-table.opm + \_globaldefs=1 \_input unimath-table.opm \_endgroup \_doc ----------------------------- @@ -195,8 +207,6 @@ % mathclass defines : as Punct, plain.tex as Rel, we keep mathclass, % i.e. there is difference from plain.tex, you can use $f:A\to B$. -\_let\{=\lbrace \_let\}=\rbrace - % mathclas defines ! as Ord, plain.tex as Close \_Umathcode `! = 5 1 `! % keep plain.tex declaration \_Umathchardef \mathexclam = 5 1 `! @@ -210,6 +220,8 @@ \_protected\_def \_cuberoot {\_Uradical 1 "0221B } \_protected\_def \_fourthroot {\_Uradical 1 "0221C } +\_def \nabla {^^^^2207} % \nabla behaves as uppercase Gereek letter, see \_setnabla + \_public \sqrt \cuberoot \fourthroot ; \_def\_intwithnolimits#1#2 {\_ifx#1\_relax \_else @@ -405,9 +417,9 @@ \_cod ----------------------------- \_private - \ldotp \cdotp \bullet \triangleleft \trianglerigt \mapstochar \rightarrow + \ldotp \cdotp \bullet \triangleleft \triangleright \mapstochar \rightarrow \prime \lhook \rightarrow \leftarrow \rhook \triangleright \triangleleft - \Relbar \Rightarrow \relbar \rightarrow \Leftarrow \mapstochar + \rbrace \lbrace \Relbar \Rightarrow \relbar \rightarrow \Leftarrow \mapstochar \longrightarrow \Longleftrightarrow \unicodevdots \unicodeddots \unicodeadots ; \_endcode @@ -427,6 +439,11 @@ for technical details about Unicode-math. \_endinput History: +2021-04-25 \triangleright: typo fixed +2021-04-20 reading mathclass.opm improved +2021-04-07 \_setnabla introduced, \nabla as uppercase Greek letter +2021-03-26 \it does \_itGreek +2021-03-19 \{, \} are defined as mode independent macros in math-macros.opm 2021-03-11 Umathcode `* declaed as \ast 2021-02-03 Unicode superscripts, subscripts declared 2021-01-31 Mathcode of ! ? set to Close, codes undeclared in mathclass set correctly diff --git a/macros/optex/base/usebib.opm b/macros/optex/base/usebib.opm index f37d21b315..9dbd475241 100644 --- a/macros/optex/base/usebib.opm +++ b/macros/optex/base/usebib.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \MakeReference {Reading bib databases <2021-03-12>} % loaded on demand by \usebib +\_codedecl \MakeReference {Reading bib databases <2021-04-13>} % loaded on demand by \usebib \_doc ----------------------------- Loading the `librarian.tex` macro package. See `texdoc librarian` @@ -24,14 +24,13 @@ \_cod ----------------------------- \_def\_usebib/#1 (#2) #3 {% - \_let\_citeI=\_relax \_xdef\_citelist{\_citelist\_citelistB}% - \_global\_let\_addcitelist=\_writeXcite + \_let\_citeI=\_relax \_xdef\_citelist{\_trycs{_ctlst:\_bibp}{}\_trycs{_ctlstB:\_bibp}{}}% + \_global \_ea\_let \_csname _ctlst:\_bibp\_endcsname =\_write \_ifx\_citelist\_empty \_opwarning{No cited items. \_noexpand\usebib ignored}% \_else \_bgroup \_par \_emergencystretch=.3\_hsize - \_ifx\_bibpart\_undefined \_def\_bibpart{none}\_fi \_def\_optexbibstyle{#2}% \_setctable\_optexcatcodes \_ea \_skiptoendinput \_input languages.opm @@ -48,10 +47,10 @@ \_input #3.bib \_ea}\_ea\_def\_ea\_citelist\_ea{\_citelist}% \_fi - \_def\_citeI[##1]{\_csname lb@cite\_endcsname{##1}{\_bibpart}{}{}}\_citelist + \_def\_citeI[##1]{\_csname lb@cite\_endcsname{##1}{\_bibp}{}{}}\_citelist \_BibFile{#3}% - \_if s#1\_SortList{\_bibpart}\_fi - \_ReadList{\_bibpart}% + \_if s#1\_SortList{\_bibp}\_fi + \_ReadList{\_bibp}% \_restorectable \_egroup \_fi @@ -117,13 +116,13 @@ \_cod ----------------------------- \_def\MakeReference{\_par \_bibskip - \_advance\_bibnum by1 - \_isdefined{_bim:\_the\_bibnum}\_iftrue - \_edef\_tmpb{\_csname _bim:\_the\_bibnum\_endcsname}% + \_bibgl\_advance\_bibnum by1 + \_isdefined{_bim:\_bibp\_the\_bibnum}\_iftrue + \_edef\_tmpb{\_csname _bim:\_bibp\_the\_bibnum\_endcsname}% \_bibmark=\_ea{\_tmpb}% \_else \_bibmark={}\_fi \_edef\_tmpb{\EntryKey}% - \_noindent \_dest[cite:\_the\_bibnum]\_printlabel\EntryKey + \_noindent \_dbib\EntryKey \_printbib {% \_RetrieveFieldIn{entrytype}\_entrytype @@ -136,8 +135,7 @@ \_csname _print:misc\_endcsname \_fi\_fi \_csname _print:END\_endcsname - \_ifx\_wref\_wrefrelax\_else - \_immediate\_wref\_Xbib{{\EntryKey}{\_the\_bibnum}{\_the\_bibmark}}\_fi + \_wbib \EntryKey {\_the\_bibnum}{\_the\_bibmark}% }\_par } @@ -369,7 +367,8 @@ character is sorted before `A`. History: -------- - +2021-04-13 \bibpart implemented +2021-04-13 \_bibgl introduced (used by \slides) 2021-03-12 \_citelistB added before first test. 2021-02-15 \_expandafter -> \_ea Apr. 2014: released in OPmac diff --git a/macros/optex/base/verbatim.opm b/macros/optex/base/verbatim.opm index 8fd20ee531..08748eb5a6 100644 --- a/macros/optex/base/verbatim.opm +++ b/macros/optex/base/verbatim.opm @@ -1,6 +1,6 @@ %% This is part of the OpTeX project, see http://petr.olsak.net/optex -\_codedecl \begtt {Verbatim <2021-01-22>} % preloaded in format +\_codedecl \begtt {Verbatim <2021-04-18>} % preloaded in format \_doc ---------------------------- The internal parameters @@ -125,15 +125,16 @@ \_ifnum\_ttline<0 \_let\_printverblinenum=\_relax \_else \_initverblinenum \_fi \_adef{ }{\_dsp}\_adef\^^I{\t}\_parindent=\_ttindent \_parskip=0pt \_def\t{\_hskip \_dimexpr\_tabspaces em/2\_relax}% + \_protrudechars=0 % disable protrusion \_the\_everytt \_relax #1\_relax \_ttfont \_def\_testcommentchars##1\_iftrue{\_iffalse}\_let\_hicomments=\_relax - \_endlinechar=`^^J + \_savemathsb \_endlinechar=`^^J \_startverb } \_ea\_def\_ea\_startverb \_ea#\_ea1\_csstring\\endtt#2^^J{% \_prepareverbdata\_tmpb{#1^^J}% \_ea\_printverb \_tmpb\_end - \_par + \_par \_restoremathsb \_endgroup \_ttskip \_isnextchar\_par{}{\_noindent}% } @@ -246,8 +247,9 @@ \_ifnum\_ttline<-1 \_let\_printverblinenum=\_relax \_else \_initverblinenum \_fi \_setverb \_adef{ }{\_dsp}\_adef\^^I{\t}\_parindent=\_ttindent \_parskip=0pt \_def\t{\_hskip \_dimexpr\_tabspaces em/2\_relax}% + \_protrudechars=0 % disable protrusion \_the\_everytt\_relax \_tmpb\_relax \_ttfont - \_endlinechar=`^^J \_tmpnum=0 + \_savemathsb \_endlinechar=`^^J \_tmpnum=0 \_loop \_ifeof\_vifile \_tmpnum=\_vinolines\_space \_fi \_ifnum\_tmpnum<\_vinolines\_space \_vireadline \_advance\_tmpnum by1 \_repeat %% skip lines @@ -265,7 +267,7 @@ \_catcode`\ =10 \_catcode`\%=9 % used in \commentchars comments \_ea\_printverb \_tmpb\_end \_global\_ttlinesave - \_par + \_par \_restoremathsb \_endgroup \_ttskip \_isnextchar\_par{}{\_noindent}% @@ -276,6 +278,17 @@ \_public \verbinput ; \_doc ----------------------------- + \`\_savemathsb`, \`\_restoremathsb` pair is used + in \^`\begtt`...\^`\endtt` or in \^`\verbinput` to temporary suppress + the \^`\mathsbon` because we don't need to print `\int _a` + in verbatim mode if `\int``_a` is really written. The \^`\_restoremathsb` + is defined locally as \^`\mathsbon` only if it is needed. + \_cod ----------------------------- + +\_def\_savemathsb{\_ifmathsb \_mathsboff \_def\_restoremathsb{\_mathsbon}\_fi} +\_def\_restoremathsb{} + + \_doc ----------------------------- If the language of your code\label[commentchars]\wlabel{} printed by \^`\verbinput` supports the format of comments started by two characters from the beginning of the @@ -363,7 +376,9 @@ \_endinput History: -2020-01-22 ... \activettchar changed to \verbchar +2021-04-18 ... \_protrudechars=0 added +2021-04-07 ... \_savemathsb, \_restoremathsb introduced +2021-01-22 ... \activettchar changed to \verbchar 2020-12-30 ... \secc followed by \begtt must be unbreakable 2020-11-13 ... \commentchars implemented 2020-04-22 ... \ttshift introduced diff --git a/macros/optex/demo/op-mathalign.tex b/macros/optex/demo/op-mathalign.tex new file mode 100644 index 0000000000..b2524ee80d --- /dev/null +++ b/macros/optex/demo/op-mathalign.tex @@ -0,0 +1,367 @@ +%% This is part of the OpTeX project, see http://petr.olsak.net/optex + +% Math alignment examples inspired by https://www.ntg.nl/maps/34/06.pdf + +\fontfam[newcm] +\margins/1 a4 (2,2,2,2)cm +\hyperlinks\Blue\Blue + +\refdecl{ + \def\Xpos#1#2#3{\sxdef{pos:#1}{{#2}{#3}\_currpage}} +} +\def\setpos[#1]{\openref\pdfsavepos + \_ewref\Xpos{{#1}\unexpanded{{\the\pdflastxpos}{\the\pdflastypos}}}} + +\def\posx [#1]{\_ea \posi \romannumeral-`\.\trycs{pos:#1}{{0}{0}{0}{0}}sp} +\def\posy [#1]{\_ea \posii \romannumeral-`\.\trycs{pos:#1}{{0}{0}{0}{0}}sp} +\def\pospg[#1]{\_ea \posiii \romannumeral-`\.\trycs{pos:#1}{{0}{0}{0}{0}}} + +\def\posi #1#2#3#4{#1} +\def\posii #1#2#3#4{#2} +\def\posiii #1#2#3#4{#3} + +\newcount\tomarginno +\def\toright#1{\_incr\tomarginno {\setpos[tr:\the\tomarginno]% + \rlap{\kern-\posx[tr:\the\tomarginno]\kern\hoffset\kern\hsize\llap{#1}}}} +\def\toleft#1{\_incr\tomarginno {\setpos[tr:\the\tomarginno]% + \rlap{\kern-\posx[tr:\the\tomarginno]\kern\hoffset\rlap{#1}}}} + +\def\eqm{\toright\eqmark} + +\def\\{\begingroup + \_setverb \obeylines \scanlatex +} +\def\scanlatex#1//{\tt #1\endgroup \scanoptex} +\long\def\scanoptex#1$${\begingroup + \_setverb \obeylines \scanoptexA +} +\ea\def\ea\scanoptexA\ea#\ea1\detokenize{$$}{\bigskip \tt + \detokenize{$$}#1\detokenize{$$}\endgroup + $$\catcode`\^^M=9 \scantextokens{#1}$$ + \bigskip +} + +\tit Math alignment examples + +The document \url{https://www.ntg.nl/maps/34/06.pdf} shows examples how to +do special math alignments in display mode in ConTeXt (and in \LaTeX/ for +comparison). We present the same examples here. They are created in +\OpTeX/ and the \LaTeX/ source is shown for comparison. + +Note that several examples here use the macro \code{\\eqm} for placing +an equation mark. The macro is defined~by + +\begtt +\def\eqm{\toright\eqmark} +\endtt +% +and the \code{\\toright} macro is defined in +\ulink[http://petr.olsak.net/optex/optex-tricks.html#torighteq]{\OpTeX/ trick 0028} +which is based on +\ulink[http://petr.olsak.net/optex/optex-tricks.html#setpos]{\OpTeX/ trick 0020}. +I.e. the following macros are used here: + +\begtt +\refdecl{ + \def\Xpos#1#2#3{\sxdef{pos:#1}{{#2}{#3}\_currpage}} +} +\def\setpos[#1]{\openref\pdfsavepos + \_ewref\Xpos{{#1}\unexpanded{{\the\pdflastxpos}{\the\pdflastypos}}}} + +\def\posx [#1]{\_ea \posi \romannumeral-`\.\trycs{pos:#1}{{0}{0}{0}{0}}sp} +\def\posy [#1]{\_ea \posii \romannumeral-`\.\trycs{pos:#1}{{0}{0}{0}{0}}sp} +\def\pospg[#1]{\_ea \posiii \romannumeral-`\.\trycs{pos:#1}{{0}{0}{0}{0}}} + +\def\posi #1#2#3#4{#1} +\def\posii #1#2#3#4{#2} +\def\posiii #1#2#3#4{#3} + +\newcount\tomarginno +\def\toright#1{\_incr\tomarginno {\setpos[tr:\the\tomarginno]% + \rlap{\kern-\posx[tr:\the\tomarginno]\kern\hoffset\kern\hsize\llap{#1}}}} +\def\toleft#1{\_incr\tomarginno {\setpos[tr:\the\tomarginno]% + \rlap{\kern-\posx[tr:\the\tomarginno]\kern\hoffset\rlap{#1}}}} +\endtt +% +and we have to run \TeX/ twice. + +\notoc\nonum\sec Contents + +\centerline{\vbox{\hsize=.5\hsize +\maketoc +}} + +\vfil\break + +\let\_firstnoindent=\relax +\mathsboff \catcode`\_=12 \everytable{\catcode`\_=11} + +\sec Gather + +\\ +\begin{gather} + v = u + at, \\ + d = ut + \frac12 at^2. +\end{gather} +// + +$$ + \displaylines{ + v = u + at, \eqm \cr + d = ut + {1\over2} at^2. \eqm + } +$$ + +\sec Left gather + +\\ +\begin{align} + & v = u + at, \\ + & d = ut + \frac12 at^2. +\end{align} +// + +$$ + \eqalignno{ + & v = u + at, & \eqmark \cr + & d = ut + {1\over2} at^2. & \eqmark + } +$$ + +\sec Right gather + +\\ +\begin{align} + v = u + at , & \\ + d = ut + \frac12 atˆ2. & +\end{align} +// + +$$ + \eqalignno{ + v = u + at, && \eqmark \cr + d = ut + {1\over2} at^2. && \eqmark + } +$$ + +\sec Align + +\\ +\begin{align} + v &= u + at, \\ + d &= ut + \frac12 at^2. +\end{align} +// + +$$ + \eqalignno{ + v &= u + at, & \eqmark \cr + d &= ut + {1\over2} at^2. & \eqmark + } +$$ + +\sec Split + +\\ +\begin{equation} \begin{split} + (x+1)^8 ={} & x^8 + 8 x^7 + 28 x^6 + 56 x^5 + 70 x^4 \\ + & + 56 x^3 + 28 x^2 + 8 x + 1. +\end{split} \end{equation} +// + +$$ + \eqalign{ + (x+1)^8 = {}& x^8 + 8 x^7 + 28 x^6 + 56 x^5 + 70 x^4 \cr + & + 56 x^3 + 28 x^2 + 8 x + 1. + } \eqmark +$$ + +\sec Alignat + +\\ +\begin{alignat}{2} + \nabla\cdot \mathbf E &= \frac{\rho}{\varepsilon_0}, \qquad +& \nabla\times \mathbf E &= -\frac{\partial \mathbf B}{\partial t},\\ + \nabla\cdot \mathbf B &= 0, +& \nabla\times \mathbf B &= \mu_0{\mathbf j}+\varepsilon_0\mu_0 + \frac{\partial \mathbf E}{\partial t}. +\end{alignat} +// + +$$ + \eqalign{ + \nabla\cdot {\bf E} &= {\rho\over\varepsilon_0}, \qquad + && \nabla\times {\bf E} &= -{\partial {\bf B}\over\partial t}, \eqm\cr + \nabla\cdot {\bf B} &= 0, + && \nabla\times {\bf B} &= \mu_0{\bf j}+\varepsilon_0\mu_0 + {\partial {\bf E}\over \partial t}. \eqm + } +$$ + +\sec Flalign + +\\ +\begin{flalign*} + \nabla\cdot \mathbf E &= \frac{\rho}{\varepsilon_0}, +& \nabla\times \mathbf E &= -\frac{\partial \mathbf B}{\partial t}.\\ + \nabla\cdot \mathbf B &= 0, +& \nabla\times \mathbf B &= \mu_0{\mathbf j}+\varepsilon_0\mu_0 + \frac{\partial \mathbf E}{\partial t}. +\end{flalign*} +// + +$$ + \eqspace=10em + \eqalign{ + \nabla\cdot {\bf E} &= {\rho\over\varepsilon_0}, \qquad + && \nabla\times {\bf E} &= -{\partial {\bf B}\over\partial t}, \cr + \nabla\cdot {\bf B} &= 0, + && \nabla\times {\bf B} &= \mu_0{\bf j}+\varepsilon_0\mu_0 + {\partial {\bf E}\over \partial t}. + } +$$ + +\sec Intertext + +\\ +\begin{align*} + \cos 2\theta &= \cos^2 \theta + \sin^2 \theta \\ + \intertext{replace $\sin^2 \theta$ by $1 - \cos^2 \theta$} + &= 2\cos^2 \theta - 1 +\end{align*} +// + +$$ + \eqalignno{ + \cos 2\theta &= \cos^2 \theta + \sin^2 \theta \cr + \noalign{\hbox{replace $\sin^2 \theta$ by $1 - \cos^2 \theta$}} + &= 2\cos^2 \theta - 1 + } +$$ + +\sec Linear equations + +\\ +\begin{alignat}{5} + x_1 & {} + {}& x_2 &{} + {}& 6x_3 &{} = {}& 170, \\ + 3x_1 & {} - {}& 110x_2 &{} - {}& x_3 &{} = {}& 4, \\ + 14x_1 & {} + {}& 13x_2 &{} + {}& 10x_3 &{} = {}& 25. +\end{alignat} +// + +$$ + \thistable{\tablinespace=0pt \tabiteml={${}}\tabitemr={{}$} + \tabstrut={\lower1.5ex\vbox to3.5ex{}}} + \table{3{rc}r}{ + x_1 &+& x_2 &+& 6x_3 &=& 170, \eqm \cr + 3x_1 &-& 110x_2 &-& x_3 &=& 4, \eqm \cr + 14x_1 &+& 13x_2 &+& 10x_3 &=& 25. \eqm + } +$$ + +\sec Matrix and Arrays + +\\ +\begin{equation*} +\setlength{\arraycolsep}{1em} + \begin{array}{ccc} + A & B & C \\ + AA & BB & CC \\ + AAA & BBB & CCC + \end{array} +\end{equation*} +// + +$$ + \matrix{ + A & B & C \cr + AA & BB & CC \cr + AAA & BBB & CCC + } +$$ + +\\ +\begin{equation*} +\setlength{\arraycolsep}{1em} + \begin{array}{lcr} + A & B & C \\ + AA & BB & CC \\ + AAA & BBB & CCC + \end{array} +\end{equation*} +// + +$$ + \thistable{\tabstrut{}\tabiteml={\kern.5em${}}\tabitemr={{}$\kern.5em}} + \table{lcr}{ + A & B & C \cr + AA & BB & CC \cr + AAA & BBB & CCC + } +$$ + +\sec Pmatrix + +\\ +\begin{equation*} + A = \begin{pmatrix} 1 \\ 2 \\ 3 \end{pmatrix} +\end{equation*} +// + +$$ + \pmatrix {1\cr 2\cr 3} +$$ + +\sec Delarray package + +\\ +\begin{equation*} + \begin{array}[b]({c}) 1 \\ 2 \\ 3 \end{array} + \begin{array}[c]({c}) 1 \\ 2 \\ 3 \end{array} + \begin{array}[t]({c}) 1 \\ 2 \\ 3 \end{array} +\end{equation*} +// + +$$ + \def\mybox#1{\hbox{$\displaystyle{#1}$}} + \raise3ex\mybox{\pmatrix {1\cr 2\cr 3}} + \pmatrix {1\cr 2\cr 3} + \lower3ex\mybox{\pmatrix {1\cr 2\cr 3}} +$$ + +\sec Cases + +\\ +\begin{equation*} + |x| = + \begin{cases} + x, & \text{if $x \ge 0$;} \\ + -x, & \text{otherwise.} + \end{cases} +\end{equation*} +// + +$$ + |x| = \cases { x & if $x \ge 0$; \cr + -x & otherwise } +$$ + +\\ +\begin{equation*} + f(x) = + \begin{dcases} + \int_0ˆx g(y)\,dy, & \text{if $x \ge 0$;} \\ + \int_{-x}ˆ0 g(y)\,dy, & \text{otherwise.} + \end{dcases} +\end{equation*} +// + +$$ + \let\ds=\displaystyle + f(x) = \cases { \ds \int_0^x g(y)\,dy, & if $x \ge 0$; \cr \noalign{\medskip} + \ds \int_{-x}^0 g(y)\,dy, & otherwise. } +$$ + + + +\end diff --git a/macros/optex/demo/op-slides.tex b/macros/optex/demo/op-slides.tex index 50bcdaffa6..d1424b0d91 100644 --- a/macros/optex/demo/op-slides.tex +++ b/macros/optex/demo/op-slides.tex @@ -151,22 +151,22 @@ The previous page was created by: \sec Notes to `\slideshow` -* When `\slideshow` is active then you cannot reference sections by - hyperlinked `\ref`. Only `\pgref` works (and goes to the last layer - of the referenced page). -* If the text overfull the page (slide) then it follows to the next page without +* When `\slideshow` is active then references created by `\ref` + point to the first uncovering \"virtual" page where the destination is + and references created by `\pgref` point to the last \"virtual" page. +* If the text overfulls the page (slide) then it follows to the next page without saying explicitly `\pg;`. But `\slideshow` cannot work in this case.\pg+ * If `\slideshow` then each part of page between two `\pg`'s or between `\slideshow` and the first `\pg` is processed in a local group. * If not `\slideshow` then the document is not separated to groups. - This can lead to different results. So, you can put `\slideopen` command + This can create different results. So, you can put `\slideopen` command instead of `\slideshow`. Then local groups are opened exactly as when `\slideshow` is used but `\slideshow` is not activated. Example: \begtt \slides \def\foo...{...} % global definitions. -%\slideshow % printing version, no slide show. +%\slideshow \slideopen % opens group for first page. ... first page \pg; % closes group and opens group for second page. @@ -216,7 +216,7 @@ The previous page was created by: * `\putpic <right> <up> <width> <height> {<image-file>}` puts the image with desired <width> and <height> at the position like - `\puttext` puts the text. + `\puttext` puts the text.\pg+ \putpic .8\hsize 20mm 30mm \nospec {op-ring.png} * The ring above is the result of @@ -249,10 +249,11 @@ If you really need something unsupported by `\pg+` then you can use \endlayers \endtt -* The <layered text> should include conditions like - `\ifnum\layernum...` or `\ifcase\layernum`. - It is printed <number> times to more slide pages (layers) with the same - surrounding text. See next page... +* The `\layers` opens <number> following pages with the same + surrounding text. The counter `\layernum` is incemented from one to + <number> . The <layered text> should use `\layernum` including + conditions like `\ifnum\layernum` or `\ifcase\layernum`. + See next page... \pg; %------------------------------------------------------------------ @@ -265,10 +266,10 @@ partially show): \def\use#1#2{\ifnum\layernum#1\relax#2\fi} \def\pshow#1{\use{=#1}\Red \use{<#1}\Transparent \ignorespaces} \endtt -`\use{=3}{do something}` does something only if `\layernum=3`. +`\use{=<num>}{<something>}` does <something> only if `\layernum=<num>`.\kern-1em The `{\pshow<num> <text>}` prints <text> in Red when current layer is equal -to <num> or it prints <text> normally when current layers is greater than <num>. +to <num> or it prints <text> normally when the current layer is greater than <num>. The transparent (invisible) text is used in other cases. The following dance: @@ -288,7 +289,7 @@ was generated by \pg+ * The <layered text> is treated as a macro parameter. So, you cannot use verbatim nor `\sec` titles here. Maximal one `\layers` environment can be per one - page (terminated by `\pg+` or `\pg;` or `\pg.` + page (terminated by `\pg+` or `\pg;` or `\pg.`). \pg; %------------------------------------------------------------------ @@ -298,7 +299,7 @@ The \LaTeX{} package {\bf\Blue Beamer} gives much more features and many themes are prepared for Beamer, {\bf\Red but} \pg+ * the user of Beamer is forced to {\em program} his/her document using - dozens of \code{\\begin{foo}} and \code{\\end{foo}} and many another + dozens of \code{\\begin{foo}} and \code{\\end{foo}} and many other programming constructions,\pg+ * plain \TeX{} gives you a possibility to simply {\em write} your document with minimal markup. The result is more compact. diff --git a/macros/optex/doc/omls.tex b/macros/optex/doc/omls.tex index bcc5749a51..0f42e4b3c0 100644 --- a/macros/optex/doc/omls.tex +++ b/macros/optex/doc/omls.tex @@ -493,14 +493,14 @@ output of the \LaTeX/ source file. \secc Titles \begitems -* \.`\tit <title><eof>` should be a title of the document. -* \.`\chap <title><eof>` or `\chap [<label>] <title><eof>` is the title of +* \.`\tit <title><eol>` should be a title of the document. +* \.`\chap <title><eol>` or `\chap [<label>] <title><eof>` is the title of first level. -* \.`\sec <title><eof>` or `\sec [<label>] <title><eof>` is the title of +* \.`\sec <title><eol>` or `\sec [<label>] <title><eof>` is the title of second level. -* \.`\secc <title><eof>` or `\secc [<label>] <title><eof>` is the title of +* \.`\secc <title><eol>` or `\secc [<label>] <title><eof>` is the title of third level. -* \.`\secl<level> <title><eof>` is the title of given level. +* \.`\secl<level> <title><eol>` is the title of given level. \enditems \secc Fonts diff --git a/macros/optex/doc/optex-doc.pdf b/macros/optex/doc/optex-doc.pdf Binary files differindex a4df4f013a..ba31f2ad23 100644 --- a/macros/optex/doc/optex-doc.pdf +++ b/macros/optex/doc/optex-doc.pdf diff --git a/macros/optex/doc/optex-doc.tex b/macros/optex/doc/optex-doc.tex index 9f2fadeeb4..e14d95c230 100644 --- a/macros/optex/doc/optex-doc.tex +++ b/macros/optex/doc/optex-doc.tex @@ -20,7 +20,7 @@ \tit Format Based on Plain \TeX/ and OPmac\fnotemark1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\hfill Version 1.01 +\hfill Version 1.02 \centerline{\it Petr Olšák, 2020, 2021} diff --git a/macros/optex/doc/optex-math.tex b/macros/optex/doc/optex-math.tex index 789dd5a187..57afd22334 100644 --- a/macros/optex/doc/optex-math.tex +++ b/macros/optex/doc/optex-math.tex @@ -1476,6 +1476,9 @@ $$ \eqalignno{ } $$ \endtt +More examples of alignments in display math mode (including comparison with +\LaTeX/ code) are shown in the document +\ulink[http://petr.olsak.net/ftp/olsak/optex/op-mathalign.pdf]{op-mathalign.pdf}. \sec Concept of loading math fonts diff --git a/macros/optex/doc/optex-techdoc.tex b/macros/optex/doc/optex-techdoc.tex index 4ae25a9c7e..525fdb9477 100644 --- a/macros/optex/doc/optex-techdoc.tex +++ b/macros/optex/doc/optex-techdoc.tex @@ -51,38 +51,38 @@ The `optex.ini` file is read as the main file when the format is generated. % Category codes are set first. Note that the `_` is set to category code \"letter", it can be used as a part of control sequence names. -Other category codes are set as in the plain \TeX/. +Other category codes are set as in plain \TeX/. \verbinput (6-20) optex.ini % The \`\optexversion` and \`\fmtname` are defined. -\verbinput (22-25) optex.ini +\verbinput (22-26) optex.ini % We check if \LuaTeX/ engine is used at `-ini` state. And the `^^J` character is set as `\newlinechar`. -\verbinput (27-36) optex.ini +\verbinput (28-37) optex.ini % The basic macros for macro file syntax is defined, i.\,e.\ `\_endcode`, `\_doc` and `\_cod`. The `\_codedecl` will be re-defined later. -\verbinput (38-42) optex.ini +\verbinput (39-43) optex.ini % Individual `*.opm` macro files are read. -\verbinput (44-87) optex.ini +\verbinput (45-89) optex.ini % The file `optex.lua` is embedded into the format as byte-code. It is documented in section~\ref[lua]. -\verbinput (89-92) optex.ini +\verbinput (91-94) optex.ini The `\everyjob` register is initialized and the format is saved by the `\dump` command. -\verbinput (94-102) optex.ini +\verbinput (96-104) optex.ini } diff --git a/macros/optex/doc/optex-userdoc.tex b/macros/optex/doc/optex-userdoc.tex index a70cedcf4d..9bcec7db1e 100644 --- a/macros/optex/doc/optex-userdoc.tex +++ b/macros/optex/doc/optex-userdoc.tex @@ -375,7 +375,7 @@ Hundreds math symbols and operators like in AMS\TeX/ are accessible. For example `\alpha` $\alpha$, `\geq`~$\geq$, `\sum` $\sum$, `\sphericalangle` $\sphericalangle$, `\bumpeq`, $\bumpeq$. See AMS\TeX/ manual or -\ulink[http://petr.olsak.net/ftp/olsak/optex/optex-math.pdf] +\ulink[http://petr.olsak.net/ftp/olsak/optex/optex-math.pdf\#ref:objects] {Typesetting Math with \OpTeX/} for complete list of math symbols. The following math alphabets are available: @@ -1309,6 +1309,29 @@ nothing. It tells only that the mentioned bib-record should be printed in the reference list. If \^`\nocite[*]` is used then all records from <bib-base> are printed. +You can create more independent lists of references (you are creating proceedings, +for example). Use \^`\bibpart` `{<name>}` to set the scope where \~`\cite`s +and references list are printed (and interconnected) independent of another +parts of your document. The \~`\cite` labels used in different parts can be +the same and they are not affected. References lists can be created manualy +by \^`\bib` or from a database by `\usebib`. +Example: + +\begtt \typosize[10/12] +\bibpart {AA} +...\cite[labelX] ... \cite[labelY] ... % They belong to AA bib-list +\usebib/c (simple) file.bib % generates AA bib-list numbered 1, 2, ... + % \cite prints [1], [2], ... by bib-list AA +\bibpart {BB} +...\cite[labelZ] ... \cite[labelX] ... % They belong to BB bib-list +\bibnum=0 \usebib/c (simple) my.bib % generates BB bib-list numbered 1, 2, ... + % \cite prints [1], [2], ... by bib-list BB +\endtt +% +By default, \^`\bibpart` is empty. So \~`\cite`s and the references list are conneted +using this empty internal name. + + \sec Graphics %%%%%%%%%%%%% diff --git a/macros/optex/pkg/emoji.opm b/macros/optex/pkg/emoji.opm index e14579135f..9053953bff 100644 --- a/macros/optex/pkg/emoji.opm +++ b/macros/optex/pkg/emoji.opm @@ -51,5 +51,8 @@ We can use \emoji{grinning} or directly: {\emojifont 😀} too. More than 3000 emoticons are available. +See also \ulink[http://petr.olsak.net/optex/optex-tricks.html#emoji] +{\OpTeX/ trick 0062}. + If you want black-and-white pictograms, see another font: \url{http://petr.olsak.net/optex/optex-tricks.html\#fawesome} |