summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/witharrows/witharrows.sty
blob: 8f4add2a4bf1a19bac0945eb3a56dca4689e84ad (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
%%
%% This is file `witharrows.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% witharrows.dtx  (with options: `package')
%% 
%% Copyright (C) 2017 by F. Pantigny
%% 
%% This file 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.
%% 
\def\myfileversion{1.3}
\def\myfiledate{2018/01/11}
\RequirePackage{tikz}
\usetikzlibrary{calc,arrows.meta,bending}
\RequirePackage{l3keys2e}
\ProvidesExplPackage
  {witharrows}
  {\myfiledate}
  {\myfileversion}
  {Draws arrows for explanations on the right}
\RequirePackage{xparse}
\RequirePackage{footnote}
\tikzset{__wa_node_style/.style={
               above = \l__wa_ystart_dim,
               inner~sep = 0 pt,
               minimum~width = 0pt,
               minimum~height = \l__wa_ygap_dim,
               red,
               \bool_if:NT \l__wa_shownodes_bool {draw}}}
\tikzset{TipsOfWithArrows/.style= { > = {Straight~Barb[scale=1.2,bend]}} }
\cs_if_free:NT \spread@equation
    {\cs_set:Npn \spread@equation{\openup\jot
                                  \cs_set_eq:NN \spread@equation \prg_do_nothing}}
\seq_new:N \g__wa_position_in_the_tree_seq
\seq_gput_right:Nn \g__wa_position_in_the_tree_seq 1
\int_new:N \g__wa_last_env_int
\int_new:N \l__wa_level_int
\skip_new:N \l__wa_interline_skip
\bool_new:N \l__wa_MoreColumns_bool
\int_new:N \l__wa_pos_env_int
\int_new:N \l__wa_pos_arrows_int
\int_new:N \l__wa_previous_pos_arrows_int
\dim_new:N \l__wa_ygap_dim
\dim_set:Nn \l__wa_ygap_dim {0.4 ex}
\dim_new:N \l__wa_ystart_dim
\dim_set:Nn \l__wa_ystart_dim {0.4 ex}
\dim_new:N \l__wa_xoffset_dim
\dim_set:Nn \l__wa_xoffset_dim {3mm}
\bool_new:N \l__wa_shownodes_bool
\bool_new:N \l__wa_shownodenames_bool
\bool_new:N \l__wa_displaystyle_bool
\tl_clear_new:N \l__wa_options_tikz_tl
\dim_new:N \g__wa_x_dim
\seq_new:N \g__wa_arrow_int_seq
\int_new:N \g__wa_arrow_int
\seq_new:N \g__wa_line_int_seq
\int_new:N \g__wa_line_int
\seq_new:N \g__wa_line_bis_int_seq
\int_new:N \g__wa_line_bis_int

\keys_define:nn {WithArrows/GlobalOrEnv}
   {  t   .code:n            = {\int_set:Nn \l__wa_pos_env_int 0},
      t   .value_forbidden:n = true,
      c   .code:n            = {\int_set:Nn \l__wa_pos_env_int 1},
      c   .value_forbidden:n = true,
      b   .code:n            = {\int_set:Nn \l__wa_pos_env_int 2},
      b   .value_forbidden:n = true,
      ygap .dim_set:N        = \l__wa_ygap_dim,
      ygap .value_required:n = true,
      ystart .dim_set:N        = \l__wa_ystart_dim,
      ystart .value_required:n = true,
      MoreColumns .bool_set:N        = \l__wa_MoreColumns_bool,
      MoreColumns .value_forbidden:n = true,
      CommandName .tl_set:N         = \l__wa_CommandName_tl,
      CommandName .initial:n        = {Arrow},
      CommandName .value_required:n = true,
      displaystyle .bool_set:N     = \l__wa_displaystyle_bool,
      shownodes .bool_set:N        = \l__wa_shownodes_bool,
      shownodenames .bool_set:N    = \l__wa_shownodenames_bool,
      group    .code:n    = {\int_compare:nNnT \l__wa_previous_pos_arrows_int > {-1}
                                    {\msg_error:nn {witharrows}
                                                   {Two~options~are~incompatible}}
                             \int_set:Nn \l__wa_previous_pos_arrows_int 5
                             \int_set:Nn \l__wa_pos_arrows_int 5},
      group    .value_forbidden:n = true,
      groups   .code:n   = {\int_compare:nNnT \l__wa_previous_pos_arrows_int > {-1}
                                   {\msg_error:nn {witharrows}
                                                  {Two~options~are~incompatible}}
                            \int_set:Nn \l__wa_previous_pos_arrows_int 6
                            \int_set:Nn \l__wa_pos_arrows_int 6},
      groups   .value_forbidden:n = true}
\keys_define:nn {WithArrows}
     {tikz     .code:n            = {\tl_put_right:Nn \l__wa_options_tikz_tl {,#1}},
      tikz     .value_required:n  = true,
      rr       .value_forbidden:n = true,
      rr       .code:n            = {\__wa_analyze_option_position:n 0},
      ll       .value_forbidden:n = true,
      ll       .code:n            = {\__wa_analyze_option_position:n 1},
      rl       .value_forbidden:n = true,
      rl       .code:n            = {\__wa_analyze_option_position:n 2},
      lr       .value_forbidden:n = true,
      lr       .code:n            = {\__wa_analyze_option_position:n 3},
      i        .value_forbidden:n = true,
      i        .code:n            = {\__wa_analyze_option_position:n 4},
      xoffset  .code:n  = {\bool_if:nTF {\int_compare_p:nNn \l__wa_level_int = 2 &&
                                         \int_compare_p:nNn \l__wa_pos_arrows_int > 4}
                               {\msg_error:nn {witharrows}
                                              {Option~incompatible~with~"group(s)"}}
                               {\dim_set:Nn \l__wa_xoffset_dim {#1}}},
      xoffset  .value_required:n  = true,
      jot       .code:n     = {\int_compare:nNnTF \l__wa_level_int = 1
                                  {\dim_set:Nn \jot {#1}}
                                  {\msg_error:nn {witharrows} {Option~will~be~ignored} }},
      jot       .value_required:n  = true,
      interline   .code:n       = {\int_compare:nNnTF \l__wa_level_int = 1
                                      {\skip_set:Nn \l__wa_interline_skip {#1}}
                                      {\msg_error:nn {witharrows} {Option~will~be~ignored}}},
      interline   .value_required:n = true,
      jump    .code:n  = {\msg_error:nn {witharrows} {Option~will~be~ignored}},
      unknown .code:n  = {\msg_error:nn {witharrows} {Option~unknown}}
}
\keys_define:nn {WithArrows/jump}
     {jump  .code:n     = {\int_set:Nn \l__wa_jump_int {#1}
                           \int_compare:nNnF \l__wa_jump_int > 0
                               {\msg_error:nn {witharrows}
                                              {The~option~"jump"~must~be~non~negative}}},
      jump  .value_required:n  = true}
\cs_new_protected:Nn \__wa_analyze_option_position:n
     {\int_compare:nNnT \l__wa_previous_pos_arrows_int > {-1}
        {\msg_error:nn {witharrows}
                       {Two~options~are~incompatible}}
      \int_set:Nn \l__wa_previous_pos_arrows_int {#1}
      \bool_if:nTF { \int_compare_p:nNn \l__wa_level_int = 2 &&
                     \int_compare_p:nNn \l__wa_pos_arrows_int > 4}
         {\msg_error:nn {witharrows}
                        {Option~incompatible~with~"group(s)"}}
         {\int_set:Nn \l__wa_pos_arrows_int {#1}}}
\ProcessKeysOptions {WithArrows}
\NewDocumentCommand \WithArrowsOptions {m}
    {\int_set:Nn \l__wa_previous_pos_arrows_int {-1}
     \keys_set_known:nnN {WithArrows} {#1} \l_tmpa_tl
     \keys_set:nV {WithArrows/GlobalOrEnv} \l_tmpa_tl}
\NewDocumentCommand \__wa_Arrow {O{} m O{}}
         {\tl_if_eq:noF {WithArrows} {\@currenvir}
                  {\msg_error:nn {witharrows} {Arrow~used~outside~{WithArrows}~environment}}
          \int_gincr:N \g__wa_arrow_int
          \int_zero_new:N \l__wa_jump_int
          \int_set:Nn \l__wa_jump_int 1
          \keys_set_known:nnN {WithArrows/jump} {#1,#3} \l_tmpa_tl
          \prop_put:NnV \l_tmpa_prop {initial} \g__wa_line_int
          \int_set:Nn \l_tmpa_int {\g__wa_line_int + \l__wa_jump_int}
          \prop_put:NnV \l_tmpa_prop {final} \l_tmpa_int
          \prop_put:NnV \l_tmpa_prop {options} \l_tmpa_tl
          \prop_put:Nnn \l_tmpa_prop {label} {#2}
          \prop_gclear_new:c
                {g__wa_arrow_\l__wa_prefix_tl _\int_use:N\g__wa_arrow_int _prop}
          \prop_gset_eq:cN
                {g__wa_arrow_\l__wa_prefix_tl _\int_use:N\g__wa_arrow_int _prop}
                \l_tmpa_prop
          }
\cs_new_protected:Nn \__wa_Arrow_first_column:
               {\tl_set:Nn \l_tmpa_tl {Arrow}
                \msg_error:nn {witharrows} {Arrow~in~first~column}
                \__wa_Arrow}
\NewDocumentEnvironment {WithArrows} {O{}}
         { \seq_gput_right:NV \g__wa_arrow_int_seq \g__wa_arrow_int
           \int_gzero:N \g__wa_arrow_int
           \seq_gput_right:NV \g__wa_line_int_seq \g__wa_line_int
           \int_gzero:N \g__wa_line_int
           \seq_gput_right:NV \g__wa_line_bis_int_seq \g__wa_line_bis_int
           \int_gzero:N \g__wa_line_bis_int
           \seq_gput_right:Nn \g__wa_position_in_the_tree_seq 1
           \seq_set_eq:NN \l_tmpa_seq \g__wa_position_in_the_tree_seq
           \seq_pop_right:NN \l_tmpa_seq \l_tmpa_tl
           \tl_clear_new:N \l__wa_prefix_tl
           \tl_set:Nx \l__wa_prefix_tl {\seq_use:Nnnn \l_tmpa_seq {-} {-} {-}}

           \reverse_if:N \if_mode_math:
                             \msg_error:nn {witharrows} {{WithArrows}~used~outside~math~mode}
                         \fi
           \savenotes
           \cs_set_eq:NN \\ \__wa_cr:
           \mathsurround = \c_zero_dim
           \int_zero_new:N \l__wa_initial_int
           \int_zero_new:N \l__wa_final_int
           \int_zero_new:N \l__wa_arrow_int
           \skip_zero:N \l__wa_interline_skip
           \int_set:Nn \l__wa_previous_pos_arrows_int {-1}
           \int_set:Nn \l__wa_level_int 1
           \keys_set_known:nnN {WithArrows} {#1} \l_tmpa_tl
           \keys_set:nV {WithArrows/GlobalOrEnv} \l_tmpa_tl
           \cs_set_eq:cN \l__wa_CommandName_tl \__wa_Arrow
           \int_case:nn \l__wa_pos_env_int
                   {0 {\vtop}
                    1 {\vcenter}
                    2 {\vbox}}
           \bgroup
           \spread@equation
           \ialign\bgroup
           \int_gincr:N \g__wa_line_int
           \cs_set_eq:cN \l__wa_CommandName_tl \__wa_Arrow_first_column:
           \strut\hfil
           $\bool_if:NT \l__wa_displaystyle_bool \displaystyle {##}$
           &
           \int_gincr:N \g__wa_line_bis_int
           $\bool_if:NT \l__wa_displaystyle_bool \displaystyle {{}##}$
           \tikz[remember~picture,overlay]
                  \node[__wa_node_style]
                     (wa-\tl_use:N\l__wa_prefix_tl-\int_use:N\g__wa_line_int-l) {} ;
           \hfil
           \tikz[remember~picture,overlay]
                  \node[__wa_node_style]
                    (wa-\tl_use:N\l__wa_prefix_tl-\int_use:N\g__wa_line_int-r) {} ;
           \bool_if:NT \l__wa_shownodenames_bool
                {\hbox_overlap_right:n {\small wa-\tl_use:N\l__wa_prefix_tl
                                                 -\int_use:N\g__wa_line_int}}
           && \bool_if:NF \l__wa_MoreColumns_bool
                {\msg_error:nn {witharrows} {Third~column~in~a~{WithArrows}~environment}}
           $\bool_if:NT \l__wa_displaystyle_bool \displaystyle {##}$
           \cr
          }
          {\crcr
           \egroup
           \egroup
           \int_compare:nNnT \g__wa_line_bis_int < \g__wa_line_int
                  {\msg_error:nn {witharrows} {All~lines~must~have~an~ampersand}}
            \int_compare:nNnT \g__wa_arrow_int > 0
                  {\int_compare:nNnTF \l__wa_pos_arrows_int > 4
                    \__wa_draw_arrows:
                    {\__wa_draw_arrows:nn 1 \g__wa_arrow_int}}
           \spewnotes
           \seq_gpop_right:NN \g__wa_position_in_the_tree_seq \l_tmpa_tl
           \seq_gpop_right:NN \g__wa_position_in_the_tree_seq \l_tmpa_tl
           \seq_gput_right:Nx \g__wa_position_in_the_tree_seq {\int_eval:n {\l_tmpa_tl + 1}}
           \int_compare:nNnT {\seq_count:N \g__wa_position_in_the_tree_seq} = 1
                      {\int_gincr:N \g__wa_last_env_int}
           \seq_gpop_right:NN \g__wa_arrow_int_seq {\l_tmpa_tl}
           \int_gset:Nn \g__wa_arrow_int {\l_tmpa_tl}
           \seq_gpop_right:NN \g__wa_line_int_seq \l_tmpa_tl
           \int_gset:Nn \g__wa_line_int {\l_tmpa_tl}
           \seq_gpop_right:NN \g__wa_line_bis_int_seq \l_tmpa_tl
           \int_gset:Nn \g__wa_line_bis_int {\l_tmpa_tl}
           }
\cs_set_protected:Nn \__wa_cr:
      {\scan_stop:
       \group_align_safe_begin:
       \peek_meaning_remove:NTF * \__wa_cr_i: \__wa_cr_i:}
\cs_set_protected:Nn \__wa_cr_i:
      {\peek_meaning:NTF [ {\__wa_cr_ii:} {\__wa_cr_ii:[\c_zero_dim]} }
\cs_new_protected:Npn \__wa_cr_ii:[#1]
      {\group_align_safe_end:
       \cr\noalign{\skip_vertical:n {#1 + \l__wa_interline_skip}
       \scan_stop:}}
\cs_new_protected:Nn \__wa_draw_arrows:
  { \group_begin:
    \int_zero_new:N \l__wa_first_arrow_of_group_int
    \int_zero_new:N \l__wa_first_line_of_group_int
    \int_zero_new:N \l__wa_last_line_of_group_int
    \bool_set_true:N \l__wa_new_group_bool
    \int_set:Nn \l__wa_arrow_int 1
    \int_until_do:nNnn \l__wa_arrow_int > \g__wa_arrow_int
     {
       \prop_get:cnN {g__wa_arrow_\l__wa_prefix_tl _\int_use:N\l__wa_arrow_int _prop}
                     {initial} \l_tmpa_tl
       \int_set:Nn \l__wa_initial_int {\l_tmpa_tl}
       \prop_get:cnN {g__wa_arrow_\l__wa_prefix_tl _\int_use:N\l__wa_arrow_int _prop}
                     {final} \l_tmpa_tl
       \int_set:Nn \l__wa_final_int {\l_tmpa_tl}
       \bool_if:nT {     \int_compare_p:nNn \l__wa_pos_arrows_int = 6
                      && \int_compare_p:nNn \l__wa_arrow_int > 1
                      && \int_compare_p:nNn \l__wa_initial_int > \l__wa_last_line_of_group_int}
              {\__wa_draw_arrows:nn \l__wa_first_arrow_of_group_int {\l__wa_arrow_int - 1}
               \bool_set_true:N \l__wa_new_group_bool}
       \bool_if:nTF \l__wa_new_group_bool
              {\bool_set_false:N \l__wa_new_group_bool
               \int_set:Nn \l__wa_first_arrow_of_group_int \l__wa_arrow_int
               \int_set:Nn \l__wa_first_line_of_group_int \l__wa_initial_int
               \int_set:Nn \l__wa_last_line_of_group_int \l__wa_final_int
               \tikz[remember~picture]
                  \path let \p1 = (wa-\tl_use:N\l__wa_prefix_tl-\int_use:N\l__wa_initial_int-l)
                        in \pgfextra {\dim_gset:Nn \g__wa_x_dim {\x1}} ;
              }
              {\int_set:Nn \l__wa_last_line_of_group_int
                     {\int_max:nn \l__wa_last_line_of_group_int \l__wa_final_int}}
       \__wa_actualise_x_value:nn \l__wa_initial_int \l__wa_final_int
       \int_incr:N \l__wa_arrow_int
     }
     \__wa_draw_arrows:nn \l__wa_first_arrow_of_group_int \g__wa_arrow_int
     \group_end:
  }
\cs_generate_variant:Nn \keys_set:nn {no}
\cs_new_protected:Nn \keys_set_WithArrows: {\keys_set:no {WithArrows}}
\cs_new_protected:Nn \__wa_draw_arrows:nn
  {\group_begin:
   \int_zero_new:N \l__wa_first_arrow_int
   \int_set:Nn \l__wa_first_arrow_int {#1}
   \int_zero_new:N \l__wa_last_arrow_int
   \int_set:Nn \l__wa_last_arrow_int {#2}
   \int_set:Nn \l__wa_arrow_int \l__wa_first_arrow_int
   \int_until_do:nNnn \l__wa_arrow_int > \l__wa_last_arrow_int
     {
      \prop_get:cnN {g__wa_arrow_\l__wa_prefix_tl _\int_use:N\l__wa_arrow_int _prop}
                    {initial} \l_tmpa_tl
      \int_set:Nn \l__wa_initial_int {\l_tmpa_tl}
      \prop_get:cnN {g__wa_arrow_\l__wa_prefix_tl _\int_use:N\l__wa_arrow_int _prop}
                    {final} \l_tmpa_tl
      \int_set:Nn \l__wa_final_int {\l_tmpa_tl}
      \int_compare:nNnT \l__wa_final_int > \g__wa_line_int
             {\msg_fatal:nn {witharrows} {Too~few~lines~for~an~arrow}}
      \group_begin:
      \int_set:Nn \l__wa_previous_pos_arrows_int {-1}
      \int_set:Nn \l__wa_level_int 2
      \prop_get:cnN {g__wa_arrow_\l__wa_prefix_tl
                        _\int_use:N\l__wa_arrow_int _prop} {options} \l_tmpa_tl
      \exp_args:NNo \exp_args:No \keys_set_WithArrows: {\l_tmpa_tl}
      \bool_set_false:N \l__wa_initial_r_bool
      \bool_set_false:N \l__wa_final_r_bool
      \int_case:nn \l__wa_pos_arrows_int
             {0 {\bool_set_true:N \l__wa_initial_r_bool
                 \bool_set_true:N \l__wa_final_r_bool}
              2 {\bool_set_true:N \l__wa_initial_r_bool}
              3 {\bool_set_true:N \l__wa_final_r_bool}}
      \int_compare:nNnT \l__wa_pos_arrows_int = 4
             {
              \tikz[remember~picture]
              \path let \p1 = (wa-\tl_use:N\l__wa_prefix_tl-\int_use:N\l__wa_initial_int-l)
                    in \pgfextra {\dim_gset:Nn \g__wa_x_dim {\x1}} ;
              \__wa_actualise_x_value:nn \l__wa_initial_int \l__wa_final_int
              }
      \tl_set:Nx \l__wa_initial_tl
              {wa-\tl_use:N\l__wa_prefix_tl-\int_use:N\l__wa_initial_int-
                       \bool_if:NTF\l__wa_initial_r_bool rl .south}
      \tl_set:Nx \l__wa_final_tl
              {wa-\tl_use:N\l__wa_prefix_tl-\int_use:N\l__wa_final_int-
                       \bool_if:NTF\l__wa_final_r_bool rl .north}
      \begin{tikzpicture}[remember~picture,
                          overlay,
                          align=left,
                          auto=left,
                          font = {\small\itshape},
                          TipsOfWithArrows,
                          ->,
                          looseness=1,
                          bend~left=45]
      \prop_get:cnN {g__wa_arrow_\l__wa_prefix_tl _\int_use:N\l__wa_arrow_int _prop}
                    {label} \l_tmpa_tl
      \draw \exp_after:wN [\l__wa_options_tikz_tl]
            let \p1 = (\tl_use:N \l__wa_initial_tl),
                \p2 = (\tl_use:N \l__wa_final_tl) in
              (\int_compare:nNnTF \l__wa_pos_arrows_int > 3
                {\dim_use:N \g__wa_x_dim + \dim_use:N \l__wa_xoffset_dim, \y1}
                {\x1 + \dim_use:N \l__wa_xoffset_dim, \y1} )
              to node [node~contents = {\tl_use:N \l_tmpa_tl}] {}
              (\int_compare:nNnTF \l__wa_pos_arrows_int > 3
                {\dim_use:N \g__wa_x_dim + \dim_use:N \l__wa_xoffset_dim, \y2}
                {\x2 + \dim_use:N \l__wa_xoffset_dim, \y2} ) ;
      \end{tikzpicture}
      \group_end:
      \int_incr:N \l__wa_arrow_int
      }
      \group_end:
     }
\cs_new_protected:Nn \__wa_actualise_x_value:nn
    {\group_begin:
     \int_set:Nn \l__wa_initial_int {#1}
     \int_set:Nn \l__wa_final_int {#2}
     \int_compare:nNnT \l__wa_final_int > \g__wa_line_int
             {\msg_error:nn {witharrows} {Too~few~lines~for~an~arrow}}
     \int_set:Nn \l_tmpa_int \l__wa_initial_int
     \int_until_do:nNnn \l_tmpa_int > \l__wa_final_int
         {\tikz[remember~picture]
             \path let \p1 = (wa-\tl_use:N\l__wa_prefix_tl-\int_use:N\l_tmpa_int-l)
                   in \pgfextra {\dim_gset:Nn \g__wa_x_dim {\dim_max:nn \g__wa_x_dim {\x1}}} ;
          \int_incr:N \l_tmpa_int
         }
     \group_end:
    }
\cs_generate_variant:Nn \tl_if_eq:nnF {noF}
\NewDocumentCommand \WithArrowsLastEnv {}
     {\int_use:N \g__wa_last_env_int}
\msg_new:nnn {witharrows}
             {Third~column~in~a~{WithArrows}~environment}
             {By~default,~a~\{WithArrows\}~environment~can~only~have~two~columns.~
              Maybe~you~have~forgotten~a~newline~symbol.~If~you~really~want~
              more~than~two~columns,~you~should~use~the~option~"MoreColumns"~at~
              a~global~level~or~for~an~environment.~However,~you~can~go~one~for~this~time.}
\msg_new:nnn {witharrows}
             {Arrow~used~outside~{WithArrows}~environment}
             {The~command~\token_to_str:N\Arrow\ should~be~used~only~directly~
              in~\{WithArrows\}~environment~and~not~in~a~subenvironment.~However,~you~
              can~go~on.}
\msg_new:nnn {witharrows}
             {The~option~"jump"~must~be~non~negative}
             {You~can't~use~a~strictly~negative~value~for~the~option~"jump"~of~command~
              \token_to_str:N\Arrow.~ You~can~create~an~arrow~going~backwards~with~
              the~option~"<-"~of~Tikz.}
\msg_new:nnn {witharrows}
             {Too~few~lines~for~an~arrow}
             {There~is~at~least~an~arrow~that~can't~be~drawn~because~it~arrives~after~the~
              last~line~of~the~environment.}
\msg_new:nnn {witharrows}
             {{WithArrows}~used~outside~math~mode}
             {The~environment~\{WithArrows\}~should~be~used~only~in~math~mode.~
              Nevertheless,~you~can~go~on.}
\msg_new:nnn  {witharrows}
              {Two~options~are~incompatible}
              {You~try~to~use~the~option~"\tl_use:N\l_keys_key_tl"~but~
              this~option~is~incompatible~or~redundant~with~the~option~"
              \int_case:nn\l__wa_previous_pos_arrows_int
                  {0 {rr}
                   1 {ll}
                   2 {rl}
                   3 {lr}
                   4 {i}
                   5 {group}
                   6 {groups}}"~
              previously~set~in~the~same~
              \int_case:nn\l__wa_level_int
                   {0 {command~\token_to_str:N\WithArrowsOptions}
                    1 {declaration~of~options~of~the~environment~\{WithArrows\}}
                    2 {command~\token_to_str:N\Arrow}}.~
              If~you~go~on,~I~will~overwrite~the~first~option.}
\msg_new:nnnn {witharrows}
              {All~lines~must~have~an~ampersand}
              {All~lines~of~an~environment~\{WithArrows\}~must~have~an~second~column~
               (because~the~nodes~are~created~in~the~second~column).~You~can~go~on~but~maybe~
               you~will~have~an~pgf~error~for~an~undefined~shape.}
              {The~ampersand~can~be~implicit~
               (e.g.~if~you~use~\token_to_str:N\MoveEqLeft\ of~mathtools).}
\msg_new:nnn {witharrows}
             {Option~incompatible~with~"group(s)"}
             {You~try~to~use~the~option~"\tl_use:N\l_keys_key_tl"~while~
              you~are~using~the~option~"
              \int_compare:nNnTF \l__wa_pos_arrows_int = 5
                   {group}
                   {groups}".~
              It's~incompatible.~You~can~go~on~ignoring~this~option~
              "\tl_use:N\l_keys_key_tl"~but~you~should~correct~your~code.}
\msg_new:nnn {witharrows}
             {Option~will~be~ignored}
             {The~option~"\tl_use:N\l_keys_key_tl"~can't~be~used~here.~
              If~you~go~on,~it~will~be~ignored.}
\msg_new:nnn {witharrows}
             {Option~unknown}
             {The~option~"\tl_use:N\l_keys_key_tl"~is~unknown~or~meaningless~in~the~context.~
              If~you~go~on,~it~will~be~ignored.}
\msg_new:nnn {witharrows}
             {Arrow~in~first~column}
             {You~should~not~use~the~command~\token_to_str:N\Arrow\
              \tl_if_eq:NNF \l__wa_CommandName_tl \l_tmpa_tl
                    {(renamed~in~\str_use:N \c_backslash_str
                     \tl_use:N \l__wa_CommandName_tl)~}
              ~in~the~first~column~but~only~in~the~second~column.~
              This~is~a~restriction~of~the~version~1.3~of~the~
              package~witharrows~(in~the~aim~of~developping~further~
              ~a~new~functionality~with~\token_to_str:N\Arrow\ in~the~
              first~column).\\
              However~you~can~go~on~for~this~time.}
\endinput
%%
%% End of file `witharrows.sty'.