summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/aligned-overset/aligned-overset.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/aligned-overset/aligned-overset.sty')
-rw-r--r--Master/texmf-dist/tex/latex/aligned-overset/aligned-overset.sty109
1 files changed, 109 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/aligned-overset/aligned-overset.sty b/Master/texmf-dist/tex/latex/aligned-overset/aligned-overset.sty
new file mode 100644
index 00000000000..5495608cb83
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/aligned-overset/aligned-overset.sty
@@ -0,0 +1,109 @@
+%%
+%% This is file `aligned-overset.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% aligned-overset.dtx (with options: `package')
+%%
+%% Copyright (C) 2018 by Marcel Krueger
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. The latest version of this license is in:
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+\NeedsTeXFormat{LaTeX2e}
+\RequirePackage{expl3}
+\ProvidesExplPackage
+ {aligned-overset}
+ {2018/01/18}
+ {0.0.1}
+ {aligned overset and underset}
+
+\RequirePackage{xparse,amsmath,mathtools}
+\box_new:N\l__alignedsets_clap_box
+\box_new:N\l__alignedsets_full_box
+
+\let\__alignedsets_original_overset:nn\overset
+\cs_set:Npn\overset{
+ \group_align_safe_begin:
+ \__alignedsets_modified_overset:nwn
+}
+\NewExpandableDocumentCommand\__alignedsets_modified_overset:nwn{mt{&}m}{
+ \group_align_safe_end:
+ \IfBooleanTF{#2}{
+ \group_begin:
+ \hbox_set:Nn\l__alignedsets_clap_box{
+ $
+ \displaystyle
+ {}\__alignedsets_original_overset:nn{\mathclap{#1}}{#3}{}
+ $
+ }
+ \hbox_set:Nn\l__alignedsets_full_box{
+ $
+ \displaystyle
+ {}\__alignedsets_original_overset:nn{#1}{#3}{}
+ $
+ }
+ \hspace{
+ \dim_eval:n{(\box_wd:N\l__alignedsets_full_box-\box_wd:N\l__alignedsets_clap_box)/2}
+ }
+ \exp_args:NNNx
+ \group_end:
+ {&}
+ \hspace{
+ -\dim_eval:n{
+ (\box_wd:N\l__alignedsets_full_box-\box_wd:N\l__alignedsets_clap_box)/2
+ }
+ }
+ \__alignedsets_original_overset:nn{#1}{#3}
+ }{
+ \__alignedsets_original_overset:nn{#1}{#3}
+ }
+}
+\let\__alignedsets_original_underset:nn\underset
+\cs_set:Npn\underset{
+ \group_align_safe_begin:
+ \__alignedsets_modified_underset:nwn
+}
+\NewExpandableDocumentCommand\__alignedsets_modified_underset:nwn{mt{&}m}{
+ \group_align_safe_end:
+ \group_end_ee:
+ \IfBooleanTF{#2}{
+ \group_begin:
+ \hbox_set:Nn\l__alignedsets_clap_box{
+ $
+ \displaystyle
+ {}\__alignedsets_original_underset:nn{\mathclap{#1}}{#3}{}
+ $
+ }
+ \hbox_set:Nn\l__alignedsets_full_box{
+ $
+ \displaystyle
+ {}\__alignedsets_original_underset:nn{#1}{#3}{}
+ $
+ }
+ \hspace{
+ \dim_eval:n{(\box_wd:N\l__alignedsets_full_box-\box_wd:N\l__alignedsets_clap_box)/2}
+ }
+ \exp_args:NNNx
+ \group_end:
+ {&}
+ \hspace{
+ -\dim_eval:n{
+ (\box_wd:N\l__alignedsets_full_box-\box_wd:N\l__alignedsets_clap_box)/2
+ }
+ }
+ \__alignedsets_original_underset:nn{#1}{#3}
+ }{
+ \__alignedsets_original_underset:nn{#1}{#3}
+ }
+}
+\endinput
+%%
+%% End of file `aligned-overset.sty'.