summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/leftindex/leftindex.sty
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/leftindex/leftindex.sty')
-rw-r--r--macros/latex/contrib/leftindex/leftindex.sty29
1 files changed, 25 insertions, 4 deletions
diff --git a/macros/latex/contrib/leftindex/leftindex.sty b/macros/latex/contrib/leftindex/leftindex.sty
index fdd7a6a822..406c7a973e 100644
--- a/macros/latex/contrib/leftindex/leftindex.sty
+++ b/macros/latex/contrib/leftindex/leftindex.sty
@@ -1,9 +1,9 @@
\RequirePackage{xparse,mathtools}
-\ProvidesExplPackage{leftindex}{2020/08/25}{0.1beta}{}
+\ProvidesExplPackage{leftindex}{2024/01/31}{0.2beta}{}
%----------------------------------------------------------------
% leftindex -- left indices with better spacing
-% Version: 0.1beta
+% Version: 0.2beta
% Maintained by Sebastian Ørsted
% E-mail: sorsted@gmail.com
% Released under the LaTeX Project Public License v1.3c or later
@@ -35,7 +35,7 @@
\manualleftindex { #2 } { #1 } { #3 } { #4 }
}
{
- \manualleftindex { #5 } { #1 } { #3 } { #4 }
+ \manualleftindex { #1 } { #1 } { #3 } { #4 }
}
}
{
@@ -44,6 +44,27 @@
#5
}
+\DeclareDocumentCommand\LeftIndex { o o E{^_}{{}{}} }
+{
+ % #1 = slanting phantom
+ % #2 = height phantom
+ % #3 = left superscript
+ % #4 = left subscript
+ \IfValueTF {#1}
+ {
+ \IfValueTF{#2}
+ {
+ \manualleftindex { #2 } { #1 } { #3 } { #4 }
+ }
+ {
+ \manualleftindex { #1 } { #1 } { #3 } { #4 }
+ }
+ }
+ {
+ \manualleftindex { } { } { #3 } { #4 }
+ }
+}
+
\ExplSyntaxOn
\cs_new_protected:Npn\leftindex_kern_horizontal:n#1
@@ -131,13 +152,13 @@
\box_wd:N \l__leftindex_subscript_temp_box
}
}
+ \mathop{}
\leftindex_kern_horizontal:n
{
\dim_max:nn
{ \l__leftindex_width_of_superscript_dim }
{ \l__leftindex_width_of_subscript_dim }
}
- \mathop{}
\mathopen{ \vphantom { #2 } }
\tl_if_blank:nF { #4 }
{