ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* relative file locations when compiling from different folders (in projects)
@ 2008-09-30 22:59 Mojca Miklavec
  2008-10-01 10:49 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Mojca Miklavec @ 2008-09-30 22:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

I'm just wondering if there's some recipe about how to simplify the
work when icluding other files and images in projects, when one is
compiling from different folders.

For example:

articles/08/01/art-one.tex (product)
articles/08/01/art-two.tex (product)
articles/08/02/art-three.tex (product)
articles/08/02/art-four.tex (product)
articles/08/magazine_2008.tex (product)
components/funny.tex (component)
img/08/01/img-1.png
img/08/01/img-2.png
img/08/01/img-3.png
img/08/02/img-2.png
magazine_all.tex (project)
layout.tex (environment)

If I do
> cd articles/08/01
> texexec art-one
then images are expected to be set up as ../../../img/08/01 and if I
need to \input somefile from the project (like "funny.tex"), even if
that's a component, I need to provide some explicit location.

But then I would want to compile
> cd articles/08
> texexec magazine_2008
and then all relative paths break, even when specified in subfolders.
Now I would need to set up ../../img/08/01 as image directory. Even
though the article provides relative path, that path is now relative
to the document I compile one folder lower in hierarchy, not to the
document that defines the relative path (which is a bit weird, but I
understad why it is so).

Also ... is there some elegant way to include "funny.tex" from an
article, so that it will work both in article and magazine? (I'm
thinking about putting \def\projectroot{../../} at the top of files,
but that's a bit ugly.)

I can solve the problem in my own ways with some weird macros, like
the ones that set image directory to
"directory={../../../img/08/01,../../img/08/01,img/08/01}" at the top
of every article file, but my solutions are all a bit ugly. (Another
thing is that it needs to be flexible enough, so that I don't need to
change every single article in case that I decide to move images or
articles to another location in project.)

If some elegance exists to solve that, I would welcome any hints or
suggestions. But as I said: it's all solvable in one way or another,
so this is just a low-priority request for sharing your ideas. I'm
posting this because I would almost bet that there's some one-liner to
solve it all :) :) :)

Thanks,
    Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: relative file locations when compiling from different folders (in projects)
  2008-09-30 22:59 relative file locations when compiling from different folders (in projects) Mojca Miklavec
@ 2008-10-01 10:49 ` Hans Hagen
  2008-10-03 16:30   ` Mojca Miklavec
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2008-10-01 10:49 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Mojca Miklavec wrote:
> Hello,
> 
> I'm just wondering if there's some recipe about how to simplify the
> work when icluding other files and images in projects, when one is
> compiling from different folders.

\usepath[..]
\usesubpath[...] (on top of paths)
\setupexternalfigures[directory={.....}]

and alike



> For example:
> 
> articles/08/01/art-one.tex (product)
> articles/08/01/art-two.tex (product)
> articles/08/02/art-three.tex (product)
> articles/08/02/art-four.tex (product)
> articles/08/magazine_2008.tex (product)
> components/funny.tex (component)
> img/08/01/img-1.png
> img/08/01/img-2.png
> img/08/01/img-3.png
> img/08/02/img-2.png
> magazine_all.tex (project)
> layout.tex (environment)
> 
> If I do
>> cd articles/08/01
>> texexec art-one
> then images are expected to be set up as ../../../img/08/01 and if I
> need to \input somefile from the project (like "funny.tex"), even if
> that's a component, I need to provide some explicit location.
> 
> But then I would want to compile
>> cd articles/08
>> texexec magazine_2008
> and then all relative paths break, even when specified in subfolders.
> Now I would need to set up ../../img/08/01 as image directory. Even
> though the article provides relative path, that path is now relative
> to the document I compile one folder lower in hierarchy, not to the
> document that defines the relative path (which is a bit weird, but I
> understad why it is so).
> 
> Also ... is there some elegant way to include "funny.tex" from an
> article, so that it will work both in article and magazine? (I'm
> thinking about putting \def\projectroot{../../} at the top of files,
> but that's a bit ugly.)
> 
> I can solve the problem in my own ways with some weird macros, like
> the ones that set image directory to
> "directory={../../../img/08/01,../../img/08/01,img/08/01}" at the top
> of every article file, but my solutions are all a bit ugly. (Another
> thing is that it needs to be flexible enough, so that I don't need to
> change every single article in case that I decide to move images or
> articles to another location in project.)
> 
> If some elegance exists to solve that, I would welcome any hints or
> suggestions. But as I said: it's all solvable in one way or another,
> so this is just a low-priority request for sharing your ideas. I'm
> posting this because I would almost bet that there's some one-liner to
> solve it all :) :) :)
> 
> Thanks,
>     Mojca
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: relative file locations when compiling from different folders (in projects)
  2008-10-01 10:49 ` Hans Hagen
@ 2008-10-03 16:30   ` Mojca Miklavec
  2008-10-03 18:15     ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Mojca Miklavec @ 2008-10-03 16:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello Hans,

