[XeTeX] Cannot load dislocated image file

Sven Siegmund sven.siegmund at gmail.com
Sat Mar 15 14:09:46 CET 2008


Thank you for your nice axplanation and suggestion.

\hskip0pt did work.

I will try to use \XeTeXpicfile and if I experience further problems I
will probably return to the graphicx package.

Best regards,

S.


2008/3/15, Jonathan Kew <jonathan_kew at sil.org>:
> On 15 Mar 2008, at 12:39 pm, Sven Siegmund wrote:
>
>  > Thanks, that helped. Yes, indeed, the initial slash was the problem.
>  >
>  > Another problem was the double quotes. I had to use single quotes
>  > because with double quotes I cound not further spcify the width of the
>  > picture.
>  >
>  > i.e.
>  >
>  > \XeTeXpicfile "img/maerklin-schienentypen-h0.jpg" width 10cm
>  > did not work, but
>  >
>  > \XeTeXpicfile 'img/maerklin-schienentypen-h0.jpg' width 10cm
>  > works ok.
>  >
>  > Another problem, which I am trying to solve now is the centering of
>  > the image.
>  >
>  > my source is now
>  >
>  > \begin{figure}[htp]
>  > \centering
>  > \XeTeXpicfile 'img/maerklin-schienentypen-h0.jpg' width 10cm
>  > \caption{Gleistypen}
>  > \label{fig:gleistypen}
>  > \end{figure}
>  >
>  > but the yentering command did not affect the position of the
>  > picture file.
>
>
> Apparently \centering applies to the lines of a paragraph, but not to
>  boxes found outside of horizontal mode. \XeTeXpicfile does not by
>  itself cause TeX to leave "vertical mode" and begin paragraph building.
>
>  You could fix this by putting \hskip0pt before \XeTeXpicfile; that
>  will ensure TeX enters horizontal mode, and the picture becomes part
>  of a line that will be centered (rather than just a box in the
>  vertical list).
>
>  However, I'd suggest you simply use \includegraphics instead; with
>  \usepackage{graphicx} in your preamble, this should work as you want
>  (and is more readily portable to non-xetex usage):
>
>    \begin{figure}[htp]
>    \centering
>    \includegraphics[width=10cm]{img/maerklin-schienentypen-h0.jpg}
>
>    \caption{Gleistypen}
>    \label{fig:gleistypen}
>    \end{figure}
>
>
> JK
>
>  _______________________________________________
>  XeTeX mailing list
>  postmaster at tug.org
>  http://tug.org/mailman/listinfo/xetex
>


More information about the XeTeX mailing list