[texhax] A sign-change puzzle

Uwe Lück uwe.lueck at web.de
Tue Dec 12 03:29:25 CET 2006


Pierre,

At 16:49 09.12.06, pierre.mackay wrote:
>I am currently working on a book that requires a lot of letterspacing
>in uppercase and some numeric text.  I use a tail-recursion macro :
>
>\def\[#1]{\lsp#1\empty\psl}%
>\def\lsp#1#2\psl{\ifx#1\empty
>\else#1\kern\letterspacing\lsp#2\psl\fi}
[...]
>Can anyone suggest to me why this sign change is necessary?

thank you for your interesting posting. However, I haven't
analysed your problem yet. I am just copying below some private
macros from a current project of mine -- in case anybody
can make sense of them. The trick is to mix a fixed kerning value
with the implicit kernings from the font. This has pleased me most
with the example of "VORWORT". I hope that sometimes
in the future somebody will find the time to make a package of it for
CTAN.

Best,

Uwe.

________________________________________

\newcommand{\@CE at textpart}[1]{%
   \normalfont\Large\MakeUppercase{#1}}
%% TODO: \part fuer Extra-Seiten "Vorwort", "Einleitung",
%%       "Textteil" ... gemaess Vorgaenger-Band anpassen
%%       (Texthoehe!?)
\newcommand{\@CE at gesperrt}{%
   \futurelet\@let at token\@CE at sperr
}
\catcode`\"\active %% TODO!?
\newcommand{\@CE at sperr}[1]{%
   \ifx#1\@nnil \else
     \protected at edef\@CE at tempa{%
       \@CE at tempa
       \ifx\@let at token\@sptoken \space \fi
       \@CE at kerning@{#1}%
       #1}
     \ifx#1"\else
       \def\@CE at tempb{#1}\let\@CE at kerning@\@CE at kerning
     \fi
     \expandafter \@CE at gesperrt
   \fi
}
\newcommand{\@CE at kerning}[1]{%
   \ifx#1"\else
     \protect\@CE at impl@kern\@CE at tempb{#1}% %% TODO!?
     \kern.5mm %% EINLEITU.TEX von NCG IX
   \fi}
\newcommand{\@CE at impl@kern}[2]{%
   \settowidth\dimen@{\@CE at textpart{#1#2}}%
   \kern.5\dimen@ %% TODO .5!?
%  \message{\the\dimen@\space-}%
   \settowidth\dimen@{\@CE at textpart{#1\kern\z@#2}}%
   \kern-.5\dimen@ %% TODO .5!?
%  \message{\the\dimen@\space\space}%
}
%% TODO: -> CTAN




More information about the texhax mailing list