Debian Codegraph @

texmf-dist/tex/latex/spectralsequences/sseqmessages.code.tex

raw
1 %%
2 %% Package: spectralsequences v1.3.3 2023-01-28
3 %% Author: Hood Chatham
4 %% Email: [email protected]
5 %% Date: 2023-01-28
6 %% License: Latex Project Public License
7 %%
8 %% File: sseqmessages.code.tex
9 %% Exposes: Error message redirects?
10 %%
11 %% Set up fancy error messages
12 %%
13
14
15
16 %% The error handling system is build on top of l3msg. l3msg produces errors like:
17 %%
18 %% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19 %% !
20 %% ! LaTeX error: "<package>/<error-name>"
21 %% !
22 %% ! <error message text>
23 %% !
24 %% ! See the <package> documentation for further information. % produced by \msg_see_documentation_text:n{<package>}
25 %% !...............................................
26 %%
27 %% The user will see underneath it l.<line number> <text on line>
28 %%
29 %% Unfortunately, if the error is in a \foreach statement, the user will only see the final line of the foreach loop, often just the close brace.
30 %% It's impossible to tell from this where in the \foreach the error occurred. Similar problems occur if the command is inside a user command.
31 %%
32 %% We're going to modify this file to improve the situation.
33 %%
34 %% If the command is in a forloop or a user command I want to:
35 %% -- annotate the error with the command that caused it, or the previous command if the error occurred before I can know what the current command looks like.
36 %% -- present a stack trace to inform the user where exactly the problem occurred
37 %%
38 %%
39 %% We automatically print the annotation and stack trace at the end of all l3msg messages by hooking into \msg_see_documentation_text:n.
40 %% The annotation and stack trace are prepared by a command \sseq@error@setup which we hook into the beginning of the latex3 message processing code.
41 %%
42 %% Here's an example of the result:
43 %%
44 %% !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
45 %% !
46 %% ! spectralsequences error: "index-too-large"
47 %% !
48 %% ! Index '-3' provided for target of structure line is too large -- only 1
49 %% ! classes exist at position (32,8).
50 %% !
51 %% ! (Error occurred during call "\structline(16,-1,-1)(16,0,-3)", in the % This is the annotation
52 %% ! \foreach block that ends on line 158, with variable values: \n = 2.) % it's stored in \sseq@error@annotation
53 %% !
54 %% ! Stack trace: % This is the stack trace
55 %% ! \towergroupb (8*\n ,4*\n ) % Produced by \sseq@printstacktrace
56 %% ! \foreach \n in {2,3,4}
57 %% !
58 %% ! See the spectralsequences documentation for further information.
59 %% !
60 %% ! Type <return> to continue.
61 %% !...............................................
62
63
64 \def\sseq@protecterror#1{\@nx\sseq@protecterror\unexpanded{{#1}}}
65
66 % Stack, thiscall, foreachcall.
67 % Here we record what the user has said (as best we can tell)
68 \newtoks\sseq@thiscalltoks
69
70 % These guys are set up because I want \sseq@DeclareDocumentCommandAs@setinputline to work
71 % but I want the definition of \sseq@inputline to be local, and it would be really bad to
72 % open a group inside of sseq@DeclareDocumentCommandAs that has to be closed in the code.
73 % So what I do is globally put it into \sseq@globalinputline using \sseq@setinputline
74 % and then after starting the group at the beginning of the actual macro body,
75 % call \sseq@loadinputline
76 \def\sseq@setinputline{\xdef\sseq@globalinputline{\the\inputlineno}}
77 \def\sseq@loadinputline{\let\sseq@inputline\sseq@globalinputline}
78
79 \def\sseq@thiscall{\the\sseq@thiscalltoks}
80 \def\sseq@setthiscall#1{\sseq@seterrorannotation{call}\sseq@thiscalltoks{#1}}
81 \def\sseq@esetthiscall#1{\sseq@seterrorannotation{call}\sseq@eval{\sseq@thiscalltoks{#1}}}
82 \def\sseq@gsetthiscall{\sseq@seterrorannotation{call}\global\sseq@thiscalltoks}
83 \def\sseq@xsetthiscall#1{\sseq@eval{\@nx\sseq@gsetthiscall{#1}}}
84 \def\sseq@xsetlastcall#1{\sseq@eval{\global\sseq@thiscalltoks{#1}}}
85
86 \def\sseq@usermacro@esetthiscall#1{\sseq@eval{\sseq@thiscalltoks{#1}}} % Don't set \sseq@error@annotation@call
87
88 \newtoks\sseq@foreachcall
89 \newtoks\sseq@topofstacktrace
90 \sseq@topofstacktrace{}
91 \def\sseq@restofstacktrace{}
92
93 \def\sseq@pushstacktrace#1{
94 \edef\sseq@temp{\the\sseq@topofstacktrace}
95 \ifx\sseq@temp\pgfutil@empty\else
96 \edef\sseq@restofstacktrace{\unexpanded{\\\ \ \ }\@nx\sseq@stack@unexpanded{\the\sseq@topofstacktrace}\unexpanded\@xp{\sseq@restofstacktrace}}
97 \fi
98 \sseq@eval{\sseq@topofstacktrace{\unexpanded{#1}\sseq@possibleoninputlinedash}}
99 \let\sseq@possibleoninputlinedash\empty
100 \let\sseq@possibleoninputlinepar\empty
101 }
102 \def\sseq@opushstacktrace#1{\@xp\sseq@pushstacktrace\@xp{#1}}
103 \def\sseq@stack@unexpanded#1{\@nx\sseq@stack@unexpanded\unexpanded{{#1}}}
104
105
106
107 % Positional information about the error:
108 % Lengths are five more than the correct length to account for the fact that the line starts with !<space> and to accommodate two quote characters and a comma.
109 \def\sseq@error@annotation@aftercall{\\\\Error occurred after call\sseq@printthiscall\sseq@error@inforeachloop}
110 \chardef\sseq@error@annotation@length@aftercall=34
111 \def\sseq@error@annotation@call{\\\\Error occurred during call\sseq@printthiscall\sseq@error@inforeachloop}
112 \chardef\sseq@error@annotation@length@call=33
113 \def\sseq@error@annotation@atbeginforeach{\\\\Error occurred at the beginning of \string\foreach\ statement\sseq@printthiscall\sseq@error@inforeachloop}
114 \chardef\sseq@error@annotation@length@atbeginforeach=60
115 \def\sseq@error@annotation@atbeginusercmd{\\\\Error occurred at the beginning of user command\sseq@printthiscall\sseq@error@inforeachloop}
116 \chardef\sseq@error@annotation@length@atbeginusercmd=54
117
118 \def\sseq@seterrorannotation@drawing#1#2#3#4#5{%
119 \def\sseq@error@annotation{\\\\Error occurred while drawing class (#2,#3,#4)\ifnum#5>0 \space which has been replaced #5 time\ifnum#5>1s\fi\fi.
120 Look for a \ifnum#5>0\string\replaceclass\else\string\class\fi\space command that makes a class at that position.
121 Also make sure to check any \@nx\classoptions commands that could be the culprit.}%
122 }
123
124 \def\sseq@seterrorannotation#1{%
125 \@xp\let\@xp\sseq@error@annotation\csname sseq@error@annotation@#1\endcsname
126 \@xp\let\@xp\sseq@error@annotation@length\csname sseq@error@annotation@length@#1\endcsname
127 }
128
129 \sseq@seterrorannotation{aftercall}
130
131 \def\sseq@inputline{\the\inputlineno}
132 \def\sseq@error@inforeachloop{\sseq@possibleoninputlinepar\sseq@possibleperiod}
133 \def\sseq@error@inforeachloop@active{\sseq@possiblecomma in loop with variable values:\sseq@for@printvars\sseq@possibleperiodb}
134 \def\sseq@error@setup@errorinfo{}% Changed during \foreach and user commands
135
136 \def\sseq@possibleoninputlinepar{ (on input line \sseq@inputline)} % let this to a no-op at beginning of usermacros
137 \def\sseq@possibleoninputlinedash{ -- on input line \sseq@inputline}
138
139 \def\sseq@possiblecomma{,\space}
140 \def\sseq@possibleperiod{.}
141 \def\sseq@possibleperiodb{.}
142
143
144 \def\sseq@error@announcestacktrace{\\\\Stack trace:}
145 \def\sseq@printstacktrace{ % Only prints rest of stack trace because top element is mentioned in annotation.
146 \ifx\sseq@restofstacktrace\pgfutil@empty\else
147 \sseq@error@announcestacktrace\sseq@restofstacktrace
148 \fi
149 }
150
151 % \sseq@error@setup happens before the error is reported, \sseq@error@cleanup at the end.
152
153 \ExplSyntaxOn
154
155 \def\sseq@error@setup@withinfo{
156 \bgroup
157 \def\foreach{\@nx\foreach}
158 \sseq@countthiscall
159 \ifnum\sseq@thiscallnumchars>\numexpr\l_iow_line_count_int-\sseq@error@annotation@length\relax
160 \def\sseq@printthiscall{:\\\@xp\iow_indent:n\@xp{\the\sseq@thiscalltoks}\\}
161 \let\sseq@possiblecomma\empty
162 \let\sseq@possibleperiod\empty
163 \fi
164 \let\sseq@stack@unexpanded\unexpanded
165 \sseq@error@setup@errorinfo
166 \sseq@error@hook
167 }
168
169 \def\sseq@error@setup@noinfo{\bgroup\def\foreach{\@nx\foreach}\let\sseq@stack@unexpanded\unexpanded\def\sseq@error@annotation{}\sseq@error@hook}
170 \let\sseq@error@setup\sseq@error@setup@noinfo
171 \def\sseq@error@cleanup{\egroup\sseq@errortrue} % If the error was thrown in NewDocumentCommand, we need to process it. Just used in sseqmacromakers.
172
173
174 \def\sseq@printthiscall{\ "\the\sseq@thiscalltoks"}
175 % make \exp_args:NNNf:
176 \let \sseq_dummy:NNn \empty
177 \cs_generate_variant:Nn \sseq_dummy:NNn {NNf}
178
179
180 % Count the chars in thiscall
181 % Detokenize handles the control words, but keeps the spaces as spaces. To count them properly, we lowercase them into 0's (any nonspace character would do just fine).
182 \def\sseq@countthiscall{
183 \bgroup\lccode`\ =`\0\relax
184 \edef\temp{\detokenize\@xp{\the\sseq@thiscalltoks}}
185 \exp_args:Nf\lowercase{
186 \exp_args:NNNf\egroup
187 \edef\sseq@thiscallnumchars{
188 \exp_args:NNo\@nx\tl_count:n{\temp}
189 }
190 }
191 }
192
193 \ExplSyntaxOff
194
195
196 \def\sseq@error@hook{} % \sseq@error@hook is just used once in the isalive error handling to set \protect to relax. Probably a better way to do that...
197 \def\sseq@errorinfo{%
198 \sseq@error@annotation
199 \sseq@printstacktrace
200 }
201
202
203
204 \def\sseq@atbeginusermacro@msgsetup{%
205 \let\protect\empty % prevent issues if protected variables like \xmax are used as the loop max
206 \let\sseq@error@setup@errorinfo\sseq@error@setup@errorinfo@active % Install foreach error annotations
207 \let\sseq@error@setup\sseq@error@setup@withinfo
208 \sseq@opushstacktrace{\the\sseq@thiscalltoks}
209 }
210
211 \def\sseq@atbeginforeach@msgsetup{%
212 \let\protect\empty % prevent issues if protected variables like \xmax are used as the loop max
213 \let\sseq@error@setup@errorinfo\sseq@error@setup@errorinfo@active
214 \let\sseq@error@build@foreachvarsinfo\sseq@error@build@foreachvarsinfo@active % Install stack annotation
215 \let\sseq@error@inforeachloop\sseq@error@inforeachloop@active % install message indicating foreach variable values
216 \let\sseq@error@setup\sseq@error@setup@withinfo
217 \sseq@foreachcall\@xp{\string\foreach} % Stack gets pushed at the beginning of the body of the foreach loop once we know what the call looks like
218 }
219
220
221 \def\sseq@error@setup@errorinfo@active{%
222 \edef\tempa{\the\sseq@thiscalltoks}\edef\tempb{\the\sseq@foreachcall}
223 \ifx\tempa\tempb % We're at the beginning of a for loop
224 \sseq@seterrorannotation{atbeginforeach}
225 \else
226 \edef\tempb{\the\sseq@topofstacktrace}
227 \ifx\tempa\tempb % we're at the beginning of a user macro
228 \sseq@seterrorannotation{atbeginusercmd}
229 \else
230 % The top of the stack trace doesn't get included in the stack trace because it is assumed to be
231 % mentioned in the annotation. Since we aren't at the beginning of the foreach or usercmd,
232 % that means it won't be mentioned. Push an empty thing onto the stack so the innermost \foreach or usercommand is mentioned.
233 \sseq@pushstacktrace{}
234 \fi
235 \fi
236 }
237
238 %%
239 %% \sseq@checkend
240 %%
241 \def\sseq@checkend#1{
242 \def\sseq@tempa{#1}
243 \ifx\sseq@tempa\@currenvir\else % mismatch
244 \sseq@error@n{endenv-mismatch}{#1}
245 \csname end\@currenvir\endcsname % run the \end code for the correct environment
246 \def\@currenvir{#1} % Prevent \@checkend from throwing a second redundant error
247 \@xp\sseq@break % don't run the code \end for this environment
248 \fi
249 }
250
251
252
253
254
255 %%%
256 %%% Set up l3msg Hooks
257 %%%
258
259
260 \ExplSyntaxOn
261 \char_set_catcode_space:N\ % Needed to make pretocmd work -- there are always spaces after every command, and they need to be retokenized as spaces
262
263 \def\SseqErrorToWarning#1{\msg_redirect_name:nnn{spectralsequences}{#1}{warning}}
264 \let\sseqerrortowarning\SseqErrorToWarning
265 \def\sseq@quieterror#1{\msg_redirect_name:nnn{spectralsequences}{#1}{none}}
266
267 \def\sseq@error {\msg_error:nn {spectralsequences}}
268 \def\sseq@error@n {\msg_error:nnn {spectralsequences}}
269 \def\sseq@error@nn {\msg_error:nnnn {spectralsequences}}
270 \def\sseq@error@nnn {\msg_error:nnnnn {spectralsequences}}
271 \def\sseq@error@nnnn{\msg_error:nnnnnn{spectralsequences}}
272 \def\sseq@error@x {\msg_error:nnx {spectralsequences}}
273 \def\sseq@error@xx {\msg_error:nnxx {spectralsequences}}
274 \def\sseq@error@xxx {\msg_error:nnxxx {spectralsequences}}
275 \def\sseq@error@xxxx{\msg_error:nnxxxx{spectralsequences}}
276 \def\sseq@warning {\msg_warning:nn{spectralsequences}}
277
278 \def\sseq@newerror#1#2{\msg_new:nnn{spectralsequences}{#1}{#2\sseq@errorinfo}}
279 \def\sseq@newerror@internal#1#2{\msg_new:nnn{spectralsequences}{#1}{Internal error: #2 \sseq@openagithubissue}}
280 \edef\sseq@openagithubissue{Please report this on the github issue tracker which is at the following url: \sseq@issuetracker}
281
282
283 \cs_new_eq:NN \__sseq_hooked_msg_see_documentation_text:n \msg_see_documentation_text:n
284 \cs_new_eq:NN \__sseq_hooked_msg_fatal_code:nnnnnn \__msg_fatal_code:nnnnnn
285 \cs_new_eq:NN \__sseq_hooked_msg_error_code:nnnnnn \__msg_error_code:nnnnnn
286 \cs_new_eq:NN \__sseq_hooked_msg_warning_code:nnnnnn \__msg_warning_code:nnnnnn
287 \cs_new_eq:NN \__sseq_hooked_msg_info_code:nnnnnn \__msg_info_code:nnnnnn
288 \cs_new_eq:NN \__sseq_hooked_interupt_wrap:nnn \__msg_interrupt_wrap:nnn
289
290
291 \cs_new:Npn \sseq@installmsghooks {%
292 \cs_set_eq:NN \errmessage \sseq@errmessage
293 \cs_set_eq:NN \msg_see_documentation_text:n \__sseq_hooked_msg_see_documentation_text:n
294 \cs_set_eq:NN \__msg_fatal_code:nnnnnn \__sseq_hooked_msg_fatal_code:nnnnnn
295 \cs_set_eq:NN \__msg_error_code:nnnnnn \__sseq_hooked_msg_error_code:nnnnnn
296 \cs_set_eq:NN \__msg_warning_code:nnnnnn \__sseq_hooked_msg_warning_code:nnnnnn
297 \cs_set_eq:NN \__msg_info_code:nnnnnn \__sseq_hooked_msg_info_code:nnnnnn
298 \cs_set_eq:NN \__msg_interrupt_wrap:nnn \__sseq_hooked_interupt_wrap:nnn
299 }
300
301 \sseq@newerror@internal{msg-patch-failed}{Failed to patch the latex 3 message system. The errors will not be as expressive.}
302
303 \def\sseq@msgpatchfailed{
304 \msg_warning:nn{spectralsequences}{msg-patch-failed}
305 \def\sseq@installmsghooks{}
306 \sseq@break
307 }
308
309 \let\sseq@errmessage@std\errmessage
310 \def\sseq@errmessage#1{\sseq@error@setup\let\\\iow_newline:\sseq@errmessage@std{#1\sseq@error@annotation}\sseq@error@cleanup}
311
312 \pretocmd\__sseq_hooked_msg_see_documentation_text:n{\sseq@errorinfo}{}{\sseq@msgpatchfailed}
313
314
315 \pretocmd\__sseq_hooked_msg_fatal_code:nnnnnn {\sseq@error@setup} {}{\sseq@msgpatchfailed}
316 \pretocmd\__sseq_hooked_msg_error_code:nnnnnn {\sseq@error@setup} {}{\sseq@msgpatchfailed}
317 %\pretocmd\__sseq_hooked_msg_warning_code:nnnnnn{\sseq@msg@setup} {}{\sseq@msgpatchfailed}
318 %\pretocmd\__sseq_hooked_msg_info_code:nnnnnn {\sseq@msg@setup} {}{\sseq@msgpatchfailed}
319 \apptocmd\__sseq_hooked_msg_fatal_code:nnnnnn {\sseq@error@cleanup}{}{\sseq@msgpatchfailed}
320 \apptocmd\__sseq_hooked_msg_error_code:nnnnnn {\sseq@error@cleanup}{}{\sseq@msgpatchfailed}
321 %\apptocmd\__sseq_hooked_msg_warning_code:nnnnnn{\sseq@error@cleanup}{}{\sseq@msgpatchfailed}
322 %\apptocmd\__sseq_hooked_msg_info_code:nnnnnn {\sseq@error@cleanup}{}{\sseq@msgpatchfailed}
323 \patchcmd \__sseq_hooked_interupt_wrap:nnn {\str_count:N\l__msg_text_str-\str_count:N\l__msg_name_str +2} {2} {}{\sseq@msgpatchfailed}
324
325 \sseq@breakpoint
326
327
328
329 %%%%
330 %%%%
331 %%%% Error message definitions
332 %%%%
333 %%%%
334
335
336 %%
337 %%
338 %% checkdefinitions -- patch-failed errors
339 %%
340 %%
341 \@ifpackagelater{tikz}{2015/07/08}{
342 \sseq@newerror@internal{pgfkeys-patch-failed}{Failed to patch the key value system. Setting all commands to do nothing and quitting. Your copy of tikz is newer than the version spectralsequences was designed for and seems to be incompatible with core features.}
343 \sseq@newerror@internal{fit-patch-failed}{Failed to patch fit. \@nx\circleclasses won't work. Your copy of tikz is newer than the version spectralsequences was designed for and seems to be incompatible with \string\circleclasses.}
344 \sseq@newerror@internal{foreach-patch-failed}{Failed to patch \string\foreach. The errors spectralsequences provides will be less comprehensive. Your copy of tikz is newer than the version spectralsequences was designed for and seems to be incompatible with parts of the error handling system.}
345 \sseq@newerror@internal{circleclasses-not-provided}{\@nx\circleclasses won't work because your copy of tikz is too new. Instead I'm doing nothing.}
346 }{
347 \sseq@newerror{pgfkeys-patch-failed}{Failed to patch the key value system. Setting all commands to do nothing and quitting. Your copy of tikz is older than the version spectralsequences was designed for and seems to be incompatible with core features. Update tikz!}
348 \sseq@newerror{fit-patch-failed}{Failed to patch fit. \@nx\circleclasses won't work. Your copy of tikz is older than the version spectralsequences was designed for and seems to be incompatible with \string\circleclasses. Update tikz!}
349 \sseq@newerror{foreach-patch-failed}{Failed to patch \string\foreach. The errors spectralsequences provides will be less comprehensive. Your copy of tikz is older than the version spectralsequences was designed for and seems to be incompatible with parts of the error handling system.}
350 \sseq@newerror{circleclasses-not-provided}{\@nx\circleclasses won't work because your copy of tikz is too old. Instead I'm doing nothing. Update tikz!}
351 }
352
353
354 \def\sseq@pgfkeyspatchfailed {
355 \msg_critical:nn {spectralsequences} {pgfkeys-patch-failed}
356 }
357
358 \sseq@newerror@internal{expl3-incompatibility}{Since this version of spectralsequences, the expl3 definition of #1 was updated in an incompatible way.}
359
360 \sseq@newerror@internal{this-shouldnt-happen}{This branch of the code should be unreachable. Something really weird has happened. Error occurred in #1.}
361
362 % Convexity thing
363 \sseq@newerror{clip-not-convex}{The clip you provided to the "clip" option was not convex and the current edge intersects it more than two times. I'm not going to draw it.}
364
365
366 %%
367 %%
368 %% loadstore
369 %%
370 %%
371 \sseq@newerror@internal{illegal-add-background-mode}{\string#1 occurred in background mode.}
372
373
374
375 %%
376 %%
377 %% macromakers
378 %%
379 %%
380 \sseq@newerror@internal{U-xparse-incompatible}{The 'U' argument type is incompatible with the current version of xparse.}
381 \sseq@newerror{wont-override-builtin}{Macro '#1' is a spectralsequences built in and I won't override it. Try a different name.}
382 \sseq@newerror{usermacro-not-free}{Macro '#1' has already been defined using \string\DeclareSseqCommand, \string\NewSseqCommand, \string\DeclareSseqGroup, or \string\NewSseqGroup. I am overriding it. If this is what you intended, you should either use \@nx\DeclareSseqGroup or \string\DeclareSseqCommand, which won't complain.}
383
384 \sseq@newerror{macro-patch-failed}{Failed to patch macro '#1'. This is probably some annoying catcode issue. Try \@nx\tracingpatches to see more information about why the patch failed.}
385 \sseq@newerror{usermacro-unsupported-argument-type}{Unsupported argument type '#1'. All argument types in the 2017/05/29 release of xparse are supported except for v, e, and E.}
386
387 %%
388 %%
389 %% parsers
390 %%
391 %%
392 \sseq@newerror{classpattern-already-defined}{Class pattern '#1' already defined. Overwriting it.}
393 \sseq@newerror{classpattern-invalid-math-expression}{Expression '#1' encountered in class pattern definition is not a valid math expression. Skipping the definition.}
394 \sseq@newerror{classpattern-unexpected-token}{Unexpected token '#1' in class pattern definition. Skipping the definition.}
395 \sseq@newerror{classpattern-missing-tokens}{Incomplete class pattern definition. Skipping the definition.}
396 \sseq@newerror{classpattern-extra-coord-ignored}{Extra coordinate '#1' ignored in row #2. You probably forgot a semicolon.}
397 \sseq@newerror{classpattern-too-few-coords}{Too few coordinates in row #1.}
398
399 \sseq@newerror{classpattern-too-many-classes}{%
400 Too many classes in position #1. You are trying to add a #2th class, but the current class pattern is "#3" which only defines offset patterns for up to #4 classes.
401 If you need to have this many classes in this position, you can make your own class pattern with \string\sseqnewclasspattern, but you might want to consider alternatives like using one class to represent multiple generators in some way -- it is hard to make a diagram look good with large numbers of classes in one position.%
402 }
403
404 \sseq@newerror{invalid-coordinate}{Invalid #1coordinate\sseq@printforerrortype.}
405 \sseq@newerror{no-classes}{No classes yet exist in #1\sseq@printerrortype{, the }.}
406 \sseq@newerror{index-too-large}{Index '#1' provided\sseq@printforerrortype\ is too large -- only #2 classes exist at position #3.}
407 \sseq@newerror{undefined-tag}{Index '#1' provided\sseq@printforerrortype\ is not a valid integer expression or known tag in position #2.}
408 \sseq@newerror{class-no-tag}{The class #1 has no tag so I cannot get it.}
409
410 \sseq@newerror{class-extra-coords}{Too many coordinates. Ignoring the extra ones.}
411 \sseq@newerror{named-coordinate-class}{You can't pass a named coordinate to \string\class.}
412
413 \sseq@newerror{d-no-degree}{%
414 If you want to use the differential command \string\d\ you must either specify the grading of the differential or explicitly provide a target coordinate for the differential.
415 Specify the degree by providing 'degree={f(\#1)}{g(\#1)}' as an option to '\string\begin{sseqdata}',
416 where f(\#1) and g(\#1) are formulas for the x and y degree of the \#1th page differential. Alternatively, you may say e.g., '\string\d2(source)(target)'%
417 }
418 \sseq@newerror{d-named-coord-two-indexes}{You provided a named class and two indexes, but the named class already comes with an index so you can only provide one more for the target. Ignoring the second index.}% should be a warning
419 \sseq@newerror{d-target-index-target-coord}{You provided both a target index and a target coordinate, but this overdetermines the differential. Ignoring the target index.}
420 \sseq@newerror{d-wrong-degree}{Differential does not respect grading. The target should be in position #1 but instead it is #2 in position #3.}
421
422 \sseq@newerror{index-ignored} {The coordinate #1 is not a class, but it has an index '#3'. Ignoring the index and treating it as the literal position #2.}
423 \sseq@newerror{anchor-ignored} {The coordinate #1 is not a class, but it has an anchor '#3'. Ignoring the anchor and treating it as the literal position #2.}
424 \sseq@newerror{invalid-tikz-coord}{The coordinate #1 does not refer to a tikz class but its #2 coordinate is not valid \string\pgfmathparse\ input.}
425
426 % handlers
427 \sseq@newerror{NormalizeMonomial-invalid-exponent}{The exponent #1 of the variable #2 in the monomial #3 is not a valid integer expression. Giving up on processing this monomial -- I will leave it alone and hope for the best.}
428 \sseq@newerror{AHSSNameHandler-missing-cell}{The name #1 has no cell (an integer expression surrounded by brackets). Giving up on processing it and returning my input in \string\result.}
429 \sseq@newerror{AHSSNameHandler-invalid-integer}{The cell degree #1 of #2 is not a valid integer expression. I am leaving it alone, but I processed the monomial.}
430
431
432
433 %%
434 %%
435 %% foreach
436 %%
437 %%
438 \sseq@newerror{DoUntil-no-bound}{You used #1 but specified neither an x range nor a y range.}
439 \sseq@newerror{DoUntil-no-progress}{You used #1 but the loop body you provided seems to be making no progress towards the boundary.}
440 \sseq@newerror{Do-invalid-int-expr}{Argument "#2" to #1 is not a valid integer expression.}
441
442
443
444
445 %%
446 %%
447 %% keys
448 %%
449 %%
450
451 \def\sseq@possiblecurrentvalue{\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text\else=\pgfkeyscurrentvalue\fi}
452 \def\sseq@possiblecurrentvaluemean{\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text\else={\@xp\sseq@macrogobble\meaning\pgfkeyscurrentvalue}\fi}
453
454 \sseq@newerror{option-illegal}{%
455 You said '#1\sseq@possiblecurrentvalue', but the option '#1' is
456 illegal in the sseqdata and sseqpage environments#3.%
457 }
458 \sseq@newerror{option-illegal-as-global}{%
459 You passed '#1\sseq@possiblecurrentvalue' as a global option, but option '#1' is illegal as a global option.%
460 }
461 \sseq@newerror{option-global-only}{%
462 You said '#1\sseq@possiblecurrentvaluemean', but the option '#1' is
463 only allowed as a global option (as in '\string\begin{sseqdata}[#1\sseq@possiblecurrentvaluemean]'
464 or '\string\begin{sseqpage}[#1\sseq@possiblecurrentvaluemean]').%
465 }
466
467
468 % Applies to name and page. Saying "sseqs={name=somename}" is a bad idea.
469 \sseq@newerror{option-no-default-allowed}{%
470 You cannot set a default value for '#1'.% Try \@nx\sseqset{sseqs={#1\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text\else=\pgfkeyscurrentvalue\fi}}.%
471 }
472 \sseq@newerror{option-tikz-prims-only}{%
473 You can only use '#1' as an option for tikz primitives, not for \@nx\class, \@nx\replaceclass, \@nx\classoptions, \@nx\d, \@nx\doptions, \@nx\structline, or \@nx\structlineoptions.%
474 }
475
476 \sseq@newerror{invalid-intexpr}{The value '#2' provided for key '#1' is not a valid integer expression.}
477 \sseq@newerror{invalid-positive-intexpr}{The value '#2' provided for key '#1' does not evaluate to a positive integer.}
478 \sseq@newerror{invalid-dimenexpr}{The value '#2' provided for key '#1' is not a valid dimension expression.}
479 \sseq@newerror{invalid-color}{The value '#2' provided for key '#1' is not a valid color or color expression.}
480 \sseq@newerror{invalid-axis-type}{The value '#1' provided for '\sseq@axistypekey{#2}' is not valid. Valid values for '\sseq@axistypekey{#2}' are: \sseq@validaxestypes}
481
482 \sseq@newerror{det-one-after-scale}{You cannot use the option '#1\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text\else=\pgfkeyscurrentvalue\fi' as a global option after using 'xscale', 'yscale', or 'scale'. Please move '#1\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text\else=\pgfkeyscurrentvalue\fi' before any scaling options.}
483 \sseq@newerror{invalid-scale}{You said '#1scale=#2' as a global option, but '#2' is not a valid pgf math expression.}
484 \sseq@newerror{unit-scale}{You said '#1scale=#2' as a global option, but '#2' is not a scalar.}
485 \sseq@newerror{negative-scale}{You said '#1scale=#2' as a global option, but scaling by negative numbers is not allowed as a global option. Instead, please use the option '#1mirror', and then scale by the absolute value.}
486
487 \sseq@newerror{illegal-transform}{%
488 You said '#1\ifx\pgfkeyscurrentvalue\pgfkeysnovalue@text\else=\pgfkeyscurrentvalue\fi', but
489 no coordinate transforms are allowed in the body of sseqpage or sseqdata other than shifts by unit-free integers
490 except as options for tikz primitives or for scopes that only contain tikz primitives. If you need a coordinate transformation,
491 first use the option 'standard parse'.%
492 }
493
494 \sseq@newerror{unknown-key}{I do not know the key "\pgfkeyscurrentname".}
495 \sseq@newerror{unknown-global}{Undefined global option '\pgfkeyscurrentname\@xp\ifx\pgfkeyscurrentvalue\pgfkeysnovalue\else=\pgfkeyscurrentvalue\fi'.}
496
497 \sseq@newerror{scope-quotes}{Quotes are not allowed as options to a scope.}
498 \sseq@newerror{tikz-edge-quotes}{If you want to use quotes on a tikz edge, please provide it directly to the 'to' command e.g., \@nx\draw (0,0) to["hi"] (1,0);}
499
500 \sseq@newerror{change-style-data}{It's pointless to use 'change #1s' in the sseqdata environment. Try '#1s={##1}' instead.}
501 \sseq@newerror{change-style-standalone}{It's pointless to use 'change #1s' in a standalone sseqpage environment. Try '#1s={##1}' instead.}
502 \sseq@newerror{page-update-existing}{Option 'update existing' is only for the sseqdata environment.}
503 \sseq@newerror{page-no-name}{You can't specify a page but no name.}
504 \sseq@newerror{keep-changes-no-name}{Option 'keep changes' is only for named spectral sequences.}
505 \sseq@newerror{only-for-sseqpages}{Option '#1' is only for the sseqpage environment.}
506 \sseq@newerror{unknown-grid}{Undefined grid style '#1'.}
507 \sseq@newerror{unknown-class-pattern}{Unknown class pattern '\sseq@classpattern'.}
508 \sseq@newerror{class-placement-shift}{Shifts are illegal in the transformations applied in "class placement" key. If you want to shift your nodes, use \string\sseqnewclasspattern.} % #1 <- x shift, #2 <- shift amount
509 \sseq@newerror@internal{do-command-failed}{\string\sseq@pgfkeysdocommand{#1}{#2} failed.}
510
511 \sseq@newerror{standard-parse}{You cannot use \string#1 inside a scope that has either the background key or coordinate transformations other than integer shifts.}
512
513 \sseq@newerror{no-tooltip}{You cannot use the 'tooltip' option without either using the 'tooltips' package option or giving your own definition for '\string\sseqtooltip'.
514 Tooltips aren't enabled by default because they use the 'pdfcomment' package which creates two extra auxiliary files.%
515 }
516
517 %%
518 %%
519 %% main
520 %%
521 %%
522
523 \sseq@newerror{endenv-mismatch}{\string\begin {\@currenvir }\@currenvline \space ended by \string\end {#1}. I'm going to run the code for \string\end{\@currenvir} instead.}
524 \sseq@newerror{env-inside-tikz}{#1 environment started inside tikz.}
525 \sseq@newerror{env-inside-sseq}{#1 environment started inside other sseq environment.}
526 \sseq@newerror{env-data-no-name}{Every 'sseqdata' environment must have a name. Specify one by saying 'name=your sseq name'.}
527 \sseq@newerror{env-data-already-exist}{A spectral sequence with the name '#1' already exists; updating it. If you want to add to an already existing spectral sequence, please pass the option 'update existing'.} % warning
528 \sseq@newerror{env-page-not-exist}{No spectral sequence named '#1' exists. Making a new one.} % warning
529
530
531 \sseq@newerror{is-alive-illegal-here}{You can't use \@nx\isalive outside of a page constraint for a tikz primitive.}
532
533 \sseq@newerror{no-range}{Empty spectral sequence. For every spectral sequence you must either specify both the "x range" and "y range" or include at least one
534 \string\class.} % maybe warning?
535 \sseq@newerror{range-overflow}{The #1 range #2 is too large. The maximum #1 range to fit on the page with the current #1scale and plot options is #1max - #1min = #3. The maximum #1scale possible with the current #1range is #4. Either change the scale or the range as appropriate.}
536 \sseq@newerror{range-super-overflow}{The #1 range #2 is too large. The maximum range possible is #1max - #1min = 16383 because of internal limitations of etex. }
537
538 \sseq@newerror{index-out-of-bounds}{Index #1 is greater than or equal to the current stack depth #2. Valid indices must be strictly less than the stack depth.}
539 \sseq@newerror{incomplete-tikz}{Incomplete tikz expression. What I have so far is #1 and I am stopping because I ran into #2. You probably forgot a semicolon.}
540
541
542 \sseq@newerror{cmdoptions-only}{You can only use the '#1' option with #2, not with #3.} % warning
543 \sseq@newerror{cmdoptions-without-options}{There is no reason to use \string#1 without giving options.} % warning
544 \sseq@newerror{cmdoptions-feature-doesn't-exist}{There is no #1 of the form '\sseq@thiscall' so I can't add options to it.}
545
546 \sseq@newerror{classoptions-already-dead}{Generation #1 of the class #2 perished on page #3 so there is no reason to add an option to it on page \sseq@thepage.}
547 \sseq@newerror{classoptions-not-yet-born}{Generation #1 of the class #2 is not yet present on page \sseq@thepage\ so there is no reason to add an option to it.}
548 \sseq@newerror{classoptions-page-gen}{Don't use both "page" and "generation" for the same \@nx\classoption command.} % warning
549 \sseq@newerror{classoptions-class-already-named}{The class \coord\ already is named '\sseq@obj{class.\classname.name}'. Overwriting it. Use \@nx\nameclass if you want to give it a second name.}%warning
550 \sseq@newerror{doptions-invisible}{Cannot add options to invisible differential.}
551 \sseq@newerror{doptions-no-effect-on-this-page}{Adding an option to a differential on page #1 when the current page is \sseq@thepage\ and the 'keep changes' option is not present has no effect.}
552
553 \sseq@newerror{class-tag-already-defined}{A class with tag '#1' is already defined in position #2. Overwriting it.} % warning
554
555 \sseq@newerror{replaceclass-not-dead-yet}{I cannot replace the class at #1 because it seems to be alive and well.}
556 \sseq@newerror{replaceclass-no-effect-on-this-page}{The class at #1 died on page #2 so replacing it only affects pages after #3, but the current page is \sseq@thepage.} % warning
557 \sseq@newerror{replacestructlines-class-not-replaced}{I cannot replace the structlines on #1 because it has not been replaced.}
558
559
560 \sseq@newerror{d-invalid-page}{Invalid page '#1'.}
561 \sseq@newerror{d-class-already-hit}{% #1 <-#3, #2 <-\csname #3name\endcsname, #3 <- #2, #4 <- \unexpanded\@xpthree{\sseq@obj{\[email protected]}}
562 The #1 #2 of differential \sseq@thiscall\ on page #3 has already been the #4.
563 Use \string\replaceclass#2 before \sseq@thiscall.%
564 }
565 \sseq@newerror{d-class-has-extension}{The #1 #2 of differential \sseq@thiscall\ on page #3 has already been involved in an extension. If you are planning to replace it, move the \string\extension\ after the call to \string\replaceclass.}
566 \sseq@newerror{d-hit-same-page-replaceclass}{%#1 <- #3, #2 <- \csname #3name\endcsname, #3 <- #2, #3 <-\sseq@obj{#1[\the\sseq@tempcount].deathinfo},
567 The #1 #2 of differential \sseq@thiscall\ was the #3.
568 If multiple differentials touch a class on the same page, they cannot be separated by a \@nx\replaceclass command.%
569 }
570 \sseq@newerror{d-hit-wrong-order}{%
571 The #1 #2 of differential \sseq@thiscall\ on page #3 has already been the #4.
572 First use the shorter differential, then \string\replaceclass#2, then the longer differential.%
573 }
574
575
576 \sseq@newerror{structline-no-page-max}{You cannot provide \@nx\structline with the option "page=min--max", only with "page=min".} %warning
577 \sseq@newerror{structline-already-exists}{Cannot add a structline from #1 to #2 because such a structline already exists.}
578 \sseq@newerror{structline-stillborn}{#1 dies before it is born. Perhaps you meant to specify a different source or target?}
579 \sseq@newerror{extension-stillborn}{Either the source or target of extension is not currently alive. Perhaps you meant to specify a different source or target? Perhaps you forgot a call to \@nx\replaceclass?}
580 \sseq@newerror{edge-source-target-equal}{The source and target of a #1 cannot be equal.}
581
582
583 \protected\def\sseq@quiet{\msg_redirect_module:nnn{spectralsequences}{error}{info}}
584 \protected\def\sseq@endquiet{}
585
586 \ExplSyntaxOff