[NTG-context] Test whether variable has been set

2007-05-27 Thread Elliot Clifton
Hi,

How can test whether a variable has been set? I couldn't find any
reference to this in the wiki?

TIA,

Elliot
___
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] Test whether variable has been set

2007-05-27 Thread Peter Rolf
Hi Elliot,

Elliot Clifton schrieb:
 Hi,
 
 How can test whether a variable has been set? I couldn't find any
 reference to this in the wiki?

What do you mean by set?

I use

\doifnothing{\getvariable{foo}{bar}}
  {foo:bar contains nothing.\par}%
\doifsomething{\getvariable{foo}{bar}}
  {foo:bar contains something.\par}%
\doifelsenothing{\getvariable{foo}{bar}}
  {foo:bar contains nothing.\par}
  {foo:bar contains something.\par}%

to test, if a defined(!) variable contains something.

If you want to test if a variable is defined, you can use

\doifnotvariable{foo}{bar}
  {foo:bar is undefined.\par}%
\doifvariable{foo}{bar}
  {foo:bar is defined.\par}%
\doifelsevariable{foo}{bar}
  {foo:bar is defined.\par}
  {foo:bar is undefined.\par}%

Never used these macros, as I always define default values for my variables.


HTH, Peter


 TIA,
 
 Elliot
 ___
 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
 ___
 

___
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] Test whether variable has been set

2007-05-27 Thread Elliot Clifton
Hi Peter,

Thanks for your reply. I think I may have misunderstood the variable
section on the wiki. I been using \setvariable to both declare and
assign variables from my component files. When I should have been
declaring them in the environment file first, right?
\setvariable[namespace][key=DefaultValue], right? So how do I test for
a (Default)Value?
Sorry, I'm just beginning TeX programming I don't understand how to do this.

Elliot
___
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] Test whether variable has been set

2007-05-27 Thread Aditya Mahajan
On Sun, 27 May 2007, Elliot Clifton wrote:

 Hi Peter,

 Thanks for your reply. I think I may have misunderstood the variable
 section on the wiki. I been using \setvariable to both declare and
 assign variables from my component files. When I should have been
 declaring them in the environment file first, right?
 \setvariable[namespace][key=DefaultValue], right? So how do I test for
 a (Default)Value?
 Sorry, I'm just beginning TeX programming I don't understand how to do this.

Elliot,

You can use \doif{\getvalue{set}{var}}{value} for simple string 
comparisons. See http://wiki.contextgarden.net/System_Macros for basic 
flow control features of ConTeXt.

It may also be possble to see if variables have changed using setups 
http://wiki.contextgarden.net/Inside_ConTeXt#Using_setups_for_namespaces 
but I have never personally used that.

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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Reverse itemize

2007-05-27 Thread Hans Hagen
Aditya Mahajan wrote:
 Hi,

 Is it possible to have a reverse key for itemize, so that

 \startitemize[n,reverse]
   \item one
   \item two
   \item three
 \stopitemize

 gives

 3. one
 2. two
 1. three

 I thought that this should be easier than random items, but I can not 
 figure how random key works.
   
random collects the items, and only works with \startitem \stopitem,

you need a change somewhere else, i'll send you a patch offlist for testing

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] Test whether variable has been set

2007-05-27 Thread Hans Hagen
Aditya Mahajan wrote:
 On Sun, 27 May 2007, Elliot Clifton wrote:

   
 Hi Peter,

 Thanks for your reply. I think I may have misunderstood the variable
 section on the wiki. I been using \setvariable to both declare and
 assign variables from my component files. When I should have been
 declaring them in the environment file first, right?
 \setvariable[namespace][key=DefaultValue], right? So how do I test for
 a (Default)Value?
 Sorry, I'm just beginning TeX programming I don't understand how to do this.
 

 Elliot,

 You can use \doif{\getvalue{set}{var}}{value} for simple string 
 comparisons. See http://wiki.contextgarden.net/System_Macros for basic 
 flow control features of ConTeXt.

 It may also be possble to see if variables have changed using setups 
 http://wiki.contextgarden.net/Inside_ConTeXt#Using_setups_for_namespaces 
 but I have never personally used that.
   
these test if the variable has been set (defined test):

\doifelsevariable#1#2
\doifvariable#1#2
\doifnotvariable#1#2

(is not the same as test for empty)

there is also:

\getvariabledefault#1#2#3

with #3 being a default value for when undefined

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] Scite folding

2007-05-27 Thread Idris Samawi Hamid
Hi,

On Sun, 27 May 2007 11:18:48 -0600, soft_sharesoft_share@126.com
wrote:

 Dear all,
 Just come across this thread. The TeX folding feature in NotePad++ was  
 adapted by me and originally the adaptations was made in SciTE. As I am  
 not a ConTeXt user, I am not aware of the structure of sectioning  
 commands in ConTeXt. Could anyone of you let me know of a minimum list  
 of sectioning commands in ConTeXt so that I can modify the source code  
 to make the TeX folding in SciTE and NotePad++ work also for ConTeXt  
 documents?

I could not get the Notepad++ source to compile, but then again, I am not
a programmer;-)

I'll zip the contents of my local notepad++ setup and send it to you
[offlist], as well as some emails I sent to the notepad++ people.

One more thing: we need to add an options for the .tex extension in
notepad++'s Open-File dialog.

I am extremely busy these days but will try to help!

Best
Idris

