diff options
author | Philipp Gesang <megas.kapaneus@gmail.com> | 2011-05-13 20:36:36 +0200 |
---|---|---|
committer | Philipp Gesang <megas.kapaneus@gmail.com> | 2011-05-13 20:36:36 +0200 |
commit | a61cd9e1d10c210efde9a9dbb5e58c5357bb3f9e (patch) | |
tree | bf8660a8051c173549c57c849b251876c4f15377 /tex/context/third/letterspace | |
parent | d5affb220f4c9a89ccc266bef4b093abe21c815d (diff) | |
download | t-letterspace-a61cd9e1d10c210efde9a9dbb5e58c5357bb3f9e.tar.gz |
bad idea: reverted to rev18
Diffstat (limited to 'tex/context/third/letterspace')
-rw-r--r-- | tex/context/third/letterspace/t-letterspace.mkiv | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/tex/context/third/letterspace/t-letterspace.mkiv b/tex/context/third/letterspace/t-letterspace.mkiv index 8ab420e..ce3f026 100644 --- a/tex/context/third/letterspace/t-letterspace.mkiv +++ b/tex/context/third/letterspace/t-letterspace.mkiv @@ -87,12 +87,35 @@ \fi \fi% {\letterspace_setstuff\currentobject}% - % Hans’ macro \doifnextcharelse works a lot better than my - % previously defined kludge … - \doifnextcharelse{\ }{% + \doifnextspace{% {\letterspace_setstuff\ }% \gobblespacetokens% - }{}% + }% +} + +%D This is a partial ripoff of a couple of macros from +%D \type{syst-aux.mkiv}. +%D \useURL [flet] [http://www.tug.org/TUGboat/Articles/tb09-3/tb22bechtolsheim.pdf] [] [\type{futurelet}] +%D Very helpful for further understanding of what’s exactly going +%D on: Stephan von Bechtolsheim’s tutorial on \from[flet]. +%D +%D In short: the trick is checking whether the token following +%D the command is a space, that is: whether it expands to +%D \type{\blankspace}. If the test succeeds, a space will be +%D added that has the correct parameters and all space tokens +%D following the command will be gobbled. Otherwise -- the next +%D token being anything else -- \type{\letterspace} will proceed +%D without changing anything. + +\def\doifnextspace#1{% + \def\!!string{#1}% + \futurelet\nexttoken\inspectnexttoken% +} + +\def\inspectnexttoken{% + \ifx\nexttoken\blankspace + \@EA\!!string + \fi% } %D \macros |