ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* using 1 layout on several documents
@ 2005-09-30 10:50 Boris Pedrofiets
  2005-09-30 11:46 ` Peter Rolf
  0 siblings, 1 reply; 9+ messages in thread
From: Boris Pedrofiets @ 2005-09-30 10:50 UTC (permalink / raw)


Hi,

I made a layout that I want to use for several documents. What is the best 
way to handle this, without placing a copy of the layout description in 
every file?

Thanks for helping!

Boris

_________________________________________________________________
Vind alles terug op je PC: MSN Search Toolbar http://toolbar.msn.nl/

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

* Re: using 1 layout on several documents
  2005-09-30 10:50 using 1 layout on several documents Boris Pedrofiets
@ 2005-09-30 11:46 ` Peter Rolf
  2005-09-30 13:08   ` Boris Pedrofiets
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Rolf @ 2005-09-30 11:46 UTC (permalink / raw)


Hi Boris,

Boris Pedrofiets wrote:
> Hi,
> 
> I made a layout that I want to use for several documents. What is the
> best way to handle this, without placing a copy of the layout
> description in every file?
>
Simply use an environment (file).

Something like...

[content of file 'env-mylayout.tex']
--------
\startenvironment env-mylayout

....your layout settings....

\stopenvironment
--------


Then put the file somewhere in the tex-path
(??/texmf/texmf-local/tex/context/user/ is a good place) and call
texhash/mktexlsr(!), so that context can find it;

Now you can use your layout settings by just typing

\environment env-mylayout

at the beginning of your document (before \starttext).

If the environment is not already defined, then context tries to load a
file with the same name as the environment name (environment foo -->
foo.tex). I just use the prefix 'env-' to seperate the env. files from
the rest in this folder (typescripts, modules, ...).

Hope that helps,

Peter

> Thanks for helping!
> 
> Boris
> 
> _________________________________________________________________
> Vind alles terug op je PC: MSN Search Toolbar http://toolbar.msn.nl/
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

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

* Re: using 1 layout on several documents
  2005-09-30 11:46 ` Peter Rolf
@ 2005-09-30 13:08   ` Boris Pedrofiets
  2005-09-30 14:57     ` Peter Rolf
  0 siblings, 1 reply; 9+ messages in thread
From: Boris Pedrofiets @ 2005-09-30 13:08 UTC (permalink / raw)


Thank you Peter!

Just wondering...
Looking at the files s-mg-01.tex and mag-0000.tex from the context 
distribution, there is a different approach. Here I find \usemodule.

What are the differences? And, when use with? Or is it just a metter of 
taste?

Boris.


>From: Peter Rolf <indiego@gmx.net>
>Reply-To: mailing list for ConTeXt users <ntg-context@ntg.nl>
>To: mailing list for ConTeXt users <ntg-context@ntg.nl>
>Subject: Re: [NTG-context] using 1 layout on several documents
>Date: Fri, 30 Sep 2005 13:46:45 +0200
>
>Hi Boris,
>
>Boris Pedrofiets wrote:
> > Hi,
> >
> > I made a layout that I want to use for several documents. What is the
> > best way to handle this, without placing a copy of the layout
> > description in every file?
> >
>Simply use an environment (file).
>
>Something like...
>
>[content of file 'env-mylayout.tex']
>--------
>\startenvironment env-mylayout
>
>....your layout settings....
>
>\stopenvironment
>--------
>
>
>Then put the file somewhere in the tex-path
>(??/texmf/texmf-local/tex/context/user/ is a good place) and call
>texhash/mktexlsr(!), so that context can find it;
>
>Now you can use your layout settings by just typing
>
>\environment env-mylayout
>
>at the beginning of your document (before \starttext).
>
>If the environment is not already defined, then context tries to load a
>file with the same name as the environment name (environment foo -->
>foo.tex). I just use the prefix 'env-' to seperate the env. files from
>the rest in this folder (typescripts, modules, ...).
>
>Hope that helps,
>
>Peter
>
> > Thanks for helping!
> >
> > Boris
> >
> > _________________________________________________________________
> > Vind alles terug op je PC: MSN Search Toolbar http://toolbar.msn.nl/
> >
> > _______________________________________________
> > ntg-context mailing list
> > ntg-context@ntg.nl
> > http://www.ntg.nl/mailman/listinfo/ntg-context
> >
> >
>
>_______________________________________________
>ntg-context mailing list
>ntg-context@ntg.nl
>http://www.ntg.nl/mailman/listinfo/ntg-context

_________________________________________________________________
Nieuw op MSN Messenger 7.5: Dynamische achtergronden 
http://www1.imagine-msn.com/Messenger/Audio.aspx

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

* Re: using 1 layout on several documents
  2005-09-30 13:08   ` Boris Pedrofiets
@ 2005-09-30 14:57     ` Peter Rolf
  2005-10-01 20:06       ` Modules how? Boris Pedrofiets
  2005-10-02 20:05       ` using 1 layout on several documents Hans Hagen
  0 siblings, 2 replies; 9+ messages in thread
From: Peter Rolf @ 2005-09-30 14:57 UTC (permalink / raw)


Boris Pedrofiets wrote:
> Thank you Peter!
> 
> Just wondering...
> Looking at the files s-mg-01.tex and mag-0000.tex from the context
> distribution, there is a different approach. Here I find \usemodule.
>
> What are the differences? And, when use with? Or is it just a metter of
> taste?
> 
AFAIK modules are used for adding functionality (whatever) and
environment is used for defining a specific layout (global or local).

In would say that s-mag-01.tex is a borderline case (or a matter of
taste?). And maybe I'm the wrong one to ask :)

