From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/44468 Path: news.gmane.org!not-for-mail From: "Mojca Miklavec" Newsgroups: gmane.comp.tex.context Subject: relative file locations when compiling from different folders (in projects) Date: Wed, 1 Oct 2008 00:59:17 +0200 Message-ID: <6faad9f00809301559v66deafc2m44308f570e08d519@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1222815666 32216 80.91.229.12 (30 Sep 2008 23:01:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Sep 2008 23:01:06 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Wed Oct 01 01:02:04 2008 connect(): Connection refused Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1KkoEE-0006ft-QR for gctc-ntg-context-518@m.gmane.org; Wed, 01 Oct 2008 01:02:02 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id EC8CE1FE4A; Wed, 1 Oct 2008 01:00:56 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 03438-01-2; Wed, 1 Oct 2008 01:00:05 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 90A521FE2B; Wed, 1 Oct 2008 00:59:59 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4ACFA1FE28 for ; Wed, 1 Oct 2008 00:59:56 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 02581-02 for ; Wed, 1 Oct 2008 00:59:18 +0200 (CEST) Original-Received: from yw-out-1718.google.com (yw-out-1718.google.com [74.125.46.153]) by ronja.ntg.nl (Postfix) with ESMTP id 67EC01FE2B for ; Wed, 1 Oct 2008 00:59:18 +0200 (CEST) Original-Received: by yw-out-1718.google.com with SMTP id 5so57693ywm.74 for ; Tue, 30 Sep 2008 15:59:17 -0700 (PDT) Original-Received: by 10.151.45.2 with SMTP id x2mr10853654ybj.13.1222815557583; Tue, 30 Sep 2008 15:59:17 -0700 (PDT) Original-Received: by 10.150.137.7 with HTTP; Tue, 30 Sep 2008 15:59:17 -0700 (PDT) Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:44468 Archived-At: 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 ___________________________________________________________________________________