summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/ifetex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-12-17 00:59:43 +0000
committerKarl Berry <karl@freefriends.org>2011-12-17 00:59:43 +0000
commit3d4ec1129a9ea9a6c2d6d173e2d358f3a3945e55 (patch)
tree23f5ae90080a56317f023875bd7134bed2852cf0 /Master/texmf-dist/source/latex/ifetex
parentbb697854fb4e6eca8595e8c660b3a8aaffa47b06 (diff)
ifetex 1.2 (15dec11)
git-svn-id: svn://tug.org/texlive/trunk@24853 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/ifetex')
-rw-r--r--Master/texmf-dist/source/latex/ifetex/ifetex.dtx42
1 files changed, 39 insertions, 3 deletions
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 @@
%</driver>
% \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[<version>]
+% 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
%</ifetex.sty>
% \fi