From 3d4ec1129a9ea9a6c2d6d173e2d358f3a3945e55 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 17 Dec 2011 00:59:43 +0000 Subject: ifetex 1.2 (15dec11) git-svn-id: svn://tug.org/texlive/trunk@24853 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/ifetex/ifetex.pdf | Bin 123825 -> 130510 bytes Master/texmf-dist/source/latex/ifetex/ifetex.dtx | 42 +++++++++++++++++++++-- Master/texmf-dist/tex/latex/ifetex/ifetex.sty | 25 ++++++++++++-- 3 files changed, 62 insertions(+), 5 deletions(-) diff --git a/Master/texmf-dist/doc/latex/ifetex/ifetex.pdf b/Master/texmf-dist/doc/latex/ifetex/ifetex.pdf index ea70346e2bc..50391eee0e3 100644 Binary files a/Master/texmf-dist/doc/latex/ifetex/ifetex.pdf and b/Master/texmf-dist/doc/latex/ifetex/ifetex.pdf differ diff --git a/Master/texmf-dist/source/latex/ifetex/ifetex.dtx b/Master/texmf-dist/source/latex/ifetex/ifetex.dtx index a563833790b..383494db5ca 100644 --- a/Master/texmf-dist/source/latex/ifetex/ifetex.dtx +++ b/Master/texmf-dist/source/latex/ifetex/ifetex.dtx @@ -24,10 +24,10 @@ %<*driver> \ProvidesFile{ifetex.dtx}[% %<=*DATE> - 2011/11/06 + 2011/12/15 %<=/DATE> %<=*VERSION> - v1.1 + v1.2 %<=/VERSION> Conditional to test for e-TeX] \documentclass{ydoc} @@ -44,7 +44,7 @@ % % \fi % -% \CheckSum{41} +% \CheckSum{73} % % \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 @@ -65,6 +65,7 @@ % % \changes{v1.0}{2011/10/31}{First version.} % \changes{v1.1}{2011/11/06}{Changed to manual, local declaration of \cs{ifetex}.} +% \changes{v1.2}{2011/12/15}{Added \cs{NeedsETeX} \protect\LaTeX\ macro.} % % \DoNotIndex{\newcommand,\newenvironment} % @@ -94,6 +95,12 @@ % The \LaTeX\ which comes with \emph{Scientific Work Place} by MacKichan seems to not support \eTeX\ yet. % Package authors can use this package to test for missing \eTeX\ and provide fall-back code. % +% \DescribeMacro\NeedsETeX[] +% The \LaTeX\ package provides this macro which can be used in packages or classes to produce an error if \eTeX\ is not available, +% similar to \Macro\NeedsTeXFormat. In addition an optional version number can be given in the format x.y, where x is the main version and y the revision. +% This number is checked against \Macro\eTeXversion and \Macro\eTeXrevision and an appropriate error is raised if the available +% \eTeX\ is too old. +% % \StopEventually{} % \section{Implementation} % @@ -115,6 +122,35 @@ % \begin{macrocode} \@@input ifetex % \end{macrocode} +% +% +% \begin{macro}{\NeedsETeX}[1]{optional version number (x.y)} +% Produces error if e-TeX is not available or if its version is too old. +% \begin{macrocode} +\newcommand*\NeedsETeX[1][]{% + \ifetex + \ifx\@nnil#1\@nnil\else + \ifdim\the\eTeXversion\eTeXrevision\p@<#1\p@\relax + \@latex@error{This file needs e-TeX with version #1% + \MessageBreak but only version \the\eTeXversion\eTeXrevision is available}{% + The current input file will not be processed + further,\MessageBreak + because it was written for a newer version of e-TeX. + \MessageBreak\@ehd}% + \endinput + \fi\fi + \else + \@latex@error{This file needs e-TeX}{% + The current input file will not be processed + further,\MessageBreak + because it was written for e-TeX which is not available. + \MessageBreak\@ehd}% + \endinput + \fi +} +% \end{macrocode} +% \end{macro} +% % \iffalse % % \fi diff --git a/Master/texmf-dist/tex/latex/ifetex/ifetex.sty b/Master/texmf-dist/tex/latex/ifetex/ifetex.sty index f7b5bc17cf5..b2bc998238a 100644 --- a/Master/texmf-dist/tex/latex/ifetex/ifetex.sty +++ b/Master/texmf-dist/tex/latex/ifetex/ifetex.sty @@ -16,10 +16,31 @@ %% and the derived filebase ifetex.sty. %% \ProvidesPackage{ifetex}[% - 2011/11/06 - v1.1 + 2011/12/15 + v1.2 ifetex] \@@input ifetex +\newcommand*\NeedsETeX[1][]{% + \ifetex + \ifx\@nnil#1\@nnil\else + \ifdim\the\eTeXversion\eTeXrevision\p@<#1\p@\relax + \@latex@error{This file needs e-TeX with version #1% + \MessageBreak but only version \the\eTeXversion\eTeXrevision is available}{% + The current input file will not be processed + further,\MessageBreak + because it was written for a newer version of e-TeX. + \MessageBreak\@ehd}% + \endinput + \fi\fi + \else + \@latex@error{This file needs e-TeX}{% + The current input file will not be processed + further,\MessageBreak + because it was written for e-TeX which is not available. + \MessageBreak\@ehd}% + \endinput + \fi +} \endinput %% %% End of file `ifetex.sty'. -- cgit v1.2.3