ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Nested structure of files loaded by input
@ 2021-03-30  7:43 denis.maier
  2021-03-30  8:06 ` denis.maier
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: denis.maier @ 2021-03-30  7:43 UTC (permalink / raw)
  To: ntg-context


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

Hi,
I have file main.tex that loads various subfiles that are placed in a subdir :

\starttext
\input subdir/chapter1
\stoptext

Chapter1.tex itself loads some other files that are also placed in the subdir directory :
\starttext
\input subfile1
\stoptext

Subfile1 :
\starttext
Asdf
\stopttext

Now, when in the subdir `context chapter1` and `context subfile1` both work. But in the main directory this here fails : context main
-> < input file 'subfile1' is not found, quitting'

What am I missing ? Does \input resolve filenames according to the CWD, not to the location itself is located ?
How can I make that work?

Best,
Denis

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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Nested structure of files loaded by input
  2021-03-30  7:43 Nested structure of files loaded by input denis.maier
@ 2021-03-30  8:06 ` denis.maier
  2021-03-30  8:13 ` Henning Hraban Ramm
  2021-03-30  9:54 ` Wolfgang Schuster
  2 siblings, 0 replies; 6+ messages in thread
From: denis.maier @ 2021-03-30  8:06 UTC (permalink / raw)
  To: ntg-context


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

Ok,  I can make it work with \doiffileexistselse

But is there a more elegant way ?


Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von denis.maier@ub.unibe.ch
Gesendet: Dienstag, 30. März 2021 09:44
An: ntg-context@ntg.nl
Betreff: [NTG-context] Nested structure of files loaded by input

Hi,
I have file main.tex that loads various subfiles that are placed in a subdir :

\starttext
\input subdir/chapter1
\stoptext

Chapter1.tex itself loads some other files that are also placed in the subdir directory :
\starttext
\input subfile1
\stoptext

Subfile1 :
\starttext
Asdf
\stopttext

Now, when in the subdir `context chapter1` and `context subfile1` both work. But in the main directory this here fails : context main
-> « input file 'subfile1' is not found, quitting'

What am I missing ? Does \input resolve filenames according to the CWD, not to the location itself is located ?
How can I make that work?

Best,
Denis

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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Nested structure of files loaded by input
  2021-03-30  7:43 Nested structure of files loaded by input denis.maier
  2021-03-30  8:06 ` denis.maier
@ 2021-03-30  8:13 ` Henning Hraban Ramm
  2021-03-30  8:23   ` denis.maier
  2021-03-30  9:54 ` Wolfgang Schuster
  2 siblings, 1 reply; 6+ messages in thread
From: Henning Hraban Ramm @ 2021-03-30  8:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users



> Am 30.03.2021 um 09:43 schrieb denis.maier@ub.unibe.ch:
> What am I missing ? Does \input resolve filenames according to the CWD, not to the location itself is located ?

Nothing. You need to decide from where you want to run your files.

BTW I’d strongly suggest to use the project structure (environment, products, components) in such cases, but that doesn’t change this.


Hraban
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Nested structure of files loaded by input
  2021-03-30  8:13 ` Henning Hraban Ramm
@ 2021-03-30  8:23   ` denis.maier
  2021-03-30  8:46     ` Henning Hraban Ramm
  0 siblings, 1 reply; 6+ messages in thread
From: denis.maier @ 2021-03-30  8:23 UTC (permalink / raw)
  To: ntg-context

> -----Ursprüngliche Nachricht-----
> Von: ntg-context <ntg-context-bounces@ntg.nl> Im Auftrag von Henning
> Hraban Ramm
> Gesendet: Dienstag, 30. März 2021 10:14
> An: mailing list for ConTeXt users <ntg-context@ntg.nl>
> Betreff: Re: [NTG-context] Nested structure of files loaded by input
> 
> 
> 
> > Am 30.03.2021 um 09:43 schrieb denis.maier@ub.unibe.ch:
> > What am I missing ? Does \input resolve filenames according to the CWD,
> not to the location itself is located ?
> 
> Nothing. You need to decide from where you want to run your files.

Ok, thank you.

> 
> BTW I’d strongly suggest to use the project structure (environment,
> products, components) in such cases, but that doesn’t change this.

I use environments, but in that particular case there's no need for products and components. (OTOH, with components I probably wouldn't have noticed that things go off the rails here as \component doesn't complain about missing files...)

Denis

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Nested structure of files loaded by input
  2021-03-30  8:23   ` denis.maier
@ 2021-03-30  8:46     ` Henning Hraban Ramm
  0 siblings, 0 replies; 6+ messages in thread
From: Henning Hraban Ramm @ 2021-03-30  8:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 30.03.2021 um 10:23 schrieb <denis.maier@ub.unibe.ch> <denis.maier@ub.unibe.ch>:
>> BTW I’d strongly suggest to use the project structure (environment,
>> products, components) in such cases, but that doesn’t change this.
> 
> I use environments, but in that particular case there's no need for products and components. (OTOH, with components I probably wouldn't have noticed that things go off the rails here as \component doesn't complain about missing files...)

You’re right, that’s a common trap. Got me recently when I typeset a novel and missed one chapter (component) because the filename had a typo that I didn’t copy to the product...

Hraban
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Nested structure of files loaded by input
  2021-03-30  7:43 Nested structure of files loaded by input denis.maier
  2021-03-30  8:06 ` denis.maier
  2021-03-30  8:13 ` Henning Hraban Ramm
@ 2021-03-30  9:54 ` Wolfgang Schuster
  2 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2021-03-30  9:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

<denis.maier@ub.unibe.ch> schrieb am Di., 30. März 2021, 09:45:

> Hi,
>
> I have file main.tex that loads various subfiles that are placed in a
> subdir :
>
>
>
> \starttext
>
> \input subdir/chapter1
>
> \stoptext
>
>
>
> Chapter1.tex itself loads some other files that are also placed in the
> subdir directory :
>
> \starttext
>
> \input subfile1
>
> \stoptext
>
>
>
> Subfile1 :
>
> \starttext
>
> Asdf
>
> \stopttext
>
>
>
> Now, when in the subdir `context chapter1` and `context subfile1` both
> work. But in the main directory this here fails : context main
>
> -> « input file ‘subfile1’ is not found, quitting’
>
>
>
> What am I missing ? Does \input resolve filenames according to the CWD,
> not to the location itself is located ?
>
> How can I make that work?
>

\usepath[subdir]

Wolfgang

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

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2021-03-30  9:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30  7:43 Nested structure of files loaded by input denis.maier
2021-03-30  8:06 ` denis.maier
2021-03-30  8:13 ` Henning Hraban Ramm
2021-03-30  8:23   ` denis.maier
2021-03-30  8:46     ` Henning Hraban Ramm
2021-03-30  9:54 ` Wolfgang Schuster

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