Re: [NTG-context] Modes and conditional part of the source

2019-03-01 Thread Hans van der Meer
I used  \doifmode and friends for selection of mode dependent code.

dr. Hans van der Meer


> On 1 Mar 2019, at 01:24, Hans Hagen  wrote:
> 
> On 2/28/2019 11:29 AM, Procházka Lukáš Ing. wrote:
>> Hello,
>> I'm struggling with using modes to make a part of the text conditional.
>> Here is my code:
>> 
>> \def\b#1{\startmode[#1]}
>> \def\e{\stopmode}
>> % \enablemode[100] % For optional usage
>> \starttext
>>   A
>>   \b{100} % Should be start of some conditional text from here ...
>> B
>>   \e % ... to here
>> \stoptext
>> 
>> Compilation fails with:
>> "
>> tex error   > tex error on line 0 in file : ! Emergency stop
>> <*> cont-yes.mkiv
>> 
>> *** (job aborted, no legal \end found)
>> "
>> How to make the sample work?
> modes are like buffers ... don't wrap them in macros
> 
> (using names like \b \e is a bad idea anyway)
> 
> Hans
> 
> 
> -
>  Hans Hagen | PRAGMA ADE
>  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -
> ___
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Modes and conditional part of the source

2019-02-28 Thread Hans Hagen

On 2/28/2019 11:29 AM, Procházka Lukáš Ing. wrote:

Hello,

I'm struggling with using modes to make a part of the text conditional.

Here is my code:


\def\b#1{\startmode[#1]}
\def\e{\stopmode}

% \enablemode[100] % For optional usage

\starttext
   A
   \b{100} % Should be start of some conditional text from here ...
     B
   \e % ... to here
\stoptext


Compilation fails with:

"
tex error   > tex error on line 0 in file : ! Emergency stop
<*> cont-yes.mkiv

*** (job aborted, no legal \end found)
"

How to make the sample work?

modes are like buffers ... don't wrap them in macros

(using names like \b \e is a bad idea anyway)

Hans


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Modes and conditional part of the source

2019-02-28 Thread Procházka Lukáš Ing .

Hello Aditya,

thanks for the code, I'll try something like that.

Best regards,

Lukas


On Thu, 28 Feb 2019 12:54:06 +0100, Aditya Mahajan  wrote:


On Thu, 28 Feb 2019, Procházka Lukáš Ing. wrote:


Hello,

I'm struggling with using modes to make a part of the text conditional.

Here is my code:


\def\b#1{\startmode[#1]}
\def\e{\stopmode}

% \enablemode[100] % For optional usage

\starttext
A
\b{100} % Should be start of some conditional text from here ...
  B
\e % ... to here
\stoptext


Modes don't work that way. You can do something like this:

