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

2021-04-15 Thread Gavin Smith
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

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

2021-04-15 Thread David Carlisle
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 o

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

2021-04-15 Thread Jonathan Kew
On 15/04/2021 15:24, David Carlisle wrote: The command is scanning ahead for keywords such as  page 2 in the unhboxed case Shouldn't the \relax stop it scanning ahead anyway? but in the boxed case the } stops the scan but it seems having decided that  test is not a keyword it is inserting a

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

2021-04-15 Thread Bruno Le Floch
David got mislead. The truth is rather stranger: it seems the width of the image used when placing glyphs of a given hlist on the page is different from (and larger than) the width of the image used when measuring the total box size. For instance "!" does not get eaten: it overlaps with the follo

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

2021-04-15 Thread John Was
In case it's of any relevance, I've always boxed images, e.g. \setbox1=\hbox{\XeTeXpdffile "image.pdf"} That's mainly so that I can use \wd1 as the width of any caption beneath the image (which is invoked by "\box1", of course). I *think* from memory that the XeTeX manual says that an image is

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

2021-04-15 Thread David Carlisle
Bruno wrote > David got mislead. Yes sorry too many programming languages in head at once today:-)

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

2021-04-15 Thread Werner LEMBERG
> 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. The thing is that xetex doesn't produce any warnin

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

2021-04-15 Thread Bruno Le Floch
> On Thu, 15 Apr 2021 at 15:42, Bruno Le Floch wrote: > > David got mislead.  The truth is rather stranger: it seems the width of > the > image used when placing glyphs of a given hlist on the page is different > from > (and larger than) the width of the image used when measuring the