[XeTeX] Cannot load dislocated image file
Sven Siegmund
sven.siegmund at gmail.com
Sat Mar 15 13:39:34 CET 2008
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.
S.
2008/3/15, Jonathan Kew <jonathan_kew at sil.org>:
>
> On 15 Mar 2008, at 12:20 pm, Sven Siegmund wrote:
>
> > Hello,
> >
> > I am trying to load an image file in my document like this
> >
> > ----
> > \begin{figure}[htp]
> > \centering
> > \XeTeXpicfile "/img/maerklin-schienentypen-h0.jpg"
> > \caption{Gleistypen}
> > \label{fig:gleistypen}
> > \end{figure}
> > -----
> >
> > The problem seems to be the location of the image file. It is not in
> > the folder of the TeX-Document.:
> >
> > My TeX-Document is in d:\Sven\Märklin\geometrie\geometrie.tex and the
> > image file is d:\Sven\Märklin\geometrie\img\maerklin-schienentypen-
> > h0.jpg
> >
> > When I move the image file to "D:\Sven\Märklin\geometrie" and write
> > \XeTeXpicfile "maerklin-schienentypen-h0.jpg", it loads ok.
> >
> > What am I doing wrong when loading the file from another location?
>
>
> I'd guess that you should use
>
>
> "img/maerklin-schienentypen-h0.jpg"
>
>
> or possibly
>
> "./img/maerklin-schienentypen-h0.jpg"
>
> to specify an image file with a relative path. The leading slash in
> your example would mean the path starts at the root of the drive.
>
> As you're using xelatex, I'd generally recommend using
> \includegraphics (with the graphicx package) rather than direct XeTeX
> primitives, btw. But the issue of relative vs absolute paths would be
> the same.
>
> JK
>
> _______________________________________________
> XeTeX mailing list
> postmaster at tug.org
> http://tug.org/mailman/listinfo/xetex
>
More information about the XeTeX
mailing list