diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/realscripts')
-rw-r--r-- | Master/texmf-dist/tex/latex/realscripts/realscripts.sty | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/realscripts/realscripts.sty b/Master/texmf-dist/tex/latex/realscripts/realscripts.sty new file mode 100644 index 00000000000..22658d56dee --- /dev/null +++ b/Master/texmf-dist/tex/latex/realscripts/realscripts.sty @@ -0,0 +1,80 @@ +%% +%% This is file `realscripts.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% realscripts.dtx (with options: `package') +%% ____________________________ +%% The REALSCRIPTS package +%% (C) 2010 Will Robertson +%% License information appended +%% +\ProvidesPackage{realscripts} + [2010/08/05 v0.1 Access OpenType subscripts and superscripts] +\RequirePackage{fontspec}[2010/05/14 v2.0] +\ExplSyntaxOn +\DeclareDocumentCommand \textsubscript {s} { + \IfBooleanTF #1 \fakesubscript \realsubscript +} +\DeclareDocumentCommand \textsuperscript {s} { + \IfBooleanTF #1 \fakesuperscript \realsuperscript +} +\DeclareDocumentCommand \fakesubscript {m} { + \@textsubscript{\selectfont#1} +} +\DeclareDocumentCommand \fakesuperscript {m} { + \@textsuperscript{\selectfont#1} +} +\DeclareDocumentCommand \realsubscript {m} { + \fontspec_if_fontspec_font:TF { + \fontspec_if_opentype:TF + { \fontspec_if_feature:nTF {+subs} + { {\addfontfeature{VerticalPosition=Inferior}#1} } + { \fontspec_if_feature:nTF {+sinf} + { {\addfontfeature{VerticalPosition=ScientificInferior}#1} } + { \fakesubscript{#1} } + } + } + { \fontspec_if_aat_feature:nnTF {10} {2} + { {\addfontfeature{VerticalPosition=Inferior}#1} } + { \fakesubscript{#1} } + } + } + { \fakesubscript{#1} } +} +\DeclareDocumentCommand \realsuperscript {m} { + \fontspec_if_fontspec_font:TF + { + \fontspec_if_opentype:TF + { \fontspec_if_feature:nTF {+sups} + { {\addfontfeature{VerticalPosition=Superior}#1} } + { \fakesuperscript{#1} } + } + { \fontspec_if_aat_feature:nnTF {10} {1} + { {\addfontfeature{VerticalPosition=Superior}#1} } + { \fakesuperscript{#1} } + } + } + { \fakesuperscript{#1} } +} +\cs_set:Npn \@makefnmark { + \mbox{\normalfont\textsuperscript{\@thefnmark}} +} +%% +%% Copyright (C) 2010 by Will Robertson <will.robertson@latex-project.org> +%% +%% Distributable under the LaTeX Project Public License, +%% version 1.3c or higher (your choice). The latest version of +%% this license is at: http://www.latex-project.org/lppl.txt +%% +%% This work is "maintained" (as per LPPL maintenance status) +%% by Will Robertson. +%% +%% This work consists of the file realscripts.dtx +%% and the derived files realscripts.sty, +%% realscripts.ins, and +%% realscripts.pdf. +%% +%% +%% End of file `realscripts.sty'. |