ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Search path.
@ 2012-09-10  2:45 Andre Caldas
  2012-09-10  7:09 ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Andre Caldas @ 2012-09-10  2:45 UTC (permalink / raw)
  To: ConTeXt users

Hello, list!

I am really new to ConTeXt. I am writing a book
http://topologia-geral.ourproject.org/
It is written in LaTeX and I intend to migrate it to ConTeXt.

I want to migrate and I want to be as far from HACKS as I can. So I
want to know the recommended way to do things. One of my first
difficulties comes from the "search path" used by texexec. It seems to
me that the path searched for components, products and environments
depends on the path were the script was called from. That is, it
depends on the "current working directory".

My question (honestly) is:
- Why would I want this behavior?

When I write a project, product, component or environment file, why
would I want the references I made to be dependent on the directory
where the script was called? Shouldn't things be like the
#include "relative_path.h"
used in the C language, for example? That is, shouldn't those paths be
relative to the script that refers to them?

Am I missing something?


André Caldas.
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Search path.
  2012-09-10  2:45 Search path Andre Caldas
@ 2012-09-10  7:09 ` Hans Hagen
  2012-09-10 12:47   ` Andre Caldas
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2012-09-10  7:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 10-9-2012 04:45, Andre Caldas wrote:
> Hello, list!
>
> I am really new to ConTeXt. I am writing a book
> http://topologia-geral.ourproject.org/
> It is written in LaTeX and I intend to migrate it to ConTeXt.
>
> I want to migrate and I want to be as far from HACKS as I can. So I
> want to know the recommended way to do things. One of my first
> difficulties comes from the "search path" used by texexec. It seems to
> me that the path searched for components, products and environments
> depends on the path were the script was called from. That is, it
> depends on the "current working directory".
>
> My question (honestly) is:
> - Why would I want this behavior?
>
> When I write a project, product, component or environment file, why
> would I want the references I made to be dependent on the directory
> where the script was called? Shouldn't things be like the
> #include "relative_path.h"
> used in the C language, for example? That is, shouldn't those paths be
> relative to the script that refers to them?
>
> Am I missing something?

The way tex (and its path) are set up is that files are looked up on the 
current path (.) or relative to it, or in the (tds compliant) tex tree. 
Auxiliary files are created in the current directory.

One can hardcode a path in the tex source if needed. Another option is 
to move to the source path (something texmfstart --path ... texexec ... 
or mtxrun --path ... --script context ...) but what's best depends on 
the kind of project.

Do you really need to use context mkii? As it's a new project, using 
context mkiv might be a better idea.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Search path.
  2012-09-10  7:09 ` Hans Hagen
@ 2012-09-10 12:47   ` Andre Caldas
  2012-09-10 13:13     ` Pontus Lurcock
  0 siblings, 1 reply; 6+ messages in thread
From: Andre Caldas @ 2012-09-10 12:47 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

>> When I write a project, product, component or environment file, why
>> would I want the references I made to be dependent on the directory
>> where the script was called? Shouldn't things be like the
>> #include "relative_path.h"
>> used in the C language, for example? That is, shouldn't those paths be
>> relative to the script that refers to them? [...]
>
> The way tex (and its path) are set up is that files are looked up on the
> current path (.) or relative to it, or in the (tds compliant) tex tree.
> Auxiliary files are created in the current directory.

I thought the reason was TeX itself. I just had some hope that ConTeXt
would "fix" this behavior some how. Since ConTeXt allows one to have
products and contents relatively independent from the project itself,
I thought that it would make sense to have the references to files
independent from the project structure as well.

Maybe I can just live with TEXINPUTS and BIBINPUTS... :-)

I guess the magic could be at some extent done with "\usepath".
Leaving the probably already extensively discussed "\usepath"
precedence order for another discussion...


> One can hardcode a path in the tex source if needed. Another option is to
> move to the source path (something texmfstart --path ... texexec ... or
> mtxrun --path ... --script context ...) but what's best depends on the kind
> of project.

I definitely prefer not to hard code paths in the source. Actually, I
would like the "components" to not have to worry at all about where
they live...

I will study texmfstart. :-)


> Do you really need to use context mkii? As it's a new project, using context
> mkiv might be a better idea.

No, I don't. I want to use always the preferred solution. I want to
follow your guidelines and be enlightened... :-)
How did you know I was using one and not the other? I didn't know it myself!!!


Thank you very much for your help and for this great piece of software, Hans.


André Caldas.
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Search path.
  2012-09-10 12:47   ` Andre Caldas
