summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pkgloader/pkgloader-error.sty
blob: 7ec796ef6e586b63551da43b4d3d2e4c570bdf9b (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
60
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iffalse %%%%
%                                                                              %
%  Copyright (c) 2018 - Michiel Helvensteijn   (www.mhelvens.net)              %
%                                                                              %
%  https://github.com/mhelvens/latex-pkgloader                                 %
%                                                                              %
%  This work may be distributed and/or modified under the conditions           %
%  of the LaTeX Project Public License, either version 1.3 of this             %
%  license or (at your option) any later version. The latest version           %
%  of this license is in       http://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.                                                %
%                                                                              %
%  This work has the LPPL maintenance status `maintained'.                     %
%                                                                              %
%  The Current Maintainer of this work is Michiel Helvensteijn.                %
%                                                                              %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \fi %%%%
%                                                             %
%  This file is loaded whenever a combination of packages is  %
%  requested that has been marked as illegal. Loading this    %
%  file always results in the termination of the LaTeX run.   %
%                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%% Back to expl3 syntax
%
\ExplSyntaxOn


%%% Add an empty line to the log before the errors are printed
%
\typeout{}


%%% Initialization for the error-message loop
%
\cs_generate_variant:Nn \int_step_inline:nnnn {nnvn}
\cs_generate_variant:Nn \int_compare:nNnTF    {nNvTF}
\cs_generate_variant:Nn \msg_error:nnnn       {nnvv}


%%% The loop issues one error message for each reason the
%%% package combination is illegal. None of them are
%%% critical or fatal errors; we terminate the run manually.
%
\int_step_inline:nnvn {1} {1} {g__pkgloader_count_(pkgloader-error.sty)_int} {
	\bool_if:cT {g__pkgloader_used_(pkgloader-error.sty)_(#1)_bool} {
		\msg_error:nnvv
			{pkgloader} {illegal-combination}
			{g__pkgloader_condition_(pkgloader-error.sty)_(#1)_tl}
			{g__pkgloader_reason_   (pkgloader-error.sty)_(#1)_tl}
	}
}


%%% Terminate the LaTeX run
%
\stop\bye