ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Sanjoy Mahajan <sanjoy@MIT.EDU>
To: ntg-context@ntg.nl
Subject: using environments with project structure (in MkIV)
Date: Fri, 28 Feb 2014 10:03:15 -0500	[thread overview]
Message-ID: <8761nzwa8c.fsf@approx.mit.edu> (raw)

I'm having trouble using project structure and font loading together in
MkIV.  Here's how the problem arises.

As Aditya and Wolfgang have pointed out, the recommended way to set up
fonts in MkIV is before \starttext or \startcomponent.  For a component,
the setups usually go in an environment file that is referenced by the
project file, and the project file is mentioned with a \project, e.g.

\startcomponent test
\project testproject
\input knuth
\stopcomponent

However, the \project line has to come *after* \startcomponent.  If it
comes before \startcomponent, then context doesn't process the component
file at all, and no PDF file is generated.  An example:

\project testproject
\startcomponent test
\input knuth
\stopcomponent

(with testproject.tex containing \startproject blah \stopproject)

A workaround is to replace the \project line with \environment env where
env is what testproject would have included anyway.  e.g.

\environment env
\startcomponent test
\input knuth
\stopcomponent

Here, env.tex has all the setups including the font setups (and one
would do the same in the product file, i.e. in the file that includes
the components, by putting "\environment env" before the \startproduct).

The first problem is that it seems some of the functionality of
products, projects, and components is lost.  But maybe that's a matter
of taste.

Another problem is that env.tex doesn't know that one is compiling a
product or component---thus, the system modes *product and *component
are not defined while reading env.tex.

Is there another way of doing project structure that I am missing?

My update to the wiki page on project structure (on putting \project
before \startcomponent) seems to be wrong, and I'll fix it once I
understand what to do!

-Sanjoy
___________________________________________________________________________________
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
___________________________________________________________________________________


                 reply	other threads:[~2014-02-28 15:03 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761nzwa8c.fsf@approx.mit.edu \
    --to=sanjoy@mit.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).