> Boris.
> 
> 
Greetings,

Peter

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

* Modules how?
  2005-09-30 14:57     ` Peter Rolf
@ 2005-10-01 20:06       ` Boris Pedrofiets
  2005-10-02  8:09         ` Taco Hoekwater
  2005-10-02 20:05       ` using 1 layout on several documents Hans Hagen
  1 sibling, 1 reply; 9+ messages in thread
From: Boris Pedrofiets @ 2005-10-01 20:06 UTC (permalink / raw)


Looking at the files s-mag-01.tex and mag-0000.tex from the context 
distribution I created a file with layout and defs myself. My question: how 
can I use my-module?

Boris

_________________________________________________________________
Vind alles terug op je PC: MSN Search Toolbar http://toolbar.msn.nl/

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

* Re: Modules how?
  2005-10-01 20:06       ` Modules how? Boris Pedrofiets
@ 2005-10-02  8:09         ` Taco Hoekwater
  2005-10-02 16:58           ` Boris Pedrofiets
  0 siblings, 1 reply; 9+ messages in thread
From: Taco Hoekwater @ 2005-10-02  8:09 UTC (permalink / raw)


Boris Pedrofiets wrote:
> Looking at the files s-mag-01.tex and mag-0000.tex from the context 
> distribution I created a file with layout and defs myself. My question: 
> how can I use my-module?

Rename the file you made, so the name starts with "p-" and
ends with the extension ".tex", like:

   p-boris.tex

Now you can start your documents with

   \usemodule[boris]

Modules normally start with a single letter, followed by a dash.

Context first looks for m-boris (a core system module), then
p-boris (a user private module), then s-boris (a style module),
then x-boris (dunno?), then t-boris (a third-party module),
and finally (if nothing else works), in a new context
distribution it will try boris.tex.

Even if it works, using module names without a prefix is a bad
idea, because it is very likely to create clashes with other
input file names. Use "p-boris.tex" for your own files, and
"t-boris.tex" for files you want to share with other people.

Taco

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

* Re: Modules how?
  2005-10-02  8:09         ` Taco Hoekwater
@ 2005-10-02 16:58           ` Boris Pedrofiets
  2005-10-02 17:53             ` Christopher Creutzig
  0 siblings, 1 reply; 9+ messages in thread
From: Boris Pedrofiets @ 2005-10-02 16:58 UTC (permalink / raw)


Hi,

>From: Taco Hoekwater
>
>   p-boris.tex
>Now you can start your documents with
>   \usemodule[boris]
>

This works when I put the module file in the same directory as my textfile.
When the file is in the same dir as s-mag-01.tex, context can't find it. How 
can I achieve this? And where do I place the picture file (logo) needed in 
my module?

Tanks again!

Boris

_________________________________________________________________
Zie en hoor je vrienden met MSN Messenger 7.5 
http://www1.imagine-msn.com/Messenger/Video.aspx

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

* Re: Modules how?
  2005-10-02 16:58           ` Boris Pedrofiets
@ 2005-10-02 17:53             ` Christopher Creutzig
  0 siblings, 0 replies; 9+ messages in thread
From: Christopher Creutzig @ 2005-10-02 17:53 UTC (permalink / raw)


Boris Pedrofiets wrote:

> This works when I put the module file in the same directory as my textfile.
> When the file is in the same dir as s-mag-01.tex, context can't find it. How 

 Please run texhash or mktexlsr, whichever exists on your system.  You
need to do that every time you update your TeX installation.

 Oh, and please don't place your local stuff in that directory.  That's
just asking for trouble, since the directory may be overwritten by
updates and the like.  Better put it into your local texmf tree under
.../tex/context/user/.  On my system, I get the part to write instead of
the ... above by calling
kpsewhich --expand-var='$TEXMFLOCAL'

> can I achieve this? And where do I place the picture file (logo) needed in 
> my module?

 It should go to the same directory, I think.  But I never tried.


regards,
	Christopher

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

* Re: using 1 layout on several documents
  2005-09-30 14:57     ` Peter Rolf
  2005-10-01 20:06       ` Modules how? Boris Pedrofiets
@ 2005-10-02 20:05       ` Hans Hagen
  1 sibling, 0 replies; 9+ messages in thread
From: Hans Hagen @ 2005-10-02 20:05 UTC (permalink / raw)


Peter Rolf wrote:

>Boris Pedrofiets wrote:
>  
>
>>Thank you Peter!
>>
>>Just wondering...
>>Looking at the files s-mg-01.tex and mag-0000.tex from the context
>>distribution, there is a different approach. Here I find \usemodule.
>>
>>What are the differences? And, when use with? Or is it just a metter of
>>taste?
>>
>>    
>>
>AFAIK modules are used for adding functionality (whatever) and
>environment is used for defining a specific layout (global or local).
>
>In would say that s-mag-01.tex is a borderline case (or a matter of
>taste?). And maybe I'm the wrong one to ask :)
>  
>
indeed a border case ... the s- prefix is reserver for 'styles' that are 
shipped with the distribution (just to make it easier to distinguish them)

Hans 


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

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

end of thread, other threads:[~2005-10-02 20:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-30 10:50 using 1 layout on several documents Boris Pedrofiets
2005-09-30 11:46 ` Peter Rolf
2005-09-30 13:08   ` Boris Pedrofiets
2005-09-30 14:57     ` Peter Rolf
2005-10-01 20:06       ` Modules how? Boris Pedrofiets
2005-10-02  8:09         ` Taco Hoekwater
2005-10-02 16:58           ` Boris Pedrofiets
2005-10-02 17:53             ` Christopher Creutzig
2005-10-02 20:05       ` using 1 layout on several documents 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).