Re: [NTG-context] XML and context

2005-02-23 Thread Hans Hagen
Paul Tremblay wrote:
I've been looking over some articles published on context and XML,
nameely http://www.pragma-ade.com/show-mag-9.htm. 

According to this article, there is a Relax schema for an XML version of
context. The namespace is 'http://www.pragma-ade.com/rlg/foxet.rng'. 

This implies that the Relax schema can only be used if using FO, or? I
was wondering if could directly convert to the XML at the namespace
above and then process the resulting document with context. 

This would be easier than using the mapping method.
there are several ways to process xml with context and the magazine mentioned 
just explores a few of them;

- here i mostly map xml onto context commands using commands like:
\defineXMLenvironment[orderedlist]
  {\startitemize[n,packed]}
  {\startitemize}
\defineXMLenvironment[unorderedlist]
  {\startitemize[packed]}
  {\startitemize}
\defineXMLenvironment[item]
  {\item}
  {\endgraf}
- often we get messy xml, so some clean up is needed on forehand, which we do 
with either xslt or with scripting

- another option is to use foxet and xsl-fo formatted input (texexec --pdf 
--foxet somefile.fo) but (1) foxet is not yet perfect and (2) fo-based 
typesetting is suboptimal)

The mapping variant discussed in the magazine can be seen as a future xml based 
layer around the context tex core; a kind xml based typesetting engine so that 
one can do without tex programming and stick to xml tools (which some prefer)

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] m-letter stationary

2005-02-23 Thread Hans Hagen
Rob Ermers wrote:
Dear Contexers,
I have succeeded in creating letters on my pdf stationary-1. Beautiful.
Now I want to print the second and following pages on paper with on a 
slightly different stationary (stationary-2), as is costumary.

Does anyone how to set this up?
(The example on the wiki is too complicated for me. I sticked to sample 
files from Hans Hagen, which makes it possible to use an xml address 
database.)

The present set up for the background is given below.
Kind regards,
Robert Ermers
\useexternalfigure[achtergrond][stationary-1.pdf][]
\definelayer[achtergrond]
\setupbackgrounds[page][state=repeat,background={achtergrond}]
\setlayer[achtergrond][x=0in,y=0in]{\externalfigure[stationary-1.pdf]}
An option is to use the logo features but since layers are more fun i will 
probably turn that into an optional module some day (is anyone using it?)

