ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to add directory to input path?
@ 2009-07-21  8:37 Mojca Miklavec
  2009-07-21 11:22 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Mojca Miklavec @ 2009-07-21  8:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

I bet that I have already asked that, but I don't find or remember the
answer. I would like to add some folders to TeX search path. Let's say
that I have:
    main.tex
    sub/include1.tex

and would like to use "\input include1.tex" inside main.tex without
having to specify full path, in the same way as
\setupexternalfigures[directory=...] can be used. I have tried
\usedirectory, \usepath, \usesubpath, but neither works. Well ...
actually \usepath works in mkiv, but not in mkii. If I use \usepath
then \allinputpaths gets the folder I have specified, but it doesn't
seem to work.

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] 6+ messages in thread

* Re: How to add directory to input path?
  2009-07-21  8:37 How to add directory to input path? Mojca Miklavec
@ 2009-07-21 11:22 ` Wolfgang Schuster
  2009-07-21 12:28   ` Mojca Miklavec
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2009-07-21 11:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 21.07.2009 um 10:37 schrieb Mojca Miklavec:

> Hello,
>
> I bet that I have already asked that, but I don't find or remember the
> answer. I would like to add some folders to TeX search path. Let's say
> that I have:
>    main.tex
>    sub/include1.tex
>
> and would like to use "\input include1.tex" inside main.tex without
> having to specify full path, in the same way as
> \setupexternalfigures[directory=...] can be used. I have tried
> \usedirectory, \usepath, \usesubpath, but neither works. Well ...
> actually \usepath works in mkiv, but not in mkii. If I use \usepath
> then \allinputpaths gets the folder I have specified, but it doesn't
> seem to work.

\usepath[sub]

\component include1

Wolfgang

___________________________________________________________________________________
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] 6+ messages in thread

* Re: How to add directory to input path?
  2009-07-21 11:22 ` Wolfgang Schuster
@ 2009-07-21 12:28   ` Mojca Miklavec
  2009-07-21 13:31     ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Mojca Miklavec @ 2009-07-21 12:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Jul 21, 2009 at 13:22, Wolfgang Schuster wrote:
>
> Am 21.07.2009 um 10:37 schrieb Mojca Miklavec:
>
>> Hello,
>>
>> I bet that I have already asked that, but I don't find or remember the
>> answer. I would like to add some folders to TeX search path. Let's say
>> that I have:
>>   main.tex
>>   sub/include1.tex
>>
>> and would like to use "\input include1.tex" inside main.tex without
>> having to specify full path, in the same way as
>> \setupexternalfigures[directory=...] can be used. I have tried
>> \usedirectory, \usepath, \usesubpath, but neither works. Well ...
>> actually \usepath works in mkiv, but not in mkii. If I use \usepath
>> then \allinputpaths gets the folder I have specified, but it doesn't
>> seem to work.
>
> \usepath[sub]
>
> \component include1

Thanks. So basically there's no way to convince \input to work
"properly" (that is: respecting some additional input path) in mkii?
(In mkiv it seems to work, but it could be that that's just because it
interacts with its own "kpathsea".)

But then I have another question. I actually wanted to use that inside
a module (gnuplot) that uses something like

    \processmyfile[#1][#2]{
        ....
        \readlocfile{#2}{}{}
        ....
    }

I wish I remembered why I decided for \readlocfile (I guess it was for
error handling that is still waiting to be implemented). How should I
change the module in this particular case? (What should I use instead
of \readlocfile, so that the file will be found?)

Thank you,
    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] 6+ messages in thread

