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/
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
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
Reply-To: mailing list for ConTeXt users To: mailing list for ConTeXt users 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
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
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/
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
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
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
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 -----------------------------------------------------------------
participants (5)
-
Boris Pedrofiets
-
Christopher Creutzig
-
Hans Hagen
-
Peter Rolf
-
Taco Hoekwater