The figure searching code gets confused if a file of the same basename
(but in a different directory) has already been loaded.  Here is
a minimal min.tex to show what I mean:

\placefigure[here][ch1fig]{should be 1/fig-1.pdf}{\externalfigure[fig-1.pdf]}
\placefigure[here][ch2fig1]{should be 2/fig-1.pdf}{\externalfigure[fig-1.pdf]}
\placefigure[here][ch2fig2]{should be 2/fig-2.pdf}{\externalfigure[fig-2.pdf]}

Probably it's a silly idea to use \setupexternalfigures within the body,
but the same problem happens when using components (where each
component's preamble has a similar line), where it makes more sense.

Here is the directory structure (all the files are attached as a .tgz):


The final (third) figure is correctly found as 2/fig-2.pdf.  But the
second figure is reused from 1/fig-1.pdf because another fig-1.pdf has
already been found: as 1/fig-1.pdf.  Here is the relevant bit from the
texexec output:

  figures         : dimensions of 1/fig-1.pdf loaded from figurefile itself
  (./min.tuo) (/home/sanjoy/texmf/tex/context/base/pdfr-ec.tex)
  floatblocks     : 1 placed
  figures         : figureobject fig-1.pdf is reused  <===== The problem??
  floatblocks     : 2 placed
  figures         : dimensions of 2/fig-2.pdf loaded from figurefile itself
  floatblocks     : 3 placed

One part of ConTeXt does know the right figure path.  A
\getfiguredimensions[fig-1.pdf] after the second \placefigure will
trigger a kpathsea search for 2/fig-1.pdf, which it finds.  But it still
loads 1/fig-1.pdf, which is why I've said 'sort of searched' in the
subject line.


Attachment: searching.tgz
Description: test files

ntg-context mailing list

Reply via email to