summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/witharrows/witharrows.sty
blob: e7809aa70b2634281303895bc6d5434d0e106338 (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
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
%%
%% This is file `witharrows.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% witharrows.dtx  (with options: `package')
%% 
%% Copyright (C) 2017-2018 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.13}
\def\myfiledate{2018/12/31}
\RequirePackage{tikz}
\usetikzlibrary{arrows.meta,bending}
\RequirePackage{expl3}[2018-01-01]
\RequirePackage{l3keys2e}
\ProvidesExplPackage
  {witharrows}
  {\myfiledate}
  {\myfileversion}
  {Draws arrows for explanations on the right}
\RequirePackage{xparse}
\bool_new:N \g__wi_footnotehyper_bool
\bool_new:N \g__wi_footnote_bool
\int_new:N \l__wi_level_int
\keys_define:nn {WithArrows/package}
      {footnote      .bool_gset:N = \g__wi_footnote_bool,
       footnotehyper .bool_gset:N = \g__wi_footnotehyper_bool,
       unknown       .code:n      = \msg_fatal:nn {witharrows}
                                         {Option~unknown~for~package}}
\msg_new:nnn {witharrows}
             {Option~unknown~for~package}
             {You~can't~use~the~option~"\tl_use:N\l_keys_key_tl"~when~loading~the~
              package~witharrows.}
\ProcessKeysOptions {WithArrows/package}
\msg_new:nnn {witharrows}
             {Option~incompatible~with~Beamer}
             {The~option~"\tl_use:N \l_keys_key_tl"\ is~incompatible~
              with~Beamer~because~Beamer~has~its~own~system~to~extract~footnotes.}
\msg_new:nnn {witharrows}
             {footnote~with~footnotehyper~package}
             {You~can't~use~the~option~footnote~because~the~package~
              footnotehyper~has~already~been~loaded.~
              If~you~want,~you~can~use~the~option~"footnotehyper"~and~the~footnotes~
              within~the~environments~{WithArrows}~will~be~extracted~with~the~tools~
              of~the~package~footnotehyper.}
\msg_new:nnn {witharrows}
             {footnotehyper~with~footnote~package}
             {You~can't~use~the~option~"footnotehyper"~because~the~package~
              footnote~has~already~been~loaded.~
              If~you~want,~you~can~use~the~option~"footnote"~and~the~footnotes~
              within~the~environments~{WithArrows}~will~be~extracted~with~the~tools~
              of~the~package~footnote.}
\bool_if:NT \g__wi_footnote_bool
      {\@ifclassloaded {beamer}
                {\msg_fatal:nn {witharrows}
                               {Option~incompatible~with~Beamer}}
                {}
       \@ifpackageloaded{footnotehyper}
           {\msg_fatal:nn {witharrows}
                          {footnote~with~footnotehyper~package}}
           {}
       \usepackage{footnote}}
\bool_if:NT \g__wi_footnotehyper_bool
      {\@ifclassloaded {beamer}
                {\msg_fatal:nn {witharrows}
                               {Option~incompatible~with~Beamer}}
                {}
       \@ifpackageloaded{footnote}
           {\msg_fatal:nn {witharrows}
                          {footnotehyper~with~footnote~package}}
           {}
       \usepackage{footnotehyper}
       \bool_gset_true:N \g__wi_footnote_bool}