On Wed, Oct 1, 2008 at 12:49 PM, Hans Hagen wrote:
> Mojca Miklavec wrote:
>> Hello,
>>
>> I'm just wondering if there's some recipe about how to simplify the
>> work when icluding other files and images in projects, when one is
>> compiling from different folders.
>
> \usepath[..]
> \usesubpath[...] (on top of paths)
> \setupexternalfigures[directory={.....}]

Great!

I knew that there must be some secret to do it in some more elegant
way than I was trying to cook up.

Thanks a lot,
    Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: relative file locations when compiling from different folders (in projects)
  2008-10-03 16:30   ` Mojca Miklavec
@ 2008-10-03 18:15     ` Hans Hagen
  2008-10-05 18:17       ` Henning Hraban Ramm
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2008-10-03 18:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Mojca Miklavec wrote:
> Hello Hans,
> 
> On Wed, Oct 1, 2008 at 12:49 PM, Hans Hagen wrote:
>> Mojca Miklavec wrote:
>>> Hello,
>>>
>>> I'm just wondering if there's some recipe about how to simplify the
>>> work when icluding other files and images in projects, when one is
>>> compiling from different folders.
>> \usepath[..]
>> \usesubpath[...] (on top of paths)
>> \setupexternalfigures[directory={.....}]
> 
> Great!
> 
> I knew that there must be some secret to do it in some more elegant
> way than I was trying to cook up.

you don't want to know how old these features are

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: relative file locations when compiling from different folders (in projects)
  2008-10-03 18:15     ` Hans Hagen
@ 2008-10-05 18:17       ` Henning Hraban Ramm
  2008-10-06 21:35         ` luigi scarso
  2008-10-07 18:02         ` Hans Hagen
  0 siblings, 2 replies; 7+ messages in thread
From: Henning Hraban Ramm @ 2008-10-05 18:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2008-10-03 um 20:15 schrieb Hans Hagen:

>>>> I'm just wondering if there's some recipe about how to simplify the
>>>> work when icluding other files and images in projects, when one is
>>>> compiling from different folders.
>>> \usepath[..]
>>> \usesubpath[...] (on top of paths)
>>> \setupexternalfigures[directory={.....}]
>> I knew that there must be some secret to do it in some more elegant
>> way than I was trying to cook up.
> you don't want to know how old these features are


2 hours? 2 days? or 10 years?

Never saw \use(sub)path before...
Would have solved some of my own problems.


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: relative file locations when compiling from different folders (in projects)
  2008-10-05 18:17       ` Henning Hraban Ramm
@ 2008-10-06 21:35         ` luigi scarso
  2008-10-07 18:02         ` Hans Hagen
  1 sibling, 0 replies; 7+ messages in thread
From: luigi scarso @ 2008-10-06 21:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 725 bytes --]

On Sun, Oct 5, 2008 at 8:17 PM, Henning Hraban Ramm <hraban@fiee.net> wrote:

> Am 2008-10-03 um 20:15 schrieb Hans Hagen:
>
> >>>> I'm just wondering if there's some recipe about how to simplify the
> >>>> work when icluding other files and images in projects, when one is
> >>>> compiling from different folders.
> >>> \usepath[..]
> >>> \usesubpath[...] (on top of paths)
> >>> \setupexternalfigures[directory={.....}]
> >> I knew that there must be some secret to do it in some more elegant
> >> way than I was trying to cook up.
> > you don't want to know how old these features are
>
>
> 2 hours? 2 days? or 10 years?
>
\usepath and \usesubpath are in core-job
at least from
\def\contextversion{2002.6.25}



-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 1209 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: relative file locations when compiling from different folders (in projects)
  2008-10-05 18:17       ` Henning Hraban Ramm
  2008-10-06 21:35         ` luigi scarso
@ 2008-10-07 18:02         ` Hans Hagen
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2008-10-07 18:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Henning Hraban Ramm wrote:
> Am 2008-10-03 um 20:15 schrieb Hans Hagen:
> 
>>>>> I'm just wondering if there's some recipe about how to simplify the
>>>>> work when icluding other files and images in projects, when one is
>>>>> compiling from different folders.
>>>> \usepath[..]
>>>> \usesubpath[...] (on top of paths)
>>>> \setupexternalfigures[directory={.....}]
>>> I knew that there must be some secret to do it in some more elegant
>>> way than I was trying to cook up.
>> you don't want to know how old these features are
> 
> 
> 2 hours? 2 days? or 10 years?
> 
> Never saw \use(sub)path before...
> Would have solved some of my own problems.

definitely many years


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-10-07 18:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-30 22:59 relative file locations when compiling from different folders (in projects) Mojca Miklavec
2008-10-01 10:49 ` Hans Hagen
2008-10-03 16:30   ` Mojca Miklavec
2008-10-03 18:15     ` Hans Hagen
2008-10-05 18:17       ` Henning Hraban Ramm
2008-10-06 21:35         ` luigi scarso
2008-10-07 18:02         ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).