\define[1]\bbb
 {\doifnotmode{#1}
 {\grabbufferdata[dummy][bbb][eee]}}

\let\eee\relax

\enablemode[100]

\starttext
A

\bbb{100}
   Inside mode 100
\eee

\bbb{101}
   Inside mode 101
\eee

\stoptext


Depending on the actual use case, there might be simpler ways.

Aditya



--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS: 
nrpt3sn | IČO: 40763439
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Modes and conditional part of the source

2019-02-28 Thread Aditya Mahajan

On Thu, 28 Feb 2019, Procházka Lukáš Ing. wrote:


Hello,

I'm struggling with using modes to make a part of the text conditional.

Here is my code:


\def\b#1{\startmode[#1]}
\def\e{\stopmode}

% \enablemode[100] % For optional usage

\starttext
A
\b{100} % Should be start of some conditional text from here ...
  B
\e % ... to here
\stoptext


Modes don't work that way. You can do something like this:

\define[1]\bbb
{\doifnotmode{#1}
{\grabbufferdata[dummy][bbb][eee]}}

\let\eee\relax

\enablemode[100]

\starttext
A

\bbb{100}
  Inside mode 100
\eee

\bbb{101}
  Inside mode 101
\eee

\stoptext


Depending on the actual use case, there might be simpler ways.

Aditya___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Modes and conditional part of the source

2019-02-28 Thread Procházka Lukáš Ing .

Hello,

I'm struggling with using modes to make a part of the text conditional.

Here is my code:


\def\b#1{\startmode[#1]}
\def\e{\stopmode}

% \enablemode[100] % For optional usage

\starttext
  A
  \b{100} % Should be start of some conditional text from here ...
B
  \e % ... to here
\stoptext


Compilation fails with:

"
tex error   > tex error on line 0 in file : ! Emergency stop
<*> cont-yes.mkiv

*** (job aborted, no legal \end found)
"

How to make the sample work?

Best regards,

Lukas


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz | IDDS: 
nrpt3sn | IČO: 40763439
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

t.log
Description: Binary data


t.mkiv
Description: Binary data
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Modes in tables

2018-09-10 Thread Wolfgang Schuster

Just use a empty line before the table.

Wolfgang


Jan Willem Flamma schrieb am 10.09.18 um 11:49:

Thank you again Wolfgang.

Yet another question:

I like to get rid of the \par and tried integrating it into the tablesetups 
somehow. I've tried adding things like before={\blank} and before\par but 
couldn’t get it to work.


\starttext

\startsetups [tablesetups]
 
 \setupTABLE [start]  [frame=off,rulethickness=0pt,offset=0pt]

 \setupTABLE [column] [1] [width=6cm,align=flushleft]
 \setupTABLE [column] [2] [width=3cm,align=flushleft]
\stopsetups

Calculate the hydrostatic pressure of the following fluid.
\par% <-- can I get rid of this par?
\bTABLE [setups=tablesetups]
 \bTR
 \bTD Well depth \eTD
 \bTD 10100 ft   \eTD
 \bTD 3100 m \eTD
 \eTR
 \bTR
 \bTD Fluid density  \eTD
 \bTD 9.0 ppg\eTD
 \bTD 1.08 kg/l  \eTD
 \eTR
\eTABLE

\stoptext


On 7 Sep 2018, at 20:19, Wolfgang Schuster  
wrote:



Jan Willem Flamma schrieb am 07.09.18 um 20:01:

Thank you Wolfgang.

When comparing the results between tabulate and TABLE, I noticed some different 
results in formatting.

1. When using TABLE the table text is slightly shifted to the right. My initial 
guess was that this is due to the frame thickness but setting rulethickness= 
0pt did not solve this.
How can I get the text in the table to align with the regular text?

In a natural table each cell acts like \framed where you have a offset value on 
each side, to get rid of it set offset to 0pt.

\setupTABLE [start] [frame=off,rulethickness=0pt,offset=0pt]


2. In both cases column widths of 6cm and 3 cm have been set. Yet, the results 
show a difference in column width (not sure which one is correct)

Tabulate adds extra space between the columns but it can be disabled.

\starttabulate[|lw(6cm)j0|i0lw(3cm)|p|]


3. The vertical space between the regular text and the start of the table 
varies. It is larger when using tabulate.

Tabulate add by default a \blank before and after the table which can be 
disabled.

\starttabulate [...] [before=,after=]

or

\setuptabulate [before=,after=]


4. The vertical space between the lines in the table text also varies. It is 
larger when using TABLE.

Setting offset to 0pt reduces the vertical space in natural table but there 
will always be differences between different table types.


Wolfgang

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Modes in tables

2018-09-10 Thread Jan Willem Flamma
Thank you again Wolfgang.

Yet another question: 

I like to get rid of the \par and tried integrating it into the tablesetups 
somehow. I've tried adding things like before={\blank} and before\par but 
couldn’t get it to work.


\starttext

\startsetups [tablesetups]

\setupTABLE [start]  [frame=off,rulethickness=0pt,offset=0pt]
\setupTABLE [column] [1] [width=6cm,align=flushleft]
\setupTABLE [column] [2] [width=3cm,align=flushleft]
\stopsetups

Calculate the hydrostatic pressure of the following fluid.
\par% <-- can I get rid of this par?
\bTABLE [setups=tablesetups]
\bTR
\bTD Well depth \eTD
\bTD 10100 ft   \eTD
\bTD 3100 m \eTD
\eTR
\bTR
\bTD Fluid density  \eTD
\bTD 9.0 ppg\eTD
\bTD 1.08 kg/l  \eTD
\eTR
\eTABLE

\stoptext

> On 7 Sep 2018, at 20:19, Wolfgang Schuster 
>  wrote:
> 
> 
> 
> Jan Willem Flamma schrieb am 07.09.18 um 20:01:
>> Thank you Wolfgang.
>> 
>> When comparing the results between tabulate and TABLE, I noticed some 
>> different results in formatting.
>> 
>> 1. When using TABLE the table text is slightly shifted to the right. My 
>> initial guess was that this is due to the frame thickness but setting 
>> rulethickness= 0pt did not solve this.
>> How can I get the text in the table to align with the regular text?
> 
> In a natural table each cell acts like \framed where you have a offset value 
> on each side, to get rid of it set offset to 0pt.
> 
> \setupTABLE [start] [frame=off,rulethickness=0pt,offset=0pt]
> 
>> 2. In both cases column widths of 6cm and 3 cm have been set. Yet, the 
>> results show a difference in column width (not sure which one is correct)
> 
> Tabulate adds extra space between the columns but it can be disabled.
> 
> \starttabulate[|lw(6cm)j0|i0lw(3cm)|p|]
> 
>> 3. The vertical space between the regular text and the start of the table 
>> varies. It is larger when using tabulate.
> 
> Tabulate add by default a \blank before and after the table which can be 
> disabled.
> 
> \starttabulate [...] [before=,after=]
> 
> or
> 
> \setuptabulate [before=,after=]
> 
>> 4. The vertical space between the lines in the table text also varies. It is 
>> larger when using TABLE.
> 
> Setting offset to 0pt reduces the vertical space in natural table but there 
> will always be differences between different table types.
> 
> 
> Wolfgang

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Modes in tables

2018-09-07 Thread Wolfgang Schuster



Jan Willem Flamma schrieb am 07.09.18 um 20:01:

Thank you Wolfgang.

When comparing the results between tabulate and TABLE, I noticed some different 
results in formatting.

1. When using TABLE the table text is slightly shifted to the right. My initial 
guess was that this is due to the frame thickness but setting rulethickness= 
0pt did not solve this.
How can I get the text in the table to align with the regular text?


In a natural table each cell acts like \framed where you have a offset 
value on each side, to get rid of it set offset to 0pt.


\setupTABLE [start] [frame=off,rulethickness=0pt,offset=0pt]


2. In both cases column widths of 6cm and 3 cm have been set. Yet, the results 
show a difference in column width (not sure which one is correct)


Tabulate adds extra space between the columns but it can be disabled.

\starttabulate[|lw(6cm)j0|i0lw(3cm)|p|]


3. The vertical space between the regular text and the start of the table 
varies. It is larger when using tabulate.


Tabulate add by default a \blank before and after the table which can be 
disabled.


\starttabulate [...] [before=,after=]

or

\setuptabulate [before=,after=]


4. The vertical space between the lines in the table text also varies. It is 
larger when using TABLE.


Setting offset to 0pt reduces the vertical space in natural table but 
there will always be differences between different table types.



Wolfgang
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Modes in tables

2018-09-07 Thread Jan Willem Flamma
Thank you Wolfgang.

When comparing the results between tabulate and TABLE, I noticed some different 
results in formatting.

1. When using TABLE the table text is slightly shifted to the right. My initial 
guess was that this is due to the frame thickness but setting rulethickness= 
0pt did not solve this. 
How can I get the text in the table to align with the regular text?

2. In both cases column widths of 6cm and 3 cm have been set. Yet, the results 
show a difference in column width (not sure which one is correct)

3. The vertical space between the regular text and the start of the table 
varies. It is larger when using tabulate.

4. The vertical space between the lines in the table text also varies. It is 
larger when using TABLE.

(I left out the modes in MWE below because I don’t think it is relevant here.)

\starttext

\setupwhitespace[big]

\startsetups [tablesetups]
\setupTABLE [start]  [frame=off, rulethickness=0pt]
\setupTABLE [column] [1] [width=6cm,align=flushleft]
\setupTABLE [column] [2] [width=3cm,align=flushleft]
\stopsetups

Calculate the hydrostatic pressure of the following fluid.
\par
\bTABLE [setups=tablesetups]
\bTR
\bTD Well depth \eTD
\bTD 10100 ft   \eTD
\bTD 3100 m \eTD
\eTR
\bTR
\bTD Fluid density  \eTD
\bTD 9.0 ppg\eTD
\bTD 1.08 kg/l  \eTD
\eTR
\eTABLE

Calculate the hydrostatic pressure of the following fluid.
\starttabulate[|lw(6cm)|lw(3cm)|p|]
\NC Well depth  \NC 10100 ft\NC 3100 m  \NC \NR
\NC Fluid density   \NC 9.0 ppg \NC 1.08 kg/l   \NC \NR
\stoptabulate

\stoptext



> On 6 Sep 2018, at 18:53, Wolfgang Schuster 
>  wrote:
> 
> You can’t do this with tabulate but it’s possible with natural tables.
> 
> %\enablemode [BL]
> 
> \starttext
> 
> \startsetups [tablesetups]
> \setupTABLE [start]  [frame=off]
> \setupTABLE [column] [1] [width=6cm,align=flushleft]
> \setupTABLE [column] [2] [width=2cm,align=flushleft]
> \stopsetups
> 
> \bTABLE [setups=tablesetups]
> \bTR
> \bTD Well depth \eTD
> \bTD 10100 ft \eTD
> \startmode [BL] \bTD \unit{3100 meter} \eTD \stopmode
> \eTR
> \bTR
> \bTD Fluid density \eTD
> \bTD 9.0 ppg \eTD
> \startmode [BL] \bTD \unit{1.08 kilogram per liter} \eTD \stopmode
> \eTR
> \eTABLE
> 
> \stoptext
> 
> Wolfgang
> 
> 
> Jan Willem Flamma schrieb am 06.09.18 um 11:44:
>> Dear list members
>> 
>> I would like to disable to third column in the question when mode BL is not 
>> enabled.
>> 
>> When mode BL is enabled (using the toggle), the third column should of 
>> course appear again.
>> 
>> How can I achieve this?
>> 
>> Regards,
>> Jan Willem
>> 
>> 
>> MWE:
>> 
>> \starttext
>> 
>> %Toggles
>> %\enablemode[BL]
>> 
>> \defineblock[question]
>> \defineblock[answer]
>> 
>> \hideblocks[question]
>> \hideblocks[answer]
>>  
>> \defineenumeration
>> [question]
>> [text=Question,
>>  after={\blank[2*big]},
>>  inbetween={\blank[nowhite]},
>>  way=bychapter,
>>  prefixsegments=chapter,
>>  prefix=yes]
>> 
>>  \defineenumeration
>> [answer]
>> [counter=answer,
>>  text=,
>>  width=,
>>  before={\blank[nowhite]},
>>  after={\blank[nowhite]},
>>  indenting=no,
>>  titledistance=1cm,
>>  location=inmargin,
>>  alternative=left,
>>  headstyle=,
>>  way=bychapter,
>>  prefixsegments=chapter,
>>  prefix=yes]
>>\beginquestion
>> \startquestion
>> Calculate the hydrostatic pressure of the following fluid.
>> \starttabulate[|lw(6cm)|lw(3cm)|\doifmode{BL}{p|}]
>> \NC Well depth   \NC 10100 ft\doifmode{BL}{\NC 3100 m}   
>>  \NC \NR
>> \NC Fluid density\NC 9.0 ppg \doifmode{BL}{\NC 1.08 
>> kg/l}\NC \NR
>> \stoptabulate
>> \stopquestion
>> \endquestion
>> \beginanswer
>> \startanswer
>> 4726 psi\doifmode{BL}{ / 328 bar}
>> \stopanswer
>> \endanswer
>> 
>> 
>> \startsection[title=Questions]
>> \useblocks[question]
>> \startsubsubsection[title=Answers]
>> \useblocks[answer]
>> \stopsubsubsection
>> \stopsection
>> 
>> \stoptext
>> ___
>> 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://context.aanhet.net
>> archive  : https://bitbucket.org/phg/context-mirror/commits/
>> wiki : http://contextgarden.net
>> ___
> 

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 

Re: [NTG-context] Modes in tables

2018-09-06 Thread Wolfgang Schuster

You can’t do this with tabulate but it’s possible with natural tables.

%\enablemode [BL]

\starttext

\startsetups [tablesetups]
    \setupTABLE [start]  [frame=off]
    \setupTABLE [column] [1] [width=6cm,align=flushleft]
    \setupTABLE [column] [2] [width=2cm,align=flushleft]
\stopsetups

\bTABLE [setups=tablesetups]
    \bTR
        \bTD Well depth \eTD
        \bTD 10100 ft \eTD
        \startmode [BL] \bTD \unit{3100 meter} \eTD \stopmode
    \eTR
    \bTR
        \bTD Fluid density \eTD
        \bTD 9.0 ppg \eTD
        \startmode [BL] \bTD \unit{1.08 kilogram per liter} \eTD \stopmode
    \eTR
\eTABLE

\stoptext

Wolfgang


Jan Willem Flamma schrieb am 06.09.18 um 11:44:

Dear list members

I would like to disable to third column in the question when mode BL is not 
enabled.

When mode BL is enabled (using the toggle), the third column should of course 
appear again.

How can I achieve this?

Regards,
Jan Willem


MWE:

\starttext

%Toggles
%\enablemode[BL]

\defineblock[question]
\defineblock[answer]

\hideblocks[question]
\hideblocks[answer]
  


\defineenumeration
 [question]
 [text=Question,
  after={\blank[2*big]},
  inbetween={\blank[nowhite]},
  way=bychapter,
  prefixsegments=chapter,
  prefix=yes]

  
\defineenumeration

 [answer]
 [counter=answer,
  text=,
  width=,
  before={\blank[nowhite]},
  after={\blank[nowhite]},
  indenting=no,
  titledistance=1cm,
  location=inmargin,
  alternative=left,
  headstyle=,
  way=bychapter,
  prefixsegments=chapter,
  prefix=yes]
  
  
\beginquestion

\startquestion
Calculate the hydrostatic pressure of the following fluid.
\starttabulate[|lw(6cm)|lw(3cm)|\doifmode{BL}{p|}]
\NC Well depth   \NC 10100 ft\doifmode{BL}{\NC 3100 m}  
 \NC \NR
\NC Fluid density\NC 9.0 ppg \doifmode{BL}{\NC 1.08 kg/l}   
\NC \NR
\stoptabulate
\stopquestion
\endquestion
\beginanswer
\startanswer
4726 psi\doifmode{BL}{ / 328 bar}
\stopanswer
\endanswer


\startsection[title=Questions]
 \useblocks[question]
 \startsubsubsection[title=Answers]
 \useblocks[answer]
 \stopsubsubsection
\stopsection

\stoptext
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Modes in tables

2018-09-06 Thread Jan Willem Flamma
Dear list members

I would like to disable to third column in the question when mode BL is not 
enabled.

When mode BL is enabled (using the toggle), the third column should of course 
appear again.

How can I achieve this?

Regards,
Jan Willem


MWE: 

\starttext

%Toggles
%\enablemode[BL]

\defineblock[question]
\defineblock[answer]

\hideblocks[question] 
\hideblocks[answer] 
 

\defineenumeration
[question]
[text=Question,
 after={\blank[2*big]},
 inbetween={\blank[nowhite]},
 way=bychapter,
 prefixsegments=chapter,
 prefix=yes]

 
\defineenumeration
[answer]
[counter=answer,
 text=,
 width=,
 before={\blank[nowhite]},
 after={\blank[nowhite]},
 indenting=no,
 titledistance=1cm,
 location=inmargin,
 alternative=left,
 headstyle=,
 way=bychapter,
 prefixsegments=chapter,
 prefix=yes]
 
 
\beginquestion
\startquestion
Calculate the hydrostatic pressure of the following fluid. 
\starttabulate[|lw(6cm)|lw(3cm)|\doifmode{BL}{p|}]
\NC Well depth   \NC 10100 ft\doifmode{BL}{\NC 3100 m}  
 \NC \NR
\NC Fluid density\NC 9.0 ppg \doifmode{BL}{\NC 1.08 kg/l}   
\NC \NR
\stoptabulate
\stopquestion
\endquestion
\beginanswer
\startanswer
4726 psi\doifmode{BL}{ / 328 bar}
\stopanswer
\endanswer


\startsection[title=Questions]
\useblocks[question]
\startsubsubsection[title=Answers]
\useblocks[answer]
\stopsubsubsection
\stopsection

\stoptext
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Modes in Lua

2017-06-01 Thread Henning Hraban Ramm
Thank you all!

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

Am 2017-05-31 um 18:57 schrieb Hans Hagen :

> On 5/31/2017 4:51 PM, Pablo Rodriguez wrote:
>> This is the way to detect system modes, but I don’t know how to do it
>> for \mainlanguage (**en).
>> \mainlanguage[es]
>> \starttext
>> \en\startlua
>> if tex.systemmodes['en'] then
>> context('Language is English.')
>> else
>> context('Language is not English.')
>> end
>> context('\\par')
>> if tex.modes['es'] then
>> context('Main language is Spanish.')
>> else
>> context('Main language is not Spanish.')
>> end
>> \stoplua
>> \stoptext
>> Just in case it help,
> tex.modes['*en']
> tex.modes['**en']
> 
> tex.systemmodes['en']
> tex.systemmodes['*en']
> 

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Modes in Lua

2017-05-31 Thread Hans Hagen

On 5/31/2017 4:51 PM, Pablo Rodriguez wrote:

On 05/31/2017 11:03 AM, MF wrote:

if tex.modes['specialmode'] then
 context('I’m special.')
end
  
Best greetings,

Massi


Hi, this should be easy:

How can I access ConTeXt’s modes in Lua? Is it any different with
language modes (*en)?


This is the way to detect system modes, but I don’t know how to do it
for \mainlanguage (**en).

 \mainlanguage[es]
 \starttext
 \en\startlua
 if tex.systemmodes['en'] then
 context('Language is English.')
 else
 context('Language is not English.')
 end
 context('\\par')
 if tex.modes['es'] then
 context('Main language is Spanish.')
 else
 context('Main language is not Spanish.')
 end
 \stoplua
 \stoptext

Just in case it help,

tex.modes['*en']
tex.modes['**en']

tex.systemmodes['en']
tex.systemmodes['*en']

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Modes in Lua

2017-05-31 Thread Pablo Rodriguez
On 05/31/2017 04:51 PM, Pablo Rodriguez wrote:
> [...]
> This is the way to detect system modes, but I don’t know how to do it
> for \mainlanguage (**en).

It was simple (not even using tex.systemmodes):

\mainlanguage[es]
\starttext
\en\startlua
if tex.modes['*en'] then
context('Language is English.')
else
context('Language is not English.')
end
context('\\par')
if tex.modes['**es'] then
context('Main language is Spanish.')
else
context('Main language is not Spanish.')
end
\stoplua
\stoptext

Just in case it helps,

Pablo
-- 
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Modes in Lua

2017-05-31 Thread Pablo Rodriguez
On 05/31/2017 11:03 AM, MF wrote:
> if tex.modes['specialmode'] then
> context('I’m special.')
> end
>  
> Best greetings,
> Massi
> 
>> Hi, this should be easy:
>>
>> How can I access ConTeXt’s modes in Lua? Is it any different with
>> language modes (*en)?

This is the way to detect system modes, but I don’t know how to do it
for \mainlanguage (**en).

\mainlanguage[es]
\starttext
\en\startlua
if tex.systemmodes['en'] then
context('Language is English.')
else
context('Language is not English.')
end
context('\\par')
if tex.modes['es'] then
context('Main language is Spanish.')
else
context('Main language is not Spanish.')
end
\stoplua
\stoptext

Just in case it help,

Pablo
-- 
http://www.ousia.tk
___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

Re: [NTG-context] Modes in Lua

2017-05-31 Thread MF
if tex.modes['specialmode'] then
context('I’m special.')
end
 
Best greetings,
Massi

> Hi, this should be easy:
> 
> How can I access ConTeXt’s modes in Lua? Is it any different with
> language modes (*en)?
> 
> e.g.
> 
> \startluacode
> 
> if context.modes['specialmode'] then
> context('I’m special.')
> end
> 
> \stopluacode
> 

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] Modes in Lua

2017-05-31 Thread Henning Hraban Ramm
Hi, this should be easy:

How can I access ConTeXt’s modes in Lua? Is it any different with language 
modes (*en)?

e.g.

\startluacode

if context.modes['specialmode'] then
context('I’m special.')
end

\stopluacode


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___

[NTG-context] modes + arranging

2012-07-08 Thread Thomas A. Schmitz

Hi all,

sorry for the slightly silly example, but it's something I can't figure 
out, and it has worked before. For processing my documents, I have 
defined a mode which will arrange pages. Here's the silly example test.tex:


\startmode[arranged]
\setuppapersize[A6][A4]

\setuparranging[2*4]

\stopmode

\setuppagenumbering[state=stop]

\starttext

\dorecurse{8}{\null\vfill\centerline\recurselevel\vfill\null\page}

\stoptext

When I process this with

context --mode=arranged test

I get the expected output. When I process it with

context --mode=arranged --arrange test

the pages are NOT arranged. I need the --arrange switch for my data, and 
I don't understand what's going wrong here. Behavior is the same with 
current beta and a slightly older version (06.30).


Thanks

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


Re: [NTG-context] modes + arranging

2012-07-08 Thread Hans Hagen

On 8-7-2012 20:06, Thomas A. Schmitz wrote:

Hi all,

sorry for the slightly silly example, but it's something I can't figure
out, and it has worked before. For processing my documents, I have
defined a mode which will arrange pages. Here's the silly example test.tex:


Can you test with

c_flags.noarrange  = nil

in line 671 in mtx-context.lua (some time ago the 'opt' file has been 
replaced by passing commandline arguments and this slipped through).


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-


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


Re: [NTG-context] modes + arranging

2012-07-08 Thread Thomas A. Schmitz

On 07/09/2012 12:17 AM, Hans Hagen wrote:

Can you test with

 c_flags.noarrange  = nil

in line 671 in mtx-context.lua (some time ago the 'opt' file has been
replaced by passing commandline arguments and this slipped through).

Hans


Hi Hans,

yes, when I change this line, arranging works again! Thanks for the 
quick fix!


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


[NTG-context] Modes in MkIV minimals (bug?)

2010-10-24 Thread Matija Šuklje
Hullo,


I'm working on my thesis (and it's pf_ul styling[1]) and I tried to include 
modes.

The thing is that modes seem to be set right and work when invoked in CLI 
(e.g. 'context --mode=osnutek,zaslon diplomska.tex', but ConteXt seems to 
completely igonore lines in text such as:

\enablemode[osnutek]

Is this a bug or am I doing something wrong?

I'm using minimals:
MTXrun | current version: 2010.06.18 11:26


Cheers,
Matija

P.S. Is ConTeXt (mkIV) in TexLive 2010 deemed as stable and usable?
-.-.-
[1] 
http://wiki.contextgarden.net/Law_Faculty_University_of_Ljubljana_Styling_and_citations
-- 
gsm:+386 41 849 552
www:http://matija.suklje.name
xmpp:   matija.suk...@gabbler.org


signature.asc
Description: This is a digitally signed message part.
___
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
___


Re: [NTG-context] Modes in MkIV minimals (bug?)

2010-10-24 Thread Wolfgang Schuster

Am 24.10.2010 um 21:21 schrieb Matija Šuklje:

 Hullo,
 
 
 I'm working on my thesis (and it's pf_ul styling[1]) and I tried to include 
 modes.
 
 The thing is that modes seem to be set right and work when invoked in CLI 
 (e.g. 'context --mode=osnutek,zaslon diplomska.tex', but ConteXt seems to 
 completely igonore lines in text such as:
 
 \enablemode[osnutek]
 
 Is this a bug or am I doing something wrong?

Do you enable the mode before it is used or after it, e.g.

\enablemode[foo]
\startmode[foo]
...
\stopmode

use the content of the mode „foo“ while

\startmode[foo]
...
\stopmode
\enablemode[foo]

doesn’t use it because at the time the mode was called it was disabled and the 
\enablemode has therefore no effect because it’s calles to late.

If this doesn’t apply to you make a minimals example.

Wolfgang

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


Re: [NTG-context] Modes in MkIV minimals (bug?)

2010-10-24 Thread Matija Šuklje
Dne nedelja 24. oktobra 2010 ob 21:27:58 je Wolfgang Schuster napisal(a):
 Do you enable the mode before it is used or after it, e.g.

That did it, thanks :)


Cheers,
Matija

-- 
gsm:+386 41 849 552
www:http://matija.suklje.name
xmpp:   matija.suk...@gabbler.org


signature.asc
Description: This is a digitally signed message part.
___
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
___


Re: [NTG-context] modes

2010-10-15 Thread Henning Hraban Ramm

Am 2010-10-14 um 15:57 schrieb Hans Hagen:


(for module writers)

The latest beta gives access to modes at the lua end


Wikified (unmodified):
http://wiki.contextgarden.net/Modes#Modes_in_LuaTeX


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

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


[NTG-context] modes

2010-10-14 Thread Hans Hagen

Hi,

(for module writers)

The latest beta gives access to modes at the lua end

\starttext

\enablemode[test]
\enablemode[]

\doifallmodes{test,xxx}{NO}
\doifallmodes{test,}{YES}
\doifmode{test}{YES}
\doifnotmode{xxx}{YES}

\startluacode
tex.sprint(tex.modes['x']and YES or NOP)
tex.sprint(tex.modes['xx']   and YES or NOP)
tex.sprint(tex.modes['xxx']  and YES or NOP)
tex.sprint(tex.modes[''] and YES or NOP)
tex.sprint(tex.modes['test'] and YES or NOP)
\stopluacode

\stoptext


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
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
___


Re: [NTG-context] modes questions

2008-09-30 Thread Alan Stone
On Mon, Sep 29, 2008 at 10:37 PM, Hans Hagen [EMAIL PROTECTED] wrote:

 Alan Stone wrote:
  On Thu, Sep 11, 2008 at 12:46 PM, Hans Hagen [EMAIL PROTECTED] wrote:
 
  Alan Stone wrote:
  (2.2) How does ConTeXt handle a modefile ? Are the modes parsed into a
  modelist ( re: question 1.2 ) ?
  best use ctx files instead, like in
 
  == somefile.ctx ===
 
  ?xml version='1.0' standalone='yes'?
 
  ctx:job
  ctx:preprocess/
  ctx:flags
  ctx:flagtexengine=luatex/ctx:flag
  ctx:flaginterface=en/ctx:flag
  /ctx:flags
  ctx:process
  ctx:resources
  ctx:modeproofing/ctx:mode
  ctx:environmentsomestyle.tex/ctx:environment
  /ctx:resources
  /ctx:process
  ctx:postprocess/
  /ctx:job
 
  texexec  --ctx=somefile
 
 
  How about the other texexec options,

 i implement them stepwise, i leave out those no longer relevant and all
 --pdf* ones will be done with ctx files instead


Are there currently other ones than those listed above which already have
been implemented ?

How can one follow along which additional ones are implemented with the
update releases ?

-- 
Best,
Alan

Ubuntu 8.04 Hardy Heron (Desktop)
  * ConTeXt  ver: 2008.09.16 19:49 MKIV  fmt: 2008.9.20  int:
english/english  (ConTeXt minimals installation)
  * texexec --lua foo
___
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
___


Re: [NTG-context] modes questions

2008-09-30 Thread Hans Hagen
Alan Stone wrote:

 Are there currently other ones than those listed above which already have
 been implemented ?
 
 How can one follow along which additional ones are implemented with the
 update releases ?

--help

or just looking at the code

i have no time to write/update a manual now

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


Re: [NTG-context] modes questions

2008-09-29 Thread Alan Stone
On Thu, Sep 11, 2008 at 12:46 PM, Hans Hagen [EMAIL PROTECTED] wrote:

 Alan Stone wrote:
  (2.2) How does ConTeXt handle a modefile ? Are the modes parsed into a
  modelist ( re: question 1.2 ) ?

 best use ctx files instead, like in

 == somefile.ctx ===

 ?xml version='1.0' standalone='yes'?

 ctx:job
 ctx:preprocess/
 ctx:flags
 ctx:flagtexengine=luatex/ctx:flag
 ctx:flaginterface=en/ctx:flag
 /ctx:flags
 ctx:process
 ctx:resources
 ctx:modeproofing/ctx:mode
 ctx:environmentsomestyle.tex/ctx:environment
 /ctx:resources
 /ctx:process
 ctx:postprocess/
 /ctx:job

 texexec  --ctx=somefile


How about the other texexec options,
re: http://linux.die.net/man/1/texexec ?
Which ones go where in the ctx file
+ what is their syntax ?

-- 
Best,
Alan

Ubuntu 8.04 Hardy Heron (Desktop)
  * ConTeXt  ver: 2008.09.16 19:49 MKIV  fmt: 2008.9.20  int:
english/english  (ConTeXt minimals installation)
  * texexec --lua foo
___
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
___


Re: [NTG-context] modes questions

2008-09-29 Thread Hans Hagen
Alan Stone wrote:
 On Thu, Sep 11, 2008 at 12:46 PM, Hans Hagen [EMAIL PROTECTED] wrote:
 
 Alan Stone wrote:
 (2.2) How does ConTeXt handle a modefile ? Are the modes parsed into a
 modelist ( re: question 1.2 ) ?
 best use ctx files instead, like in

 == somefile.ctx ===

 ?xml version='1.0' standalone='yes'?

 ctx:job
 ctx:preprocess/
 ctx:flags
 ctx:flagtexengine=luatex/ctx:flag
 ctx:flaginterface=en/ctx:flag
 /ctx:flags
 ctx:process
 ctx:resources
 ctx:modeproofing/ctx:mode
 ctx:environmentsomestyle.tex/ctx:environment
 /ctx:resources
 /ctx:process
 ctx:postprocess/
 /ctx:job

 texexec  --ctx=somefile

 
 How about the other texexec options,

i implement them stepwise, i leave out those no longer relevant and all 
--pdf* ones will be done with ctx files instead


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


Re: [NTG-context] modes questions

2008-09-21 Thread Hans Hagen
Alan Stone wrote:
 On Sat, Sep 20, 2008 at 6:07 PM, Hans Hagen [EMAIL PROTECTED] wrote:
 
 Alan Stone wrote:
 Are such macros possible ?

 modes: ma, mb, ... mz
 values: va, vb, ... vz
 command: cmd
 parameter: p

 (1) instead of

 \doifmode{ma}{\cmd[name][va]}
 \doifmode{mb}{\cmd[name][vb]}
 
 \doifmode{mz}{\cmd[name][vz]}

 a macro which does: \doifmode{m*}{\cmd[name][v*]}

 (2) instead of

 \doifmode{ma}{\cmd[p=va]}
 \doifmode{mb}{\cmd[p=vb]}
 
 \doifmode{mz}{\cmd[p=vz]}

 a macro which does: \doifmode{m*}{\cmd[p=v*]}
 nl, because there is no knowledge of what modes are set (i could cook
 something up for mkiv or course)


 
 Is there something like, or the equivalent of, one/two dimensional arrays in
 (Con)TeXt ?
 
 array1={ma, mb, ... mz}
 array2={va, vb, ... vz}

comma separated lists are used at several spots

but usage really depends on the problem to be solved

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


Re: [NTG-context] modes questions

2008-09-20 Thread Alan Stone
Are such macros possible ?

modes: ma, mb, ... mz
values: va, vb, ... vz
command: cmd
parameter: p

(1) instead of

\doifmode{ma}{\cmd[name][va]}
\doifmode{mb}{\cmd[name][vb]}
...
\doifmode{mz}{\cmd[name][vz]}

a macro which does: \doifmode{m*}{\cmd[name][v*]}

(2) instead of

\doifmode{ma}{\cmd[p=va]}
\doifmode{mb}{\cmd[p=vb]}
...
\doifmode{mz}{\cmd[p=vz]}

a macro which does: \doifmode{m*}{\cmd[p=v*]}

-- 
Best,
Alan

* texmfstart texexec --lua foo
* ConTeXt  ver: 2008.09.16 19:49 MKIV fmt: 2008.9.20  int: english/english
* Windows XP Home SP3
___
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
___


Re: [NTG-context] modes questions

2008-09-20 Thread Hans Hagen
Alan Stone wrote:
 Are such macros possible ?
 
 modes: ma, mb, ... mz
 values: va, vb, ... vz
 command: cmd
 parameter: p
 
 (1) instead of
 
 \doifmode{ma}{\cmd[name][va]}
 \doifmode{mb}{\cmd[name][vb]}
 
 \doifmode{mz}{\cmd[name][vz]}
 
 a macro which does: \doifmode{m*}{\cmd[name][v*]}
 
 (2) instead of
 
 \doifmode{ma}{\cmd[p=va]}
 \doifmode{mb}{\cmd[p=vb]}
 
 \doifmode{mz}{\cmd[p=vz]}
 
 a macro which does: \doifmode{m*}{\cmd[p=v*]}

nl, because there is no knowledge of what modes are set (i could cook 
something up for mkiv or course)

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


Re: [NTG-context] modes questions

2008-09-17 Thread Alan Stone
On Thu, Sep 11, 2008 at 12:46 PM, Hans Hagen [EMAIL PROTECTED] wrote:

 Alan Stone wrote:
  Hi,
 
  (1) --mode=modelist
 
  (1.1) Is there a limit to the number of modes in modelist ?

 no, just what the console and memory permit

  (1.2) Is there a way to call the modelist and submit it to conditional
  testing within ConTeXt ? For example, to lookup (true/false) the
  presence of modes containing/starting with (an) alphannumeric
  string(s) ?

 \doifmodeelse{somemode} { } { } etc etc etc

  (2) --modefile=file
 
  (2.1) What's the syntax of a modefile ?

 this concerns examodes stuff that we use for process control at pragma

  (2.2) How does ConTeXt handle a modefile ? Are the modes parsed into a
  modelist ( re: question 1.2 ) ?

 best use ctx files instead, like in

 == somefile.ctx ===

 ?xml version='1.0' standalone='yes'?

 ctx:job
 ctx:preprocess/
 ctx:flags
 ctx:flagtexengine=luatex/ctx:flag
 ctx:flaginterface=en/ctx:flag
 /ctx:flags
 ctx:process
 ctx:resources
 ctx:modeproofing/ctx:mode
 ctx:environmentsomestyle.tex/ctx:environment
 /ctx:resources
 /ctx:process
 ctx:postprocess/
 /ctx:job

 texexec  --ctx=somefile


As I'm not familiar with XML, neither using ConTeXt with XML...

What if I want to pass a list of modes: mode1, mode2, mode3,  ?


-- 
Best,
Alan

* ConTeXt ver: 2008.09.10 14:01 MKIV fmt: 2008.9.14 int: english/english
* Windows XP Home SP3
___
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
___


Re: [NTG-context] modes questions

2008-09-17 Thread Hans Hagen
Alan Stone wrote:
 On Thu, Sep 11, 2008 at 12:46 PM, Hans Hagen [EMAIL PROTECTED] wrote:
 
 Alan Stone wrote:
 Hi,

 (1) --mode=modelist

 (1.1) Is there a limit to the number of modes in modelist ?
 no, just what the console and memory permit

 (1.2) Is there a way to call the modelist and submit it to conditional
 testing within ConTeXt ? For example, to lookup (true/false) the
 presence of modes containing/starting with (an) alphannumeric
 string(s) ?
 \doifmodeelse{somemode} { } { } etc etc etc

 (2) --modefile=file

 (2.1) What's the syntax of a modefile ?
 this concerns examodes stuff that we use for process control at pragma

 (2.2) How does ConTeXt handle a modefile ? Are the modes parsed into a
 modelist ( re: question 1.2 ) ?
 best use ctx files instead, like in

 == somefile.ctx ===

 ?xml version='1.0' standalone='yes'?

 ctx:job
 ctx:preprocess/
 ctx:flags
 ctx:flagtexengine=luatex/ctx:flag
 ctx:flaginterface=en/ctx:flag
 /ctx:flags
 ctx:process
 ctx:resources
 ctx:modeproofing/ctx:mode
 ctx:environmentsomestyle.tex/ctx:environment
 /ctx:resources
 /ctx:process
 ctx:postprocess/
 /ctx:job

 texexec  --ctx=somefile
 
 
 As I'm not familiar with XML, neither using ConTeXt with XML...
 
 What if I want to pass a list of modes: mode1, mode2, mode3,  ?

just add more

ctx:modeanothermode/ctx:mode
ctx:modeandanotherone/ctx:mode


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


[NTG-context] modes questions

2008-09-11 Thread Alan Stone
Hi,

(1) --mode=modelist

(1.1) Is there a limit to the number of modes in modelist ?

(1.2) Is there a way to call the modelist and submit it to conditional
testing within ConTeXt ? For example, to lookup (true/false) the
presence of modes containing/starting with (an) alphannumeric
string(s) ?

(2) --modefile=file

(2.1) What's the syntax of a modefile ?

(2.2) How does ConTeXt handle a modefile ? Are the modes parsed into a
modelist ( re: question 1.2 ) ?

-- 
Best,
Alan

* using ConTeXt ver: 2008.08.18 14:00 MKIV fmt: 2008.8.22 int:
english/english (on Windows XP)
___
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
___


Re: [NTG-context] modes questions

2008-09-11 Thread Hans Hagen
Alan Stone wrote:
 Hi,
 
 (1) --mode=modelist
 
 (1.1) Is there a limit to the number of modes in modelist ?

no, just what the console and memory permit

 (1.2) Is there a way to call the modelist and submit it to conditional
 testing within ConTeXt ? For example, to lookup (true/false) the
 presence of modes containing/starting with (an) alphannumeric
 string(s) ?

\doifmodeelse{somemode} { } { } etc etc etc

 (2) --modefile=file
 
 (2.1) What's the syntax of a modefile ?

this concerns examodes stuff that we use for process control at pragma

 (2.2) How does ConTeXt handle a modefile ? Are the modes parsed into a
 modelist ( re: question 1.2 ) ?

best use ctx files instead, like in

== somefile.ctx ===

?xml version='1.0' standalone='yes'?

ctx:job
 ctx:preprocess/
 ctx:flags
 ctx:flagtexengine=luatex/ctx:flag
 ctx:flaginterface=en/ctx:flag
 /ctx:flags
 ctx:process
 ctx:resources
 ctx:modeproofing/ctx:mode
 ctx:environmentsomestyle.tex/ctx:environment
 /ctx:resources
 /ctx:process
 ctx:postprocess/
/ctx:job

texexec  --ctx=somefile


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


Re: [NTG-context] modes questions

2008-09-11 Thread Taco Hoekwater
Hans Hagen wrote:
 
 (1.2) Is there a way to call the modelist and submit it to conditional
 testing within ConTeXt ? For example, to lookup (true/false) the
 presence of modes containing/starting with (an) alphannumeric
 string(s) ?
 
 \doifmodeelse{somemode} { } { } etc etc etc

This presumes that you actually know the list of enabled modes, so
I think a commalist of set modes would be useful as well. Modules
could use that to set up keyword-based behaviours.

Best wishes,
Taco
___
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
___


Re: [NTG-context] modes questions

2008-09-11 Thread Hans Hagen
Taco Hoekwater wrote:
 Hans Hagen wrote:
 (1.2) Is there a way to call the modelist and submit it to conditional
 testing within ConTeXt ? For example, to lookup (true/false) the
 presence of modes containing/starting with (an) alphannumeric

\doifinstring

 string(s) ?
 \doifmodeelse{somemode} { } { } etc etc etc
 
 This presumes that you actually know the list of enabled modes, so
 I think a commalist of set modes would be useful as well. Modules
 could use that to set up keyword-based behaviours.

there is already such a mechanism (thomas uses it in his module)

maybe at some point in mkiv we can provide the list because then i can 
use lua for keeping track of things; maintaining a comma separated list 
is tex is not that fast (and i use modes a lot to control styles that 
need a high performance); think of

\enablemode[a,b,c]

and a large list of enabled modes that we need to check for already set 
nodes (in lua it's just a hash and a the fill list a list-of-keys)

btw, this would make mkiv incompatible with mkii

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


Re: [NTG-context] modes questions

2008-09-11 Thread Alan Stone
On Thu, Sep 11, 2008 at 12:52 PM, Taco Hoekwater [EMAIL PROTECTED] wrote:
 Hans Hagen wrote:

 (1.2) Is there a way to call the modelist and submit it to conditional
 testing within ConTeXt ? For example, to lookup (true/false) the
 presence of modes containing/starting with (an) alphannumeric
 string(s) ?

 \doifmodeelse{somemode} { } { } etc etc etc

 This presumes that you actually know the list of enabled modes, so
 I think a commalist of set modes would be useful as well. Modules
 could use that to set up keyword-based behaviours.

That's what I meant. Thanks for clarifying.

 Best wishes,
 Taco

-- 
Best,
Alan

* using ConTeXt ver: 2008.08.18 14:00 MKIV fmt: 2008.8.22 int:
english/english (on Windows XP)
___
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
___


Re: [NTG-context] modes questions

2008-09-11 Thread Alan Stone
On Thu, Sep 11, 2008 at 1:37 PM, Hans Hagen [EMAIL PROTECTED] wrote:
 Taco Hoekwater wrote:
 Hans Hagen wrote:
 (1.2) Is there a way to call the modelist and submit it to conditional
 testing within ConTeXt ? For example, to lookup (true/false) the
 presence of modes containing/starting with (an) alphannumeric

 \doifinstring

 string(s) ?
 \doifmodeelse{somemode} { } { } etc etc etc

 This presumes that you actually know the list of enabled modes, so
 I think a commalist of set modes would be useful as well. Modules
 could use that to set up keyword-based behaviours.

 there is already such a mechanism (thomas uses it in his module)

Is this mechanism documented somewhere ?

 maybe at some point in mkiv we can provide the list because then i can
 use lua for keeping track of things; maintaining a comma separated list
 is tex is not that fast (and i use modes a lot to control styles that
 need a high performance); think of

 \enablemode[a,b,c]

 and a large list of enabled modes that we need to check for already set
 nodes (in lua it's just a hash and a the fill list a list-of-keys)

 btw, this would make mkiv incompatible with mkii

-- 
Best,
Alan

* using ConTeXt ver: 2008.08.18 14:00 MKIV fmt: 2008.8.22 int:
english/english (on Windows XP)
___
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
___


Re: [NTG-context] modes with Scite

2006-07-25 Thread dwarnold45
Hans,

I thought Shift+F8, paramters, would have something to do with adding options 
at the command line, but it did not work with --mode=short.

 Hans Hagen [EMAIL PROTECTED] wrote: 
 [EMAIL PROTECTED] wrote:
  All,
 
  I am using the Scite editor provided by one of the Context dristributions.
 
  Is there a way to include modes with one of the various compiling commands?

 no, but you can 
 
 (1) temporary put \enablemode[...] at the to of the file
 (2) use a separate file where you set the mode, and load the file 
 
 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
 -
 
 ___
 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


Re: [NTG-context] modes with Scite

2006-07-25 Thread Hans Hagen
[EMAIL PROTECTED] wrote:
 Hans,

 I thought Shift+F8, paramters, would have something to do with adding options 
 at the command line, but it did not work with --mode=short.

   
in your user scite props you need to say:

name.context.texexec=texmfstart texexec $(name.texexec.flag.pdfopen) $(1)


  Hans Hagen [EMAIL PROTECTED] wrote: 
   
 [EMAIL PROTECTED] wrote:
 
 All,

 I am using the Scite editor provided by one of the Context dristributions.

 Is there a way to include modes with one of the various compiling commands?
   
   
 no, but you can 

 (1) temporary put \enablemode[...] at the to of the file
 (2) use a separate file where you set the mode, and load the file 

 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
 -

 ___
 ntg-context mailing list
 ntg-context@ntg.nl
 http://www.ntg.nl/mailman/listinfo/ntg-context
 

   


-- 

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

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] modes with Scite

2006-07-24 Thread Hans Hagen
[EMAIL PROTECTED] wrote:
 All,

 I am using the Scite editor provided by one of the Context dristributions.

 Is there a way to include modes with one of the various compiling commands?
   
no, but you can 

(1) temporary put \enablemode[...] at the to of the file
(2) use a separate file where you set the mode, and load the file 

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
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] modes with Scite

2006-07-24 Thread Hans Hagen
[EMAIL PROTECTED] wrote:
 All,

 I am using the Scite editor provided by one of the Context dristributions.

 Is there a way to include modes with one of the various compiling commands?
   
btw, you can make a local scite options file and add menu items (key bindings); 
so you can map say ctrl-F10 to process your doc using your mode; see 
context.properties for examples); local scite files are per directory 

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
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] modes with Scite

2006-07-22 Thread dwarnold45
All,

I am using the Scite editor provided by one of the Context dristributions.

Is there a way to include modes with one of the various compiling commands?
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] modes in newtexexec

2005-12-12 Thread Hans Hagen

Johan Sandblom wrote:


Hello.

Doing

texmfstart texexec

now appears to call newtexexec. However, newtexexec does not seem to
handle --mode at all. Is it coming? Should I set it up so I can call
texexec directly in order to use modes?
 

i ran into that as well, it does recognize the modes (plural) option; 
the problem is (was since i fixed it) in


--modes
--modefile

and mode got resolved to modefile

Hans

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] modes in newtexexec

2005-12-09 Thread Johan Sandblom
Hello.

Doing

texmfstart texexec

now appears to call newtexexec. However, newtexexec does not seem to
handle --mode at all. Is it coming? Should I set it up so I can call
texexec directly in order to use modes?

Regards, Johan
--
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
What is wanted is not the will to believe, but the
will to find out, which is the exact opposite
- Bertrand Russell
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Modes for configuration

2005-10-17 Thread Hans Hagen

Alan Bowen wrote:

Following the example in the ConTeXt Wiki (http:// 
wiki.contextgarden.net/Modes) I have defined an environment file that  
specifies two modes (screen, print) for the production of the same  
source file. This works well when the appropriate texexec commands  
are given at the command line.


The problem is that I am trying to set  this production up for users  
who are happier with a GUI. Is there a way to do generate diverse  
outputs from the same source file without resorting to the command  
line? I have experimented with TeXShop�the users tend to works on Macs 
�but without success thus far.


(1) at the top of the file you can say:

% modes=...

i can think of a 'plugin' in texexec that pops up a menu asking what 
mode to use (maybe you should put it put it on the wish list in the 
context portal -)


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
-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Modes for configuration

2005-10-17 Thread Alan Bowen

Willi—

Many thanks. That is helpful and much appreciated. I missed the  
closing remark about \enablemode on the Mode page of  ConTeXt wiki  
(which I come to rely on extensively).


The advantage of the command line/texexec approach is that one can  
specify the name of the output using --result xxx and so avoid  
clobbering files. But I suspect that the users will find it easier to  
play with \enablemode commands using their various editors of choice  
and to rename the output before recompiling the file.


Alan

On Oct 16, 2005, at 2:53 PM, Willi Egger wrote:


Hi Alan,

This is simle to solve:

%\enablemode[screen]
\enablemode[print]
\envrionment yourenvironment

Important is to enable the required mode before loading the  
environment file. - Dit you know that you can select multiple modes  
e.g. you have a print-mode and the document should be created for
letter, A4 and A5. So you could define a letter-mode an A4-mode and  
an A5-mode.


In the document you can say

\enablemode[print,A4]
\envrionment yourenvironment

Hope that this helps

Willi

Alan Bowen wrote:


Following the example in the ConTeXt Wiki (http://  
wiki.contextgarden.net/Modes) I have defined an environment file  
that  specifies two modes (screen, print) for the production of  
the same  source file. This works well when the appropriate  
texexec commands  are given at the command line.


The problem is that I am trying to set  this production up for  
users  who are happier with a GUI. Is there a way to do generate  
diverse  outputs from the same source file without resorting to  
the command  line? I have experimented with TeXShop—the users tend  
to works on Macs —but without success thus far.


Thanks for any suggestions.

Alan


___
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



___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Modes for configuration

2005-10-17 Thread Alan Bowen
Many thanks, Hans. The idea of a pop-up menu for texexec does have a  
peculiar charm.


Best, Alan

On Oct 17, 2005, at 4:21 AM, Hans Hagen wrote:


Alan Bowen wrote:


Following the example in the ConTeXt Wiki (http://  
wiki.contextgarden.net/Modes) I have defined an environment file  
that  specifies two modes (screen, print) for the production of  
the same  source file. This works well when the appropriate  
texexec commands  are given at the command line.


The problem is that I am trying to set  this production up for  
users  who are happier with a GUI. Is there a way to do generate  
diverse  outputs from the same source file without resorting to  
the command  line? I have experimented with TeXShop�the users  
tend to works on Macs �but without success thus far.




(1) at the top of the file you can say:

% modes=...

i can think of a 'plugin' in texexec that pops up a menu asking  
what mode to use (maybe you should put it put it on the wish list  
in the context portal -)


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
-

___
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


Re: [NTG-context] Modes for configuration

2005-10-17 Thread Alan Bowen
Well, I am very glad that you said something. I was feeling unusually  
sheepish for having missed it!


Cheers, Alan

On Oct 17, 2005, at 4:45 PM, Henning Hraban Ramm wrote:


Am 2005-10-17 um 19:04 schrieb Alan Bowen:


Many thanks. That is helpful and much appreciated. I missed the  
closing remark about \enablemode on the Mode page of  ConTeXt wiki




That's no wonder - I added it this morning after I read Willi's  
mail. ;-



Grüßlis vom Hraban!
---
http://www.fiee.net/texnique/
http://contextgarden.net
http://www.cacert.org (I'm an assurer)

___
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


Re: [NTG-context] Modes for configuration

2005-10-16 Thread Willi Egger

Hi Alan,

This is simle to solve:

%\enablemode[screen]
\enablemode[print]
\envrionment yourenvironment

Important is to enable the required mode before loading the environment 
file. - Dit you know that you can select multiple modes e.g. you have a 
print-mode and the document should be created for
letter, A4 and A5. So you could define a letter-mode an A4-mode and an 
A5-mode.


In the document you can say

\enablemode[print,A4]
\envrionment yourenvironment

Hope that this helps

Willi

Alan Bowen wrote:

Following the example in the ConTeXt Wiki (http:// 
wiki.contextgarden.net/Modes) I have defined an environment file that  
specifies two modes (screen, print) for the production of the same  
source file. This works well when the appropriate texexec commands  
are given at the command line.


The problem is that I am trying to set  this production up for users  
who are happier with a GUI. Is there a way to do generate diverse  
outputs from the same source file without resorting to the command  
line? I have experimented with TeXShop—the users tend to works on Macs 
—but without success thus far.


Thanks for any suggestions.

Alan


___
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


[NTG-context] Modes for configuration

2005-10-15 Thread Alan Bowen
Following the example in the ConTeXt Wiki (http:// 
wiki.contextgarden.net/Modes) I have defined an environment file that  
specifies two modes (screen, print) for the production of the same  
source file. This works well when the appropriate texexec commands  
are given at the command line.


The problem is that I am trying to set  this production up for users  
who are happier with a GUI. Is there a way to do generate diverse  
outputs from the same source file without resorting to the command  
line? I have experimented with TeXShop—the users tend to works on Macs 
—but without success thus far.


Thanks for any suggestions.

Alan


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context