ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* context minimals "path and directory structure" question
@ 2008-10-20  8:13 Jan-Erik Hägglöf
  2008-10-20  9:16 ` luigi scarso
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jan-Erik Hägglöf @ 2008-10-20  8:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello!

I'm using  context-minimal version: 2008.10.01 19:13 and have a
generally question.

I'm writing several documents with similar structure and design and have
collected all common settings in "settings.tex" like following:

\startenvironment settings
...
...
...
\stopenvironment

and just do the usual invoking by

in 

anything.tex

\environment settings

\starttext
...
...
...
\stoptext

I've installed the "minimals" structure in /home/$USER/context/... on my
ubuntu 8.04 machine.

Now to the question:

Where in this "structure" do I place "settings.tex" so it can be found
by context from anywhere in my document-structure?

I suppose I should do something like "context --make" after placing the
file. If I do the usual upgrade what happens then?

Is there a more efficient way doing similar tasks, like writing a
module? 

All best!

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

* Re: context minimals "path and directory structure" question
  2008-10-20  8:13 context minimals "path and directory structure" question Jan-Erik Hägglöf
@ 2008-10-20  9:16 ` luigi scarso
  2008-10-20 11:16 ` Mojca Miklavec
  2008-10-20 13:18 ` Aditya Mahajan
  2 siblings, 0 replies; 4+ messages in thread
From: luigi scarso @ 2008-10-20  9:16 UTC (permalink / raw)
  To: janerik.hagglof, mailing list for ConTeXt users


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

On Mon, Oct 20, 2008 at 10:13 AM, Jan-Erik Hägglöf <
janerik.hagglof@bredband.net> wrote:

> Hello!
>
> I'm using  context-minimal version: 2008.10.01 19:13

ok, I suppose that you are using first-setup.sh
and
. setuptext

> and have a
> generally question.
>
> I'm writing several documents with similar structure and design and have
> collected all common settings in "settings.tex" like following:
>
> \startenvironment settings
> ...
> ...
> ...
> \stopenvironment
>
> and just do the usual invoking by
>
> in
>
> anything.tex
>
> \environment settings
>
> \starttext
> ...
> ...
> ...
> \stoptext
>
> I've installed the "minimals" structure in /home/$USER/context/... on my
> ubuntu 8.04 machine.
>
> Now to the question:
>
> Where in this "structure" do I place "settings.tex" so it can be found
> by context from anywhere in my document-structure?
>
 tex/texmf-local/tex/context/user
can be a good place


> I suppose I should do something like "context --make" after placing the
> file. If I do the usual upgrade what happens then?
>
first-setup.sh  should not delete your files.

context --generate
context --make
are "safe "
(well, one can always write a malicius tex file that overwrite
tex/texmf-local/tex/context/user/settings.tex ...)

-- 
luigi

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

[-- Attachment #2: Type: text/plain, Size: 487 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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: context minimals "path and directory structure" question
  2008-10-20  8:13 context minimals "path and directory structure" question Jan-Erik Hägglöf
  2008-10-20  9:16 ` luigi scarso
@ 2008-10-20 11:16 ` Mojca Miklavec
  2008-10-20 13:18 ` Aditya Mahajan
  2 siblings, 0 replies; 4+ messages in thread
From: Mojca Miklavec @ 2008-10-20 11:16 UTC (permalink / raw)
  To: janerik.hagglof, mailing list for ConTeXt users

On Mon, Oct 20, 2008 at 10:13 AM, Jan-Erik Hägglöf wrote:
> Hello!
>
> I'm using  context-minimal version: 2008.10.01 19:13 and have a
> generally question.
>
> I'm writing several documents with similar structure and design and have
> collected all common settings in "settings.tex" like following:
>
> \startenvironment settings
> ...
> ...
> ...
> \stopenvironment
>
> and just do the usual invoking by
>
> in
>
> anything.tex
>
> \environment settings
>
> \starttext
> ...
> ...
> ...
> \stoptext
>
> I've installed the "minimals" structure in /home/$USER/context/... on my
> ubuntu 8.04 machine.
>
> Now to the question:
>
> Where in this "structure" do I place "settings.tex" so it can be found
> by context from anywhere in my document-structure?

Like Luigi said, texmf-local/tex/context/whatever might be the best
place in the tree.

> I suppose I should do something like "context --make" after placing the
> file.

mktexlsr for kpathsea and luatools --generate for mkiv.
Though some folders are searched even without putting them to database.

> If I do the usual upgrade what happens then?

The script doesn't touch texmf-local.

> Is there a more efficient way doing similar tasks, like writing a
> module?

You can also have "settings.tex" on top of all the folders that use
it. Plain file and module do not make much difference in such cases.

(For safety reasons, I prefer to have a copy of such files locally (in
folder where I process files). I never know when I switch computer and
forget to copy some files from some "global" folders.)

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

* Re: context minimals "path and directory structure" question
  2008-10-20  8:13 context minimals "path and directory structure" question Jan-Erik Hägglöf
  2008-10-20  9:16 ` luigi scarso
  2008-10-20 11:16 ` Mojca Miklavec
@ 2008-10-20 13:18 ` Aditya Mahajan
  2 siblings, 0 replies; 4+ messages in thread
From: Aditya Mahajan @ 2008-10-20 13:18 UTC (permalink / raw)
  To: janerik.hagglof, mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1745 bytes --]

On Mon, 20 Oct 2008, Jan-Erik Hägglöf wrote:

> Where in this "structure" do I place "settings.tex" so it can be found
> by context from anywhere in my document-structure?

For files which are specific to one or two projects, I usually place them 
in the directory:

main-dir/
  |
  +---- settings.tex
  |
  +---- project-1/
  |        |
  |        +--- component-1-1.tex
  |
  +---- project-2/

and then in component-1-1.tex, put

\environment settings

There is no need to tell the relative path to context. When context cannot 
find a file in the current dir, it looks up two (or three?) levels to find 
the file.

As Mojca said, this has the added advantage of making the structure 
self-sufficient. You can just copy the main-dir on a different computer 
and everything works.

For files that are used in many different projects, I usually make it a 
module (if you are not using any advanced features, like localenvironments 
or setupmodules, modules and environments are the same)

I have created a directory texmf-local/tex/context/aditya where I put all 
my files (and sync them to a svn server so that I can use them on 
different computers).

> I suppose I should do something like "context --make" after placing the
> file. If I do the usual upgrade what happens then?

You make need to run luatools --generate (or texhash if using mkii) if 
place the files in texmf-local. To prevent any accidents with upgrades, 
create a directory in texmf-local/tex/context that is unique. You can also 
create the directory in $TEXMFHOME/tex/context (which is usually 
$HOME/tex/context in *nix systems, I do not know about win/mac). Normally 
upgrades do not touch anything in $TEXMFHOME.

Aditya

[-- Attachment #2: Type: text/plain, Size: 487 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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2008-10-20 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-20  8:13 context minimals "path and directory structure" question Jan-Erik Hägglöf
2008-10-20  9:16 ` luigi scarso
2008-10-20 11:16 ` Mojca Miklavec
2008-10-20 13:18 ` Aditya Mahajan

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