summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-01-01 20:32:12 +0000
committerKarl Berry <karl@freefriends.org>2023-01-01 20:32:12 +0000
commit855d5215723f5bff8afadcf46452597e5873b8a8 (patch)
tree0c5d4628ef7be59d096f8ded7fe6b3137c9bb849 /Master/texmf-dist/tex/generic
parent9bca2e005cf2d87e637dbd5910442f26ba5fd5af (diff)
witharrows (1jan23)
git-svn-id: svn://tug.org/texlive/trunk@65425 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r--Master/texmf-dist/tex/generic/witharrows/witharrows.sty251
1 files changed, 195 insertions, 56 deletions
diff --git a/Master/texmf-dist/tex/generic/witharrows/witharrows.sty b/Master/texmf-dist/tex/generic/witharrows/witharrows.sty
index 54a29d97d40..f4a208a7f1c 100644
--- a/Master/texmf-dist/tex/generic/witharrows/witharrows.sty
+++ b/Master/texmf-dist/tex/generic/witharrows/witharrows.sty
@@ -6,7 +6,7 @@
%%
%% witharrows.dtx (with options: `LaTeX')
%%
-%% Copyright (C) 2017-2022 by F. Pantigny
+%% Copyright (C) 2017-2023 by F. Pantigny
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
@@ -18,8 +18,8 @@
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
-\def\myfileversion{2.7}
-\def\myfiledate{2022/04/20}
+\def\myfileversion{2.8}
+\def\myfiledate{2023/01/01}
\RequirePackage{tikz}
\usetikzlibrary{arrows.meta,bending}
\RequirePackage{l3keys2e}
@@ -28,20 +28,16 @@
{\myfiledate}
{\myfileversion}
{Draws arrows for explanations on the right}
-\msg_new:nnn { witharrows } { expl3~too~old }
- {
- Your~version~of~LaTeX~(especially~expl3)~is~too~old.~
- You~can~go~on~but~you~will~probably~have~other~errors~
- if~you~use~the~functionalities~of~witharrows.
- }
-\cs_if_exist:NF \seq_set_map_x:NNn
- { \msg_error:nn { witharrows } { expl3~too~old } }
-\RequirePackage { xparse }
\RequirePackage { varwidth }
\bool_new:N \c__witharrows_footnotehyper_bool
\bool_new:N \c__witharrows_footnote_bool
\cs_new_protected:Npn \__witharrows_msg_new:nn { \msg_new:nnn { witharrows } }
-\cs_new_protected:Npn \__witharrows_msg_new:nnn { \msg_new:nnnn { witharrows } }
+\cs_new_protected:Npn \__witharrows_msg_new:nnn #1 #2 #3
+ {
+ \bool_if:NTF \c__witharrows_messages_for_Overleaf_bool
+ { \msg_new:nnn { witharrows } { #1 } { #2 \\ #3 } }
+ { \msg_new:nnnn { witharrows } { #1 } { #2 } { #3 } }
+ }
\cs_new_protected:Npn \__witharrows_msg_redirect_name:nn
{ \msg_redirect_name:nnn { witharrows } }
\cs_new_protected:Npn \__witharrows_error:n { \msg_error:nn { witharrows } }
@@ -49,6 +45,13 @@
\cs_new_protected:Npn \__witharrows_fatal:n { \msg_fatal:nn { witharrows } }
\cs_new_protected:Npn \__witharrows_error:nn { \msg_error:nnn { witharrows } }
\cs_generate_variant:Nn \__witharrows_error:nn { n x }
+\cs_new_protected:Npn \__witharrows_error_or_warning:n
+ { \bool_if:NTF \c__witharrows_messages_for_Overleaf_bool \__witharrows_warning:n \__witharrows_error:n }
+\bool_set:Nn \c__witharrows_messages_for_Overleaf_bool
+ {
+ \str_if_eq_p:Vn \c_sys_jobname_str { _region_ } % for Emacs
+ || \str_if_eq_p:Vn \c_sys_jobname_str { output } % for Overleaf
+ }
\keys_define:nn { WithArrows / package }
{
footnote .bool_set:N = \c__witharrows_footnote_bool ,
@@ -65,6 +68,7 @@
\ProcessKeysOptions { WithArrows / package }
\__witharrows_msg_new:nn { footnote~with~footnotehyper~package }
{
+ Footnote~forbidden.\\
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~
@@ -269,6 +273,8 @@
\seq_new:N \l__witharrows_o_arrows_seq
\dim_new:N \l__witharrows_xoffset_for_o_arrows_dim
\dim_set:Nn \l__witharrows_xoffset_for_o_arrows_dim { 2 mm }
+\bool_new:N \l__witharrows_right_overlap_bool
+\bool_set_true:N \l__witharrows_right_overlap_bool
\cs_new_protected:Npn \__witharrows_eval_if_allowed:n #1
{
\str_if_empty:NTF \l__witharrows_previous_key_str
@@ -299,7 +305,7 @@
\str_set:Nx \l__witharrows_string_Arrow_for_msg_str
{ \c_backslash_str Arrow~alias~\c_backslash_str #1 } ,
command-name .value_required:n = true ,
- tikz-code .tl_set:N = \l__witharrows_tikz_code_tl,
+ tikz-code .tl_set:N = \l__witharrows_tikz_code_tl ,
tikz-code .initial:n = \draw~(#1)~to~node{#3}~(#2)~; ,
tikz-code .value_required:n = true ,
displaystyle .bool_set:N = \l__witharrows_displaystyle_bool ,
@@ -369,7 +375,9 @@
c .code:n = \int_set:Nn \l__witharrows_pos_env_int 1 ,
c .value_forbidden:n = true ,
b .code:n = \int_set:Nn \l__witharrows_pos_env_int 2 ,
- b .value_forbidden:n = true
+ b .value_forbidden:n = true ,
+ right-overlap .bool_set:N = \l__witharrows_right_overlap_bool ,
+ right-overlap .value_required:n = true
}
\clist_new:N \c__witharrows_extensible_delimiters_clist
\clist_set:Nn \c__witharrows_extensible_delimiters_clist
@@ -389,7 +397,7 @@
{
fleqn .bool_set:N = \l__witharrows_fleqn_bool ,
fleqn .default:n = true ,
- mathindent .dim_set:N = \l__witharrows_mathindent_dim ,
+ mathindent .skip_set:N = \l__witharrows_mathindent_skip ,
mathindent .initial:n = 25 pt ,
mathindent .value_required:n = true ,
notag .code:n =
@@ -489,7 +497,7 @@
\__witharrows_set_seq_of_str_from_clist:Nn \l__witharrows_options_WithArrows_seq
{
adjust, b, c, code-after, code-before, command-name,
- displaystyle, end-adjust,
+ right-overlap, displaystyle, end-adjust,
format, group, groups, i,
interline, jot, ll,
lr, max-length-of-arrow, more-columns, name,
@@ -535,7 +543,8 @@
\seq_new:N \l__witharrows_options_WithArrowsOptions_seq
\__witharrows_set_seq_of_str_from_clist:Nn \l__witharrows_options_WithArrowsOptions_seq
{
- allow-duplicate-names, b, c, command-name, more-columns, tikz-code, adjust,
+ allow-duplicate-names, b, c, command-name, right_overlap,
+ more-columns, tikz-code, adjust,
displaystyle, end-adjust, fleqn, group, groups, i, interline, jot, ll, lr,
mathindent, max-length-of-arrow, no-arrows, up-and-down, rl, rr,
show-node-names, show-nodes, start-adjust, t, tikz, wrap-lines, xoffset,
@@ -724,6 +733,14 @@
{ \keys_set:nn { WithArrows / WithArrows } { #1 } }
\bool_if:NT \l__witharrows_in_DispWithArrows_bool
{ \keys_set:nn { WithArrows / DispWithArrows } { #1 } }
+ \bool_if:NF \l__witharrows_right_overlap_bool
+ {
+ \bool_if:NT \l__witharrows_in_WithArrows_bool
+ {
+ \dim_gzero_new:N \g__witharrows_overlap_x_dim
+ \dim_zero_new:N \l__witharrows_delta_x_dim
+ }
+ }
\cs_set_eq:cN \l__witharrows_command_name_str \__witharrows_Arrow_first_columns:
\int_set:Nn \l__witharrows_nb_cols_int { \str_count:N \l__witharrows_format_str }
\int_gset_eq:NN \g__witharrows_col_int \l__witharrows_nb_cols_int
@@ -791,7 +808,7 @@
\halign to \l__witharrows_linewidth_dim
\bgroup
\bool_if:NT \l__witharrows_fleqn_bool
- { \skip_horizontal:N \l__witharrows_mathindent_dim }
+ { \skip_horizontal:N \l__witharrows_mathindent_skip }
}
\int_gincr:N \g__witharrows_line_int
\int_gzero:N \g__witharrows_col_int
@@ -847,6 +864,9 @@
\if_mode_math: \else:
\__witharrows_error:n { WithArrows~outside~math~mode }
\fi:
+ \box_clear_new:N \l__witharrows_env_box
+ \hbox_set:Nw \l__witharrows_env_box
+ \int_compare:nNnT \l__witharrows_pos_env_int = 1 \c_math_toggle_token
\int_case:nn \l__witharrows_pos_env_int { 0 \vtop 1 \vcenter 2 \vbox }
\bgroup
\spread@equation
@@ -863,7 +883,15 @@
\\
\egroup
\egroup
+ \int_compare:nNnT \l__witharrows_pos_env_int = 1 \c_math_toggle_token
+ \hbox_set_end:
\__witharrows_post_halign:
+ \bool_if:NF \l__witharrows_right_overlap_bool
+ {
+ \box_set_wd:Nn \l__witharrows_env_box
+ { \g__witharrows_overlap_x_dim + \box_wd:N \l__witharrows_env_box }
+ }
+ \box_use_drop:N \l__witharrows_env_box
\bool_if:NT \c__witharrows_footnote_bool { \end { savenotes } }
}
\cs_new_protected:Npn \__witharrows_post_halign:
@@ -915,12 +943,15 @@
{ \peek_meaning:NTF [ \__witharrows_cr_ii: { \__witharrows_cr_ii: [ \c_zero_dim ] } }
\cs_new_protected:Npn \__witharrows_cr_ii: [ #1 ]
{
- \peek_meaning_ignore_spaces:NTF \end
+ \peek_remove_spaces:n
{
- \__witharrows_cr_iii:n { #1 }
- \__witharrows_analyze_end:Nn
+ \peek_meaning:NTF \end
+ {
+ \__witharrows_cr_iii:n { #1 }
+ \__witharrows_analyze_end:Nn
+ }
+ { \__witharrows_cr_iii:n { #1 } }
}
- { \__witharrows_cr_iii:n { #1 } }
}
\cs_new_protected:Npn \__witharrows_cr_iii:n #1
{
@@ -937,7 +968,8 @@
\cs_set:Npx \@currentlabel { \p@equation \g_tmpa_tl }
\bool_if:NT \c__witharrows_hyperref_loaded_bool
{
- \str_set:Nn \This@name { equation }
+ % the following line is probably useless (2022/05/16)
+ % \str_set:Nn \This@name { equation }
\hyper@refstepcounter { equation }
}
\bool_if:NT \c__witharrows_cleveref_loaded_bool
@@ -1146,7 +1178,7 @@
\hbox_to_wd:nn \l__witharrows_linewidth_dim
{
\bool_if:NTF \l__witharrows_fleqn_bool
- { \skip_horizontal:N \l__witharrows_mathindent_dim }
+ { \skip_horizontal:N \l__witharrows_mathindent_skip }
\hfil
\hbox_to_wd:nn \g__witharrows_alignment_dim
{
@@ -1545,6 +1577,25 @@
{ \dim_use:N \g__witharrows_y_final_dim }
}
}
+ \bool_if:NF \l__witharrows_right_overlap_bool
+ {
+ \bool_if:NT \l__witharrows_in_WithArrows_bool
+ {
+ \pgfpicture
+ \pgfrememberpicturepositiononpagetrue
+ \pgfpointanchor { wa - \l__witharrows_prefix_str - 1 - r } { south }
+ \int_compare:nNnTF \l__witharrows_pos_arrow_int < 5
+ {
+ \dim_set:Nn \l__witharrows_delta_x_dim
+ {
+ \pgf@x -
+ ( \dim_min:nn \g__witharrows_x_initial_dim \g__witharrows_x_final_dim )
+ }
+ }
+ { \dim_set:Nn \l__witharrows_delta_x_dim { \pgf@x - \l__witharrows_x_dim } }
+ \endpgfpicture
+ }
+ }
\__witharrows_draw_arrow:nno \g_tmpa_tl \g_tmpb_tl \l_tmpa_tl
\group_end:
}
@@ -1560,13 +1611,25 @@
\pgf@relevantforpicturesizetrue
#1
\dim_compare:nNnTF \pgf@picminx = { 16000 pt }
- { \dim_zero:NN \l_tmpa_dim }
+ { \dim_zero:N \l_tmpa_dim }
{ \dim_set:Nn \l_tmpa_dim { \pgf@picmaxx - \pgf@picminx } }
\dim_add:Nn \l_tmpa_dim \l__witharrows_xoffset_dim
\prop_gput:cnV
{ g__witharrows_arrow _ \l__witharrows_prefix_str _ \int_use:N \l__witharrows_arrow_int _ prop }
{ width }
\l_tmpa_dim
+ \bool_if:NF \l__witharrows_right_overlap_bool
+ {
+ \bool_if:NT \l__witharrows_in_WithArrows_bool
+ {
+ \dim_gset:Nn \g__witharrows_overlap_x_dim
+ {
+ \dim_max:nn
+ \g__witharrows_overlap_x_dim
+ { \l_tmpa_dim - \l__witharrows_delta_x_dim }
+ }
+ }
+ }
\pgfresetboundingbox
\end{tikzpicture}
}
@@ -1852,7 +1915,6 @@
-- node (__witharrows_label) {}
([xshift = \l__witharrows_xoffset_dim+5mm]\l_tmpb_tl-r.south)
-- ([xshift = \l__witharrows_xoffset_dim]\l_tmpb_tl-r.south) ;
-
\pgfpointanchor { wa - \l__witharrows_prefix_str - __witharrows_label } { west }
\dim_set:Nn \l_tmpa_dim { 20 cm }
\path \pgfextra { \tl_gset:Nx \g_tmpa_tl \tikz@text@width } ;
@@ -1880,9 +1942,15 @@
{
\draw [ <- ]
( [xshift = \l__witharrows_xoffset_dim]\k-r.south ) -- ++(5mm,0) ;
- } ;
+ } % ;
\end{tikzpicture}
}
+\bool_if:NTF \c__witharrows_messages_for_Overleaf_bool
+ { \str_const:Nn \c__witharrows_available_keys_str { } }
+ {
+ \str_const:Nn \c__witharrows_available_keys_str
+ { For~a~list~of~the~available~keys,~type~H~<return>. }
+ }
\str_new:N \l_witharrows_body_str
\cs_new:Npn \__witharrows_potential_body_i:
{
@@ -1891,7 +1959,7 @@
}
\cs_new:Npn \__witharrows_potential_body_ii:
{
- \str_if_empty:NTF \l_nicematrix_body_str
+ \str_if_empty:NTF \l_witharrows_body_str
{ No~further~help~available }
{
The~body~of~your~environment~was:\\
@@ -1904,6 +1972,7 @@
{ If~you~go~on,~this~command~will~be~ignored. }
\__witharrows_msg_new:nn { amsmath~not~loaded }
{
+ amsmath~not~loaded.\\
You~can't~use~the~option~'\l_keys_key_str'~because~the~
package~'amsmath'~has~not~been~loaded.\\
If~you~go~on,~this~option~will~be~ignored~in~the~rest~
@@ -1911,6 +1980,7 @@
}
\__witharrows_msg_new:nn { Bad~value~for~replace~brace~by }
{
+ Incorrect~value.\\
Bad~value~for~the~option~'\l_keys_key_str'.~The~value~must~begin~
with~an~extensible~left~delimiter.~The~possible~values~are:~.,
\token_to_str:N \{,~(,~[,~\token_to_str:N \lbrace,~
@@ -1923,6 +1993,7 @@
}
\__witharrows_msg_new:nn { option~of~cr~negative }
{
+ Bad~value.\\
The~argument~of~the~command~\token_to_str:N\\~
should~be~positive~in~the~row~\int_use:N \g__witharrows_line_int\
of~your~environment~\{\l__witharrows_type_env_str\}.\\
@@ -1930,13 +2001,15 @@
}
\__witharrows_msg_new:nn { omit~probably~used }
{
- There~is~a~problem.~Maybe~you~have~used~a~command~
+ Strange~problem.\\
+ Maybe~you~have~used~a~command~
\token_to_str:N\omit\ in~the~line~\int_use:N \g__witharrows_line_int\
(or~another~line)~of~your~environment~\{\l__witharrows_type_env_str\}.\\
You~can~go~on~but~you~may~have~others~errors.
}
\__witharrows_msg_new:nnn { newline~at~the~end~of~env }
{
+ Incorrect~end.\\
The~environments~of~witharrows~(\{WithArrows\}~and~
\{DispWithArrows\})~should~not~end~by~\token_to_str:N \\.\\
However,~you~can~go~on~for~this~time.~No~similar~error~will~be~
@@ -1946,6 +2019,7 @@
{ \__witharrows_potential_body_ii: }
\__witharrows_msg_new:nnn { Invalid~option~format }
{
+ Invalide~value.\\
The~key~'format'~should~contain~only~letters~r,~c~and~l~and~
must~not~be~empty.\\
\c__witharrows_option_ignored_str
@@ -1954,6 +2028,7 @@
{ \__witharrows_potential_body_ii: }
\__witharrows_msg_new:nnn { invalid~key~o }
{
+ Invalid~use~of~a~key.\\
The~key~'o'~for~individual~arrows~can~be~used~only~in~mode~
'group'~or~in~mode~'groups'.\\
\c__witharrows_option_ignored_str
@@ -1962,6 +2037,7 @@
{ \__witharrows_potential_body_ii: }
\__witharrows_msg_new:nnn { Value~for~a~key }
{
+ Misuse~of~a~key.\\
The~key~'\l_keys_key_str'~should~be~used~without~value. \\
However,~you~can~go~on~for~this~time.
\__witharrows_potential_body_i:
@@ -1969,12 +2045,13 @@
{ \__witharrows_potential_body_ii: }
\__witharrows_msg_new:nnn { Unknown~option~in~Arrow }
{
+ Unknown~option.\\
The~key~'\l_keys_key_str'~is~unknown~for~the~command~
\l__witharrows_string_Arrow_for_msg_str\ in~the~row~
\int_use:N \g__witharrows_line_int\ of~your~environment~
\{\l__witharrows_type_env_str\}. \l_tmpa_str \\
\c__witharrows_option_ignored_str \\
- For~a~list~of~the~available~keys,~type~H~<return>.
+ \c__witharrows_available_keys_str
}
{
The~available~keys~are~(in~alphabetic~order):~
@@ -1982,9 +2059,10 @@
}
\__witharrows_msg_new:nnn { Unknown~option~WithArrows }
{
+ Unknown~option.\\
The~key~'\l_keys_key_str'~is~unknown~in~\{\l__witharrows_type_env_str\}. \\
\c__witharrows_option_ignored_str \\
- For~a~list~of~the~available~keys,~type~H~<return>.
+ \c__witharrows_available_keys_str
}
{
The~available~keys~are~(in~alphabetic~order):~
@@ -1992,9 +2070,10 @@
}
\__witharrows_msg_new:nnn { Unknown~option~DispWithArrows }
{
+ Unknown~option.\\
The~key~'\l_keys_key_str'~is~unknown~in~\{\l__witharrows_type_env_str\}. \\
\c__witharrows_option_ignored_str \\
- For~a~list~of~the~available~keys,~type~H~<return>.
+ \c__witharrows_available_keys_str
}
{
The~available~keys~are~(in~alphabetic~order):~
@@ -2002,10 +2081,11 @@
}
\__witharrows_msg_new:nnn { Unknown~option~WithArrowsOptions }
{
+ Unknown~option.\\
The~key~'\l_keys_key_str'~is~unknown~in~
\token_to_str:N \WithArrowsOptions. \\
\c__witharrows_option_ignored_str \\
- For~a~list~of~the~available~keys,~type~H~<return>.
+ \c__witharrows_available_keys_str
}
{
The~available~keys~are~(in~alphabetic~order):~
@@ -2013,10 +2093,11 @@
}
\__witharrows_msg_new:nnn { Unknown~option~Arrow~in~code-after }
{
+ Unknown~option.\\
The~key~'\l_keys_key_str'~is~unknown~in~
\token_to_str:N \Arrow\ in~code-after. \\
\c__witharrows_option_ignored_str \\
- For~a~list~of~the~available~keys,~type~H~<return>.
+ \c__witharrows_available_keys_str
}
{
The~available~keys~are~(in~alphabetic~order):~
@@ -2024,6 +2105,7 @@
}
\__witharrows_msg_new:nnn { Too~much~columns~in~WithArrows }
{
+ Too~much~columns.\\
Your~environment~\{\l__witharrows_type_env_str\}~has~\int_use:N
\l__witharrows_nb_cols_int\ columns~and~you~try~to~use~one~more.~
Maybe~you~have~forgotten~a~\c_backslash_str\c_backslash_str.~
@@ -2035,6 +2117,7 @@
{ \__witharrows_potential_body_ii: }
\__witharrows_msg_new:nnn { Too~much~columns~in~DispWithArrows }
{
+ Too~much~columns.\\
Your~environment~\{\l__witharrows_type_env_str\}~has~\int_use:N
\l__witharrows_nb_cols_int\ columns~and~you~try~to~use~one~more.~
Maybe~you~have~forgotten~a~\c_backslash_str\c_backslash_str\
@@ -2045,6 +2128,7 @@
{ \__witharrows_potential_body_ii: }
\__witharrows_msg_new:nn { Negative~jump }
{
+ Incorrect~value.\\
You~can't~use~a~negative~value~for~the~option~'jump'~of~command~
\l__witharrows_string_Arrow_for_msg_str\
in~the~row~\int_use:N \g__witharrows_line_int\
@@ -2054,6 +2138,7 @@
}
\__witharrows_msg_new:nn { new-group~without~groups }
{
+ Misuse~of~a~key.\\
You~can't~use~the~option~'new-group'~for~the~command~
\l__witharrows_string_Arrow_for_msg_str\
because~you~are~not~in~'groups'~mode.~Try~to~use~the~option~
@@ -2063,8 +2148,9 @@
\__witharrows_msg_new:nnn
{ Too~few~lines~for~an~arrow }
{
+ Impossible~arrow.\\
Line~\l__witharrows_input_line_str\
- :~an~arrow~specifiead~in~the~row~\int_use:N \l__witharrows_initial_int\
+ :~an~arrow~specified~in~the~row~\int_use:N \l__witharrows_initial_int\
of~your~environment~\{\l__witharrows_type_env_str\}~can't~be~drawn~
because~it~arrives~after~the~last~row~of~the~environment. \\
If~you~go~on,~this~arrow~will~be~ignored.
@@ -2073,12 +2159,14 @@
{ \__witharrows_potential_body_ii: }
\__witharrows_msg_new:nn { o~arrow~with~no~arrow~under }
{
+ Problem~with~the~key~'o'.\\
Line~\l__witharrows_input_line_str\
:~there~is~no~arrow~'under'~your~arrow~of~type~'o'.\\
If~you~go~on,~this~arrow~won't~be~drawn.
}
\__witharrows_msg_new:nnn { WithArrows~outside~math~mode }
{
+ You~are~outside~math~mode.\\
The~environment~\{\l__witharrows_type_env_str\}~should~be~used~only~in~math~mode~
like~the~environment~\{aligned\}~of~amsmath. \\
Nevertheless,~you~can~go~on.
@@ -2087,6 +2175,7 @@
{ \__witharrows_potential_body_ii: }
\__witharrows_msg_new:nnn { DispWithArrows~in~math~mode }
{
+ You~are~in~math~mode.\\
The~environment~\{\l__witharrows_type_env_str\}~should~be~used~only~outside~math~
mode~like~the~environments~\{align\}~and~\{align*\}~of~amsmath. \\
This~error~is~fatal.
@@ -2095,14 +2184,17 @@
{ \__witharrows_potential_body_ii: }
\__witharrows_msg_new:nn { Incompatible~options~in~Arrow }
{
+ Incompatible~options.\\
You~try~to~use~the~option~'\l_keys_key_str'~but~
this~option~is~incompatible~or~redundant~with~the~option~
'\l__witharrows_previous_key_str'~set~in~the~same~command~
\l__witharrows_string_Arrow_for_msg_str. \\
\c__witharrows_option_ignored_str
}
-\__witharrows_msg_new:nn { Incompatible~options }
- { You~try~to~use~the~option~'\l_keys_key_str'~but~
+\__witharrows_msg_new:nn { Incompatible~options a}
+ {
+ Incompatible~options.
+ You~try~to~use~the~option~'\l_keys_key_str'~but~
this~option~is~incompatible~or~redundant~with~the~option~
'\l__witharrows_previous_key_str'~set~in~the~same~command~
\bool_if:NT \l__witharrows_in_code_after_bool
@@ -2114,8 +2206,10 @@
}
\__witharrows_msg_new:nnn { Arrow~not~in~last~column }
{
+ Bad~use~of~\l__witharrows_string_Arrow_for_msg_str.
You~should~use~the~command~\l__witharrows_string_Arrow_for_msg_str\
only~in~the~last~column~(column~\int_use:N\l__witharrows_nb_cols_int)~
+ in~the~row~\int_use:N \g__witharrows_line_int\
of~your~environment~\{\l__witharrows_type_env_str\}.\\
However~you~can~go~on~for~this~time.
\__witharrows_potential_body_i:
@@ -2123,6 +2217,7 @@
{ \__witharrows_potential_body_ii: }
\__witharrows_msg_new:nn { Wrong~line~in~Arrow }
{
+ Wrong~line.\\
The~specification~of~line~'#1'~you~use~in~the~command~
\l__witharrows_string_Arrow_for_msg_str\
in~the~'code-after'~of~\{\l__witharrows_type_env_str\}~doesn't~exist. \\
@@ -2130,23 +2225,27 @@
}
\__witharrows_msg_new:nn { Both~lines~are~equal }
{
+ Both~lines~are~equal.\\
In~the~'code-after'~of~\{\l__witharrows_type_env_str\}~you~try~to~
draw~an~arrow~going~to~itself~from~the~line~'#1'.~This~is~not~possible. \\
\c__witharrows_option_ignored_str
}
\__witharrows_msg_new:nn { Wrong~line~specification~in~MultiArrow }
{
+ Wrong~line~specification.\\
The~specification~of~line~'#1'~doesn't~exist. \\
If~you~go~on,~it~will~be~ignored~for~\token_to_str:N \MultiArrow.
}
\__witharrows_msg_new:nn { Too~small~specification~for~MultiArrow }
{
+ Too~small~specification.\\
The~specification~of~lines~you~gave~to~\token_to_str:N \MultiArrow\
is~too~small:~you~need~at~least~two~lines. \\
\c__witharrows_command_ignored_str
}
\__witharrows_msg_new:nn { Not~allowed~in~DispWithArrows }
{
+ Forbidden~command.\\
The~command~\token_to_str:N #1
is~allowed~only~in~the~last~column~
(column~\int_use:N\l__witharrows_nb_cols_int)~of~\{\l__witharrows_type_env_str\}. \\
@@ -2154,12 +2253,14 @@
}
\__witharrows_msg_new:nn { Not~allowed~in~WithArrows }
{
+ Forbidden~command.\\
The~command~\token_to_str:N #1 is~not~allowed~in~\{\l__witharrows_type_env_str\}~
(it's~allowed~in~the~last~column~of~\{DispWithArrows\}). \\
\c__witharrows_option_ignored_str
}
\__witharrows_msg_new:nn { tag*~without~amsmath }
{
+ amsmath~not~loaded.\\
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\
@@ -2167,12 +2268,14 @@
}
\__witharrows_msg_new:nn { Multiple~tags }
{
+ Multiple~tags.\\
You~can't~use~twice~the~command~\token_to_str:N\tag\
in~a~line~of~the~environment~\{\l__witharrows_type_env_str\}. \\
If~you~go~on,~the~tag~'#1'~will~be~used.
}
\__witharrows_msg_new:nn { Multiple~labels }
{
+ Multiple~labels.\\
Normally,~we~can't~use~the~command~\token_to_str:N\label\
twice~in~a~line~of~the~environment~\{\l__witharrows_type_env_str\}. \\
However,~you~can~go~on.~
@@ -2183,13 +2286,15 @@
}
\__witharrows_msg_new:nn { Multiple~labels~with~cleveref }
{
+ Multiple~labels.\\
Since~you~use~cleveref,~you~can't~use~the~command~\token_to_str:N\label\
twice~in~a~line~of~the~environment~\{\l__witharrows_type_env_str\}. \\
If~you~go~on,~you~may~have~undefined~references.
}
\__witharrows_msg_new:nn { Inexistent~v-node }
{
- There~is~a~problem.~Maybe~you~have~put~a~command~\token_to_str:N\cr\
+ There~is~a~problem.\\
+ Maybe~you~have~put~a~command~\token_to_str:N\cr\
instead~of~a~command~\token_to_str:N\\~at~the~end~of~
the~row~\l_tmpa_int\
of~your~environment~\{\l__witharrows_type_env_str\}. \\
@@ -2197,6 +2302,7 @@
}
\__witharrows_msg_new:nn { Option~xoffset~forbidden }
{
+ Incorrect~key.\\
You~can't~use~the~option~'xoffset'~in~the~command~
\l__witharrows_string_Arrow_for_msg_str\ in~the~row~\int_use:N \g__witharrows_line_int\
of~your~environment~\{\l__witharrows_type_env_str\}~
@@ -2209,6 +2315,7 @@
}
\__witharrows_msg_new:nnn { Duplicate~name }
{
+ Duplicate~name.\\
The~name~'\l_keys_value_tl'~is~already~used~and~you~shouldn't~use~
the~same~environment~name~twice.~You~can~go~on,~but,~
maybe,~you~will~have~incorrect~results. \\
@@ -2222,6 +2329,7 @@
}
\__witharrows_msg_new:nn { Invalid~specification~for~MultiArrow }
{
+ Invalid~specification.\\
The~specification~of~rows~for~\token_to_str:N\MultiArrow\
(i.e.~#1)~is~invalid. \\
\c__witharrows_command_ignored_str
@@ -2231,29 +2339,58 @@
\keys_if_exist:nnTF { WithArrows / Global } { #1 }
{ \__witharrows_error:nn { Key~already~defined } { #1 } }
{
- \keys_define:nn { WithArrows / Global }
+ \seq_clear:N \l_tmpa_seq
+ \keyval_parse:NNn \__witharrows_valid_key:n \__witharrows_valid_key:nn { #2 }
+ \seq_if_empty:NTF \l_tmpa_seq
{
- #1 .code:n =
- { \keys_set_known:nn { WithArrows / WithArrowsOptions } { #2 } }
+ \seq_put_right:Nx \l__witharrows_options_WithArrows_seq
+ { \tl_to_str:n { #1 } }
+ \seq_put_right:Nx \l__witharrows_options_DispWithArrows_seq
+ { \tl_to_str:n { #1 } }
+ \seq_put_right:Nx \l__witharrows_options_WithArrowsOptions_seq
+ { \tl_to_str:N { #1 } }
+ \cs_if_exist:NTF \keys_precompile:nnN
+ {
+ \keys_precompile:nnN
+ { WithArrows / WithArrowsOptions }
+ { #2 }
+ \l_tmpa_tl
+ \__witharrows_key_define:nV { #1 } \l_tmpa_tl
+ }
+ {
+ \keys_define:nn { WithArrows / Global }
+ {
+ #1 .code:n =
+ { \keys_set:nn { WithArrows / WithArrowsOptions } { #2 } }
+ }
+ }
}
- \seq_put_right:Nx \l__witharrows_options_WithArrows_seq { \tl_to_str:n { #1 } }
- \seq_put_right:Nx \l__witharrows_options_DispWithArrows_seq
- { \tl_to_str:n { #1 } }
- \seq_put_right:Nx \l__witharrows_options_WithArrowsOptions_seq
- { \tl_to_str:N { #1 } }
- \group_begin:
- \msg_set:nnn { witharrows } { Unknown~option~WithArrowsOptions }
- {
- The~key~'\l_keys_key_str'~can't~be~set~in~the~
- definition~of~a~style.~You~can~go~on~for~this~time~
- but~you~should~suppress~this~key.
- }
- \WithArrowsOptions { #2 }
- \group_end:
+ { \__witharrows_error:nn { Impossible~style } { #1 } }
}
}
+\__witharrows_msg_new:nn { Impossible~style }
+ {
+ Impossible~style.\\
+ It's~impossible~to~define~the~style~'#1'~
+ because~it~contains~unknown~keys:~'
+ \seq_use:Nnnn \l_tmpa_seq { '~and~' } { ',~'} { ',~and~}'.
+ }
+\cs_new_protected:Npn \__witharrows_valid_key:n #1
+ {
+ \keys_if_exist:nnF { WithArrows / Global } { #1 }
+ { \seq_put_right:Nn \l_tmpa_seq { #1 } }
+ }
+\cs_new_protected:Npn \__witharrows_valid_key:nn #1 #2
+ {
+ \keys_if_exist:nnF { WithArrows / Global } { #1 }
+ { \seq_put_right:Nn \l_tmpa_seq { #1 } }
+ }
+\cs_new_protected:Npn \__witharrows_key_define:nn #1 #2
+ { \keys_define:nn { WithArrows / Global } { #1 .code:n = #2 } }
+\cs_generate_variant:Nn \__witharrows_key_define:nn { n V }
\__witharrows_msg_new:nn { Key~already~defined }
{
+ Key~already~define.\\
The~key~'#1'~is~already~defined. \\
If~you~go~on,~your~instruction~\token_to_str:N\WithArrowsNewStyle\
will~be~ignored.
@@ -2274,6 +2411,7 @@
}
\__witharrows_msg_new:nn { Option~unknown~for~up-and-down }
{
+ Unknown~option.\\
The~option~'\l_keys_key_str'~is~unknown.~\c__witharrows_option_ignored_str
}
\tl_const:Nn \c__witharrows_tikz_code_up_tl
@@ -2410,6 +2548,7 @@
\seq_put_right:Nn \l__witharrows_options_Arrow_seq { up }
\__witharrows_msg_new:nn { calc~not~loaded }
{
+ calc~not~loaded.\\
You~can't~use~the~option~'\l_keys_key_str'~because~you~don't~have~loaded~the~
Tikz~library~'calc'.You~should~add~'\token_to_str:N\usetikzlibrary{calc}'~
~in~the~preamble~of~your~document. \\