Created
January 4, 2016 09:42
-
-
Save anonymous/912701e28f8bfe965ed1 to your computer and use it in GitHub Desktop.
Using document level function to call different code level functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage{xparse} | |
\ExplSyntaxOn | |
\cs_new_protected:Npn \johannes_all_caps_kern:nn #1#2 | |
{ | |
\tl_set:Nx \l_tmpa_tl { \tl_upper_case:n { #2 } } | |
\group_begin: | |
\addfontfeature{Scale=0.9} | |
\textls [ #1 ] { \l_tmpa_tl } | |
\group_end: | |
} | |
\cs_new_protected:Npn \johannes_all_caps_nokern:nn #1#2 | |
{ | |
\tl_set:Nx \l_tmpa_tl { \tl_upper_case:n { #2 } } | |
\group_begin: | |
\addfontfeature{Scale=0.9} | |
\textls * [ #1 ] { \l_tmpa_tl } | |
\group_end: | |
} | |
\NewDocumentCommand \allcaps { s O{200} m } | |
{ | |
\IfBooleanTF { #1 } | |
{ \johannes_all_caps_kern:nn { #2 } { #3 } } | |
{ \johannes_all_caps_nokern:nn { #2 } { #3 } } | |
} | |
\ExplSyntaxOff | |
\begin{document} | |
\end{document} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment