On Thu, 5 Nov 2009, Martin Scholz wrote:
> is there a way in conTeXt how I can use a filename, so that I can write a
> text where I can refer to it for using it in the following scenario:
>
> I need 4 documents with nearly the same content. what I like to do is to
> switch in the document depending on the called filename.
Hello Martin,
As already posted, modes are good for binary switches.
Often, I extract some values from the filename, that are used in the text,
here is a simple example:
\def\ResultName{\systemparameter{file}}
% only to show, that a special filename can trigger a mode:
\doif{\ResultName}{order}{\enablemode[ordermode]}{}
\starttext
This file is the \ResultName.
\startmode[ordermode]
special text for order
\stopmode
\stoptext
Then I call context with different resultnames:
"context --result=order filename" or
"context --result=invoice filename"
> as I got a file called invoice.tex and create some links to this file
> called delivery.tex order.tex and so on and now call
Symbolic links are a good idea, if you cannot submit options
like "--result=...".
Cheers, Peter
--
Contact information: http://pmrb.free.fr/contact/
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] / 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
___________________________________________________________________________________