Jethro Djan via ntg-context schrieb am 16.12.2022 um 17:14:
Dear list,

I am using the project structure to typeset my thesis. This is how the directory looks like:

chapters/chapter1.tex
chapters/chapter2.tex

output/
env_thesis.tex
prd_main.tex
ref.bib

I didn’t use the project.

1. How do I specify output directory?

context --runpath=output ...

I have already seen the following thread:

https://www.mail-archive.com/ntg-context@ntg.nl/msg101654.html

It doesn’t seem to work on a project. So for example when I run mtxrun —path=output --script context ../prd_main, I get this error: 

tex error on line 5 in file /usr/local/texlive/2022/texmf-dist/doc/latex/buctthesis/chapter1.tex: ! Undefined control sequence

How do you load the chapter file in your product file?

The error message above appears because ConTeXt can't find the chapter file of your document and uses one with the same name from a documentation of a LaTeX class which has the same name.

2. How do I get CoTeXt to recognise the ref.bib file when I run the components not the product?

For context, I don’t want the references printed at the end of each chapter but I would like the in-text citation to work (if that is possible). If not, is it possible compile the whole product but only output a certain page range?

You need a reference to the environment file from within the component file, otherwise ConTeXt has no knowledge of the bib file.

Wolfgang