\graphicspath{{ch01/ch01figs/}{ch02/ch02figs/} ... }
The graphics package is graphicx. Figures are inserted with
\includegraphics
called from within each chapter. But LaTeX reports that graphics
files
cannot be found. Questions:
(1) Can graphicspath handle multiple directory levels?
(documentation doesnt say; all examples are one-level)
(2) If yes, is the problem caused by including graphics from L2?
(3) If no, should \graphicspath be set on entry to each chapter?
I have previously used graphicspath successfully with TeXShop
with a 2-level organization for several articles, but this is my
first trial with a 3-level one. Thanks.
=== master.tex ===
\documentclass[a4paper]{book}
\usepackage{graphicx}
\graphicspath{{ch01/ch01figs/}{ch02/ch02figs/}}
\begin{document}
\frontmatter
x
\mainmatter
\chapter{Primo}
\input{ch01/primo}
\chapter{Secondo}
\input{ch02/secondo}
\end{document}
=== ch01/primo.tex ===
abc
\includegraphics{logo1}
=== ch01/secondo.tex
abc
\includegraphics{logo2}
=== output of "ls -R" ===
% ls -R
ch01 ch02 master.aux master.log master.pdf master.tex
./ch01:
ch01figs primo.tex
./ch01/ch01figs:
logo1.pdf
./ch02:
ch02figs secondo.tex
./ch02/ch02figs:
logo2.pdf
=== relevant part of the log file (edited to limit line length)
Chapter 1.
(./ch01/primo.tex
<ch01/ch01figs/logo1.pdf, id=6, 190.7125pt x 192.72pt>
<use ch01/ch01figs/logo1.pdf>)
[1 <./ch01/ch01figs/logo1.pdf>]
Chapter 2.
(./ch02/secondo.tex
<ch02/ch02figs/logo2.pdf, id=16, 190.7125pt x 192.72pt>
<use ch02/ch02figs/logo2.pdf>)
[2 <./ch02/ch02figs/logo2.pdf>]
===
So it seems to work.
Ciao
Enrico
carlos> On Apr 29, 2:07 am, Enrico Gregorio <grego...@math.unipd.it> wrote:
[...]
>> > \graphicspath{{ch01/ch01figs/}{ch02/ch02figs/} ... }
[...]
>> So it seems to work.
>>
>> Ciao Enrico
[...]
carlos> Many thanks. Was your test done on a Mac under OSX? I am
carlos> beginning to suspect
carlos> that the behavior of graphicspath for multiple levels is OS
carlos> dependent. If that is the case I will have to put it inside an /if
carlos> ... \fi since the publisher might have a different OS.
Hi, use something like
\graphicspath{{:eps:}{:tiff:}}
on a Mac.
I'm quoting from "grfguide.pdf":
\graphicspath{ dir-list }
This optional declaration may be used to specify a list of directories in
which to search for graphics files. The format is the same as for the
LaTeX2e primitive \input@path. A list of directories, each in a {} group
(even if there is only one in the list). For example:
\graphicspath{{eps/}{tiff/}} would cause the system to look in the
subdirectories eps and tiff of the current directory. This is unix syntax,
on a Mac it would be:
\graphicspath{{:eps:}{:tiff:}}
Note the differing conventions, an initial : is needed on Macintosh systems
to denote the current folder, whereas on unix an initial / would denote the
top level 'root' directory.
The default setting of this path is \input@path that is: graphics files
will be found wherever TEX files are found.
Hope this helps
Toto
--
I rarely meddled in the cat's personal affairs and she rarely meddled in
mine. Neither of us was foolish enough to attribute human emotions to our
pets. Friedman, Kinky: Greenwich Killing Time
> Hi, use something like
>
> \graphicspath{{:eps:}{:tiff:}}
>
> on a Mac.
>
> I'm quoting from "grfguide.pdf":
>
> \graphicspath{ dir-list }
>
> This optional declaration may be used to specify a list of directories in
> which to search for graphics files. The format is the same as for the
> LaTeX2e primitive \input@path. A list of directories, each in a {} group
> (even if there is only one in the list). For example:
>
> \graphicspath{{eps/}{tiff/}} would cause the system to look in the
> subdirectories eps and tiff of the current directory. This is unix
> syntax,
> on a Mac it would be:
>
> \graphicspath{{:eps:}{:tiff:}}
>
> Note the differing conventions, an initial : is needed on Macintosh
> systems
> to denote the current folder, whereas on unix an initial / would denote
> the
> top level 'root' directory.
This is seriously outdated. The Mac since OS 10 *is* BSD unix
underlyingly, so it uses / as the directory delimiter. The : delimiter
hasn't been in use for years for most users, and simply doesn't work.
Since you're on a Linux box, I guess you couldn't have known...
Alan
> Many thanks. Was your test done on a Mac under OSX? I am beginning
> to suspect
> that the behavior of graphicspath for multiple levels is OS
> dependent. If that is the
> case I will have to put it inside an /if ... \fi since the publisher
> might have a different OS.
It was on Mac OS X. I don't use Windows, but I believe that
TeX programs on that platform understand directory delimiters just
like on Unix systems. So the only problem would be on Mac OS 9,
and I doubt that publishers still use it.
Ciao
Enrico