[luatex] letterspacing in LuaTeX

Ulrike Fischer luatex at nililand.de
Mon Jul 26 11:04:57 CEST 2010


Am Sun, 25 Jul 2010 12:57:02 +0200 schrieb Pablo Rodríguez:


> In the meantime, a workaround might be to use the \so command from the 
> soulutf8 package. This is what I tried first and here is a sample:

[...]

> All I get is the following message:
> 
>      ! Package soul Error: Reconstruction failed.

The problem has nothing to do with fonts or utf8. I get the same
error with lualatex (Version beta-0.61.0-2010061910 (rev 3724))
(xelatex + pdflatex works fine) with this example: 


\documentclass[10pt]{book}
\usepackage{soul}

\begin{document}
This is only a \so{a}.
\end{document}
 

The problem is in SOUL at analyze: soul makes to much loops (and ends
with negative "goal") because the box \@one is not voided like in
pdflatex. The \showbox commands of the example below  shows in the
log file of pdflatex the boxes

First step

> \box1=
\hbox(4.3045+0.0)x0.00002
.\glue 0.0
.\SOUL at tt a
.\penalty 10000
.\glue(\parfillskip) 0.0 plus 1.0fil
.\glue(\rightskip) 0.0

Second step

> \box1=void


lualatex shows:

First step

> \box1=
\hbox(4.3045+0.0)x0.00002, direction TLT
.\SOUL at tt a
.\penalty 10000
.\glue(\parfillskip) 0.0 plus 1.0fil
.\glue(\leftskip) 0.0

Second step

> \box1=
\hbox(0.0+0.0)x0.00002, direction TLT
.\whatsit
..\localinterlinepenalty=0
..\localbrokenpenalty=0
..\localleftbox=null
..\localrightbox=null
.\glue(\rightskip) 0.0

then comes the error.


\documentclass[10pt]{book}
\usepackage{soul}
\makeatletter
\showboxdepth=100
\def\SOUL at analyze{{%
    \setbox\z@\vbox{%
        \unvcopy\z@
        \unskip
        \unpenalty
       \global\setbox\@ne=\lastbox}% 
    \showbox\@ne  %show box @ne
    \ifvoid\@ne
    \else
        \setbox\@ne\hbox{\unhbox\@ne}%
        \SOUL at syllgoal=\wd\@ne
        \showthe\SOUL at syllgoal %show goal
        \advance\count@\@ne
        \SOUL at analyze
        \SOUL at syllwidth\z@
        \SOUL at syllable={}%
        \ifnum\count@>\z@
            \advance\SOUL at syllgoal-\SOUL at ttwidth
            \SOUL at dosyllable
            \SOUL at getkern{\the\SOUL at lasttoken}{\SOUL at hyphkern}%
                {\SOUL at sethyphenchar}%
            \SOUL at everyhyphen
        \else
            \SOUL at dosyllable
        \fi
    \fi
}}

\begin{document}
This is only a \so{a}.
\end{document}


-- 
Ulrike Fischer 



More information about the luatex mailing list