put this in cont-new.tex:
\unprotect
\unexpanded\def\flushlayer[#1]%
  {\doifelsevalue{\??ll#1\c!state}\v!next
 {\global\letvalue{\??ll#1\c!state}\v!start} % dangerous, stack-built-up
 {\doifelsevalue{\??ll#1\c!state}\v!continue
{\global\letvalue{\??ll#1\c!state}\v!repeat} % dangerous, stack-built-up
{\doifelsevalue{\??ll#1\c!doublesided}\v!yes
   {\doifundefinedelse{\@@layerbox#1}%
  {\dodoflushlayerA[#1]}
  {\doifbothsidesoverruled
 \dodoflushlayerB\v!left [#1]%  left
   \orsideone
 \dodoflushlayerB\v!right[#1]% right
   \orsidetwo
 \dodoflushlayerB\v!left [#1]%  left
   \od}}
   {\dodoflushlayerA[#1]
\protect
Then you can say:
\definelayer[achtergrond-1][width=\paperwidth,height=\paperheight]
\definelayer[achtergrond-2][width=\paperwidth,height=\paperheight,state=continue]
\setupbackgrounds[page][background={achtergrond-1,achtergrond-2}]
\setlayer[achtergrond-1][preset=lefttop]   {\externalfigure[stationary-1.pdf]}
\setlayer[achtergrond-2][preset=leftbottom]{\externalfigure[stationary-2.pdf]}
\starttext
test \page test \page
test \page test \page
\stoptext
(i added the 'continue' option)
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] new small manual

2005-02-23 Thread Hans Hagen
A small manual on modes (i need a place to discuss system modes -)
http://www.pragma-ade.com/show-man-41.htm
-
  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] Cover: how to make it ?

2005-02-23 Thread VnPenguin
Hi all,
I would like to make a cover for my document (print mode) like the one
of minstall.pdf or mlabels.pdf.
Anyone could give me some examples please.

Thank you in advance,
Q.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: new small manual

2005-02-23 Thread Jojo
Hello Hans,

I got this:

Example Server Report
Wed Feb 23 16:11:52 CET 2005
request http://www.pragma-ade.com/show-man-41.html cannot be honored


Greetings,  

Jojo
2005/02/23

+++ Hans Hagen [23/02/05 12:44 +0100]:
 A small manual on modes (i need a place to discuss system modes -)
 
 http://www.pragma-ade.com/show-man-41.htm
 
 
 -
   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] Re: new small manual

2005-02-23 Thread Adam Lindsay
Jojo said this at Wed, 23 Feb 2005 22:14:45 +0800:

request http://www.pragma-ade.com/show-man-41.html cannot be honored

Just clicking on the link htm worked for me...
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept. [EMAIL PROTECTED]
 Lancaster University, InfoLab21+44(0)1524/510.514
 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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


Re: [NTG-context] Re: new small manual

2005-02-23 Thread Taco Hoekwater


Jojo wrote:
 request http://www.pragma-ade.com/show-man-41.html

! Illegal unit of measure (replaced by htm).
? H
I dddon't go any higher than htm.


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


Re: [NTG-context] Cover: how to make it ?

2005-02-23 Thread Hans Hagen
VnPenguin wrote:
Hi all,
I would like to make a cover for my document (print mode) like the one
of minstall.pdf or mlabels.pdf.
Anyone could give me some examples please.
\setupcolors[state=start]
\startuseMPgraphic{cover}
   StartPage ;
 fill Page withcolor .5green ;
 path p ; p := unitcircle randomized .1 xsized(PaperWidth-1cm) ;
 fill p shifted -center p shifted center Page  withcolor red ;
   StopPage ;
\stopuseMPgraphic
\defineoverlay[cover][\useMPgraphic{cover}]
\starttext
\setupbackgrounds[page][background=cover]
\startstandardmakeup
  \raggedcenter
  \vfill \definedfont[SerifBold at 48pt]\setstrut \strut Penguins in Vietnam
  \blank[2*big] \definedfont[SerifBold at 24pt]\setstrut \strut A Very Short 
Story
  \vfill
\stopstandardmakeup
\setupbackgrounds[page][background=]
\input tufte
\stoptext
an alternative is to use a layer and position text using the layer mechanism
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] Cover: how to make it ?

2005-02-23 Thread VnPenguin
On Wed, 23 Feb 2005 15:55:21 +0100, Hans Hagen [EMAIL PROTECTED] wrote:
 VnPenguin wrote:
  Hi all,
  I would like to make a cover for my document (print mode) like the one
  of minstall.pdf or mlabels.pdf.
  Anyone could give me some examples please.
 
 \setupcolors[state=start]
 
 \startuseMPgraphic{cover}
 StartPage ;
   fill Page withcolor .5green ;
   path p ; p := unitcircle randomized .1 xsized(PaperWidth-1cm) ;
   fill p shifted -center p shifted center Page  withcolor red ;
 StopPage ;
 \stopuseMPgraphic
...

 \input tufte
 
 \stoptext
 
 an alternative is to use a layer and position text using the layer mechanism
 
 Hans
 

Thank you so much Hans !
Q.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: new small manual

2005-02-23 Thread VnPenguin
On Wed, 23 Feb 2005 15:21:20 +0100, Taco Hoekwater [EMAIL PROTECTED] wrote:
 
 
 Jojo wrote:
  request http://www.pragma-ade.com/show-man-41.html

http://www.pragma-ade.com/show-man-41.htm (not html)

works for me :)
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] XML and context

2005-02-23 Thread Paul Tremblay
On Wed, Feb 23, 2005 at 09:33:40AM +0100, Hans Hagen wrote:
 
 The mapping variant discussed in the magazine can be seen as a future xml 
 based layer around the context tex core; a kind xml based typesetting 
 engine so that one can do without tex programming and stick to xml tools 
 (which some prefer)
 
 Hans
 

But my unerstanding is that the mapping technique does not take care of
white space. So if I have:

pSome paragrah in XmL

with 

space
/p

This could get converted as:

Some paragrah in XmL

with 

space
\par

Which would produce 3 paragrahs.

There is actually a nice small tool TeXML (at sourceforge) that takes
care of this problem. It allows you to use an XML to issue TeX commands,
and then converts those commands into TeX (or LaTeX or ConText). It
takes care of white space.

I am one of those people who likes to stick to XML tools, who likes to
convert a tree to a tree. I was wondering the best way to do this. It
seems that using TeXML is the best way. I just wanted to make sure there
was not a more direct way in ConTeXt.

Thanks

Paul


-- 


*Paul Tremblay *
[EMAIL PROTECTED]*

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


Re: [NTG-context] XML and context

2005-02-23 Thread luigi.scarso
Paul Tremblay wrote:
But my unerstanding is that the mapping technique does not take care of
white space. So if I have:
pSome paragrah in XmL
with 

space
/p
This could get converted as:
Some paragrah in XmL
with 

space
\par
Which would produce 3 paragrahs.
 

I remember DocBook In Context customization in 2002
I still think that XML (but not XSL formatting object ) better
describe structure rather than presentation
(ConTexT it useful for structure AND presentation).
For example,spaces inside a xml are dangerous: how can I transform them ?
Do I use  a newline, a kern ,  a skip with glue, a space '\ ', a space ' 
',  a \blank... ?
With what amount ?

I still think that (xml structure / TeX presentation)
is better than (xml structure / xml presentation);
TeX is a typographical programming language, maybe not so easy,
but ConTeXt is  an excellent  high-level layer: XML is not a programming 
language, and has not any typographics issues (XSL FO apart: but I 
consider it not so good as TeX).

By the way, I still think that for stickers (a relative simple 
tipographical document) an xml layer is really useful and I moving into 
this directions for my future works;
but just typesetting a simple book with (xml structure / xml presentation)
seem to me an unnecessary complication.

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


Re: [NTG-context] XML and context

2005-02-23 Thread Adam Lindsay
luigi.scarso said this at Wed, 23 Feb 2005 19:53:01 +0100:

Some paragrah in XmL

with 

space
\par

Which would produce 3 paragrahs.

I remember DocBook In Context customization in 2002

Indeed. And since this the whitespace processing is with an XSLT
transform, you can notionally keep such processing within the ConTeXt
`family':
   http://www.leverkruid.nl/context/#whitespace
...by \applyXSLTscript commands and the like!

No sense in being purist about these things... If a bit of XSLT is the
right tool for the job, may as well use that!
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept. [EMAIL PROTECTED]
 Lancaster University, InfoLab21+44(0)1524/510.514
 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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


Re: [NTG-context] XML and context

2005-02-23 Thread Paul Tremblay
On Wed, Feb 23, 2005 at 10:18:59PM +, Adam Lindsay wrote:
http://www.leverkruid.nl/context/#whitespace
 ...by \applyXSLTscript commands and the like!
 

That assumes you are using xalan as your xslt processor. I use xsltproc.
In general, stripping white space in XML is nearly impossible with xslt.
That is why the utility TeXML uses SAX to do so. 

 No sense in being purist about these things... If a bit of XSLT is the
 right tool for the job, may as well use that!
 -- 

Well, since I'm conerting from TEI, I do need a bit of XSLT! 

Thanks

Paul

-- 


*Paul Tremblay *
[EMAIL PROTECTED]*

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


Re: [NTG-context] arabtex support

2005-02-23 Thread mohd zamri murah
testing and result.

== test.tex 
\input font-arb % the new font-arb you send me
\starttext

\setarab
\novocalize % normal arab document doesn't have the vocal signs.

Some texts in arab. some random thought. here are some arabic words.
\bwkw pndwAn. Below some arabic word with english word. We can
combine them in one paragraph. % \.. will produce line beyond the
margin. use for short arabic only.

\startarabic

  kAjyn ayn mmr.hAl sAtw prwtwtA'yp awntwq mnjAnkn dwkwmn jAwy dry
  dwkwmn rwmy some english words . ay mggwnAkn kwnsyp pgatwrcArA'n
brAsAskn kwmpwnwn . ay mggwnAkn kwnsyp pgatwrcArA'n brAsAskn kwmpwnwn.

\stoparabic

\stoptext

===
1) it fail with log;

mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; 
mag:=1; nonstopmode;
input ArabicItalic
This is METAFONT, Version 2.71828 (Web2C 7.5.3)
kpathsea: Running mktexmf ArabicItalic

! I can't find file ArabicItalic'.

solution;
 add these to font-arb.tex near line 213.

\definefontsynonym [ArabicItalic][xnsh14]

% nash14 doesn't have italic. the error probably at line 43.

\font\arbfont=\truefontname{Arabic#1} at \currentfontscale\scratchdimen

2) the body text in english such as some text ... appear in \em.
 solution: add these to top of file test.tex.

\usetypescript[postscript]
\switchtotypescript[postscript]

3) the symbol | and ~ is broken in arabic mode.

code \kw|pm have error; 

! Illegal arabic command: |.
[EMAIL PROTECTED] ...age {Illegal arabic command: \nxp #1}
  \a@@cmd = [EMAIL PROTECTED] 
#1\ar...
argument kw|
  pm
[EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] #1
   \end \box [EMAIL PROTECTED] 
\egroup 
[EMAIL PROTECTED] ...b {#1}\fi \ifarab [EMAIL PROTECTED] {#1}
   \fi \iftrans [EMAIL 
PROTECTED]
l.25 \kw|pm


the | is needed to break some arabic ligature. the ~ is needed to
code a few arabic/jawi glyph. any idea how to proceed?

zamri 

On Wed, 23 Feb 2005 09:27:53 +0100, Hans Hagen [EMAIL PROTECTED] wrote:
 mohd zamri murah wrote:
 
  1) I rename font-arb.tex to m-arabtex.tex and \usemodule[arabtex]. it
  works. ( as to why it works and was it OK to do it, I cannot explain )
 
 I wonder too since you exceed the 8 char limit of module names (i will remove
 trat restriction in the next version of context); so i tested your file with
 
 % \input m-arabtex
 \input font-arb
 
  2) need to add at top of document , ( probably any font definition )
  font-arb.tex did mention something about font macro.
  \usetypescript[postscript]
  \switchtotypeface[postscript]
 
  if you did not, the body text will appear in \em .
 
 making it a module will get around this font switch (originally it was thought
 that arabtex would be used for arab docs, but it's also used for mixed docs, 
 so
 a module more in sync with greek and chinese
 
  3) there is some spurious arabic text, align left. I believe there is
  bug in \startarabic ... \stoparabic code.
 
 i'll send you another version (i can't read arab so i dunny what is spurious 
 or
 not)
 
  can Hans look over font-arb.tex, see if there need  some
  updating/changes. It was written way back in 1999. can font-arb be
  turn into a module?
 
 sure
 
 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