-- 
Professor Idris Samawi Hamid
Department of Philosophy
Colorado State University
Fort Collins, CO 80523

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
___
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] Test whether variable has been set

2007-05-27 Thread Peter Rolf
Elliot Clifton schrieb:
 Hi Peter,
 
 Thanks for your reply. I think I may have misunderstood the variable
 section on the wiki. I been using \setvariable to both declare and
 assign variables from my component files. When I should have been
 declaring them in the environment file first, right?

As long as you can garantee, that your variables are declared *before*
they are read, things are ok. But an environment or extra file is IMO
the cleanest way.

Reading an undefined variable results in the \empty token. This can be
problematic, if you expect a number; e.g.
\dimexpr\getvariable{foo}{width}\relax.

Anyway, it's no good idea to use something that is not defined.

So you have to
  - define a variable, before you use it  or
  - use the \doifnotvariable,\doifvariable and \doifelsevariable macros
before you try to read a (maybe undefined) variable.

I can't say much about the second one. Search the ConTeXt sources to get
an idea.

The \doifnothing,\doifsomething and \doifelsenothing macros just test,
if the variable is empty or not.
A variable can be defined with an empty value (\setvariable[foo][bar=]).
I use this for automatic size calculations. If no default value is
given, then the size is calculated in my macro.


 \setvariable[namespace][key=DefaultValue], right? So how do I test for
 a (Default)Value?

\doifsamestring{\getvariable{foo}{bar}} {your_default_value}
  {equal}%
\doifsamestringelse{\getvariable{foo}{bar}} {your_default_value}
  {equal}
  {unequal}%

probably not the fastest variant. If I remember it right, I had some
problems with \doif comparison (catcodes?).

 Sorry, I'm just beginning TeX programming I don't understand how to do this.

No problem. If it's not in the WIKI, this is the place to ask.


Best, Peter

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

___
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] button for Fullscreen

2007-05-27 Thread Héctor Palacios



Hi context'users

Please, i need  a button for  FullScreen mode.


\but [FullScreen]  Pantalla-completa

but this not works.


Thanks in avance.

--
Héctor
___
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] Ruby version requirements

2007-05-27 Thread Oliver Buerschaper
Hi all,

I'm in the middle of putting together a native Mac OS X edition of  
ConTeXt Minimal ... for this I need to know which version of Ruby is  
minimally required by the latest ConTeXt release. (It wouldn't hurt  
though to know this for older ConTeXt versions, too ;-) Any help  
appreciated.

Thanks,
Oliver
___
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] Ruby version requirements

2007-05-27 Thread Taco Hoekwater
Oliver Buerschaper wrote:
 Hi all,
 
 I'm in the middle of putting together a native Mac OS X edition of  
 ConTeXt Minimal ... for this I need to know which version of Ruby is  
 minimally required by the latest ConTeXt release. (It wouldn't hurt  
 though to know this for older ConTeXt versions, too ;-) Any help  
 appreciated.

At least 1.8, because of a nested def in one of the library files.

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


[NTG-context] Problem with setuphead and textstyle or numberstyle

2007-05-27 Thread Tim Stone
I'm trying out the chapter heading method used in In the Details in  
chapter 7.  I'm using exactly (I think) the code from the booklet  
(except that instead of \BigText and \BigNumber I'm using  
{\definedfont[Sans sa x]}.
The style parameter to \setuphead works but neither textstyle nor  
numberstyle has any effect on the result.
I've included the code I'm using below and would be most grateful to  
know what daft error I've made and can't spot.

Many thanks,
Tim Stone

=Code snippet below 

\setuphead
[chapter]
[placehead=empty,
header=chapter,
style={\definedfont[SansText sa 3]}, %% This is the only one that is  
working - if removed, reverts to normal sized Serif
textstyle={\definedfont[SansText sa 4]}, %% This isn't working - FIX ME
numberstyle={\definedfont[SansText sa 5]}] %% This isn't working -  
FIX ME
\definetext
[chapter]
[header]
[\setups{chapter}]
[]
\startsetups chapter
\setups[chapter:title]
\setups[chapter:number]
\setups[chapter:finish]
\stopsetups
\definelayer
[chapter]
[width=\dimexpr(\makeupwidth+\cutspace),
height=\headerheight]
\startsetups chapter:title
\setlayerframed
[chapter]
[x=\dimexpr(\makeupwidth+\cutspace), location={left,bottom}]
[height=\headerheight,
foregroundcolor=white,
background=color,
backgroundcolor=darkblue,
frame=off,
offset=none,
align={right,lohi}]
{\hbox spread 0.5\cutspace
{\hss
\doiftextelse{\placeheadtext[chapter]}%
{\placeheadtext[chapter]}%
{\placeheadtext[title]}%
\hss} \space
\vskip .5cm}
\stopsetups
\startsetups chapter:number
\setlayerframed
[chapter]
[x=\dimexpr(\makeupwidth+\cutspace),
y=\vsize,
location={left,bottom}]
[width=\dimexpr(\cutspace-\rightmargindistance),
height=\dimexpr(\cutspace-\rightmargindistance),
foregroundcolor=blue,
background=color,
backgroundcolor=yellow,
frame=off,
offset=none,
align={middle,lohi}]
{\hbox to \hsize
{\hss
\doifmode{*bodypart}{
\placeheadnumber[chapter]
}%
\hss}
}
\stopsetups
\startsetups chapter:finish
\framed
[width=\makeupwidth,
height=\headerheight,
background=chapter,
frame=off]
{}
\stopsetups

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