@ 2012-09-10 13:13     ` Pontus Lurcock
  2012-09-10 14:56       ` Aditya Mahajan
  0 siblings, 1 reply; 6+ messages in thread
From: Pontus Lurcock @ 2012-09-10 13:13 UTC (permalink / raw)
  To: ntg-context

On Mon 10 Sep 2012, Andre Caldas wrote:

> > Do you really need to use context mkii? As it's a new project,
> > using context mkiv might be a better idea.
> 
> No, I don't. I want to use always the preferred solution. I want to
> follow your guidelines and be enlightened... :-)
> How did you know I was using one and not the other? I didn't know it
> myself!!!

Probably from the name of the binary -- ‘texexec’ runs mkii,
whereas ‘context’ gives you mkiv.

Pont
___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Search path.
  2012-09-10 13:13     ` Pontus Lurcock
@ 2012-09-10 14:56       ` Aditya Mahajan
  0 siblings, 0 replies; 6+ messages in thread
From: Aditya Mahajan @ 2012-09-10 14:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On 2012-09-10, at 9:13 AM, Pontus Lurcock <pont@talvi.net> wrote:

> On Mon 10 Sep 2012, Andre Caldas wrote:
> 
>>> Do you really need to use context mkii? As it's a new project,
>>> using context mkiv might be a better idea.
>> 
>> No, I don't. I want to use always the preferred solution. I want to
>> follow your guidelines and be enlightened... :-)
>> How did you know I was using one and not the other? I didn't know it
>> myself!!!
> 
> Probably from the name of the binary -- ‘texexec’ runs mkii,
> whereas ‘context’ gives you mkiv.


We also need to clarify this on the wiki, which talks about texexec in a few places. 

Aditya

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Search Path
@ 2005-05-06  4:33 Randall Skelton
  0 siblings, 0 replies; 6+ messages in thread
From: Randall Skelton @ 2005-05-06  4:33 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1869 bytes --]

Hi all,

I've become rather confused on how ConTeXt searches paths so I made a
quick example... Attached is ConTest.zip which expands to a trivial
directory layout for a project.

ConTest/env_test.tex
ConTest/prd_one
ConTest/prd_one/cmp_aaa
ConTest/prd_one/cmp_aaa/cmp_aaa.tex
ConTest/prd_one/cmp_aaa/tbl_aaa.tex
ConTest/prd_one/cmp_bbb
ConTest/prd_one/cmp_bbb/cmp_bbb.tex
ConTest/prd_one/prd_one.tex
ConTest/prd_two
ConTest/prd_two/cmp_ccc
ConTest/prd_two/cmp_ccc/cmp_ccc.tex
ConTest/prd_two/cmp_ddd
ConTest/prd_two/cmp_ddd/cmp_ddd.tex
ConTest/prd_two/prd_two.tex
ConTest/prj_test.tex

My problems:

(1) I generally like to keep tables, figures and even some complicated
equations in separate input files so that I can easily move the files
between different projects (i.e. papers for publications, internal
docs, grant applications, etc).  More often than not, my 'tbl_*' files
are symlinks.  In this example I use:

  \input tbl_aaa.tex

within the file cmp_aaa.tex to illustrate my problem.  Namely, I
cannot find the file tbl_aaa.tex when generating either prj_test.tex
or prd_one.tex?

I've tried a variety of commands in place of input, including the
various readfile commands but nothing I've tried can make ConTeXt find
this file.

(2) Can someone please explain what \usepath[] and \usesubpath[] are
for and what the difference between the two is?  I've read many
messages that refer to these but have yet to find a true example
showing their use.  Their names suggest they may be useful in the case
but as the attached files suggest, I've been unable to figure out what
to do with them.

(3) I've largely switched over my figures to using the image database
(aka resource libraries?).  Is it currently possible to create
databases of equations and/or tables?

Many thanks and have a good weekend,
Randall

[-- Attachment #2: ConTest.zip --]
[-- Type: application/zip, Size: 3519 bytes --]

[-- Attachment #3: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

end of thread, other threads:[~2012-09-10 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-10  2:45 Search path Andre Caldas
2012-09-10  7:09 ` Hans Hagen
2012-09-10 12:47   ` Andre Caldas
2012-09-10 13:13     ` Pontus Lurcock
2012-09-10 14:56       ` Aditya Mahajan
  -- strict thread matches above, loose matches on Subject: below --
2005-05-06  4:33 Search Path Randall Skelton

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).