summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/diagnose/diagnose.sty
blob: e9a6e414a47dccdf71f175d9c589c6f3632937ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%        File: diagnose.sty
%      Author: Oliver Corff
%        Date: April 10, 2001
%     Version: 0.2
%   Copyright: Ulaanbaatar, Beijing, Berlin, Shanghai
%
% Description: Diagnostic Functions
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% -------------------     identification     -------------------
\ProvidesFile{diagnose.sty}
        [2000/11/01 v0.2 Diagnostic Utility]

\newif\ifmessagetext

\newcommand{\TextMessageNo}{
	\messagetextfalse
}

\newcommand{\TextMessageYes}{
	\messagetexttrue
}

\newcommand{\TextMessage}[1]{%
	\ifmessagetext %
	#1%
	\fi %
}

\newcommand{\TokenDiagnostics}[4]{%
	\newcounter{#2}%		% Counter name
	\ifx#1\undefined		% Token name
		\setcounter{#2}{0}%	% `No' assignment to counter
		\TextMessage{#4}%	% `No' text in document
		\message{^^J#4^^J^^J}%	% `No' text in message and log file
	\else				%
		\setcounter{#2}{1}%	% `Yes' assignment to counter
		\TextMessage{#3}%	% `Yes' text in document
		\message{^^J#3^^J^^J}%	% `Yes' text in message and log file
	\fi				%
}

\newcommand{\PackageDiagnostics}[4]{%
	\newcounter{#2}%		% Counter name
	\IfFileExists{#1}{%		% Package name
		\setcounter{#2}{1}%	% `Yes' assignment to counter
		\TextMessage{#3}%	% `Yes' text in document
		\message{^^J#3^^J^^J}%	% `Yes' text in message and log file
	}				%
		{\setcounter{#2}{0}%	% `No' assignment to counter
		\TextMessage{#4}%	% `No' text in document
		\message{^^J#4^^J^^J}%	% `No' text in message and log file
	}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\TextMessageNo
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endinput	% End of package diagnose.sty