[XeTeX] \XeTeXpdffile causes over-long line unless wrapped in \hbox

David Carlisle d.p.carlisle at gmail.com
Thu Apr 15 16:24:17 CEST 2021


The command is scanning ahead for keywords such as  page 2 in the unhboxed
case  but in the boxed case the } stops the scan but it seems having
decided that  test is not a keyword it is inserting a space before it which
seems wrong. More surprising is that it eats ! here even though  ! isn't
part of the allowed syntax as far as I can see


\def\imga{\hbox{\XeTeXpdffile "image.pdf"\relax!}}
\def\imgb{\XeTeXpdffile "image.pdf"\relax!}



test test test test test test test test test test test test test
test test test test test test test test test test test test test
test test test test test test test test test test test test test
test test test test test test test test test test test test test
\imga
test test test test test test test test test test test test test
test test test test test test test test test test test test test
test test test test test test test test test test test test test
test test test test test test test test test test test test test


test test test test test test test test test test test test test
test test test test test test test test test test test test test
test test test test test test test test test test test test test
test test test test test test test test test test test test test
\imgb
test test test test test test test test test test test test test
test test test test test test test test test test test test test
test test test test test test test test test test test test test
test test test test test test test test test test test test test

\end


The effect on linebreaking is more or less accidental "test" can't be
hyphenated so it's not surprising that some lines can not be justified, and
the extra space or not space after the image is changing the linebreaking
in the paragraph.

David



On Thu, 15 Apr 2021 at 14:24, Gavin Smith <gavinsmith0123 at gmail.com> wrote:

> If I XeTeX to display an image in text, like
>
> \def\img{\XeTeXpdffile "image.pdf"\relax}
>
> test test test test test test test test test test test test test
> test test test test test test test test test test test test test
> test test test test test test test test test test test test test
> test test test test test test test test test test test test test
> \img
> test test test test test test test test test test test test test
> test test test test test test test test test test test test test
> test test test test test test test test test test test test test
> test test test test test test test test test test test test test
>
> \end
>
> and then process with "xetex test.tex" on the command line, then the line
> after the image is too long and goes into the margin.  You can see this
> in the attached file.
>
> I found wrapping the \XeTeXpdffile in an \hbox, thus:
>
> \def\img{\hbox{\XeTeXpdffile "image.pdf"\relax}}
>
> fixed the problem, but I don't see why this should be necessary.
>
> Is this a bug?
>
> XeTeX reports its version as follows:
>
> $ xetex test.texi
> This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017/Debian)
> (preloaded format=xetex)
>  restricted \write18 enabled.
> entering extended mode
> (./test.texi [1] )
> Output written on test.pdf (1 page).
> Transcript written on test.log.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/xetex/attachments/20210415/6a75466f/attachment-0001.html>


More information about the XeTeX mailing list.