diff options
Diffstat (limited to 'macros/latex/contrib/iftex')
-rw-r--r-- | macros/latex/contrib/iftex/README | 29 | ||||
-rw-r--r-- | macros/latex/contrib/iftex/iftex.pdf | bin | 0 -> 30641 bytes | |||
-rw-r--r-- | macros/latex/contrib/iftex/iftex.sty | 97 | ||||
-rw-r--r-- | macros/latex/contrib/iftex/iftex.tex | 80 |
4 files changed, 206 insertions, 0 deletions
diff --git a/macros/latex/contrib/iftex/README b/macros/latex/contrib/iftex/README new file mode 100644 index 0000000000..95def7f467 --- /dev/null +++ b/macros/latex/contrib/iftex/README @@ -0,0 +1,29 @@ +_________________ +The iftex package +v0.2 + +This very simple package, for both Plain TeX and LaTeX, +defines the \ifPDFTeX, \ifXeTeX, and \ifLuaTeX boolean +for testing whether PDFTeX, or XeTeX, or LuaTeX is being +used for typesetting. + +Also provides the \RequirePDFTeX, \RequireXeTeX, and \RequireLuaTeX +command which throws an error if PDFTeX, XeTeX and LuaTeX (respectively) +is not the engine in use. + +If you want to report any bugs or typos and corrections in the documentation, +or ask for any new features, or suggest any improvements, or ask any questions +about the package, then please do not send any direct emails to us; we will not +answer any direct emails. Instead please use the issue tracker: + <https://github.com/persian-tex/iftex/issues> +In doing so, please always explain your issue well enough, always include +a minimal working examples showing the issue, and always choose the appropriate +label for your query (i.e. if you are reporting any bugs, choose `bug' label). + +Current version release date: 2013/04/04 +______________ +Persian TeX Group +persian-tex@tug.org + +Copyright 2010–2013 +Distributed under the LaTeX Project Public License diff --git a/macros/latex/contrib/iftex/iftex.pdf b/macros/latex/contrib/iftex/iftex.pdf Binary files differnew file mode 100644 index 0000000000..483276ea7c --- /dev/null +++ b/macros/latex/contrib/iftex/iftex.pdf diff --git a/macros/latex/contrib/iftex/iftex.sty b/macros/latex/contrib/iftex/iftex.sty new file mode 100644 index 0000000000..7651466448 --- /dev/null +++ b/macros/latex/contrib/iftex/iftex.sty @@ -0,0 +1,97 @@ +%% +%% This is file `iftex.sty', + +%% +%% __________________________________ +%% Copyright © 2010–2013 Persian TeX Group +%% +%% License information appended. +%% +%% +\csname iftexloaded\endcsname +\let\iftexloaded\endinput +\expandafter\ifx\csname ProvidesPackage\endcsname\relax\else + \ProvidesPackage{iftex} + [2013/04/04 v0.2 Provides if(tex) conditional for PDFTeX, XeTeX, and LuaTeX] +\fi +\def\RequirePDFTeX{% + \ifPDFTeX\else + \begingroup + \errorcontextlines=-1\relax + \newlinechar=10\relax + \errmessage{^^J + ********************************************^^J + * PDFTeX is required to compile this document.^^J + * Sorry!^^J + ********************************************}% + \endgroup + \fi} +\def\RequireXeTeX{% + \ifXeTeX\else + \begingroup + \errorcontextlines=-1\relax + \newlinechar=10\relax + \errmessage{^^J + ********************************************^^J + * XeTeX is required to compile this document.^^J + * Sorry!^^J + ********************************************}% + \endgroup + \fi} +\def\RequireLuaTeX{% + \ifLuaTeX\else + \begingroup + \errorcontextlines=-1\relax + \newlinechar=10\relax + \errmessage{^^J + ********************************************^^J + * LuaTeX is required to compile this document.^^J + * Sorry!^^J + ********************************************}% + \endgroup + \fi} +\expandafter\ifx\csname ifPDFTeX\endcsname\relax\else + \expandafter\endinput +\fi +\expandafter\ifx\csname ifXeTeX\endcsname\relax\else + \expandafter\endinput +\fi +\expandafter\ifx\csname ifLuaTeX\endcsname\relax\else + \expandafter\endinput +\fi +\newif\ifPDFTeX +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname pdfmatch\endcsname\relax + \PDFTeXfalse +\else + \PDFTeXtrue +\fi +\newif\ifXeTeX +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname XeTeXinterchartoks\endcsname\relax + \XeTeXfalse +\else + \XeTeXtrue +\fi +\newif\ifLuaTeX +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname directlua\endcsname\relax + \LuaTeXfalse +\else + \LuaTeXtrue +\fi +%% +%% Copyright © 2010–2013 by Persian TeX Group <persian-tex@tug.org> +%% +%% Distributable under the LaTeX Project Public License, +%% version 1.3c or higher (your choice). The latest version of +%% this license is at: http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) +%% by Persian TeX Group. +%% +%% +%% +%% +%% +%% End of file `iftex.sty'. diff --git a/macros/latex/contrib/iftex/iftex.tex b/macros/latex/contrib/iftex/iftex.tex new file mode 100644 index 0000000000..a247e22b5b --- /dev/null +++ b/macros/latex/contrib/iftex/iftex.tex @@ -0,0 +1,80 @@ +\documentclass{artikel3} +\usepackage{calc} +\usepackage{pifont} +\usepackage{bbding} +\usepackage[colorlinks=true,linkcolor=mybrown,urlcolor=mygreen]{hyperref} +\usepackage{bidicode} +\newcounter{local} +\renewcommand\theenumi{\protect\setcounter{local}% + {201+\the\value{enumi}}\protect\ding{\value{local}}} +\renewcommand\labelenumi{\theenumi} +\renewcommand\labelitemi{\HandRight} +\renewcommand\labelitemii{\HandRightUp} +\renewcommand\labelitemiii{\HandCuffRight} +\renewcommand\labelitemiv{\HandPencilLeft} +\definecolor{mybrown}{rgb}{.6,0,0} +\definecolor{mygreen}{rgb}{0,.43,0} +\definecolor{Orange}{rgb}{1,.4,.2} +\newcommand\PDFTeX{PDF\TeX} +\newcommand\XeTeX{Xe\TeX} +\newcommand\LuaTeX{Lua\TeX} +\title{The \textsf{iftex} Package\\ \href{https://github.com/persian-tex/iftex}{\texttt{https://github.com/persian-tex/iftex}}} +\author{Persian TeX Group\\ \href{mailto:persian-tex@tug.org}{\texttt{persian-tex@tug.org}}} +\date{Version 0.2} +\begin{document} +\maketitle +\tableofcontents +\section{Introduction} +This package provides a way to check if a document is being processed with \PDFTeX, or \XeTeX, or \LuaTeX. +\section{Loading The Package} +The package can be loaded in the usual way both in Plain \TeX\ and \LaTeX. +\subsection{Loading The Package in Plain \TeX} +\begin{BDef} +\Lcs{input}\quad \Larg{iftex.sty} +\end{BDef} +\subsection{Loading The Package in \LaTeX} +\begin{BDef} +\Lcs{usepackage}\Largb{iftex} +\end{BDef} +\section{Defined Conditionals} +\subsection{For \PDFTeX} +\begin{BDef} +\Lcs{ifPDFTeX}\\ +\qquad\Larga{material for \PDFTeX}\\ +\Lcs{else}\\ +\qquad\Larga{material not for \PDFTeX}\\ +\Lcs{fi} +\end{BDef} +\subsection{For \XeTeX} +\begin{BDef} +\Lcs{ifXeTeX}\\ +\qquad\Larga{material for \XeTeX}\\ +\Lcs{else}\\ +\qquad\Larga{material not for \XeTeX}\\ +\Lcs{fi} +\end{BDef} +\subsection{For \LuaTeX} +\begin{BDef} +\Lcs{ifLuaTeX}\\ +\qquad\Larga{material for \LuaTeX}\\ +\Lcs{else}\\ +\qquad\Larga{material not for \LuaTeX}\\ +\Lcs{fi} +\end{BDef} +\section{Defined Commands} +\subsection{For \PDFTeX} +\begin{BDef} +\Lcs{RequirePDFTeX} +\end{BDef} +This command tests for \PDFTeX\ use and throws an error if a different engine is being used. +\subsection{For \XeTeX} +\begin{BDef} +\Lcs{RequireXeTeX} +\end{BDef} +This command tests for \XeTeX\ use and throws an error if a different engine is being used. +\subsection{For \LuaTeX} +\begin{BDef} +\Lcs{RequireLuaTeX} +\end{BDef} +This command tests for \LuaTeX\ use and throws an error if a different engine is being used. +\end{document}
\ No newline at end of file |