* Re: How to add directory to input path?
  2009-07-21 12:28   ` Mojca Miklavec
@ 2009-07-21 13:31     ` Wolfgang Schuster
  2009-07-21 14:51       ` Mojca Miklavec
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Schuster @ 2009-07-21 13:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 21.07.2009 um 14:28 schrieb Mojca Miklavec:

> Thanks. So basically there's no way to convince \input to work
> "properly" (that is: respecting some additional input path) in mkii?
> (In mkiv it seems to work, but it could be that that's just because it
> interacts with its own "kpathsea".)

The question is should \input kn MkIV behave like it did in MkII
or should it take subdirectories into account.

> But then I have another question. I actually wanted to use that inside
> a module (gnuplot) that uses something like
>
>    \processmyfile[#1][#2]{
>        ....
>        \readlocfile{#2}{}{}
>        ....
>    }
>
> I wish I remembered why I decided for \readlocfile (I guess it was for
> error handling that is still waiting to be implemented). How should I
> change the module in this particular case? (What should I use instead
> of \readlocfile, so that the file will be found?)

What behaviour do you want?

I would expect when I load a file it should found in the current  
directory
or the TeX tree but not in subdirectories, when you want to take  
subdirectory
searching I would use something like

\setupgnuplot[directory={,myplots/}]

\def\inputgnuplotfile#1%
   {\!!donefalse
    \def\doinputgnuplotfile##1%
      {\doiffileelse{##1#1}
         {\readlocalfile{##1#1}{}{}\!!donetrue\quitcommalist}
         {\!!donefalse}}
    \processcommacommand[\gnuplotparameter{directory}] 
\doinputgnuplotfile
    \!!ifdone\message{gnuplot}{...}\else\message{gnuplot}{file #1 not  
found}\fi}

Wolfgang

___________________________________________________________________________________
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] 6+ messages in thread

* Re: How to add directory to input path?
  2009-07-21 13:31     ` Wolfgang Schuster
@ 2009-07-21 14:51       ` Mojca Miklavec
  2009-07-21 21:19         ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Mojca Miklavec @ 2009-07-21 14:51 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, Jul 21, 2009 at 15:31, Wolfgang Schuster wrote:
>
> Am 21.07.2009 um 14:28 schrieb Mojca Miklavec:
>
>> Thanks. So basically there's no way to convince \input to work
>> "properly" (that is: respecting some additional input path) in mkii?
>> (In mkiv it seems to work, but it could be that that's just because it
>> interacts with its own "kpathsea".)
>
> The question is should \input kn MkIV behave like it did in MkII
> or should it take subdirectories into account.

I see no serious reason speaking against that.

>> But then I have another question. I actually wanted to use that inside
>> a module (gnuplot) that uses something like
>>
>>   \processmyfile[#1][#2]{
>>       ....
>>       \readlocfile{#2}{}{}
>>       ....
>>   }
>>
>> I wish I remembered why I decided for \readlocfile (I guess it was for
>> error handling that is still waiting to be implemented). How should I
>> change the module in this particular case? (What should I use instead
>> of \readlocfile, so that the file will be found?)
>
> What behaviour do you want?
>
> I would expect when I load a file it should found in the current directory
> or the TeX tree but not in subdirectories, when you want to take
> subdirectory
> searching I would use something like
>
> \setupgnuplot[directory={,myplots/}]

Hmmm ... that's not a bad idea either.

> \def\inputgnuplotfile#1%
>  {\!!donefalse
>   \def\doinputgnuplotfile##1%
>     {\doiffileelse{##1#1}
>        {\readlocalfile{##1#1}{}{}\!!donetrue\quitcommalist}
>        {\!!donefalse}}
>   \processcommacommand[\gnuplotparameter{directory}]\doinputgnuplotfile
>   \!!ifdone\message{gnuplot}{...}\else\message{gnuplot}{file #1 not
> found}\fi}

Thank you very much. I'll build this into the module. I can actually still use
    \processcommacommand[,\gnuplotparameter{directory},\allinputpaths]
with your code :) :) :)

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] 6+ messages in thread

* Re: How to add directory to input path?
  2009-07-21 14:51       ` Mojca Miklavec
@ 2009-07-21 21:19         ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2009-07-21 21:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Mojca Miklavec wrote:
> On Tue, Jul 21, 2009 at 15:31, Wolfgang Schuster wrote:
>> Am 21.07.2009 um 14:28 schrieb Mojca Miklavec:
>>
>>> Thanks. So basically there's no way to convince \input to work
>>> "properly" (that is: respecting some additional input path) in mkii?
>>> (In mkiv it seems to work, but it could be that that's just because it
>>> interacts with its own "kpathsea".)
>> The question is should \input kn MkIV behave like it did in MkII
>> or should it take subdirectories into account.
> 
> I see no serious reason speaking against that.

there is:

\input tree://whaterver/**/somefile.tex


-----------------------------------------------------------------
                                           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] 6+ messages in thread

end of thread, other threads:[~2009-07-21 21:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-21  8:37 How to add directory to input path? Mojca Miklavec
2009-07-21 11:22 ` Wolfgang Schuster
2009-07-21 12:28   ` Mojca Miklavec
2009-07-21 13:31     ` Wolfgang Schuster
2009-07-21 14:51       ` Mojca Miklavec
2009-07-21 21:19         ` 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).