\bool_new:N \c__wi_leqno_bool
\DeclareOption {leqno} {\bool_set_true:N \c__wi_leqno_bool}
\DeclareOption* {}
\ProcessOptions*
\cs_new_protected:Nn \__wi_error:n
        {\msg_error:nn {witharrows} {#1}}
\cs_new_protected:Nn \__wi_error:nn
        {\msg_error:nnn {witharrows} {#1} {#2}}
\cs_generate_variant:Nn \__wi_error:nn {nx}
\cs_new_protected:Nn \__wi_bool_new:N
      {\bool_if_exist:NTF #1
         {\bool_set_false:N #1}
         {\bool_new:N #1}}
\AtBeginDocument
      {\clist_map_inline:nn
            {amsmath,mathtools,autonum,cleveref,hyperref,typedref,showlabels,amsthm}
            {\bool_new:c {c__wi_#1_loaded_bool}
             \@ifpackageloaded {#1}
                   {\bool_set_true:c {c__wi_#1_loaded_bool}}
                   {}}}
\cs_generate_variant:Nn \seq_set_split:Nnn {Nxx}
\cs_new_protected:Nn \__wi_save:N
   {\seq_set_split:Nxx \l_tmpa_seq {\char_generate:nn {`_} {12}} {\cs_to_str:N #1}
    \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
    \str_set:Nx \l_tmpa_str {\seq_item:Nn \l_tmpa_seq {-1}}
    \use:c {\l_tmpa_str _if_exist:cF}
           {g_\seq_use:Nnnn \l_tmpa_seq _ _ _ }
           {\use:c {\l_tmpa_str _new:c}
                      {g_\seq_use:Nnnn \l_tmpa_seq _ _ _ } }
    \use:c {\l_tmpa_str _gset_eq:cN}
           {g_\seq_use:Nnnn \l_tmpa_seq _ _ _ } #1 }
\cs_new_protected:Nn \__wi_restore:N
   {\seq_set_split:Nxx \l_tmpa_seq {\char_generate:nn {`_} {12}} {\cs_to_str:N #1}
    \seq_pop_left:NN \l_tmpa_seq \l_tmpa_tl
    \str_set:Nx \l_tmpa_str {\seq_item:Nn \l_tmpa_seq {-1}}
    \use:c {\l_tmpa_str _set_eq:Nc}
           #1 {g_\seq_use:Nnnn \l_tmpa_seq _ _ _ } }
\tikzset{__wi_node_style/.style= {
               above = \l__wi_ystart_dim,
               inner~sep = 0 pt,
               minimum~width = 0pt,
               minimum~height = \l__wi_ygap_dim,
               red,
               \bool_if:NT \l__wi_shownodes_bool {draw} }}
\tikzset{__wi_standard/.style= { remember~picture,
                               overlay,
                               name~prefix = wa-\l__wi_prefix_str- }}
\tikzset{WithArrows/arrow/tips/.style = { > = {Straight~Barb[scale=1.2,bend]} }}
\tikzset{WithArrows/arrow/.style  = { align = left,
                                      auto = left,
                                      font = \small\itshape,
                                      WithArrows/arrow/tips,
                                      bend~left = 45,
                                      -> }}
\AtBeginDocument
    {\bool_if:NF \c__wi_amsmath_loaded_bool
       {\cs_set_protected:Npn \spread@equation
           {\openup\jot
            \cs_set_eq:NN \spread@equation \prg_do_nothing:}}}
\bool_new:N \l__wi_in_WithArrows_bool
\bool_new:N \l__wi_in_DispWithArrows_bool
\seq_new:N \g__wi_position_in_the_tree_seq
\seq_gput_right:Nn \g__wi_position_in_the_tree_seq 1
\int_new:N \g__wi_last_env_int
\skip_new:N \l__wi_interline_skip
\int_new:N \l__wi_pos_env_int
\dim_new:N \l__wi_xoffset_dim
\dim_set:Nn \l__wi_xoffset_dim {3mm}
\int_new:N \l__wi_pos_arrows_int
\int_set:Nn \l__wi_pos_arrows_int 3
\int_new:N \l__wi_previous_pos_arrows_int
\dim_new:N \l__wi_x_dim
\seq_new:N \g__wi_arrow_int_seq
\int_new:N \g__wi_arrow_int
\seq_new:N \g__wi_line_int_seq
\int_new:N \g__wi_line_int
\tl_new:N \l__wi_name_tl
\bool_new:N \l__wi_fleqn_bool
\dim_new:N \l__wi_mathindent_dim
\dim_set:Nn \l__wi_mathindent_dim {25pt}
\bool_new:N \l__wi_wrap_lines_bool
\clist_new:N \l__wi_tags_clist
\clist_set:Nn \l__wi_tags_clist {all}
\tl_new:N \l__wi_tag_tl
\bool_new:N \l__wi_tag_star_bool
\bool_new:N \l__wi_in_first_column_bool
\bool_new:N \l__wi_initial_r_bool
\bool_new:N \l__wi_initial_l_bool
\dim_new:N \l__wi_start_adjust_dim
\dim_set:Nn \l__wi_start_adjust_dim {0.4ex}
\dim_new:N \l__wi_end_adjust_dim
\dim_set:Nn \l__wi_end_adjust_dim {0.4ex}
\int_set:Nn \l__wi_level_int 1
\keys_define:nn {WithArrows/GlobalOrEnv}
   {  t   .code:n            = {\bool_if:NTF \l__wi_in_DispWithArrows_bool
                                 {\__wi_error:n {Option~will~be~ignored}
                                 {\int_set:Nn \l__wi_pos_env_int 0}}},
      t   .value_forbidden:n = true,
      c   .code:n            = {\bool_if:NTF \l__wi_in_DispWithArrows_bool
                                 {\__wi_error:n {Option~will~be~ignored}}
                                 {\int_set:Nn \l__wi_pos_env_int 1}},
      c   .value_forbidden:n = true,
      b   .code:n            = {\bool_if:NTF \l__wi_in_DispWithArrows_bool
                                 {\__wi_error:n {Option~will~be~ignored}}
                                 {\int_set:Nn \l__wi_pos_env_int 2}},
      b   .value_forbidden:n = true,
      ygap .dim_set:N        = \l__wi_ygap_dim,
      ygap .value_required:n = true,
      ygap .initial:n        = 0.4 ex,
      ystart .dim_set:N        = \l__wi_ystart_dim,
      ystart .value_required:n = true,
      ystart .initial:n        = 0.4 ex,
      MoreColumns .code:n            = { \msg_redirect_name:nnn
                                         {witharrows}
                                         {Third~column~in~an~environment~{WithArrows}}
                                         {none} },
      MoreColumns .value_forbidden:n = true,
      AllowLineWithoutAmpersand .code:n = { \__wi_error:n
                                            {AllowLineWithoutAmpersand}},
      AllowLineWithoutAmpersand .value_forbidden:n = true,
      CommandName .tl_set:N         = \l__wi_CommandName_tl,
      CommandName .initial:n        = Arrow ,
      CommandName .value_required:n = true,
      TikzCode .tl_set:N         = \l__wi_tikz_code_tl,
      TikzCode .initial:n        = \draw~(#1)~to~node{#3}~(#2)~; ,
      TikzCode .value_required:n = true,
      displaystyle .bool_set:N     = \l__wi_displaystyle_bool,
      displaystyle .initial:n      = false,
      shownodes .bool_set:N        = \l__wi_shownodes_bool,
      shownodes .initial:n         = false,
      shownodenames .bool_set:N    = \l__wi_shownodenames_bool,
      shownodenames .initial:n     = false,
      group    .code:n    = {\int_compare:nNnT \l__wi_previous_pos_arrows_int > {-1}
                                    {\__wi_error:n {Two~options~are~incompatible}}
                             \int_set:Nn \l__wi_previous_pos_arrows_int 7
                             \int_set:Nn \l__wi_pos_arrows_int 7} ,
      group    .value_forbidden:n = true,
      groups   .code:n   = {\int_compare:nNnT \l__wi_previous_pos_arrows_int > {-1}
                                   {\__wi_error:n {Two~options~are~incompatible}}
                            \int_set:Nn \l__wi_previous_pos_arrows_int 6
                            \int_set:Nn \l__wi_pos_arrows_int 6} ,
      groups   .value_forbidden:n = true,
      CodeBefore  .code:n = {\int_compare:nNnTF \l__wi_level_int = 1
                              {\__wi_error:n {Option~will~be~ignored}}
                              {\tl_put_right:Nn \l__wi_code_before_tl {#1}}} ,
      CodeBefore  .value_required:n = true,
      CodeAfter .code:n = {\int_compare:nNnTF \l__wi_level_int = 1
                              {\__wi_error:n {Option~will~be~ignored}}
                              {\tl_put_right:Nn \l__wi_code_after_tl {#1}}} ,
      CodeAfter .value_required:n = true,
      name .code:n = {\int_compare:nNnTF \l__wi_level_int = 1
                              {\__wi_error:n {Option~will~be~ignored}}
                              {\tl_set:Nn \l__wi_name_tl {#1}}} ,
      name .value_required:n = true,
      fleqn   .code:n = {\bool_if:NTF \l__wi_in_WithArrows_bool
                             {\__wi_error:n {Option~will~be~ignored}}
                             {\str_if_eq:nnTF {#1} {true}
                                 {\bool_set_true:N \l__wi_fleqn_bool}
                                 {\bool_set_false:N \l__wi_fleqn_bool}}},
      fleqn   .default:n = true,
      mathindent   .code:n = {\bool_if:NTF \l__wi_in_WithArrows_bool
                               {\__wi_error:n {Option~will~be~ignored}}
                               {\dim_set:Nn \l__wi_mathindent_dim {#1}}},
      mathindent   .value_required:n = true,
      notag   .code:n = {\bool_if:NTF \l__wi_in_WithArrows_bool
                             {\__wi_error:n {Option~will~be~ignored}}
                             {\str_if_eq:nnTF {#1} {true}
                                 {\clist_clear:N \l__wi_tags_clist}
                                 {\clist_set:Nn \l__wi_tags_clist {all}}}},
      notag   .default:n = true,
      nonumber .meta:n   = notag,
      AllowMultipleLabels .code:n = {\bool_if:NTF \l__wi_in_WithArrows_bool
                                         {\__wi_error:n {Option~will~be~ignored}}
                                         {\msg_redirect_name:nnn {witharrows}
                                                           {Multiple~labels}
                                                           {none}}},
      AllowMultipleLabels .value_forbidden:n = true,
      wrap-lines   .code:n = {\bool_if:NTF \l__wi_in_WithArrows_bool
                               {\__wi_error:n {Option~will~be~ignored}}
                               {\str_if_eq:nnTF {#1} {true}
                                   {\bool_set_true:N \l__wi_wrap_lines_bool}
                                   {\bool_set_false:N \l__wi_wrap_lines_bool}}},
      wrap-lines   .default:n = true,
      tagged-lines .code:n = {\bool_if:NTF \l__wi_in_WithArrows_bool
                              {\__wi_error:n {Option~will~be~ignored}}
                              {\clist_set:Nn \l__wi_tags_clist {#1}
                               \clist_if_in:NnT \l__wi_tags_clist {first}
                                  {\clist_remove_all:Nn \l__wi_tags_clist {first}
                                   \clist_put_left:Nn \l__wi_tags_clist 1 }}},
      tagged-lines .value_required:n = true,
      unknown .code:n  = \__wi_error:n {Option~unknown}
     }
\keys_define:nn {WithArrows/General}
     {tikz     .code:n            = \tikzset {WithArrows/arrow/.append~style = {#1}},
      tikz     .initial:n         = {},
      tikz     .value_required:n  = true,
      rr       .value_forbidden:n = true,
      rr       .code:n            = \__wi_analyze_option_position:n 3 ,
      ll       .value_forbidden:n = true,
      ll       .code:n            = \__wi_analyze_option_position:n 1 ,
      rl       .value_forbidden:n = true,
      rl       .code:n            = \__wi_analyze_option_position:n 2 ,
      lr       .value_forbidden:n = true,
      lr       .code:n            = \__wi_analyze_option_position:n 0 ,
      i        .value_forbidden:n = true,
      i        .code:n            = \__wi_analyze_option_position:n 5 ,
      xoffset  .code:n  = {\bool_if:nTF {\int_compare_p:nNn \l__wi_level_int = 3 &&
                                        \int_compare_p:nNn \l__wi_pos_arrows_int > 5}
                               {\__wi_error:n {Option~incompatible~with~"group(s)"}}
                               {\dim_set:Nn \l__wi_xoffset_dim {#1}}} ,
      xoffset  .value_required:n  = true,
      jot       .code:n     = {\int_compare:nNnTF \l__wi_level_int = 2
                                  {\dim_set:Nn \jot {#1}}
                                  {\__wi_error:n {Option~will~be~ignored}}} ,
      jot       .value_required:n  = true,
      interline   .code:n       = {\int_compare:nNnTF \l__wi_level_int = 2
                                      {\skip_set:Nn \l__wi_interline_skip {#1}}
                                      {\__wi_error:n {Option~will~be~ignored}}} ,
      interline   .value_required:n = true,
      start-adjust .dim_set:N = \l__wi_start_adjust_dim,
      start-adjust .value_required:n = true,
      end-adjust  .dim_set:N = \l__wi_end_adjust_dim,
      end-adjust  .value_required:n = true,
      adjust      .code:n  = {\dim_set:Nn \l__wi_start_adjust_dim {#1}
                              \dim_set:Nn \l__wi_end_adjust_dim {#1} },
      adjust      .value_required:n = true,
      jump    .code:n  = {\int_compare:nNnF \l__wi_level_int = 3
                             {\__wi_error:n {Option~will~be~ignored}}} ,
      unknown .code:n  = \__wi_error:n {Option~unknown}
}
\keys_define:nn {WithArrows/Arrow}
     {jump  .code:n = {\int_set:Nn \l__wi_jump_int {#1}
                       \int_compare:nNnF \l__wi_jump_int > 0
                           {\__wi_error:n {The~option~"jump"~must~be~non~negative}}} ,
      jump  .value_required:n  = true,
      rr       .value_forbidden:n = true,
      rr       .code:n            = \__wi_analyze_option_position:n 3 ,
      ll       .value_forbidden:n = true,
      ll       .code:n            = \__wi_analyze_option_position:n 1 ,
      rl       .value_forbidden:n = true,
      rl       .code:n            = \__wi_analyze_option_position:n 2 ,
      lr       .value_forbidden:n = true,
      lr       .code:n            = \__wi_analyze_option_position:n 0 ,
      i        .value_forbidden:n = true,
      i        .code:n            = \__wi_analyze_option_position:n 5 }
\cs_new_protected:Nn \__wi_analyze_option_position:n
     {\int_compare:nNnT \l__wi_previous_pos_arrows_int > {-1}
        {\__wi_error:n {Two~options~are~incompatible}}
      \int_set:Nn \l__wi_previous_pos_arrows_int {#1}
      \int_set:Nn \l__wi_pos_arrows_int {#1}}
\NewDocumentCommand \WithArrowsOptions {m}
    {\int_set:Nn \l__wi_previous_pos_arrows_int {-1}
     \keys_set_known:nnN {WithArrows/General} {#1} \l_tmpa_tl
     \keys_set:nV {WithArrows/GlobalOrEnv} \l_tmpa_tl}
\NewDocumentCommand \__wi_Arrow {O{} m O{}}
         {
          \int_gincr:N \g__wi_arrow_int
          \int_set:Nn \l__wi_previous_pos_arrows_int {-1}
          \int_set:Nn \l__wi_pos_arrows_int {-1}
          \int_set:Nn \l__wi_level_int 3
          \keys_set_known:nnN {WithArrows/Arrow} {#1,#3} \l_tmpa_tl
          \prop_put:NnV \l_tmpa_prop {initial} \g__wi_line_int
          \int_set:Nn \l_tmpa_int {\g__wi_line_int + \l__wi_jump_int}
          \prop_put:NnV \l_tmpa_prop {final} \l_tmpa_int
          \prop_put:NnV \l_tmpa_prop {position} \l__wi_pos_arrows_int
          \prop_put:NnV \l_tmpa_prop {options} \l_tmpa_tl
          \prop_put:Nnn \l_tmpa_prop {label} {#2}
          \prop_gclear_new:c
                {g__wi_arrow_\l__wi_prefix_str _\int_use:N\g__wi_arrow_int _prop}
          \prop_gset_eq:cN
                {g__wi_arrow_\l__wi_prefix_str _\int_use:N\g__wi_arrow_int _prop}
                \l_tmpa_prop
          }
\cs_new_protected:Nn \__wi_Arrow_first_column:
               {\tl_set:Nn \l_tmpa_tl {Arrow}
                \__wi_error:n {Arrow~in~first~column}
                \__wi_Arrow}
\cs_new_protected:Nn \__wi_pre_environment:n
         { \seq_gput_right:NV \g__wi_arrow_int_seq \g__wi_arrow_int
           \int_gzero:N \g__wi_arrow_int
           \seq_gput_right:NV \g__wi_line_int_seq \g__wi_line_int
           \int_gzero:N \g__wi_line_int
           \seq_gput_right:Nn \g__wi_position_in_the_tree_seq 1
           \seq_set_eq:NN \l_tmpa_seq \g__wi_position_in_the_tree_seq
           \seq_pop_right:NN \l_tmpa_seq \l_tmpa_tl
           \str_clear_new:N \l__wi_prefix_str
           \str_set:Nx \l__wi_prefix_str {\seq_use:Nnnn \l_tmpa_seq {-} {-} {-}}
           \cs_set_eq:NN \\ \__wi_cr:
           \dim_zero:N \mathsurround
           \int_zero_new:N \l__wi_initial_int
           \int_zero_new:N \l__wi_final_int
           \int_zero_new:N \l__wi_arrow_int
           \int_zero_new:N \l__wi_pos_of_arrow_int
           \int_zero_new:N \l__wi_jump_int
           \int_set:Nn \l__wi_jump_int 1
           \seq_clear_new:N \l__wi_labels_seq
           \__wi_bool_new:N \l__wi_tag_next_line_bool
           \skip_zero:N \l__wi_interline_skip
           \tl_clear_new:N \l__wi_code_before_tl
           \tl_clear_new:N \l__wi_code_after_tl
           \int_set:Nn \l__wi_previous_pos_arrows_int {-1}
           \int_set:Nn \l__wi_level_int 2
           \keys_set_known:nnN {WithArrows/General} {#1} \l_tmpa_tl
           \keys_set:nV {WithArrows/GlobalOrEnv} \l_tmpa_tl
           \bool_if:NT \g__wi_footnote_bool \savenotes
           \l__wi_code_before_tl
           \cs_set_eq:cN \l__wi_CommandName_tl \__wi_Arrow}
\NewDocumentEnvironment {WithArrows} {O{}}
         { \bool_set_true:N \l__wi_in_WithArrows_bool
           \bool_set_false:N \l__wi_in_DispWithArrows_bool
           \reverse_if:N \if_mode_math:
                             \__wi_error:n {{WithArrows}~used~outside~math~mode}
                         \fi:
           \__wi_pre_environment:n {#1}
           \cs_set_eq:NN \notag \__wi_notag:
           \cs_set_eq:NN \nonumber \__wi_notag:
           \cs_set_eq:NN \tag \__wi_tag
           \cs_set_eq:NN \label \__wi_label:n
           \cs_set_eq:NN \tagnextline \__wi_tagnextline:
           \int_case:nn \l__wi_pos_env_int
                   {0 \vtop
                    1 \vcenter
                    2 \vbox}
           \bgroup
           \spread@equation
           \ialign\bgroup
           \int_gincr:N \g__wi_line_int
           \cs_set_eq:cN \l__wi_CommandName_tl \__wi_Arrow_first_column:
           \bool_set_true:N \l__wi_in_first_column_bool
           \strut\hfil
           $\bool_if:NT \l__wi_displaystyle_bool \displaystyle {##}$
           &
           $\bool_if:NT \l__wi_displaystyle_bool \displaystyle {{}##}$
           \tikz [remember~picture,overlay]
                 \node [__wi_node_style,
                        name = wa-\l__wi_prefix_str-\int_use:N\g__wi_line_int-l,
                        alias = {\tl_if_empty:NF \l__wi_name_tl
                                     {\l__wi_name_tl-\int_use:N\g__wi_line_int-l}} ] {} ;
           \hfil
           \tikz [remember~picture,overlay]
                 \node [__wi_node_style,
                        name = wa-\l__wi_prefix_str-\int_use:N\g__wi_line_int-r,
                        alias = {\tl_if_empty:NF \l__wi_name_tl
                                   {\l__wi_name_tl-\int_use:N\g__wi_line_int-r}} ] {} ;
           \bool_if:NT \l__wi_shownodenames_bool
                {\hbox_overlap_right:n {\small wa-\l__wi_prefix_str
                                                 -\int_use:N\g__wi_line_int}}
           && \__wi_error:n {Third~column~in~an~environment~{WithArrows}}
           $\bool_if:NT \l__wi_displaystyle_bool \displaystyle {##}$
           \cr
          }
          {\\
           \egroup
           \egroup
           \__wi_post_environment:
           \bool_if:NT \g__wi_footnote_bool \endsavenotes
}
\cs_new_protected:Nn \__wi_post_environment:
          {\cs_set:Npn \WithArrowsRightX {\g__wi_right_x_dim}
           \int_compare:nNnT \g__wi_arrow_int > 0 \__wi_scan_arrows:
           \group_begin:
           \tikzset{every~picture/.style = __wi_standard}
           \cs_set:Npn \WithArrowsNbLines {\int_use:N \g__wi_line_int}
           \cs_set_eq:NN \MultiArrow \__wi_MultiArrow:nn
           \cs_set_eq:cN \l__wi_CommandName_tl \__wi_Arrow_code_after
           \l__wi_code_after_tl
           \group_end:
           \seq_gpop_right:NN \g__wi_position_in_the_tree_seq \l_tmpa_tl
           \seq_gpop_right:NN \g__wi_position_in_the_tree_seq \l_tmpa_tl
           \seq_gput_right:Nx \g__wi_position_in_the_tree_seq
                              {\int_eval:n {\l_tmpa_tl+1}}
           \int_compare:nNnT {\seq_count:N \g__wi_position_in_the_tree_seq} = 1
                      {\int_gincr:N \g__wi_last_env_int}
           \seq_gpop_right:NN \g__wi_arrow_int_seq {\l_tmpa_tl}
           \int_gset:Nn \g__wi_arrow_int {\l_tmpa_tl}
           \seq_gpop_right:NN \g__wi_line_int_seq \l_tmpa_tl
           \int_gset:Nn \g__wi_line_int {\l_tmpa_tl}
           }
\cs_new_protected:Nn \__wi_cr:
      {\scan_stop:
       \bool_if:NT \l__wi_in_first_column_bool { & {} }
       \group_align_safe_begin:
       \peek_meaning_remove:NTF * \__wi_cr_i: \__wi_cr_i:}
\cs_new_protected:Nn \__wi_cr_i:
      {\peek_meaning:NTF [ {\__wi_cr_ii:} {\__wi_cr_ii:[\c_zero_dim]} }
\cs_new_protected:Npn \__wi_cr_ii:[#1]
      {\group_align_safe_end:
       \bool_if:NT \l__wi_in_DispWithArrows_bool
           {\clist_if_in:NnTF \l__wi_tags_clist {all}
                {
                 \tl_if_empty:NT \l__wi_tag_tl
                    {\int_gincr:N \c@equation}
                 \cs_gset:Npx \g_tmpa_tl
                      {\tl_if_empty:NTF \l__wi_tag_tl
                          \theequation
                          \l__wi_tag_tl}
                 \seq_if_empty:NF \l__wi_labels_seq
                      {
                       \cs_set:Npx \@currentlabel {\p@equation \g_tmpa_tl}
                       \bool_if:NT \c__wi_hyperref_loaded_bool
                            {\cs_set:Npn \This@name {equation}
                             \hyper@refstepcounter{equation}}
                       \bool_if:NT \c__wi_cleveref_loaded_bool
                           {\cref@constructprefix{equation}{\cref@result}
                            \@ifundefined{cref@equation@alias}
                                  {\def\@tempa{equation}}
                                  {\def\@tempa{\csname cref@equation@alias\endcsname}}
                            \protected@edef\cref@currentlabel
                                           {[\@tempa][\arabic{equation}][\cref@result]
                                            \p@equation \g_tmpa_tl}}
                       \bool_if:NT \c__wi_typedref_loaded_bool
                          {\cs_set:Npn \sr@name {equation}}
                       \seq_map_function:NN \l__wi_labels_seq \__wi_old_label}
                 \__wi_save:N \l__wi_tag_star_bool
                 \__wi_save:N \l__wi_qedhere_bool
                 \bool_if:NT \l__wi_tag_next_line_bool
                            { \openup -\jot
                              \bool_set_false:N \l__wi_tag_next_line_bool
                              \notag \\ & }
                 & \__wi_restore:N \l__wi_tag_star_bool
                   \__wi_restore:N \l__wi_qedhere_bool
                   \bool_if:NT \l__wi_qedhere_bool
                         {\hbox_overlap_left:n \__wi_qedhere_i:}
                   \cs_set_eq:NN \theequation \g_tmpa_tl
                   \bool_if:NT \l__wi_tag_star_bool {\cs_set:Npn \tagform@ {}}
                   \hbox_overlap_left:n
                     {\bool_if:NF \c__wi_leqno_bool
                        {\tikz [__wi_standard] \coordinate (\int_use:N\g__wi_line_int-v) ;}
                      \quad
                      \@eqnnum }
                   \bool_if:NT \c__wi_leqno_bool
                      {\tikz [__wi_standard] \coordinate (\int_use:N \g__wi_line_int-v) ;}}
                {\__wi_save:N \l__wi_qedhere_bool
                 & \__wi_restore:N \l__wi_qedhere_bool
                   \bool_if:NT \l__wi_qedhere_bool
                         {\hbox_overlap_left:n \__wi_qedhere_i:}
                   \tikz [__wi_standard] \coordinate (\int_use:N\g__wi_line_int-v)  ; }
             }
       \cr\noalign{\skip_vertical:n {#1 + \l__wi_interline_skip}
       \scan_stop:}}
\cs_new_protected:Nn \__wi_if_in_second_col_of_disp:nn
     {\bool_if:NTF \l__wi_in_WithArrows_bool
          {\__wi_error:nn {Command~not~allowed~in~{WithArrows}}
                          {#1}}
          {\bool_if:NTF \l__wi_in_first_column_bool
             {\__wi_error:nn {Command~not~allowed~in~{DispWithArrows}}
                             {#1}}
             {#2}}}
\cs_new_protected:Nn \__wi_notag:
     {\__wi_if_in_second_col_of_disp:nn {\notag}
             {\clist_clear:N \l__wi_tags_clist}}
\NewDocumentCommand \__wi_tag {sm}
     {\__wi_if_in_second_col_of_disp:nn {\tag}
             {\tl_if_empty:NF \l__wi_tag_tl
                   {\__wi_error:nn  {Multiple~tags} {#2}}
              \clist_set:Nn \l__wi_tags_clist {all}
              \bool_if:nT \c__wi_mathtools_loaded_bool
                    {\MH_if_boolean:nT {show_only_refs}
                         {\MH_if_boolean:nF {show_manual_tags}
                             {\clist_clear:N \l__wi_tags_clist}}}
              \tl_set:Nn \l__wi_tag_tl {#2}
              \bool_set:Nn \l__wi_tag_star_bool {#1}
             \bool_if:nT {#1 && ! \bool_if_p:N \c__wi_amsmath_loaded_bool}
                  { \__wi_error:n {tag*~without~amsmath} }}
    }
\cs_new_protected:Nn \__wi_label:n
     {\__wi_if_in_second_col_of_disp:nn {\label}
             {\seq_if_empty:NF \l__wi_labels_seq
                 {\bool_if:NTF \c__wi_cleveref_loaded_bool
                    {\__wi_error:n {Multiple~labels~with~cleveref}}
                    {\__wi_error:n {Multiple~labels}}}
              \seq_put_right:Nn \l__wi_labels_seq {#1}
              \bool_if:nT \c__wi_mathtools_loaded_bool
                 {\MH_if_boolean:nT {show_only_refs}
                     {\cs_if_exist:cTF {MT_r_#1}
                       {\clist_set:Nn \l__wi_tags_clist {all}}
                       {\clist_clear:N \l__wi_tags_clist}}}
              \bool_if:nT \c__wi_autonum_loaded_bool
                     {\cs_if_exist:cTF {autonum@#1Referenced}
                       {\clist_set:Nn \l__wi_tags_clist {all}}
                       {\clist_clear:N \l__wi_tags_clist}}}}
\cs_new_protected:Nn \__wi_tagnextline:
        {\__wi_if_in_second_col_of_disp:nn {\tagnextline}
             {\bool_set_true:N \l__wi_tag_next_line_bool}}
\bool_new:N \l__wi_qedhere_bool
\cs_new_protected:Nn \__wi_qedhere: {\bool_set_true:N \l__wi_qedhere_bool}
\cs_new_protected:Nn \__wi_qedhere_i: {\group_begin:
                                       \cs_set_eq:NN \qed \qedsymbol
                                       \cs_set_eq:NN \qed@elt \setQED@elt
                                       \QED@stack\relax\relax
                                     \group_end: }
\NewDocumentEnvironment {DispWithArrows} {O{}}
         {
          \bool_if:nT \c__wi_mathtools_loaded_bool
                 {\MH_if_boolean:nT {show_only_refs}
                    {\MT_showonlyrefs_false:
                      \MH_set_boolean_T:n {show_only_refs}}}
           \bool_if:NT \c__wi_amsmath_loaded_bool \intertext@
           \if_mode_math:
               \__wi_error:n {{DispWithArrows}~used~in~math~mode}
           \fi:
           \bool_set_true:N \l__wi_in_DispWithArrows_bool
           \__wi_pre_environment:n {#1}
           \if_mode_vertical:
             \nointerlineskip
             \makebox[.6\linewidth]{}
           \fi:
           $$
           \vcenter \bgroup
           \spread@equation
           \bool_if:NTF \l__wi_fleqn_bool
                  {\tabskip = \c_zero_skip}
                  {\tabskip = 0 pt plus 1000 pt minus 1000 pt}
           \cs_set_eq:NN \__wi_old_label \label
           \cs_set_eq:NN \notag \__wi_notag:
           \cs_set_eq:NN \nonumber \__wi_notag:
           \cs_set_eq:NN \tag \__wi_tag
           \cs_set_eq:NN \label \__wi_label:n
           \cs_set_eq:NN \tagnextline \__wi_tagnextline:
           \halign to \displaywidth \bgroup
             \int_gincr:N \g__wi_line_int
             \cs_set_eq:cN \l__wi_CommandName_tl \__wi_Arrow_first_column:
             \bool_set_true:N \l__wi_in_first_column_bool
             \strut
             \bool_if:NT \l__wi_fleqn_bool
                   {\skip_horizontal:n \l__wi_mathindent_dim}
             \hfil
             $\bool_if:NT \l__wi_displaystyle_bool \displaystyle {##}$
             \tabskip = \c_zero_skip
            &
             \clist_if_in:NVT \l__wi_tags_clist \g__wi_line_int
                  {\clist_set:Nn \l__wi_tags_clist {all}}
             \bool_if:NT \c__wi_amsthm_loaded_bool {\cs_set_eq:NN \qedhere \__wi_qedhere:}
             $\bool_if:NT \l__wi_displaystyle_bool \displaystyle {{}##}$
             \tabskip = 0 pt plus 1000 pt minus 1000 pt
             \tikz [remember~picture,overlay]
                  \node [__wi_node_style,
                         name = wa-\l__wi_prefix_str-\int_use:N\g__wi_line_int-l,
                         alias = {\tl_if_empty:NF \l__wi_name_tl
                                    {\l__wi_name_tl-\int_use:N\g__wi_line_int-l}} ] {} ;
             \hfil
             \tikz [remember~picture,overlay]
                   \node [__wi_node_style,
                          name = wa-\l__wi_prefix_str-\int_use:N\g__wi_line_int-r,
                          alias = {\tl_if_empty:NF \l__wi_name_tl
                                     {\l__wi_name_tl-\int_use:N\g__wi_line_int-r}} ] {} ;
             \bool_if:NT \l__wi_shownodenames_bool
                  {\hbox_overlap_right:n {\small wa-\l__wi_prefix_str
                                                   -\int_use:N\g__wi_line_int}}
            & ##
             \tabskip = \c_zero_skip
            && \__wi_error:n {Third~column~in~an~environment~{DispWithArrows}}
               \iffalse ## \fi
             \cr}
          {\clist_if_in:NnT \l__wi_tags_clist {last}
                   {\clist_set:Nn \l__wi_tags_clist {all}}
           \\
           \egroup
           \egroup
           \bool_if:NT \l__wi_in_DispWithArrows_bool
             {\dim_gzero_new:N \g__wi_right_x_dim
              \dim_gset_eq:NN \g__wi_right_x_dim \c_max_dim
              \begin{tikzpicture} [__wi_standard]
              \int_step_variable:nnnNn 1 1 \g__wi_line_int \l_tmpa_int
                    {\tikz@parse@node\pgfutil@firstofone (\l_tmpa_int-v)
                     \dim_set:Nn \l_tmpa_dim \pgf@x
                     \dim_compare:nNnT \l_tmpa_dim < \g__wi_right_x_dim
                            {\dim_gset:Nn \g__wi_right_x_dim \l_tmpa_dim} }
              \end{tikzpicture}}
           \__wi_post_environment:
           \bool_if:nT \c__wi_mathtools_loaded_bool
                    {\MH_if_boolean:nT {show_only_refs}
                          \MT_showonlyrefs_true:}
           $$
           \bool_if:NT \g__wi_footnote_bool \endsavenotes
           \ignorespacesafterend
           }
\NewDocumentEnvironment {DispWithArrows*} {}
     {\WithArrowsOptions{notag}
      \DispWithArrows}
     {\endDispWithArrows}
\cs_new_protected:Nn \__wi_scan_arrows:
                  { \group_begin:
                    \int_compare:nNnT \l__wi_pos_arrows_int = 7
                      { \__wi_scan_arrows_i:
                        \int_set:Nn \l__wi_pos_arrows_int 8 }
                    \__wi_scan_arrows_i:
                    \group_end:}
\cs_new_protected:Nn \__wi_scan_arrows_i:
  {
    \int_zero_new:N \l__wi_first_arrow_of_group_int
    \int_zero_new:N \l__wi_first_line_of_group_int
    \int_zero_new:N \l__wi_last_line_of_group_int
    \seq_clear_new:N \l__wi_first_arrows_of_group_seq
    \seq_clear_new:N \l__wi_last_arrows_of_group_seq
    \bool_set_true:N \l__wi_new_group_bool
    \int_set:Nn \l__wi_arrow_int 1
    \int_until_do:nNnn \l__wi_arrow_int > \g__wi_arrow_int
     {
       \prop_get:cnN {g__wi_arrow_\l__wi_prefix_str _\int_use:N\l__wi_arrow_int _prop}
                     {initial} \l_tmpa_tl
       \int_set:Nn \l__wi_initial_int {\l_tmpa_tl}
       \prop_get:cnN {g__wi_arrow_\l__wi_prefix_str _\int_use:N\l__wi_arrow_int _prop}
                     {final} \l_tmpa_tl
       \int_set:Nn \l__wi_final_int {\l_tmpa_tl}
       \prop_get:cnN {g__wi_arrow_\l__wi_prefix_str _\int_use:N\l__wi_arrow_int _prop}
                     {position} \l_tmpa_tl
       \int_set:Nn \l__wi_pos_of_arrow_int \l_tmpa_tl
       \int_compare:nNnTF \l__wi_final_int > \g__wi_line_int
          {\__wi_error:n {Too~few~lines~for~an~arrow}}
          {\bool_if:nT {\int_compare_p:nNn \l__wi_arrow_int > 1
                         &&
                        \int_compare_p:nNn
                              \l__wi_initial_int > \l__wi_last_line_of_group_int
                         &&
                        \int_compare_p:n {\l__wi_pos_arrows_int != 7}}
                 {\__wi_draw_arrows:nn \l__wi_first_arrow_of_group_int {\l__wi_arrow_int - 1}
                  \bool_set_true:N \l__wi_new_group_bool}
           \bool_if:nTF \l__wi_new_group_bool
                 {\bool_set_false:N \l__wi_new_group_bool
                  \int_set:Nn \l__wi_first_arrow_of_group_int \l__wi_arrow_int
                  \int_set:Nn \l__wi_first_line_of_group_int \l__wi_initial_int
                  \int_set:Nn \l__wi_last_line_of_group_int \l__wi_final_int
                  \seq_clear:N \l__wi_first_arrows_of_group_seq
                  \seq_put_left:Nx \l__wi_first_arrows_of_group_seq
                                   {\int_use:N \l__wi_arrow_int}
                  \seq_clear:N \l__wi_last_arrows_of_group_seq
                  \seq_put_left:Nx \l__wi_last_arrows_of_group_seq
                                   {\int_use:N \l__wi_arrow_int}
                  \int_compare:nT {\l__wi_pos_arrows_int != 8}
                      {\dim_set:Nn \l__wi_x_dim {-\c_max_dim}}
                  }
                 {\int_compare:nNnT \l__wi_pos_of_arrow_int = {-1}
                     {\int_compare:nNnT \l__wi_initial_int = \l__wi_first_line_of_group_int
                           {\seq_put_left:Nx \l__wi_first_arrows_of_group_seq
                                             {\int_use:N \l__wi_arrow_int}}
                      \int_compare:nNnTF \l__wi_final_int > \l__wi_last_line_of_group_int
                        {\int_set_eq:NN \l__wi_last_line_of_group_int \l__wi_final_int
                         \seq_clear:N \l__wi_last_arrows_of_group_seq
                         \seq_put_left:Nx \l__wi_last_arrows_of_group_seq
                                          {\int_use:N \l__wi_arrow_int}}
                        {\int_compare:nNnT \l__wi_final_int = \l__wi_last_line_of_group_int
                           {\seq_put_left:Nx \l__wi_last_arrows_of_group_seq
                                             {\int_use:N \l__wi_arrow_int}}}}}
           \int_compare:nNnT \l__wi_pos_of_arrow_int = {-1}
              { \int_compare:nT {\l__wi_pos_arrows_int != 8}
                   {\__wi_update_x_value:nn \l__wi_initial_int \l__wi_final_int}} }
       \int_incr:N \l__wi_arrow_int
     }
     \int_compare:nT {\l__wi_pos_arrows_int != 7}
        {\__wi_draw_arrows:nn \l__wi_first_arrow_of_group_int \g__wi_arrow_int}
  }
\cs_generate_variant:Nn \keys_set:nn {no}
\cs_new_protected:Nn \__wi_keys_set: {\keys_set:no {WithArrows/General}}
\cs_new_protected:Nn \__wi_draw_arrows:nn
  {\group_begin:
   \int_zero_new:N \l__wi_first_arrow_int
   \int_set:Nn \l__wi_first_arrow_int {#1}
   \int_zero_new:N \l__wi_last_arrow_int
   \int_set:Nn \l__wi_last_arrow_int {#2}
   \int_set:Nn \l__wi_arrow_int \l__wi_first_arrow_int
   \int_until_do:nNnn \l__wi_arrow_int > \l__wi_last_arrow_int
     {
      \prop_get:cnN {g__wi_arrow_\l__wi_prefix_str _\int_use:N\l__wi_arrow_int _prop}
                    {initial} \l_tmpa_tl
      \int_set:Nn \l__wi_initial_int {\l_tmpa_tl}
      \prop_get:cnN {g__wi_arrow_\l__wi_prefix_str _\int_use:N\l__wi_arrow_int _prop}
                    {final} \l_tmpa_tl
      \int_set:Nn \l__wi_final_int {\l_tmpa_tl}
      \int_compare:nNnT \l__wi_final_int < {\g__wi_line_int + 1}
         \__wi_draw_arrows_i:
      \int_incr:N \l__wi_arrow_int
     }
   \group_end:
   }
\cs_new_protected:Nn \__wi_draw_arrows_i:
     {\group_begin:
      \int_set:Nn \l__wi_level_int 3
      \prop_get:cnN {g__wi_arrow_\l__wi_prefix_str
                        _\int_use:N\l__wi_arrow_int _prop} {options} \l_tmpa_tl
      \exp_args:NNo \exp_args:No
          \__wi_keys_set: {\l_tmpa_tl,tikz={xshift = \l__wi_xoffset_dim}}
      \prop_get:cnN {g__wi_arrow_\l__wi_prefix_str _\int_use:N\l__wi_arrow_int _prop}
        {position} \l_tmpa_tl
      \int_set:Nn \l_tmpa_int \l_tmpa_tl
      \int_compare:nNnF \l_tmpa_int = {-1}
         {\int_set_eq:NN \l__wi_pos_arrows_int \l_tmpa_int}
      \bool_set_false:N \l__wi_initial_r_bool
      \bool_set_false:N \l__wi_final_r_bool
      \int_case:nn \l__wi_pos_arrows_int
             {0 {\bool_set_true:N \l__wi_final_r_bool}
              2 {\bool_set_true:N \l__wi_initial_r_bool}
              3 {\bool_set_true:N \l__wi_initial_r_bool
                 \bool_set_true:N \l__wi_final_r_bool}}
      \int_compare:nNnT \l__wi_pos_arrows_int = 5
           { \dim_set:Nn \l__wi_x_dim {-\c_max_dim}
             \__wi_update_x_value:nn \l__wi_initial_int \l__wi_final_int }
      \tl_set:Nx \l__wi_initial_tl
              {\int_use:N\l__wi_initial_int-\bool_if:NTF\l__wi_initial_r_bool rl .south}
      \tl_set:Nx \l__wi_final_tl
              {\int_use:N\l__wi_final_int-\bool_if:NTF\l__wi_final_r_bool rl .north}
      \prop_get:cnN {g__wi_arrow_\l__wi_prefix_str _\int_use:N\l__wi_arrow_int _prop}
                    {label}
                    \l_tmpa_tl
      \seq_if_in:NxTF \l__wi_first_arrows_of_group_seq {\int_use:N \l__wi_arrow_int}
           {\bool_set_true:N \l_tmpa_bool}
           {\bool_set_false:N \l_tmpa_bool}
      \seq_if_in:NxTF \l__wi_last_arrows_of_group_seq {\int_use:N \l__wi_arrow_int}
           {\bool_set_true:N \l_tmpb_bool}
           {\bool_set_false:N \l_tmpb_bool}
      \int_compare:nNnT \l__wi_pos_arrows_int = 5
           {\bool_set_true:N \l_tmpa_bool
            \bool_set_true:N \l_tmpb_bool}
      \begin{tikzpicture} [__wi_standard]
          \tikz@scan@one@point\pgfutil@firstofone (\l__wi_initial_tl)
          \tl_gset:Nx \g_tmpa_tl
               {\int_compare:nNnTF \l__wi_pos_arrows_int < 5
                   { \dim_use:N \pgf@x }
                   { \dim_use:N \l__wi_x_dim } ,
                \bool_if:NTF \l_tmpa_bool
                      { \dim_eval:n {\pgf@y + \l__wi_start_adjust_dim }}
                      { \dim_use:N \pgf@y } }
          \tikz@scan@one@point\pgfutil@firstofone (\l__wi_final_tl)
          \tl_gset:Nx \g_tmpb_tl
               {\int_compare:nNnTF \l__wi_pos_arrows_int < 5
                   { \dim_use:N \pgf@x }
                   { \dim_use:N \l__wi_x_dim } ,
                \bool_if:NTF \l_tmpb_bool
                      { \dim_eval:n {\pgf@y - \l__wi_end_adjust_dim }}
                      { \dim_use:N \pgf@y }}
      \end{tikzpicture}
      \__wi_draw_arrow:nno \g_tmpa_tl \g_tmpb_tl \l_tmpa_tl
      \group_end: }
\cs_new_protected:Nn \__wi_def_function_tmpa:n
    {\cs_set:Nn \__wi_tmpa:nnn
          {\begin{tikzpicture}[__wi_standard,every~path/.style = {WithArrows/arrow}]
              #1
           \end{tikzpicture}}}
\cs_new_protected:Nn \__wi_draw_arrow:nnn
           {
            \bool_if:nT {\l__wi_wrap_lines_bool && \l__wi_in_DispWithArrows_bool}
               { \tl_set_eq:NN \l__wi_tikz_code_tl \c__wi_tikz_code_wrap_lines_tl }
            \exp_args:No \__wi_def_function_tmpa:n \l__wi_tikz_code_tl
            \__wi_tmpa:nnn {#1} {#2} {#3} }
\cs_generate_variant:Nn \__wi_draw_arrow:nnn {nno}
\tl_set:Nn \c__wi_tikz_code_wrap_lines_tl
                 {
                   \draw (#1) to node (__wi_label) {} (#2) ;
                   \tikz@parse@node \pgfutil@firstofone (__wi_label.west)
                   \dim_set:Nn \l_tmpa_dim {\g__wi_right_x_dim - \pgf@x - 0.3333 em}
                   \path \pgfextra {\tl_gset:Nx \g_tmpa_tl \tikz@text@width} ;
                   \tl_if_empty:NF \g_tmpa_tl
                      {\dim_set:Nn \l_tmpb_dim \g_tmpa_tl
                       \dim_compare:nNnT \l_tmpb_dim < \l_tmpa_dim
                           {\dim_set_eq:NN \l_tmpa_dim \l_tmpb_dim}}
                   \dim_compare:nNnT \l_tmpa_dim > \c_zero_dim
                      {\path (__wi_label.west)
                        node [anchor = west, text~width = \dim_use:N \l_tmpa_dim]
                        {#3} ; } }
\cs_new_protected:Nn \__wi_update_x_value:nn
    {\int_step_inline:nnnn {#1} 1 {#2}
        {\begin{tikzpicture} [__wi_standard]
         \tikz@scan@one@point\pgfutil@firstofone (##1-l)
         \dim_gset:Nn \g_tmpa_dim {\dim_max:nn \l__wi_x_dim \pgf@x }
         \end{tikzpicture}
         \dim_set_eq:NN \l__wi_x_dim \g_tmpa_dim } }
\cs_new:Npn \WithArrowsLastEnv {\int_use:N \g__wi_last_env_int}
\keys_define:nn {WithArrows/CodeAfter}
     {tikz     .code:n            = \tikzset {WithArrows/arrow/.append~style = {#1}} ,
      tikz     .value_required:n  = true,
      rr       .value_forbidden:n = true,
      rr       .code:n            = \__wi_analyze_option_position:n 0 ,
      ll       .value_forbidden:n = true,
      ll       .code:n            = \__wi_analyze_option_position:n 1 ,
      rl       .value_forbidden:n = true,
      rl       .code:n            = \__wi_analyze_option_position:n 2 ,
      lr       .value_forbidden:n = true,
      lr       .code:n            = \__wi_analyze_option_position:n 3 ,
      v        .value_forbidden:n = true,
      v        .code:n            = \__wi_analyze_option_position:n 4 ,
      TikzCode .tl_set:N          = \l__wi_tikz_code_tl,
      TikzCode .value_required:n  = true,
      xoffset  .dim_set:N         = \l__wi_xoffset_dim,
      xoffset  .value_required:n  = true}
\NewDocumentCommand \__wi_Arrow_code_after {O{} mmm O{}}
     {\int_set:Nn \l__wi_pos_arrows_int 1
      \int_set:Nn \l__wi_previous_pos_arrows_int {-1}
      \group_begin:
           \int_set:Nn \l__wi_level_int 3
           \keys_set:nn {WithArrows/CodeAfter}
                        {#1,#5,tikz={xshift = \l__wi_xoffset_dim}}
           \bool_set_false:N \l__wi_initial_r_bool
           \bool_set_false:N \l__wi_final_r_bool
           \int_case:nn \l__wi_pos_arrows_int
                  {0 {\bool_set_true:N \l__wi_initial_r_bool
                      \bool_set_true:N \l__wi_final_r_bool}
                   2 {\bool_set_true:N \l__wi_initial_r_bool}
                   3 {\bool_set_true:N \l__wi_final_r_bool}}
           \cs_if_free:cTF {pgf@sh@ns@wa-\l__wi_prefix_str-#2-l}
             {\__wi_error:nx {Wrong~line~specification~in~Arrow} {#2}}
             {\cs_if_free:cTF {pgf@sh@ns@wa-\l__wi_prefix_str-#3-l}
                {\__wi_error:nx {Wrong~line~specification~in~Arrow} {#3}}
                {\int_compare:nNnTF \l__wi_pos_arrows_int = 4
                    {\begin{tikzpicture} [__wi_standard]
                        \tikz@scan@one@point\pgfutil@firstofone(#2-l.south)
                        \dim_set_eq:NN \l_tmpa_dim \pgf@x
                        \dim_set_eq:NN \l_tmpb_dim \pgf@y
                        \tikz@scan@one@point\pgfutil@firstofone(#3-l.north)
                        \dim_set:Nn \l_tmpa_dim {\dim_max:nn \l_tmpa_dim \pgf@x}
                        \tl_gset:Nx \g_tmpa_tl
                                    {\dim_use:N \l_tmpa_dim , \dim_use:N \l_tmpb_dim}
                        \tl_gset:Nx \g_tmpb_tl
                                    {\dim_use:N \l_tmpa_dim , \dim_use:N \pgf@y}
                     \end{tikzpicture} }
                    {\begin{tikzpicture} [__wi_standard]
                        \tikz@scan@one@point\pgfutil@firstofone
                                    (#2-\bool_if:NTF\l__wi_initial_r_bool rl .south)
                        \tl_gset:Nx \g_tmpa_tl {\dim_use:N \pgf@x , \dim_use:N \pgf@y}
                        \tikz@scan@one@point\pgfutil@firstofone
                                    (#3-\bool_if:NTF\l__wi_final_r_bool rl .north)
                        \tl_gset:Nx \g_tmpb_tl {\dim_use:N \pgf@x , \dim_use:N \pgf@y}
                     \end{tikzpicture}}
                 \__wi_draw_arrow:nnn {\g_tmpa_tl} {\g_tmpb_tl} {#4} }}
      \group_end:
      }
\cs_new_protected:Nn \__wi_MultiArrow:nn
    {
     \foreach \x in {#1} {\cs_if_free:cTF {pgf@sh@ns@wa-\l__wi_prefix_str-\x-l}
                            {\__wi_error:nx {Wrong~line~specification~in~MultiArrow} \x }
                            {\clist_gput_right:Nx \g_tmpa_clist \x}}
     \int_compare:nNnTF {\clist_count:N \g_tmpa_clist} < 2
       {\__wi_error:n {Too~small~specification~for~MultiArrow}}
       {\clist_sort:Nn \g_tmpa_clist
                       {\int_compare:nNnTF {##1} > {##2}
                             {\sort_return_swapped:}
                             {\sort_return_same:}}
        \clist_pop:NN \g_tmpa_clist \l_tmpa_tl
        \clist_reverse:N \g_tmpa_clist
        \clist_pop:NN \g_tmpa_clist \l_tmpb_tl
        \exp_args:Nx \__wi_MultiArrow_i:n {\g_tmpa_clist}
        \begin{tikzpicture}[__wi_standard,every~path/.style={WithArrows/arrow}]
          \draw [<->] ([xshift = \l__wi_xoffset_dim]\l_tmpa_tl-r.south)
                       -- ++(5mm,0)
                       -- node (__wi_label) {}
                          ([xshift = \l__wi_xoffset_dim+5mm]\l_tmpb_tl-r.south)
                       -- ([xshift = \l__wi_xoffset_dim]\l_tmpb_tl-r.south)  ;
          \tikz@parse@node \pgfutil@firstofone (__wi_label.west)
          \dim_set:Nn \l_tmpa_dim {20 cm}
          \path \pgfextra {\tl_gset:Nx \g_tmpa_tl \tikz@text@width} ;
          \tl_if_empty:NF \g_tmpa_tl {\dim_set:Nn \l_tmpa_dim \g_tmpa_tl}
          \bool_if:nT {\l__wi_wrap_lines_bool && \l__wi_in_DispWithArrows_bool}
                  {\dim_set:Nn \l_tmpb_dim {\g__wi_right_x_dim - \pgf@x - 0.3333 em}
                   \dim_compare:nNnT \l_tmpb_dim < \l_tmpa_dim
                           {\dim_set_eq:NN \l_tmpa_dim \l_tmpb_dim}}
          \path (__wi_label.west)
           node [anchor = west, text~width = \dim_use:N \l_tmpa_dim] {#2} ;
        \end{tikzpicture} } }

\cs_new_protected:Nn \__wi_MultiArrow_i:n
     {\begin{tikzpicture}[__wi_standard,every~path/.style={WithArrows/arrow}]
        \foreach \k in {#1}
           {\draw[<-] ([xshift = \l__wi_xoffset_dim]\k-r.south) -- ++(5mm,0) ;} ;
      \end{tikzpicture}}
\msg_new:nnn {witharrows}
             {AllowLineWithoutAmpersand}
             {The~option~"AllowLineWithoutAmpersand"~is~deprecated~because~lines~
              without~ampersands~are~now~always~allowed.~The~option~
              "AllowLineWithoutAmpersand"~will~probably~be~deleted~in~a~future~version.~
              However,~you~can~go~on~for~this~time.}
\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}
             {Third~column~in~an~environment~{WithArrows}}
             {By~default,~an~environment~\{WithArrows\}~can~only~have~two~columns.~
              Maybe~you~have~forgotten~a~\str_use:N \c_backslash_str
              \str_use:N \c_backslash_str.~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}
             {Third~column~in~an~environment~{DispWithArrows}}
             {An~environment~\{DispWithArrows\}~or~\{DispWithArrows*\}~can~only~
              have~two~columns.~If~you~go~on,~you~may~have~an~incorrect~output.}
\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}
             {An~arrow~specified~in~line~\int_use:N \l__wi_initial_int\ can't~be~drawn~
              because~it~arrives~after~the~last~line~of~the~environment~(remind~that~
              the~command~\token_to_str:N\Arrow\ must~be~in~the~*start*~line~
              of~the~arrow).~If~you~go~on,~this~arrow~will~be~ignored.}
\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}
             {{DispWithArrows}~used~in~math~mode}
             {The~environment~\{DispWithArrows\}~should~be~used~only~outside~math~mode.~
              If~you~go~on,~you~will~have~other~errors.}
\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__wi_previous_pos_arrows_int
                 {0 {rr}
                  1 {ll}
                  2 {rl}
                  3 {lr}
                  4 {v}
                  5 {i}
                  6 {groups}
                  7 {group}}"~
             set~in~the~same~
             \int_case:nn\l__wi_level_int
                  {1 {command~\token_to_str:N\WithArrowsOptions}
                   2 {declaration~of~options~of~the~environment~
                      \{\@currenvir\}}
                   3 {command~\token_to_str:N\Arrow}}.~
             If~you~go~on,~I~will~use~the~option~"\tl_use:N\l_keys_key_tl".}
\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}
             {Arrow~in~first~column}
             {You~should~not~use~the~command~\token_to_str:N\Arrow\
              \str_if_eq:NNF \l__wi_CommandName_tl \l_tmpa_tl
                    {(renamed~in~\str_use:N \c_backslash_str
                     \tl_use:N \l__wi_CommandName_tl)~}
              ~in~the~first~column~but~only~in~the~second~column.\\
              However~you~can~go~on~for~this~time.}
\msg_new:nnn {witharrows}
             {Wrong~line~specification~in~Arrow}
             {The~specification~of~line~"#1"~you~use~in~\token_to_str:N\Arrow\
              ~doesn't~exist.\\
              If~you~go~on,~the~arrow~will~be~ignored.}
\msg_new:nnn {witharrows}
             {Wrong~line~specification~in~MultiArrow}
             {The~specification~of~line~"#1"~doesn't~exist.\\
              If~you~go~on,~it~will~be~ignored~for~\token_to_str:N \MultiArrow.}
\msg_new:nnn {witharrows}
             {Too~small~specification~for~MultiArrow}
             {The~specification~of~lines~you~gave~to~\token_to_str:N \MultiArrow\
              is~too~small:~we~need~at~least~two~lines.~If~you~go~on,~the~
              command~\token_to_str:N\MultiArrow\ ~will~be~ignored.}
\msg_new:nnn {witharrows}
             {tag*~without~amsmath}
             {We~can't~use~\token_to_str:N\tag*~because~you~haven't~loaded~amsmath~
              (or~mathtools).~If~you~go~on,~the~command~\token_to_str:N\tag\
              will~be~used~instead.}
\msg_new:nnn {witharrows}
             {Command~not~allowed~in~{DispWithArrows}}
             {The~command~\token_to_str:N #1
              is~not~allowed~in~the~first~column~of~\{DispWithArrows\}~but~
              only~in~the~second~column.~If~you~go~on,~this~command~will~be~ignored.}
\msg_new:nnn {witharrows}
             {Command~not~allowed~in~{WithArrows}}
             {The~command~\token_to_str:N #1
              is~not~allowed~in~\{WithArrows\}~but~is~allowed~in~the~second~
              column~of~\{DispWithArrows\}~If~you~go~on,~this~command~will~be~ignored.}
\msg_new:nnn {witharrows}
             {Multiple~tags}
             {You~can't~use~twice~the~command~\token_to_str:N\tag\
              in~a~line~of~the~environment~\{\@currenvir\}.~If~you~go~on,~the~tag~
              '#1'~will~be~used.}
\msg_new:nnn {witharrows}
             {Multiple~labels}
             {Normally,~we~can't~use~the~command~\token_to_str:N\label\
              twice~in~a~line~of~the~environment~\{\@currenvir\}.~
              However,~you~can~go~on.~
              \bool_if:NT \c__wi_showlabels_loaded_bool
                  {However,~only~the~last~label~will~be~shown~by~showlabels.~}
              If~you~don't~want~to~see~this~message~again,~you~can~use~the~option~
              "AllowMultipleLabels"~at~the~global~or~environment~level.}
\msg_new:nnn {witharrows}
             {Multiple~labels~with~cleveref}
             {Since~you~use~cleveref,~you~can't~use~the~command~\token_to_str:N\label\
              twice~in~a~line~of~the~environment~\{\@currenvir\}.~
              If~you~go~on,~you~may~have~undefined~references.}
\coffin_new:N \l__wi_halign_coffin
\NewDocumentEnvironment {CasesWithArrows} {m O{}}
         {\hbox_set:Nn \l_tmpa_box {$\left\{\vcenter to 1cm {} \right.$}
          \dim_zero_new:N \l__wi_delim_wd_dim
          \dim_set:Nn \l__wi_delim_wd_dim {\box_wd:N \l_tmpa_box}
          \box_clear_new:N \l__wi_left_part_box
          \hbox_set:Nn \l__wi_left_part_box
                       {$\bool_if:NT \l__wi_displaystyle_bool \displaystyle #1 {}$}
          \bool_if:nT \c__wi_mathtools_loaded_bool
                 {\MH_if_boolean:nT {show_only_refs}
                    {\MT_showonlyrefs_false:
                      \MH_set_boolean_T:n {show_only_refs}
                      \clist_set:Nn \l__wi_tags_clist {all}}}
           \bool_if:NT \c__wi_amsmath_loaded_bool \intertext@
           \if_mode_math:
               \__wi_error:n {{DispWithArrows}~used~in~math~mode}
           \fi:
           \bool_set_true:N \l__wi_in_DispWithArrows_bool
           %
           \__wi_pre_environment:n {#2}
           \nointerlineskip
           \hbox_to_wd:nn {0.6\linewidth} {}
           $$
           \spread@equation
           \vcoffin_set:Nnw \l__wi_halign_coffin \displaywidth
              \bool_if:NTF \l__wi_fleqn_bool
                     {\tabskip = \c_zero_skip}
                     {\tabskip = 0 pt plus 1000 pt minus 1000 pt}
              \bool_if:NTF \c__wi_amsmath_loaded_bool
                 {\cs_set_eq:NN \__wi_old_label \ltx@label}
                 {\cs_set_eq:NN \__wi_old_label \label}
              \halign to \displaywidth \bgroup
                \int_gincr:N \g__wi_line_int
                \cs_set_eq:cN \l__wi_CommandName_tl \__wi_Arrow_first_column:
                \bool_set_true:N \l__wi_in_first_column_bool
                \strut
                \bool_if:NT \l__wi_fleqn_bool
                      {\skip_horizontal:n \l__wi_mathindent_dim}
                \hfil
                \skip_horizontal:n {\box_wd:N \l__wi_left_part_box + \l__wi_delim_wd_dim}
                $\bool_if:NT \l__wi_displaystyle_bool \displaystyle {##}$
                \tabskip = \c_zero_skip
               &
                \clist_if_in:NVT \l__wi_tags_clist \g__wi_line_int
                    {\clist_set:Nn \l__wi_tags_clist {all}}
                \cs_set:Npn \notag {\clist_clear:N \l__wi_tags_clist}
                $\bool_if:NT \l__wi_displaystyle_bool \displaystyle {{}##}$
                \tabskip = 0 pt plus 1000 pt minus 1000 pt
                \tikz [remember~picture,overlay]
                     \node [__wi_node_style,
                            name = wa-\l__wi_prefix_str-\int_use:N\g__wi_line_int-l,
                            alias = {\tl_if_empty:NF \l__wi_name_tl
                                      {\l__wi_name_tl-\int_use:N\g__wi_line_int-l}} ] {} ;
                \hfil
                \tikz [remember~picture,overlay]
                     \node [__wi_node_style,
                            name = wa-\l__wi_prefix_str-\int_use:N\g__wi_line_int-r,
                            alias = {\tl_if_empty:NF \l__wi_name_tl
                                      {\l__wi_name_tl-\int_use:N\g__wi_line_int-r}} ] {} ;
                \bool_if:NT \l__wi_shownodenames_bool
                     {\hbox_overlap_right:n {\small wa-\l__wi_prefix_str
                                                      -\int_use:N\g__wi_line_int}}
               & ##
                \tabskip = \c_zero_skip
               && \__wi_error:n {Third~column~in~an~environment~{DispWithArrows}}
                  \if_false: ## \fi:
                \cr}
          {\clist_if_in:NnT {last} \l__wi_tags_clist
                   {\clist_set:Nn \l__wi_tags_clist {all}}
              \\
              \egroup
              \unskip\unpenalty\unskip\unpenalty
              \box_set_to_last:N \l_tmpa_box
              \nointerlineskip
              \box_use:N \l_tmpa_box
              \dim_gzero_new:N \g__wi_alignment_dim
              \dim_gset:Nn \g__wi_alignment_dim {\box_wd:N \l_tmpa_box}
              \box_clear_new:N \l__wi_new_box
              \hbox_set:Nn \l__wi_new_box {\hbox_unpack_clear:N \l_tmpa_box}
              \dim_compare:nNnT {\box_wd:N \l__wi_new_box} < \g__wi_alignment_dim
                   {\dim_gset:Nn \g__wi_alignment_dim {\box_wd:N \l__wi_new_box}}
           \vcoffin_set_end:
           \hbox_to_wd:nn \displaywidth
             {
              \bool_if:NTF \l__wi_fleqn_bool
                    {\skip_horizontal:n \l__wi_mathindent_dim}
                    {\hfil}
              \hbox_to_wd:nn \g__wi_alignment_dim
                   { \box_use_drop:N \l__wi_left_part_box
                     \dim_set:Nn \l_tmpa_dim {   \box_ht:N \l__wi_halign_coffin
                                               + \box_dp:N \l__wi_halign_coffin}
                     $\left\{ \vcenter to \l_tmpa_dim {\vfil} \right.$}
              \hfil}
           \coffin_typeset:Nnnnn
                        \l__wi_halign_coffin {l} {vc} {-\displaywidth} \c_zero_dim
           $$
           \__wi_post_environment:
           \bool_if:nT \c__wi_mathtools_loaded_bool
                    {\MH_if_boolean:nT {show_only_refs}
                          \MT_showonlyrefs_true:}
           \bool_if:NT \g__wi_footnote_bool \endsavenotes
           \ignorespacesafterend
           }
\NewDocumentCommand \WithArrowsNewStyle {mm}
   { \keys_if_exist:nnTF {WithArrows/General} {#1}
       {\__wi_error:nn {Key~already~defined} {#1}}
       {\keys_define:nn {WithArrows/General}
            {#1 .code:n = {\int_compare:nNnTF \l__wi_level_int < 3
                              {\keys_set:nn {WithArrows/General} {#2}}
                              {\__wi_error:n {Option~unknown}}}}
        \group_begin:
           \WithArrowsOptions{#2}
        \group_end:} }
\msg_new:nnn {witharrows}
             {Key~already~defined}
             {The~key~'#1'~is~already~defined.~If~you~go~on,~
              your~instruction~\token_to_str:N\WithArrowsNewStyle\ will~be~ignored.}
\endinput
%%
%% End of file `witharrows.sty'.