ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* CSS-like coding style
       [not found] <mailman.1264.1171692908.17432.ntg-context@ntg.nl>
@ 2007-02-17 16:08 ` Vyatcheslav Yatskovsky
  2007-02-17 16:42   ` Taco Hoekwater
                     ` (2 more replies)
  2007-02-17 22:26 ` replacing symbols Vyatcheslav Yatskovsky
  1 sibling, 3 replies; 7+ messages in thread
From: Vyatcheslav Yatskovsky @ 2007-02-17 16:08 UTC (permalink / raw)
  To: ntg-context-request@ntg.nl


[-- Attachment #1.1: Type: text/plain, Size: 535 bytes --]

Hello,
I'm puzzled with an odd thing. If I try to adopt CSS-like coding style, 

\setuptyping[
	before={
	\blank[2*big]
	\setupinterlinespace[line=1ex]
	},
	after={}
]
\setuppagenumbering[
	location=bottom
] 

works perfectly. But

\setuplayout[
	topspace=0cm, 
	bottomspace=2cm, 
	rightmargin=2cm,
	width=fit, 
	height=fit
]

fails and accepts only

\setuplayout[
	topspace=0cm, 
	bottomspace=2cm, 
	rightmargin=2cm,
	width=fit, 
	height=fit]

What is the rule behind this? :(

Best,
Vyatcheslav
 

[-- Attachment #1.2: Type: text/html, Size: 3298 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

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

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

* Re: CSS-like coding style
  2007-02-17 16:08 ` CSS-like coding style Vyatcheslav Yatskovsky
@ 2007-02-17 16:42   ` Taco Hoekwater
  2007-02-17 18:47   ` Peter Münster
  2007-02-17 18:55   ` Aditya Mahajan
  2 siblings, 0 replies; 7+ messages in thread
From: Taco Hoekwater @ 2007-02-17 16:42 UTC (permalink / raw)
  To: Yatskovsky, mailing list for ConTeXt users

Vyatcheslav Yatskovsky wrote:
> Hello,
> I'm puzzled with an odd thing. If I try to adopt CSS-like coding style, 

A rather short answer is possible: Don't do that :-)

Seriously: if it works, it is by conincidence only. I will note even
explain you the (current) rules,  because they may change tomorrow.

Always make sure that there is no whitespace surrounding your values,
nor whitespace trailing a key. Whitespace *before* a key is ignored,
but that is the only documented case where whitespace is irrelevant.

The inverse is also true, btw. If you actually need a space preceding
or trailing a value, you have to wrap the entire requested item in
a set of curly braces. There is no guarantee that the space will be
retained otherwise.

Cheers,
Taco

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

* Re: CSS-like coding style
  2007-02-17 16:08 ` CSS-like coding style Vyatcheslav Yatskovsky
  2007-02-17 16:42   ` Taco Hoekwater
@ 2007-02-17 18:47   ` Peter Münster
  2007-02-19  9:26     ` Hans Hagen
  2007-02-17 18:55   ` Aditya Mahajan
  2 siblings, 1 reply; 7+ messages in thread
From: Peter Münster @ 2007-02-17 18:47 UTC (permalink / raw)
  To: Yatskovsky, mailing list for ConTeXt users

On Sat, 17 Feb 2007, Vyatcheslav Yatskovsky wrote:

> \setuplayout[
> 	topspace=0cm, 
> 	bottomspace=2cm, 
> 	rightmargin=2cm,
> 	width=fit, 
> 	height=fit
> ]
> 
> fails

Hello,
you can use the %-sign:

\setuplayout[
	topspace=0cm, 
	bottomspace=2cm, 
	rightmargin=2cm,
	width=fit, 
	height=fit%
]

Cheers, Peter

-- 
http://pmrb.free.fr/contact/

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

* Re: CSS-like coding style
  2007-02-17 16:08 ` CSS-like coding style Vyatcheslav Yatskovsky
  2007-02-17 16:42   ` Taco Hoekwater
  2007-02-17 18:47   ` Peter Münster
@ 2007-02-17 18:55   ` Aditya Mahajan
  2007-02-19  9:28     ` Hans Hagen
  2 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2007-02-17 18:55 UTC (permalink / raw)
  To: Yatskovsky, mailing list for ConTeXt users

On Sat, 17 Feb 2007, Vyatcheslav Yatskovsky wrote:

> Hello,
> I'm puzzled with an odd thing. If I try to adopt CSS-like coding style,
>
> \setuptyping[
> 	before={
> 	\blank[2*big]
> 	\setupinterlinespace[line=1ex]
> 	},
> 	after={}
> ]

> \setuppagenumbering[
> 	location=bottom
> ]

I am not sure this will work. Maybe, since footer is the default, it 
is hard to notice the difference between footer and bottom.


> works perfectly. But
>
> \setuplayout[
> 	topspace=0cm,
> 	bottomspace=2cm,
> 	rightmargin=2cm,
> 	width=fit,
> 	height=fit
> ]
>
> fails and accepts only
>
> \setuplayout[
> 	topspace=0cm,
> 	bottomspace=2cm,
> 	rightmargin=2cm,
> 	width=fit,
> 	height=fit]
>
> What is the rule behind this? :(

The general rule of thumb, add a comma at the end of all your values,

so

\setuplayout[
   ....
   height=fit,
]

will work perfectly.

Aditya

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

* replacing symbols
       [not found] <mailman.1264.1171692908.17432.ntg-context@ntg.nl>
  2007-02-17 16:08 ` CSS-like coding style Vyatcheslav Yatskovsky
@ 2007-02-17 22:26 ` Vyatcheslav Yatskovsky
  1 sibling, 0 replies; 7+ messages in thread
From: Vyatcheslav Yatskovsky @ 2007-02-17 22:26 UTC (permalink / raw)
  To: ntg-context-request@ntg.nl

Hi,

Let me restate my question. If I get some text from an XML file using \XMLflush, is there a command in PLAIN TeX to replace some symbols (say, “&“ -> \letterampersand), on-a-fly without invoking perl, ruby, or lisp or ...? Why is there need in external script to do such an easy thing?

And what I have to do to use Lua scripts, if possible?

Cheers,
Vyatcheslav

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

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

* Re: CSS-like coding style
  2007-02-17 18:47   ` Peter Münster
@ 2007-02-19  9:26     ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2007-02-19  9:26 UTC (permalink / raw)
  To: ntg-context; +Cc: Yatskovsky

� wrote:
> On Sat, 17 Feb 2007, Vyatcheslav Yatskovsky wrote:
>
>   
>> \setuplayout[
>> 	topspace=0cm, 
>> 	bottomspace=2cm, 
>> 	rightmargin=2cm,
>> 	width=fit, 
>> 	height=fit
>> ]
>>
>> fails
>>     
>
> Hello,
> you can use the %-sign:
>
> \setuplayout[
> 	topspace=0cm, 
> 	bottomspace=2cm, 
> 	rightmargin=2cm,
> 	width=fit, 
> 	height=fit%
> ]
>   
or just add a comma afterthe last fit 


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

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

* Re: CSS-like coding style
  2007-02-17 18:55   ` Aditya Mahajan
@ 2007-02-19  9:28     ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2007-02-19  9:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Yatskovsky

Aditya Mahajan wrote:
> On Sat, 17 Feb 2007, Vyatcheslav Yatskovsky wrote:
>
>   
>> Hello,
>> I'm puzzled with an odd thing. If I try to adopt CSS-like coding style,
>>
>> \setuptyping[
>> 	before={
>> 	\blank[2*big]
>> 	\setupinterlinespace[line=1ex]
>> 	},
>> 	after={}
>> ]
>>     
>
>   
>> \setuppagenumbering[
>> 	location=bottom
>> ]
>>     
>
> I am not sure this will work. Maybe, since footer is the default, it 
> is hard to notice the difference between footer and bottom.
>
>
>   
>> works perfectly. But
>>
>> \setuplayout[
>> 	topspace=0cm,
>> 	bottomspace=2cm,
>> 	rightmargin=2cm,
>> 	width=fit,
>> 	height=fit
>> ]
>>
>> fails and accepts only
>>
>> \setuplayout[
>> 	topspace=0cm,
>> 	bottomspace=2cm,
>> 	rightmargin=2cm,
>> 	width=fit,
>> 	height=fit]
>>
>> What is the rule behind this? :(
>>     
>
> The general rule of thumb, add a comma at the end of all your values,
>
> so
>
> \setuplayout[
>    ....
>    height=fit,
> ]
>
> will work perfectly.
>   
\startsetups mine 

all kind of code 

\stopsetups 

\setups[mine]

also works ok, since in setups mode, spaces are ignores (so when needed, use \space) 

\startsetups footer
	pagenumber: \pagenumber
	\quad
	Okay
\stopsetups

\setupfootertexts[\setups{footer}]

\doifelse {whatever} {value} { 
	...
} { 
	...
} 

also works out ok in setups (no funny spaces) 

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

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

end of thread, other threads:[~2007-02-19  9:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1264.1171692908.17432.ntg-context@ntg.nl>
2007-02-17 16:08 ` CSS-like coding style Vyatcheslav Yatskovsky
2007-02-17 16:42   ` Taco Hoekwater
2007-02-17 18:47   ` Peter Münster
2007-02-19  9:26     ` Hans Hagen
2007-02-17 18:55   ` Aditya Mahajan
2007-02-19  9:28     ` Hans Hagen
2007-02-17 22:26 ` replacing symbols Vyatcheslav Yatskovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).