-
Notifications
You must be signed in to change notification settings - Fork 177
/
l3candidates.dtx
4361 lines (4360 loc) · 154 KB
/
l3candidates.dtx
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
% \iffalse meta-comment
%
%% File: l3candidates.dtx Copyright (C) 2012-2017 The LaTeX3 Project
%
% It may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this
% license or (at your option) any later version. The latest version
% of this license is in the file
%
% https://www.latex-project.org/lppl.txt
%
% This file is part of the "l3kernel bundle" (The Work in LPPL)
% and all files in that bundle must be distributed together.
%
% -----------------------------------------------------------------------
%
% The development version of the bundle can be found at
%
% https://github.com/latex3/latex3
%
% for those people who are interested.
%
%<*driver>
\documentclass[full,kernel]{l3doc}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
%
% \title{^^A
% The \textsf{l3candidates} package\\ Experimental additions to
% \pkg{l3kernel}^^A
% }
%
% \author{^^A
% The \LaTeX3 Project\thanks
% {^^A
% E-mail:
% \href{mailto:latex-team@latex-project.org}
% {latex-team@latex-project.org}^^A
% }^^A
% }
%
% \date{Released 2017/11/14}
%
% \maketitle
%
% \begin{documentation}
%
% \section{Important notice}
%
% This module provides a space in which functions can be added to
% \pkg{l3kernel} (\pkg{expl3}) while still being experimental.
% \begin{quote}
% \bfseries
% As such, the
% functions here may not remain in their current form, or indeed at all,
% in \pkg{l3kernel} in the future.
% \end{quote}
% In contrast to the material in
% \pkg{l3experimental}, the functions here are all \emph{small} additions to
% the kernel. We encourage programmers to test them out and report back on
% the \texttt{LaTeX-L} mailing list.
%
% \medskip
%
% Thus, if you intend to use any of these functions from the candidate module in a public package
% offered to others for productive use (e.g., being placed on CTAN) please consider the following points carefully:
% \begin{itemize}
% \item Be prepared that your public packages might require updating when such functions
% are being finalized.
% \item Consider informing us that you use a particular function in your public package, e.g., by
% discussing this on the \texttt{LaTeX-L}
% mailing list. This way it becomes easier to coordinate any updates necessary without issues
% for the users of your package.
% \item Discussing and understanding use cases for a particular addition or concept also helps to
% ensure that we provide the right interfaces in the final version so please give us feedback
% if you consider a certain candidate function useful (or not).
% \end{itemize}
% We only add functions in this space if we consider them being serious candidates for a final inclusion
% into the kernel. However, real use sometimes leads to better ideas, so functions from this module are
% \textbf{not necessarily stable} and we may have to adjust them!
%
% \section{Additions to \pkg{l3basics}}
%
% \begin{function}[added = 2017-07-16, updated = 2017-08-02]{\debug_on:n, \debug_off:n}
% \begin{syntax}
% \cs{debug_on:n} |{| \meta{comma-separated list} |}|
% \cs{debug_off:n} |{| \meta{comma-separated list} |}|
% \end{syntax}
% Turn on and off within a group various debugging code, some of which
% is also available as \pkg{expl3} load-time options. The items that
% can be used in the \meta{list} are
% \begin{itemize}
% \item \texttt{check-declarations} that checks all \pkg{expl3}
% variables used were previously declared and that local/global
% variables (based on their name or on their first assignment) are
% only locally/globally assigned;
% \item \texttt{check-expressions} that checks integer, dimension,
% skip, and muskip expressions are not terminated prematurely;
% \item \texttt{deprecation} that makes soon-to-be-deprecated commands produce errors;
% \item \texttt{log-functions} that logs function definitions;
% \end{itemize}
% Providing these as switches rather than options allows testing code
% even if it relies on other packages: load all other packages, call
% \cs{debug_on:n}, and load the code that one is interested in
% testing. These functions can only be used in \LaTeXe{} package mode
% loaded with \texttt{enable-debug} or another option implying it.
% \end{function}
%
% \begin{function}[added = 2017-11-28]{\debug_suspend:, \debug_resume:}
% \begin{syntax}
% \cs{debug_suspend:} \ldots{} \cs{debug_resume:}
% \end{syntax}
% Suppress (locally) errors and logging from \texttt{debug} commands,
% except for the \texttt{deprecation} errors or warnings. These pairs
% of commands can be nested. This can be used around pieces of code
% that are known to fail checks, if such failures should be ignored.
% See for instance \pkg{l3coffins}.
% \end{function}
%
% \begin{function}[added = 2017-07-04]{\mode_leave_vertical:}
% \begin{syntax}
% \cs{mode_leave_vertical:}
% \end{syntax}
% Ensures that \TeX{} is not in vertical (inter-paragraph) mode. In
% horizontal or math mode this command has no effect, in vertical mode it
% switches to horizontal mode, and inserts a box of width
% \tn{parindent}, followed by the \tn{everypar} token list.
% \begin{texnote}
% This results in the contents of the \tn{everypar} token register being
% inserted, after \cs{mode_leave_vertical:} is complete. Notice that in
% contrast to the \LaTeXe{} \tn{leavevmode} approach, no box is used
% by the method implemented here.
% \end{texnote}
% \end{function}
%
% \section{Additions to \pkg{l3box}}
%
% \subsection{Viewing part of a box}
%
% \begin{function}{\box_clip:N, \box_clip:c}
% \begin{syntax}
% \cs{box_clip:N} \meta{box}
% \end{syntax}
% Clips the \meta{box} in the output so that only material inside the
% bounding box is displayed in the output. The updated \meta{box} is an
% hbox, irrespective of the nature of the \meta{box} before the clipping is
% applied. The clipping applies within the current \TeX{} group level.
%
% \textbf{These functions require the \LaTeX3 native drivers: they do
% not work with the \LaTeXe{} \pkg{graphics} drivers!}
%
% \begin{texnote}
% Clipping is implemented by the driver, and as such the full content of
% the box is placed in the output file. Thus clipping does not remove
% any information from the raw output, and hidden material can therefore
% be viewed by direct examination of the file.
% \end{texnote}
% \end{function}
%
% \begin{function}{\box_trim:Nnnnn, \box_trim:cnnnn}
% \begin{syntax}
% \cs{box_trim:Nnnnn} \meta{box} \Arg{left} \Arg{bottom} \Arg{right} \Arg{top}
% \end{syntax}
% Adjusts the bounding box of the \meta{box} \meta{left} is removed from
% the left-hand edge of the bounding box, \meta{right} from the right-hand
% edge and so fourth. All adjustments are \meta{dimension expressions}.
% Material outside of the bounding box is still displayed in the output
% unless \cs{box_clip:N} is subsequently applied.
% The updated \meta{box} is an
% hbox, irrespective of the nature of the \meta{box} before the trim
% operation is applied. The adjustment applies within the current \TeX{}
% group level. The behavior of the operation where the trims requested is
% greater than the size of the box is undefined.
% \end{function}
%
% \begin{function}{\box_viewport:Nnnnn, \box_viewport:cnnnn}
% \begin{syntax}
% \cs{box_viewport:Nnnnn} \meta{box} \Arg{llx} \Arg{lly} \Arg{urx} \Arg{ury}
% \end{syntax}
% Adjusts the bounding box of the \meta{box} such that it has lower-left
% co-ordinates (\meta{llx}, \meta{lly}) and upper-right co-ordinates
% (\meta{urx}, \meta{ury}). All four co-ordinate positions are
% \meta{dimension expressions}. Material outside of the bounding box is
% still displayed in the output unless \cs{box_clip:N} is
% subsequently applied.
% The updated \meta{box} is an
% hbox, irrespective of the nature of the \meta{box} before the viewport
% operation is applied. The adjustment applies within the current \TeX{}
% group level.
% \end{function}
%
% \section{Additions to \pkg{l3clist}}
%
% \begin{function}[EXP, added = 2016-12-06]
% {\clist_rand_item:N, \clist_rand_item:n, \clist_rand_item:c}
% \begin{syntax}
% \cs{clist_rand_item:N} \meta{clist~var}
% \cs{clist_rand_item:n} \Arg{comma list}
% \end{syntax}
% Selects a pseudo-random item of the \meta{comma list}. If the
% \meta{comma list} has no item, the result is empty. This is only
% available in \pdfTeX{} and \LuaTeX{}.
% \begin{texnote}
% The result is returned within the \tn{unexpanded}
% primitive (\cs{exp_not:n}), which means that the \meta{item}
% does not expand further when appearing in an \texttt{x}-type
% argument expansion.
% \end{texnote}
% \end{function}
%
% \section{Additions to \pkg{l3coffins}}
%
% \begin{function}{\coffin_resize:Nnn, \coffin_resize:cnn}
% \begin{syntax}
% \cs{coffin_resize:Nnn} \meta{coffin} \Arg{width} \Arg{total-height}
% \end{syntax}
% Resized the \meta{coffin} to \meta{width} and \meta{total-height},
% both of which should be given as dimension expressions.
% \end{function}
%
% \begin{function}{\coffin_rotate:Nn, \coffin_rotate:cn}
% \begin{syntax}
% \cs{coffin_rotate:Nn} \meta{coffin} \Arg{angle}
% \end{syntax}
% Rotates the \meta{coffin} by the given \meta{angle} (given in
% degrees counter-clockwise). This process rotates both the
% coffin content and poles. Multiple rotations do not result in
% the bounding box of the coffin growing unnecessarily.
% \end{function}
%
% \begin{function}{\coffin_scale:Nnn, \coffin_scale:cnn}
% \begin{syntax}
% \cs{coffin_scale:Nnn} \meta{coffin} \Arg{x-scale} \Arg{y-scale}
% \end{syntax}
% Scales the \meta{coffin} by a factors \meta{x-scale} and
% \meta{y-scale} in the horizontal and vertical directions,
% respectively. The two scale factors should be given as real numbers.
% \end{function}
%
% \section{Additions to \pkg{l3file}}
%
% \begin{function}[added = 2017-07-11]{\file_get_mdfive_hash:nN}
% \begin{syntax}
% \cs{file_get_mdfive_hash:nN} \Arg{file name} \meta{str var}
% \end{syntax}
% Searches for \meta{file name} using the current \TeX{} search
% path and the additional paths controlled by \cs{file_path_include:n}.
% If found, sets the \meta{str var} to the MD5 sum generated from the
% content of the file. The file is read as bytes, which means that in
% contrast to most \TeX{} behaviour there will be a difference in result
% depending on the line endings used in text files. The same file will
% produce the same result between different engines: the algorithm used
% is the same in all cases.
% Where the file is not found, the \meta{str var} will be empty.
% \end{function}
%
% \begin{function}[added = 2017-07-09]{\file_get_size:nN}
% \begin{syntax}
% \cs{file_get_size:nN} \Arg{file name} \meta{str var}
% \end{syntax}
% Searches for \meta{file name} using the current \TeX{} search
% path and the additional paths controlled by \cs{file_path_include:n}.
% If found, sets the \meta{str var} to the size of the file in bytes.
% Where the file is not found, the \meta{str var} will be empty.
% \begin{texnote}
% The \XeTeX{} engine provides no way to implement this function.
% \end{texnote}
% \end{function}
%
% \begin{function}[added = 2017-07-09]{\file_get_timestamp:nN}
% \begin{syntax}
% \cs{file_get_timestamp:nN} \Arg{file name} \meta{str var}
% \end{syntax}
% Searches for \meta{file name} using the current \TeX{} search
% path and the additional paths controlled by \cs{file_path_include:n}.
% If found, sets the \meta{str var} to the modification timestamp of
% the file in the form |D:|\meta{year}\meta{month}\meta{day}\meta{hour}^^A
% \meta{minute}\meta{second}\meta{offset}, where the latter may be |Z|
% (UTC) or \meta{plus-minus}\meta{hours}|'|\meta{minutes}|'|.
% Where the file is not found, the \meta{str var} will be empty.
% \begin{texnote}
% The \XeTeX{} engine provides no way to implement this function.
% \end{texnote}
% \end{function}
%
% \begin{function}[added = 2014-07-02]{\file_if_exist_input:n, \file_if_exist_input:nF}
% \begin{syntax}
% \cs{file_if_exist_input:n} \Arg{file name}
% \cs{file_if_exist_input:nF} \Arg{file name} \Arg{false code}
% \end{syntax}
% Searches for \meta{file name} using the current \TeX{} search
% path and the additional paths controlled by
% \cs{file_path_include:n}. If found then
% reads in the file as additional \LaTeX{} source as described for
% \cs{file_input:n}, otherwise inserts the \meta{false code}.
% Note that these functions do not raise
% an error if the file is not found, in contrast to \cs{file_input:n}.
% \end{function}
%
% \begin{function}[added = 2017-07-07]{\file_input_stop:}
% \begin{syntax}
% \cs{file_input_stop:}
% \end{syntax}
% Ends the reading of a file started by \cs{file_input:n} or similar before
% the end of the file is reached. Where the file reading is being terminated
% due to an error, \cs{msg_critical:nn(nn)} should be preferred.
% \begin{texnote}
% This function must be used on a line on its own: \TeX{} reads files
% line-by-line and so any additional tokens in the \enquote{current} line
% will still be read.
%
% This is also true if the function is hidden inside another function
% (which will be the normal case), i.e., all tokens on the same line
% in the source file are still processed. Putting it on a line by itself
% in the definition doesn't help as it is the line where it is used that
% counts!
% \end{texnote}
% \end{function}
%
% \section{Additions to \pkg{l3int}}
%
% \begin{function}[EXP, added = 2016-12-06]{\int_rand:nn}
% \begin{syntax}
% \cs{int_rand:nn} \Arg{intexpr_1} \Arg{intexpr_2}
% \end{syntax}
% Evaluates the two \meta{integer expressions} and produces a
% pseudo-random number between the two (with bounds included). This
% is only available in \pdfTeX{} and \LuaTeX{}.
% \end{function}
%
% \section{Additions to \pkg{l3msg}}
%
% In very rare cases it may be necessary to produce errors in an
% expansion-only context. The functions in this section should only be
% used if there is no alternative approach using \cs{msg_error:nnnnnn}
% or other non-expandable commands from the previous section. Despite
% having a similar interface as non-expandable messages, expandable
% errors must be handled internally very differently from normal error
% messages, as none of the tools to print to the terminal or the log
% file are expandable. As a result, the message text and arguments are
% not expanded, and messages must be very short (with default settings,
% they are truncated after approximately 50 characters). It is
% advisable to ensure that the message is understandable even when
% truncated. Another particularity of expandable messages is that they
% cannot be redirected or turned off by the user.
%
% \begin{function}[EXP, added = 2015-08-06]
% {
% \msg_expandable_error:nnnnnn ,
% \msg_expandable_error:nnnnn ,
% \msg_expandable_error:nnnn ,
% \msg_expandable_error:nnn ,
% \msg_expandable_error:nn ,
% \msg_expandable_error:nnffff ,
% \msg_expandable_error:nnfff ,
% \msg_expandable_error:nnff ,
% \msg_expandable_error:nnf ,
% }
% \begin{syntax}
% \cs{msg_expandable_error:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
% \end{syntax}
% Issues an \enquote{Undefined error} message from \TeX{} itself
% using the undefined control sequence \cs{::error} then prints
% \enquote{! \meta{module}: }\meta{error message}, which should be
% short. With default settings, anything beyond approximately $60$
% characters long (or bytes in some engines) is cropped. A leading
% space might be removed as well.
% \end{function}
%
% \begin{function}[added = 2017-12-04]{\msg_show_eval:Nn, \msg_log_eval:Nn}
% \begin{syntax}
% \cs{msg_show_eval:Nn} \meta{function} \Arg{expression}
% \end{syntax}
% Shows or logs the \meta{expression} (turned into a string), an equal
% sign, and the result of applying the \meta{function} to the
% \Arg{expression} (with \texttt{f}-expansion). For instance, if the
% \meta{function} is \cs{int_eval:n} and the \meta{expression} is
% |1+2| then this logs |> 1+2=3.|
% \end{function}
%
% \begin{function}[added = 2017-12-04]
% {
% \msg_show:nnnnnn ,
% \msg_show:nnnnn ,
% \msg_show:nnnn ,
% \msg_show:nnn ,
% \msg_show:nn ,
% \msg_show:nnxxxx ,
% \msg_show:nnxxx ,
% \msg_show:nnxx ,
% \msg_show:nnx
% }
% \begin{syntax}
% \cs{msg_show:nnnnnn} \Arg{module} \Arg{message} \Arg{arg one} \Arg{arg two} \Arg{arg three} \Arg{arg four}
% \end{syntax}
% Issues \meta{module} information \meta{message}, passing \meta{arg
% one} to \meta{arg four} to the text-creating functions. The
% information text is shown on the terminal and the \TeX{} run is
% interrupted in a manner similar to \cs{tl_show:n}. This is used in
% conjunction with \cs{msg_show_item:n} and similar functions to print
% complex variable contents completely. If the formatted text does
% not contain |>~| at the start of a line, an additional line |>~.|
% will be put at the end. In addition, a final period is added if not
% present.
% \end{function}
%
% \begin{function}[EXP, added = 2017-12-04]
% {\msg_show_item:n, \msg_show_item_unbraced:n, \msg_show_item:nn, \msg_show_item_unbraced:nn}
% \begin{syntax}
% \cs{seq_map_function:NN} \meta{seq} \cs{msg_show_item:n}
% \cs{prop_map_function:NN} \meta{prop} \cs{msg_show_item:nn}
% \end{syntax}
% Used in the text of messages for \cs{msg_show:nnxxxx} to show or log
% a list of items or key--value pairs. The one-argument functions are
% used for sequences, clist or token lists and the others for property
% lists. These functions turn their arguments to strings.
% \end{function}
%
% \section{Additions to \pkg{l3prg}}
%
% \begin{function}[added = 2017-11-28]{\bool_const:Nn, \bool_const:cn}
% \begin{syntax}
% \cs{bool_const:Nn} \meta{boolean} \Arg{boolexpr}
% \end{syntax}
% Creates a new constant \meta{boolean} or raises an error if the name
% is already taken. The value of the \meta{boolean} is set globally to
% the result of evaluating the \meta{boolexpr}.
% \end{function}
%
% \section{Additions to \pkg{l3prop}}
%
% \begin{function}[EXP]{\prop_count:N, \prop_count:c}
% \begin{syntax}
% \cs{prop_count:N} \meta{property list}
% \end{syntax}
% Leaves the number of key--value pairs in the \meta{property list} in
% the input stream as an \meta{integer denotation}.
% \end{function}
%
% \begin{function}[rEXP]
% {\prop_map_tokens:Nn, \prop_map_tokens:cn}
% \begin{syntax}
% \cs{prop_map_tokens:Nn} \meta{property list} \Arg{code}
% \end{syntax}
% Analogue of \cs{prop_map_function:NN} which maps several tokens
% instead of a single function. The \meta{code} receives each
% key--value pair in the \meta{property list} as two trailing brace
% groups. For instance,
% \begin{verbatim}
% \prop_map_tokens:Nn \l_my_prop { \str_if_eq:nnT { mykey } }
% \end{verbatim}
% expands to the value corresponding to \texttt{mykey}: for each
% pair in |\l_my_prop| the function \cs{str_if_eq:nnT} receives
% \texttt{mykey}, the \meta{key} and the \meta{value} as its three
% arguments. For that specific task, \cs{prop_item:Nn} is faster.
% \end{function}
%
% \begin{function}[EXP, added = 2016-12-06]
% {\prop_rand_key_value:N, \prop_rand_key_value:c}
% \begin{syntax}
% \cs{prop_rand_key_value:N} \meta{prop~var}
% \end{syntax}
% Selects a pseudo-random key--value pair in the \meta{property list}
% and returns \Arg{key}\Arg{value}. If the \meta{property list} is
% empty the result is empty. This is only available in \pdfTeX{} and
% \LuaTeX{}.
% \begin{texnote}
% The result is returned within the \tn{unexpanded}
% primitive (\cs{exp_not:n}), which means that the \meta{value}
% does not expand further when appearing in an \texttt{x}-type
% argument expansion.
% \end{texnote}
% \end{function}
%
% \begin{function}[added = 2017-11-28]
% {
% \prop_set_from_keyval:Nn, \prop_set_from_keyval:cn,
% \prop_gset_from_keyval:Nn, \prop_gset_from_keyval:cn,
% }
% \begin{syntax}
% \cs{prop_set_from_keyval:Nn} \meta{prop~var}
% \{
% \meta{key1} |=| \meta{value1} |,|
% \meta{key2} |=| \meta{value2} |,| \ldots{}
% \}
% \end{syntax}
% Sets \meta{prop~var} to contain key--value pairs given in the second
% argument.
% \end{function}
%
% \begin{function}[added = 2017-11-28]
% {\prop_const_from_keyval:Nn, \prop_const_from_keyval:cn}
% \begin{syntax}
% \cs{prop_const_from_keyval:Nn} \meta{prop~var}
% \{
% \meta{key1} |=| \meta{value1} |,|
% \meta{key2} |=| \meta{value2} |,| \ldots{}
% \}
% \end{syntax}
% Creates a new constant \meta{prop~var} or raises an error if the
% name is already taken. The \meta{prop~var} is set globally to
% contain key--value pairs given in the second argument.
% \end{function}
%
% \section{Additions to \pkg{l3seq}}
%
% \begin{function}[rEXP]
% {
% \seq_mapthread_function:NNN, \seq_mapthread_function:NcN,
% \seq_mapthread_function:cNN, \seq_mapthread_function:ccN
% }
% \begin{syntax}
% \cs{seq_mapthread_function:NNN} \meta{seq_1} \meta{seq_2} \meta{function}
% \end{syntax}
% Applies \meta{function} to every pair of items
% \meta{seq_1-item}--\meta{seq_2-item} from the two sequences, returning
% items from both sequences from left to right. The \meta{function}
% receives two \texttt{n}-type arguments for each iteration. The mapping
% terminates when
% the end of either sequence is reached (\emph{i.e.}~whichever sequence has
% fewer items determines how many iterations
% occur).
% \end{function}
%
% \begin{function}{\seq_set_filter:NNn, \seq_gset_filter:NNn}
% \begin{syntax}
% \cs{seq_set_filter:NNn} \meta{sequence_1} \meta{sequence_2} \Arg{inline boolexpr}
% \end{syntax}
% Evaluates the \meta{inline boolexpr} for every \meta{item} stored
% within the \meta{sequence_2}. The \meta{inline boolexpr}
% receives the \meta{item} as |#1|. The sequence of all \meta{items}
% for which the \meta{inline boolexpr} evaluated to \texttt{true}
% is assigned to \meta{sequence_1}.
% \begin{texnote}
% Contrarily to other mapping functions, \cs{seq_map_break:} cannot
% be used in this function, and would lead to low-level \TeX{} errors.
% \end{texnote}
% \end{function}
%
% \begin{function}[added = 2011-12-22]
% {\seq_set_map:NNn, \seq_gset_map:NNn}
% \begin{syntax}
% \cs{seq_set_map:NNn} \meta{sequence_1} \meta{sequence_2} \Arg{inline function}
% \end{syntax}
% Applies \meta{inline function} to every \meta{item} stored
% within the \meta{sequence_2}. The \meta{inline function} should
% consist of code which will receive the \meta{item} as |#1|.
% The sequence resulting from \texttt{x}-expanding
% \meta{inline function} applied to each \meta{item}
% is assigned to \meta{sequence_1}. As such, the code
% in \meta{inline function} should be expandable.
% \begin{texnote}
% Contrarily to other mapping functions, \cs{seq_map_break:} cannot
% be used in this function, and would lead to low-level \TeX{} errors.
% \end{texnote}
% \end{function}
%
% \begin{function}[EXP, added = 2016-12-06]{\seq_rand_item:N, \seq_rand_item:c}
% \begin{syntax}
% \cs{seq_rand_item:N} \meta{seq~var}
% \end{syntax}
% Selects a pseudo-random item of the \meta{sequence}. If the
% \meta{sequence} is empty the result is empty. This is only
% available in \pdfTeX{} and \LuaTeX{}.
% \begin{texnote}
% The result is returned within the \tn{unexpanded}
% primitive (\cs{exp_not:n}), which means that the \meta{item}
% does not expand further when appearing in an \texttt{x}-type
% argument expansion.
% \end{texnote}
% \end{function}
%
% \begin{function}[added = 2017-11-28]
% {\seq_const_from_clist:Nn, \seq_const_from_clist:cn}
% \begin{syntax}
% \cs{seq_const_from_clist:Nn} \meta{seq~var} \Arg{comma-list}
% \end{syntax}
% Creates a new constant \meta{seq~var} or raises an error if the name
% is already taken. The \meta{seq~var} is set globally to contain the
% items in the \meta{comma list}.
% \end{function}
%
% \section{Additions to \pkg{l3skip}}
%
% \begin{function}{\skip_split_finite_else_action:nnNN}
% \begin{syntax}
% \cs{skip_split_finite_else_action:nnNN} \Arg{skipexpr} \Arg{action}
% ~~\meta{dimen_1} \meta{dimen_2}
% \end{syntax}
% Checks if the \meta{skipexpr} contains finite glue. If it does then it
% assigns
% \meta{dimen_1} the stretch component and \meta{dimen_2} the shrink
% component. If
% it contains infinite glue set \meta{dimen_1} and \meta{dimen_2} to $0$\,pt
% and place |#2| into the input stream: this is usually an error or
% warning message of some sort.
% \end{function}
%
% \section{Additions to \pkg{l3sys}}
%
% \begin{function}[added = 2017-05-27, EXP, pTF]{\sys_if_rand_exist:}
% \begin{syntax}
% \cs{sys_if_rand_exist_p:}
% \cs{sys_if_rand_exist:TF} \Arg{true code} \Arg{false code}
% \end{syntax}
% Tests if the engine has a pseudo-random number generator. Currently
% this is the case in \pdfTeX{} and \LuaTeX{}.
% \end{function}
%
% \begin{function}[added = 2017-05-27, EXP]{\sys_rand_seed:}
% \begin{syntax}
% \cs{sys_rand_seed:}
% \end{syntax}
% Expands to the current value of the engine's random seed, a
% non-negative integer. In engines without random number support this
% expands to $0$.
% \end{function}
%
% \begin{function}[added = 2017-05-27]{\sys_gset_rand_seed:n}
% \begin{syntax}
% \cs{sys_gset_rand_seed:n} \Arg{intexpr}
% \end{syntax}
% Sets the seed for the engine's pseudo-random number generator to the
% \meta{integer expression}. The assignment is global. This random
% seed affects all \cs[no-index]{\ldots{}_rand} functions (such as
% \cs{int_rand:nn} or \cs{clist_rand_item:n}) as well as other
% packages relying on the engine's random number generator. Currently
% only the absolute value of the seed is used. In engines without
% random number support this produces an error.
% \end{function}
%
% \begin{variable}[added = 2017-05-27]{\c_sys_shell_escape_int}
% This variable exposes the internal triple of the shell escape
% status. The possible values are
% \begin{description}
% \item[0] Shell escape is disabled
% \item[1] Unrestricted shell escape is enabled
% \item[2] Restricted shell escape is enabled
% \end{description}
% \end{variable}
%
% \begin{function}[added = 2017-05-27, EXP, pTF]{\sys_if_shell:}
% \begin{syntax}
% \cs{sys_if_shell_p:}
% \cs{sys_if_shell:TF} \Arg{true code} \Arg{false code}
% \end{syntax}
% Performs a check for whether shell escape is enabled. This
% returns true if either of restricted or unrestricted shell escape
% is enabled.
% \end{function}
%
% \begin{function}[added = 2017-05-27, EXP, pTF]{\sys_if_shell_unrestricted:}
% \begin{syntax}
% \cs{sys_if_shell_unrestricted_p:}
% \cs{sys_if_shell_unrestricted:TF} \Arg{true code} \Arg{false code}
% \end{syntax}
% Performs a check for whether \emph{unrestricted} shell escape is
% enabled.
% \end{function}
%
% \begin{function}[added = 2017-05-27, EXP, pTF]{\sys_if_shell_restricted:}
% \begin{syntax}
% \cs{sys_if_shell_restricted_p:}
% \cs{sys_if_shell_restricted:TF} \Arg{true code} \Arg{false code}
% \end{syntax}
% Performs a check for whether \emph{restricted} shell escape is
% enabled. This returns false if unrestricted shell escape is
% enabled. Unrestricted shell escape is not considered a superset
% of restricted shell escape in this case. To find whether any
% shell escape is enabled use \cs{sys_if_shell:}.
% \end{function}
%
% \begin{function}[added = 2017-05-27]{\sys_shell_now:n, \sys_shell_now:x}
% \begin{syntax}
% \cs{sys_shell_now:n} \Arg{tokens}
% \end{syntax}
% Execute \meta{tokens} through shell escape immediately.
% \end{function}
%
% \begin{function}[added = 2017-05-27]{\sys_shell_shipout:n, \sys_shell_shipout:x}
% \begin{syntax}
% \cs{sys_shell_shipout:n} \Arg{tokens}
% \end{syntax}
% Execute \meta{tokens} through shell escape at shipout.
% \end{function}
%
% \section{Additions to \pkg{l3tl}}
%
% \begin{function}[EXP,pTF]{\tl_if_single_token:n}
% \begin{syntax}
% \cs{tl_if_single_token_p:n} \Arg{token list}
% \cs{tl_if_single_token:nTF} \Arg{token list} \Arg{true code} \Arg{false code}
% \end{syntax}
% Tests if the token list consists of exactly one token, \emph{i.e.}~is
% either a single space character or a single \enquote{normal} token.
% Token groups (|{|\ldots|}|) are not single tokens.
% \end{function}
%
% \begin{function}[EXP]{\tl_reverse_tokens:n}
% \begin{syntax}
% \cs{tl_reverse_tokens:n} \Arg{tokens}
% \end{syntax}
% This function, which works directly on \TeX{} tokens, reverses
% the order of the \meta{tokens}: the first becomes the last and
% the last becomes first. Spaces are preserved. The reversal
% also operates within brace groups, but the braces themselves
% are not exchanged, as this would lead to an unbalanced token
% list. For instance, \cs{tl_reverse_tokens:n} |{a~{b()}}|
% leaves |{)(b}~a| in the input stream. This function requires
% two steps of expansion.
% \begin{texnote}
% The result is returned within the \tn{unexpanded}
% primitive (\cs{exp_not:n}), which means that the token
% list does not expand further when appearing in an \texttt{x}-type
% argument expansion.
% \end{texnote}
% \end{function}
%
% \begin{function}[EXP]{\tl_count_tokens:n}
% \begin{syntax}
% \cs{tl_count_tokens:n} \Arg{tokens}
% \end{syntax}
% Counts the number of \TeX{} tokens in the \meta{tokens} and leaves
% this information in the input stream. Every token, including spaces and
% braces, contributes one to the total; thus for instance, the token count of
% |a~{bc}| is $6$.
% This function requires three expansions,
% giving an \meta{integer denotation}.
% \end{function}
%
% \begin{function}[EXP, added = 2014-06-30, updated = 2016-01-12]
% {
% \tl_lower_case:n, \tl_upper_case:n, \tl_mixed_case:n,
% \tl_lower_case:nn, \tl_upper_case:nn, \tl_mixed_case:nn
% }
% \begin{syntax}
% \cs{tl_upper_case:n} \Arg{tokens}
% \cs{tl_upper_case:nn} \Arg{language} \Arg{tokens}
% \end{syntax}
% These functions are intended to be applied to input which may be
% regarded broadly as \enquote{text}. They traverse the \meta{tokens} and
% change the case of characters as discussed below. The character code of
% the characters replaced may be arbitrary: the replacement characters
% have standard document-level category codes ($11$ for letters, $12$ for
% letter-like characters which can also be case-changed). Begin-group and
% end-group characters in the \meta{tokens} are normalized and become |{|
% and |}|, respectively.
%
% Importantly, notice that these functions are intended for working with
% user text for typesetting. For case changing programmatic data see the
% \pkg{l3str} module and discussion there of \cs{str_lower_case:n},
% \cs{str_upper_case:n} and \cs{str_fold_case:n}.
% \end{function}
%
% The functions perform expansion on the input in most cases. In particular,
% input in the form of token lists or expandable functions is expanded
% \emph{unless} it falls within one of the special handling classes described
% below. This expansion approach means that in general the result of case
% changing matches the \enquote{natural} outcome expected from a
% \enquote{functional} approach to case modification. For example
% \begin{verbatim}
% \tl_set:Nn \l_tmpa_tl { hello }
% \tl_upper_case:n { \l_tmpa_tl \c_space_tl world }
% \end{verbatim}
% produces
% \begin{verbatim}
% HELLO WORLD
% \end{verbatim}
% The expansion approach taken means that in package mode any \LaTeXe{}
% \enquote{robust} commands which may appear in the input should be converted
% to engine-protected versions using for example the \tn{robustify} command
% from the \pkg{etoolbox} package.
%
% \begin{variable}{\l_tl_case_change_math_tl}
% Case changing does not take place within math mode material so for example
% \begin{verbatim}
% \tl_upper_case:n { Some~text~$y = mx + c$~with~{Braces} }
% \end{verbatim}
% becomes
% \begin{verbatim}
% SOME TEXT $y = mx + c$ WITH {BRACES}
% \end{verbatim}
% Material inside math mode is left entirely unchanged: in particular, no
% expansion is undertaken.
%
% Detection of math mode is controlled by the list of tokens in
% \cs{l_tl_case_change_math_tl}, which should be in open--close pairs. In
% package mode the standard settings is
% \begin{verbatim}
% $ $ \( \)
% \end{verbatim}
%
% Note that while expansion occurs when searching the text it does not
% apply to math mode material (which should be unaffected by case changing).
% As such, whilst the opening token for math mode may be \enquote{hidden}
% inside a command/macro, the closing one cannot be as this is being
% searched for in math mode. Typically, in the types of \enquote{text}
% the case changing functions are intended to apply to this should not be
% an issue.
% \end{variable}
%
% \begin{variable}{\l_tl_case_change_exclude_tl}
% Case changing can be prevented by using any command on the list
% \cs{l_tl_case_change_exclude_tl}. Each entry should be a function
% to be followed by one argument: the latter will be preserved as-is
% with no expansion. Thus for example following
% \begin{verbatim}
% \tl_put_right:Nn \l_tl_case_change_exclude_tl { \NoChangeCase }
% \end{verbatim}
% the input
% \begin{verbatim}
% \tl_upper_case:n
% { Some~text~$y = mx + c$~with~\NoChangeCase {Protection} }
% \end{verbatim}
% will result in
% \begin{verbatim}
% SOME TEXT $y = mx + c$ WITH \NoChangeCase {Protection}
% \end{verbatim}
% Notice that the case changing mapping preserves the inclusion of
% the escape functions: it is left to other code to provide suitable
% definitions (typically equivalent to \cs{use:n}). In particular, the
% result of case changing is returned protected by \cs{exp_not:n}.
%
% When used with \LaTeXe{} the commands |\cite|, |\ensuremath|, |\label|
% and |\ref| are automatically included in the list for exclusion from
% case changing.
% \end{variable}
%
% \begin{variable}{\l_tl_case_change_accents_tl}
% This list specifies accent commands which should be left unexpanded
% in the output. This allows for example
% \begin{verbatim}
% \tl_upper_case:n { \" { a } }
% \end{verbatim}
% to yield
% \begin{verbatim}
% \" { A }
% \end{verbatim}
% irrespective of the expandability of |\"|.
%
% The standard contents of this variable is |\"|, |\'|, |\.|, |\^|, |\`|,
% |\~|, |\c|, |\H|, |\k|, |\r|, |\t|, |\u| and |\v|.
% \end{variable}
%
% \enquote{Mixed} case conversion may be regarded informally as converting the
% first character of the \meta{tokens} to upper case and the rest to lower
% case. However, the process is more complex than this as there are some
% situations where a single lower case character maps to a special form, for
% example \texttt{ij} in Dutch which becomes \texttt{IJ}. As such,
% \cs[index=tl_mixed_case:n]{tl_mixed_case:n(n)}
% implement a more sophisticated mapping which accounts
% for this and for modifying accents on the first letter. Spaces at the start
% of the \meta{tokens} are ignored when finding the first \enquote{letter} for
% conversion.
% \begin{verbatim}
% \tl_mixed_case:n { hello~WORLD } % => "Hello world"
% \tl_mixed_case:n { ~hello~WORLD } % => " Hello world"
% \tl_mixed_case:n { {hello}~WORLD } % => "{Hello} world"
% \end{verbatim}
% When finding the first \enquote{letter} for this process, any content in
% math mode or covered by \cs{l_tl_case_change_exclude_tl} is ignored.
%
% (Note that the Unicode Consortium describe this as \enquote{title case}, but
% that in English title case applies on a word-by-word basis. The
% \enquote{mixed} case implemented here is a lower level concept needed for
% both \enquote{title} and \enquote{sentence} casing of text.)
%
% \begin{variable}{\l_tl_mixed_case_ignore_tl}
% The list of characters to ignore when searching for the first
% \enquote{letter} in mixed-casing is determined by
% \cs{l_tl_mixed_change_ignore_tl}. This has the standard setting
% \begin{verbatim}
% ( [ { ` -
% \end{verbatim}
% where comparisons are made on a character basis.
% \end{variable}
%
% As is generally true for \pkg{expl3}, these functions are designed to
% work with Unicode input only. As such, UTF-8 input is assumed for
% \emph{all} engines. When used with \XeTeX{} or \LuaTeX{} a full range of
% Unicode transformations are enabled. Specifically, the standard mappings
% here follow those defined by the \href{http://www.unicode.org}^^A
% {Unicode Consortium} in \texttt{UnicodeData.txt} and
% \texttt{SpecialCasing.txt}. In the case of $8$-bit engines, mappings
% are provided for characters which can be represented in output typeset
% using the |T1| font encoding. Thus for example |ä| can be case-changed
% using \pdfTeX{}. For \pTeX{} only the ASCII range is covered as the
% engine treats input outside of this range as east Asian.
%
% Context-sensitive mappings are enabled: language-dependent cases are
% discussed below. Context detection expands input but treats any
% unexpandable control sequences as \enquote{failures} to match a context.
%
% Language-sensitive conversions are enabled using the \meta{language}
% argument, and follow Unicode Consortium guidelines. Currently, the
% languages recognised for special handling are as follows.
% \begin{itemize}
% \item Azeri and Turkish (\texttt{az} and \texttt{tr}).
% The case pairs I/i-dotless and I-dot/i are activated for these
% languages. The combining dot mark is removed when lower
% casing I-dot and introduced when upper casing i-dotless.
% \item German (\texttt{de-alt}).
% An alternative mapping for German in which the lower case
% \emph{Eszett} maps to a \emph{gro\ss{}es Eszett}.
% \item Lithuanian (\texttt{lt}).
% The lower case letters i and j should retain a dot above when the
% accents grave, acute or tilde are present. This is implemented for
% lower casing of the relevant upper case letters both when input as
% single Unicode codepoints and when using combining accents. The
% combining dot is removed when upper casing in these cases. Note that
% \emph{only} the accents used in Lithuanian are covered: the behaviour
% of other accents are not modified.
% \item Dutch (\texttt{nl}).
% Capitalisation of \texttt{ij} at the beginning of mixed cased
% input produces \texttt{IJ} rather than \texttt{Ij}. The output
% retains two separate letters, thus this transformation \emph{is}
% available using \pdfTeX{}.
% \end{itemize}
%
% Creating additional context-sensitive mappings requires knowledge
% of the underlying mapping implementation used here. The team are happy
% to add these to the kernel where they are well-documented
% (\emph{e.g.}~in Unicode Consortium or relevant government publications).
%
% \begin{function}[added = 2014-06-25]
% {
% \tl_set_from_file:Nnn, \tl_set_from_file:cnn,
% \tl_gset_from_file:Nnn, \tl_gset_from_file:cnn
% }
% \begin{syntax}
% \cs{tl_set_from_file:Nnn} \meta{tl} \Arg{setup} \Arg{filename}
% \end{syntax}
% Defines \meta{tl} to the contents of \meta{filename}.
% Category codes may need to be set appropriately via the \meta{setup}
% argument.
% \end{function}
%
% \begin{function}[added = 2014-06-25]
% {
% \tl_set_from_file_x:Nnn, \tl_set_from_file_x:cnn,
% \tl_gset_from_file_x:Nnn, \tl_gset_from_file_x:cnn
% }
% \begin{syntax}
% \cs{tl_set_from_file_x:Nnn} \meta{tl} \Arg{setup} \Arg{filename}
% \end{syntax}
% Defines \meta{tl} to the contents of \meta{filename}, expanding
% the contents of the file as it is read. Category codes and other
% definitions may need to be set appropriately via the \meta{setup}
% argument.
% \end{function}
%
% \begin{function}[EXP, added = 2016-12-06]
% {\tl_rand_item:N, \tl_rand_item:c, \tl_rand_item:n}
% \begin{syntax}
% \cs{tl_rand_item:N} \meta{tl~var}
% \cs{tl_rand_item:n} \Arg{token list}
% \end{syntax}
% Selects a pseudo-random item of the \meta{token list}. If the
% \meta{token list} is blank, the result is empty. This is only
% available in \pdfTeX{} and \LuaTeX{}.
% \begin{texnote}
% The result is returned within the \tn{unexpanded}
% primitive (\cs{exp_not:n}), which means that the \meta{item}
% does not expand further when appearing in an \texttt{x}-type
% argument expansion.
% \end{texnote}
% \end{function}
%
% \begin{function}[EXP, added = 2017-02-17, updated = 2017-07-15]{\tl_range:nnn}
% \begin{syntax}
% \cs{tl_range:Nnn} \meta{tl~var} \Arg{start index} \Arg{end index}
% \cs{tl_range:nnn} \Arg{token list} \Arg{start index} \Arg{end index}
% \end{syntax}
% Leaves in the input stream the items from the \meta{start index} to the
% \meta{end index} inclusive. Spaces and braces are preserved between
% the items returned (but never at either end of the list). Positive
% \meta{indices} are counted
% from the start of the \meta{token list}, $1$~being the first item, and
% negative \meta{indices} are counted from the end of the token list,
% $-1$~being the last item. If either of \meta{start index} or
% \meta{end index} is~$0$, the result is empty. For instance,
% \begin{verbatim}
% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { 2 } { 5 } }
% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { -4 } { -1 } }
% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { -2 } { -1 } }
% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { 0 } { -1 } }
% \end{verbatim}
% prints \verb*|bcd {e{}}|, \verb*|cd {e{}}f|, \verb*|{e{}}f| and an empty
% line to the terminal. The \meta{start index} must always be smaller than
% or equal to the \meta{end index}: if this is not the case then no output
% is generated. Thus
% \begin{verbatim}
% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { 5 } { 2 } }
% \iow_term:x { \tl_range:nnn { abcd~{e{}}f } { -1 } { -4 } }
% \end{verbatim}
% both yield empty token lists. For improved performance, see
% \cs{tl_range_braced:nnn} and \cs{tl_range_unbraced:nnn}.