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.
image.pdf
Description: Adobe PDF document
test.pdf
Description: Adobe PDF document