[luatex] Kerning: when does it not work?
Ulrike Fischer
luatex at nililand.de
Thu May 5 10:38:35 CEST 2011
Am Thu, 5 May 2011 10:00:32 +0200 schrieb Ulrike Fischer:
> Am Thu, 5 May 2011 09:06:19 +0200 schrieb Heilmann, Till A.:
>
>> Well, there are some problems with Paul's code, after all: The
>> underscore character _ cannot be part of a URL *if* it occurs inside
>> a footnote (see below). I have not checked for errors with other
>> characters yet.
>
> The \url command tries to adjust the catcodes (with the
> \let\do\makeother \dospecials line) but can't do it if the catcode
> is already fixed when used in the argument of another command.
>
> You can change the catcodetable additionally in the \setbox command:
>
> \setbox\urlbox=\hbox{\directlua{tex.sprint(-2,"#1")}}%
>
> It will need some testing to decide which catcode table is suitable
> (for the test I simply took -2 where everything has catcode 12).
>
> But it will not solve all problems in \footnote: % and \ will still
> not work. So if you want to use url's in argument of other commands
> you will probably still need an \urldef-command like with the
> standard \url.
I think you will get away with most problems with
\def\url{%
\begingroup
\catcode`\%=12
\URL
}
\def\URL#1{%
\setbox\urlbox=\hbox{%
\directlua{%
tex.sprint(-2,"\luatexluaescapestring{\unexpanded{#1}}")}}%
.....
You will still not be able to use a % in a footnote-url!
--
Ulrike Fischer
More information about the luatex
mailing list