You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
140 lines
3.8 KiB
TeX
140 lines
3.8 KiB
TeX
% \iffalse meta-comment
|
|
%
|
|
% File: ifprintedition.dtx
|
|
% Version: 2023/07/12 v0.1
|
|
% Info: Detect class options printedition and webedition
|
|
%
|
|
% Copyright (C) 2023 by Taha Ahmed
|
|
% https://git.solarchemist.se/taha/ifprintedition
|
|
%
|
|
% This work may be distributed and/or modified under the
|
|
% conditions of the LaTeX Project Public License, either
|
|
% version 1.3c of this license or (at your option) any later
|
|
% version. This version of this license is in
|
|
% https://www.latex-project.org/lppl/lppl-1-3c.txt
|
|
% and the latest version of this license is in
|
|
% https://www.latex-project.org/lppl.txt
|
|
% and version 1.3 or later is part of all distributions of
|
|
% LaTeX version 2005/12/01 or later.
|
|
% \fi
|
|
%
|
|
% \iffalse
|
|
%<*driver>
|
|
\ProvidesFile{ifprintedition.dtx}
|
|
%</driver>
|
|
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
|
|
%<package>\ProvidesPackage{ifprintedition}
|
|
%<*package>
|
|
[2023/07/12 v0.1 Detect class options printedition and webedition]
|
|
%</package>
|
|
%
|
|
%<*driver>
|
|
\documentclass{ltxdoc}
|
|
\usepackage{ifprintedition}[2023/07/12]
|
|
\EnableCrossrefs
|
|
\CodelineIndex
|
|
\RecordChanges
|
|
\begin{document}
|
|
\DocInput{ifprintedition.dtx}
|
|
\PrintChanges
|
|
\PrintIndex
|
|
\end{document}
|
|
%</driver>
|
|
% \fi
|
|
%
|
|
% \CheckSum{32}
|
|
%
|
|
% \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
|
|
% Lower-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
|
|
% Digits \0\1\2\3\4\5\6\7\8\9
|
|
% Exclamation \! Double quote \" Hash (number) \#
|
|
% Dollar \$ Percent \% Ampersand \&
|
|
% Acute accent \' Left paren \( Right paren \)
|
|
% Asterisk \* Plus \+ Comma \,
|
|
% Minus \- Point \. Solidus \/
|
|
% Colon \: Semicolon \; Less than \<
|
|
% Equals \= Greater than \> Question mark \?
|
|
% Commercial at \@ Left bracket \[ Backslash \\
|
|
% Right bracket \] Circumflex \^ Underscore \_
|
|
% Grave accent \` Left brace \{ Vertical bar \|
|
|
% Right brace \} Tilde \~}
|
|
%
|
|
%
|
|
% \changes{v0.1}{2023/07/12}{Initial version}
|
|
%
|
|
% \GetFileInfo{ifprintedition.dtx}
|
|
%
|
|
% \DoNotIndex{\newcommand,\newenvironment}
|
|
%
|
|
%
|
|
% \title{The \textsf{ifprintedition} package\thanks{This document
|
|
% corresponds to \textsf{ifprintedition}~\fileversion, dated \filedate.}}
|
|
% \author{Taha Ahmed \\ \texttt{taha+ltx@chepec.se}}
|
|
%
|
|
% \maketitle
|
|
%
|
|
% \section{Introduction}
|
|
%
|
|
% Put text here.
|
|
%
|
|
% \section{Usage}
|
|
%
|
|
% Put text here.
|
|
%
|
|
% \DescribeMacro{\dummyMacro}
|
|
% This macro does nothing.\index{doing nothing|usage} It is merely an
|
|
% example. If this were a real macro, you would put a paragraph here
|
|
% describing what the macro is supposed to do, what its mandatory and
|
|
% optional arguments are, and so forth.
|
|
%
|
|
% \DescribeEnv{dummyEnv}
|
|
% This environment does nothing. It is merely an example.
|
|
% If this were a real environment, you would put a paragraph here
|
|
% describing what the environment is supposed to do, what its
|
|
% mandatory and optional arguments are, and so forth.
|
|
%
|
|
% \StopEventually{\PrintIndex}
|
|
%
|
|
% \section{Implementation}
|
|
%
|
|
% \begin{macrocode}
|
|
\newif\if@printedition
|
|
\newif\if@option@printedition
|
|
\newif\if@option@webedition
|
|
\DeclareOption{printedition}{%
|
|
\@printeditiontrue
|
|
\@option@printeditiontrue
|
|
}
|
|
\DeclareOption{webedition}{%
|
|
\@printeditionfalse
|
|
\@option@webeditiontrue
|
|
}
|
|
\ProcessOptions*\relax
|
|
% \end{macrocode}
|
|
% \begin{macro}{\ifprintedition}
|
|
% \begin{macrocode}
|
|
\newcommand*{\ifprintedition}{%
|
|
\if@printedition
|
|
\expandafter\@firstoftwo
|
|
\else
|
|
\expandafter\@secondoftwo
|
|
\fi
|
|
}
|
|
% \end{macrocode}
|
|
% \end{macro}
|
|
% \begin{macro}{\ifwebedition}
|
|
% \begin{macrocode}
|
|
\newcommand*{\ifwebedition}{%
|
|
\if@webedition
|
|
\expandafter\@firstoftwo
|
|
\else
|
|
\expandafter\@secondoftwo
|
|
\fi
|
|
}
|
|
% \end{macrocode}
|
|
% \end{macro}
|
|
%
|
|
% \Finale
|
|
\endinput
|