[latex3-commits] [git/LaTeX3-latex3-latex3] l3text: Support cube/fourth root symbol (0ce137e77)
Joseph Wright
joseph.wright at morningstar2.co.uk
Sat Dec 14 11:06:08 CET 2019
Repository : https://github.com/latex3/latex3
On branch : l3text
Link : https://github.com/latex3/latex3/commit/0ce137e7727156d19cb93d9657f726f453bc4ebe
>---------------------------------------------------------------
commit 0ce137e7727156d19cb93d9657f726f453bc4ebe
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Sat Dec 14 10:06:08 2019 +0000
Support cube/fourth root symbol
>---------------------------------------------------------------
0ce137e7727156d19cb93d9657f726f453bc4ebe
l3kernel/l3text.dtx | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index c4a4408e3..c7e63981a 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -3861,10 +3861,22 @@
\cs_new:cpx { @@_purify_unimath_ \token_to_str:N \sqrt _aux:nw } % [
#1#2 ] #3
{
- \c_space_tl
- \exp_not:N \@@_purify_unimath_loop:nw {#1} [ #2 ]
- \exp_not:c { c_@@_math_ \token_to_str:N \sqrt _tl }
- ( #3 )
+ \exp_not:N \str_case:nnTF {#2}
+ {
+ { 2 }
+ { \exp_not:N \exp_not:v { c_@@_math_ \token_to_str:N \sqrt _tl } }
+ { 3 }
+ { \exp_not:N \exp_not:v { c_@@_math_ \token_to_str:N \cuberoot _tl } }
+ { 4 }
+ { \exp_not:N \exp_not:v { c_@@_math_ \token_to_str:N \fourthroot _tl } }
+ }
+ { \exp_not:N \@@_purify_unimath_loop:nw {#1} }
+ {
+ \c_space_tl
+ \exp_not:N \@@_purify_unimath_loop:nw {#1} [ #2 ]
+ \exp_not:c { c_@@_math_ \token_to_str:N \sqrt _tl }
+ }
+ { ( #3 ) }
}
% \end{macrocode}
% \end{macro}
@@ -4469,6 +4481,12 @@
\tl_const:cx
{ c_@@_math_ \token_to_str:N \sqrt _tl }
{ \@@_tmp:n { " 221A } }
+ \tl_const:cx
+ { c_@@_math_ \token_to_str:N \cuberoot _tl }
+ { \@@_tmp:n { " 221B } }
+ \tl_const:cx
+ { c_@@_math_ \token_to_str:N \fourthroot _tl }
+ { \@@_tmp:n { " 221C } }
\group_end:
% \end{macrocode}
%
More information about the latex3-commits
mailing list