[latex3-commits] [git/LaTeX3-latex3-latex3] l3text: Support primes (54755f194)
Joseph Wright
joseph.wright at morningstar2.co.uk
Mon Dec 16 10:22:18 CET 2019
Repository : https://github.com/latex3/latex3
On branch : l3text
Link : https://github.com/latex3/latex3/commit/54755f1944903a5c31673969ab4d32c1d40506cd
>---------------------------------------------------------------
commit 54755f1944903a5c31673969ab4d32c1d40506cd
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Mon Dec 16 09:22:18 2019 +0000
Support primes
>---------------------------------------------------------------
54755f1944903a5c31673969ab4d32c1d40506cd
l3kernel/l3text.dtx | 42 ++++++++++++++++++++++++++++++++++++------
1 file changed, 36 insertions(+), 6 deletions(-)
diff --git a/l3kernel/l3text.dtx b/l3kernel/l3text.dtx
index dd98ce457..3e76a10fc 100644
--- a/l3kernel/l3text.dtx
+++ b/l3kernel/l3text.dtx
@@ -3437,8 +3437,12 @@
\token_if_math_superscript:NTF #2
{ \@@_purify_unimath_script:nnn {#1} { super } }
{
- \@@_token_to_explicit:N #2
- \@@_purify_unimath_loop:nw {#1}
+ \token_if_eq_meaning:NNTF #2 '
+ { \@@_purify_unimath_prime:n {#1} }
+ {
+ \@@_token_to_explicit:N #2
+ \@@_purify_unimath_loop:nw {#1}
+ }
}
}
}
@@ -3474,6 +3478,29 @@
\cs_new:Npn \@@_purify_unimath_script_super: { ^ }
\cs_new:Npx \@@_purify_unimath_script_sub:
{ \char_generate:nn { `\_ } { 8 } }
+\cs_new:Npn \@@_purify_unimath_prime:n #1
+ { \@@_purify_unimath_prime_auxi:nw {#1} }
+\cs_new:Npn \@@_purify_unimath_prime_auxi:nw #1#2
+ {
+ \token_if_eq_meaning:NNTF #2 '
+ { \@@_purify_unimath_prime_auxii:nw {#1} }
+ {
+ \exp_not:v { c_@@_math_char_\token_to_str:N \prime _tl }
+ \@@_purify_unimath_loop:nw {#1} #2
+ }
+ }
+\cs_new:Npn \@@_purify_unimath_prime_auxii:nw #1#2
+ {
+ \token_if_eq_meaning:NNTF #2 '
+ {
+ \exp_not:v { c_@@_math_char_\token_to_str:N \primeprimeprime _tl }
+ \@@_purify_unimath_loop:nw {#1}
+ }
+ {
+ \exp_not:v { c_@@_math_char_\token_to_str:N \primeprime _tl }
+ \@@_purify_unimath_loop:nw {#1} #2
+ }
+ }
% \end{macrocode}
% \end{macro}
% \end{macro}
@@ -4305,7 +4332,8 @@
% category codes, then we move to the ones which can be done mechanically.
% Accent characters have to be pulled out as they need to be re-ordered
% relative to their parent letter. Notice that |-| is included here as
-% it needs to be replaced.
+% it needs to be replaced. Also notice that |\primeprime| and
+% |\primeprimeprime| are added.
% \begin{macrocode}
\tl_const:cx { c_@@_math_char_ \token_to_str:N \backslash _tl }
{ \c_backslash_str }
@@ -4340,6 +4368,8 @@
\dagger { 2020 }
\ddagger { 2021 }
\prime { 2032 }
+ \primeprime { 2033 }
+ \primeprimeprime { 2034 }
\overleftarrow { 20D6 }
\overrightarrow { 20D7 }
\vec { 20D7 }
@@ -4525,13 +4555,13 @@
% \begin{macrocode}
\tl_const:cx
{ c_@@_math_ \token_to_str:N \sqrt _tl }
- { \@@_tmp:n { " 221A } }
+ { \@@_tmp:n { "221A } }
\tl_const:cx
{ c_@@_math_ \token_to_str:N \cuberoot _tl }
- { \@@_tmp:n { " 221B } }
+ { \@@_tmp:n { "221B } }
\tl_const:cx
{ c_@@_math_ \token_to_str:N \fourthroot _tl }
- { \@@_tmp:n { " 221C } }
+ { \@@_tmp:n { "221C } }
\group_end:
% \end{macrocode}
%
More information about the latex3-commits
mailing list