Re: [NTG-context] Strange expansion behavior in XML/luatex

2010-06-01 Thread Martin Kolařík

I see,

and for the single case it works. Also saving is fine, I am using it. 
Unfortunately, my example was too reduced :-). In fact, I have a problem 
with more complex documents, for example, think about:


section
captionSome inline what=something caption/caption
textpText./p/text
/section

Now, if I want not to only typeset a caption, but also to store it and 
reuse it later (typeset it twice, e.g. in the marging or elsewhere in 
the page, ...), it fails (on \processaction, \doif, ...).


So, if I understand, there is a way to modify my XML template to be safe 
during expanding -- I would use self unexpandable macros). Another way 
is problematic, as \edef inside \edef causes problems? Is it true or 
there is some other way?


Thank you,

Martin

Dne 1.6.2010 0:10, Hans Hagen napsal(a):

On 29-5-2010 12:01, Martin Kolařík wrote:


I do not know, if it is a bug or a feature :-); but notwithstanding the
fact, similar code I used in MkII worked very well.


effectively you as for:

\starttext
\edef\content{\processaction[x][something=A thing, nothing=Hic 
sunt leones]}

\stoptext

and that will not work; ok, we could make processaction unexpandable 
but i'm sure that you want something different


you can save the content this way:

\edef\content{#1}

and do this later on:

\xmlflush{\content}

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] Strange expansion behavior in XML/luatex

2010-06-01 Thread Martin Kolařík
I the case probably yes. Now I have new info how to continue with my 
MkII--MkIV conversion, so I will do. I prefer to keep the XML schema 
and the style as clean and simple as possible, but this does not 
necessarily mean that the typesetting code itself will be clean and 
simple too :-),


Thanks for now; I will ask you, if I do not succeed :-),

Martin

Dne 1.6.2010 9:51, Hans Hagen napsal(a):

On 1-6-2010 9:03, Martin Kolařík wrote:

I see,

and for the single case it works. Also saving is fine, I am using it.
Unfortunately, my example was too reduced :-). In fact, I have a problem
with more complex documents, for example, think about:

section
captionSome inline what=something caption/caption
textpText./p/text
/section

Now, if I want not to only typeset a caption, but also to store it and
reuse it later (typeset it twice, e.g. in the marging or elsewhere in
the page, ...), it fails (on \processaction, \doif, ...).


can't you just filter the caption then? in principle you can access 
each element everywhere


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


[NTG-context] Strange expansion behavior in XML/luatex

2010-05-29 Thread Martin Kolařík

Hello,

I had a problem with some my documents; I extracted it to as small code 
as possible. What is happening -- if any of xml flushing function (I 
tried xmlflush, xmlfilter and xmlall) is expanded to a macro (so the 
content of xml becomes a text of the macro), and the xml contains other 
hooked xml tags, the \edef (and its counterparts \xdef or 
\expandedaction) inside the inner tag is skipped by the log. Then 
macros relying on the expansion fail (I detected it in \doif and 
\processaction). Macros are normally expanded, only \edef fails (maybe 
some other TeX commands fail too, but I did not test it).


In my example below, content of il is flushed to a macro, inline is 
the inner tag and \processaction is the example of macro using 
\edef. Do not look for sense, it is an example.


XML:
?xml version=1.0 encoding=utf-8?
il
  Text inline what=something / text.
/il

TeX:
\startxmlsetups doc:inline
  \processaction
[\xmlatt{#1}{what}]
[something=A thing,
   nothing=Hic sunt leones]
\stopxmlsetups

\startxmlsetups doc:il
  \edef\content{\xmlflush{#1}}%
\stopxmlsetups

\xmlregistersetup{xml:doc}

\startxmlsetups xml:doc
  \xmlsetsetup{\xmldocument}{inline|il}{doc:*}
\stopxmlsetups

I do not know, if it is a bug or a feature :-); but notwithstanding the 
fact, similar code I used in MkII worked very well.


Thanks for hints,

Martin

--
Martin Kolařík

martin.kola...@email.cz
martin.kola...@jabber.cz
+420603535593

___
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] MkIV, XML and raw TeX input

2010-05-28 Thread Martin Kolařík

Hello,

I have found a problem when switching from MkII to MkIV -- I am using a 
XML containing raw TeX (a temporary solution for math, which lasts for 
four years now) and now, in MkIV, I did not succeed to adopt TeX anyhow. 
The math is typeset in math style, but obviously characters read from 
XML have improper catcode set. I tried some tricks with \scantokens, but 
nothing helped.


Here is my XML (the element is root):

?xml version=1.0 encoding=utf-8?
mathtex\int_0^\pi {sin x\over x} gt; 0/mathtex

And here is my ConTeXt environment file (I am using version 2010.05.24 
13:05):


\startxmlsetups doc:mathtex
  $\xmlflush{#1}$
\stopxmlsetups

\xmlregistersetup{xml:doc}

\startxmlsetups xml:doc
  \xmlsetsetup{\xmldocument}{mathtex}{doc:*}
\stopxmlsetups

Any hint?

Thank you,

mk

--
Martin Kolařík

martin.kola...@email.cz
martin.kola...@jabber.cz
+420603535593

___
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] MkIV, XML and raw TeX input

2010-05-28 Thread Martin Kolařík

Perfect!

Thanks very much,

mk

Dne 28.5.2010 17:38, Wolfgang Schuster napsal(a):

Am 28.05.10 15:38, schrieb Martin Kolařík:

Hello,

I have found a problem when switching from MkII to MkIV -- I am using 
a XML containing raw TeX (a temporary solution for math, which lasts 
for four years now) and now, in MkIV, I did not succeed to adopt TeX 
anyhow. The math is typeset in math style, but obviously characters 
read from XML have improper catcode set. I tried some tricks with 
\scantokens, but nothing helped.


Here is my XML (the element is root):

?xml version=1.0 encoding=utf-8?
mathtex\int_0^\pi {sin x\over x} gt; 0/mathtex

And here is my ConTeXt environment file (I am using version 
2010.05.24 13:05):


\startxmlsetups doc:mathtex
  $\xmlflush{#1}$
\stopxmlsetups


\startxmlsetups doc:mathtex
\startmathmode
\xmlflushcontext{#1}
\stopmathmode
\stopxmlsetups

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] Problem with encoding, XML and writetolist...

2006-04-06 Thread Martin Kolařík
Hi Hans and Vit,

I've attached pdf and tex made with texexec 8bit.tex using the last beta 
(with cp1250 regime). The version chapterB is what I am using now, chapterA 
version is straightforward but not functional.

From this my ideas from last mail came -- when I am expanding \XMLflush 
exactly and controlled, result is OK (the expansion stops before active 
characters start to expand.

IMHO, the solution on character level is something different (although it works 
:-); yes, I did not study Vit's problems from year before. I never had a 
problems with simple TeX (\chapter{čřžý}), only with XML :-), so for me it 
would be sufficient solve XML level. Of course, if it is stuff of other level, 
it cannot be solved in XML.

Thanks, Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Hans Hagen
Sent: Wednesday, April 05, 2006 1:03 PM
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] Problem with encoding, XML and writetolist...


Vit Zyka wrote:
 Martin Kolařík wrote:
   
 Hi Hans,

 I've analyzed the situation using different combinations of regimes and 
 encodings, including switching off handling (\donothandleactivecharacter) 
 and it seems to me, that every text with chars  127, which is fully 
 expanded (as in 8bit.tex), must cause difficulties, because TOC entry read 
 back from TUO is scanned independently and thus spaces are gobbled.
 

 Hi Martin,

 we have discussed this problem a year ago. In that time I solve it just 
 writing '{}' in each title where was needed, like

\chapter{Dobré{} ráno}

 Now I have cooked an automatic solution. It is not optimal (effective) 
 but working. The only needs is to redefine

\def\numcharacter#1{\char#1{}}
\let\dochar\numcharacter

 and to load appropriate encoding file once more. Since it is banned a 
 new macro \reuseencoding was introduce:

 For Hans:
 It would be nice if this feature was enabled in a standard distro. 
 Perhaps you will find some more optimal solution...

 ---
 \unprotected
 \def\doreuseencoding#1%
{\letvalue{\c!file\f!encodingprefix#1}\empty
 \makeshortfilename[\f!encodingprefix#1]%
 \startreadingfile
 \readsysfile\shortfilename
   {\showmessage\m!encodings2{#1}}
   {\showmessage\m!encodings3{#1}}%
 \stopreadingfile}
 \def\reuseencoding[#1]%
{\processcommalist[#1]\doreuseencoding}


 \def\numcharacter#1{\char#1{}}
 \let\dochar\numcharacter

 \reuseencoding[ec]

 \enableregime[latin2]

 \starttext
 \writetolist[chapter]{1}{Dobré ráno}
 \expanded{\writetolist[chapter]{2}{Dobré odpoledne}}

 \placecontent
 \stoptext
   
the {} may break liguature building (and maybe kerning) ... taco knows ...

I got a brainwave ... 

\enableregime[latin2]

\starttext

\def\numcharacter#1{\rawcharacter{#1}}%
\let\dochar\numcharacter

\writetolist[chapter]{1}{Dobré ráno}

\expanded{\writetolist[chapter]{2}{Dobré odpoledne}}

\placelist[chapter][criterium=text]

test

\typefile{test.tuo}

\stoptext

this can be sped up (a bit) with 

% \dostepwiserecurse{0}{255}{1}
%   {\setevalue{rchr:\recurselevel}{\rawcharacter\recurselevel}}

% \def\rawcharacter#1{\getvalue{rchr:#1}}

this means that all chars are round tripped to themselves in output files! 

raw characters are not active and they are therefore equivalent to \char  

it's enough then to put 

\def\numcharacter#1{\rawcharacter{#1}}%
\let\dochar\numcharacter

into cont-new.tex 

(i will discuss this in more detail with taco later) 

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


8bit.pdf
Description: Adobe PDF document


8bit.tex
Description: Binary data
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Problem with encoding, XML and writetolist...

2006-04-05 Thread Martin Kolařík
Hi Hans,

I've analyzed the situation using different combinations of regimes and 
encodings, including switching off handling (\donothandleactivecharacter) and 
it seems to me, that every text with chars  127, which is fully expanded (as 
in 8bit.tex), must cause difficulties, because TOC entry read back from TUO is 
scanned independently and thus spaces are gobbled.

Now I have solved it using not-stable solution -- I am using triple sequence of 
\expandafter to expand \XMLflush after \chapter instead \expanded. The solution 
is not stable as it is ConTeXt implementation dependent.

On the other side, now I do not know, how to partially expand code 
\chaper{\XMLflush{XMLTag}} to obtain sequence of simple unexpanded chars. 
Simple \expandafter is not sufficient, more \expandafters is dirty trick and 
full expansion (\expanded) leads to TOC entry problem. In TeX source this 
cannot occur (or can occur in strange situations :-), in XML source this is 
almost rule.

Maybe it would be useful to have in XML engine macro, which expands XMLdata 
exactly to get read (original) content (like mine triple \expandafter). Maybe 
such macro already exists and I am a real fool :-)

Thank you for help, have a nice day,

Martin

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Behalf Of Hans Hagen
 Sent: Monday, April 03, 2006 11:57 AM
 To: [EMAIL PROTECTED]; mailing list for ConTeXt users
 Subject: Re: [NTG-context] Problem with encoding, XML and writetolist...
 
 
 Martin Kolařík wrote:
  Aha, here maybe will be the solution :-)
 
  I'am using standalone Win32 distribution from Pragma and I'm 
 running texexec with --translate=cp1252cs. Typescripts use il2, 
 which corresponds to fonts, of course. If I run the code without 
 XML (if I transcribe XML to \chapter etc.) I get toc entry correctly too.
 
  Where should I look for more? What is natural.ctx?

 this is a one-to-one translation vector, and the one standard 
 used by context; forget about all those other mappings, they can 
 be done using regimes; you can use an il2 input regime, and any 
 (resonable) font encoding, 
 
 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] Problem with encoding, XML and writetolist...

2006-04-05 Thread Martin Kolařík
Hi Hans,

I've analyzed the situation using different combinations of regimes and 
encodings, including switching off handling (\donothandleactivecharacter) and 
it seems to me, that every text with chars  127, which is fully expanded (as 
in 8bit.tex), must cause difficulties, because TOC entry read back from TUO is 
scanned independently and thus spaces are gobbled.

Now I have solved it using not-stable solution -- I am using triple sequence of 
\expandafter to expand \XMLflush after \chapter instead \expanded. The solution 
is not stable as it is ConTeXt implementation dependent.

On the other side, now I do not know, how to partially expand code 
\chaper{\XMLflush{XMLTag}} to obtain sequence of simple unexpanded chars. 
Simple \expandafter is not sufficient, more \expandafters is dirty trick and 
full expansion (\expanded) leads to TOC entry problem. In TeX source this 
cannot occur (or can occur in strange situations :-), in XML source this is 
almost rule.

Maybe it would be useful to have in XML engine macro, which expands XMLdata 
exactly to get read (original) content (like mine triple \expandafter). Maybe 
such macro already exists and I am a real fool :-)

Thank you for help, have a nice day,

Martin

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Behalf Of Hans Hagen
 Sent: Monday, April 03, 2006 11:57 AM
 To: [EMAIL PROTECTED]; mailing list for ConTeXt users
 Subject: Re: [NTG-context] Problem with encoding, XML and writetolist...
 
 
 Martin Kolařík wrote:
  Aha, here maybe will be the solution :-)
 
  I'am using standalone Win32 distribution from Pragma and I'm 
 running texexec with --translate=cp1252cs. Typescripts use il2, 
 which corresponds to fonts, of course. If I run the code without 
 XML (if I transcribe XML to \chapter etc.) I get toc entry correctly too.
 
  Where should I look for more? What is natural.ctx?

 this is a one-to-one translation vector, and the one standard 
 used by context; forget about all those other mappings, they can 
 be done using regimes; you can use an il2 input regime, and any 
 (resonable) font encoding, 
 
 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] Problem with encoding, XML and writetolist...

2006-04-03 Thread Martin Kolařík
Hi Hans,

the test file is attached,

thanks,

Martin

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Behalf Of Hans Hagen
 Sent: Friday, March 31, 2006 7:01 PM
 To: [EMAIL PROTECTED]; mailing list for ConTeXt users
 Subject: Re: [NTG-context] Problem with encoding, XML and writetolist...


 Martin Kolařík wrote:
  Hi Hans,
 
  isn't there some news with the stuff?
 
 small test file needed to refresh my memory

 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] Problem with encoding, XML and writetolist...

2006-04-03 Thread Martin Kolařík
Aha, here maybe will be the solution :-)

I'am using standalone Win32 distribution from Pragma and I'm running texexec 
with --translate=cp1252cs. Typescripts use il2, which corresponds to fonts, of 
course. If I run the code without XML (if I transcribe XML to \chapter etc.) I 
get toc entry correctly too.

Where should I look for more? What is natural.ctx?

Thank you,

Martin


-Original Message-
From: Hans Hagen [mailto:[EMAIL PROTECTED]
Sent: Monday, April 03, 2006 10:36 AM
To: [EMAIL PROTECTED]; mailing list for ConTeXt users
Subject: Re: [NTG-context] Problem with encoding, XML and writetolist...


Martin Kolařík wrote:
 Hi Hans,

 the test file is attached,
   
what input encoding is used here? 

i get the same chapter title as toc entry 

is your tex configured for 8 bit (natural.ctx) 

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] Problem with encoding, XML and writetolist...

2006-04-03 Thread Martin Kolařík
Thanks Vit, your solution perfectly works (I tried it :-); but not for me -- in 
my case (and in another mine cases too) I use XML code, which remaps some 
pieces to \chapter. And during the expansion accented characters are replaced 
with \char xxx, this is written to tui/tuo file and read back without spaces 
-- the spaces are gobbled by TeX's number syntactic rule...

But, Hans, when I added \mainlanguage[cz] before \enableregime[windows] in 
8bit.tex and run texexec with --translate=cp1250cs, I got:

! Illegal parameter number in definition of \@@expanded.
to be read again
   \crcr
\oalign [EMAIL PROTECTED] \lineskip .25ex\ialign {##\crcr
  #1\crcr }}
\encircled ...\tx #1}}\hfil \crcr \mathhexbox 20D}
  }
\XML:dat:title -Ä
  luŁouŔcÝ koný ˙pÝ
\expanded ...\long \xdef \@@expanded {\noexpand #1
  }\@@expanded
l.3 /chapter

Thank you,

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Vit Zyka
Sent: Monday, April 03, 2006 1:18 PM
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] Problem with encoding, XML and writetolist...


Hans Hagen wrote:
 Martin Kolařík wrote:
 
Aha, here maybe will be the solution :-)

I'am using standalone Win32 distribution from Pragma and I'm running texexec 
with --translate=cp1252cs. Typescripts use il2, which corresponds to fonts, 
of course. If I run the code without XML (if I transcribe XML to \chapter 
etc.) I get toc entry correctly too.

Where should I look for more? What is natural.ctx?
  
 
 this is a one-to-one translation vector, and the one standard used by 
 context; forget about all those other mappings, they can be done using 
 regimes; you can use an il2 input regime, and any (resonable) font encoding, 
 
  Hans

specifically for you:

\mainlanguage[cz]
\enableregime[windows] % or \enableregime[latin2] for il2

is enough for Latin Modern and Czech.

Vit

___
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] Problem with encoding, XML and writetolist...

2006-04-03 Thread Martin Kolařík
Thanks Mojca, I downloaded your regime file; now I will not need write it
myself :-)

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Mojca Miklavec
Sent: Monday, April 03, 2006 2:33 PM
To: [EMAIL PROTECTED]; mailing list for ConTeXt users; Hans Hagen
Subject: Re: [NTG-context] Problem with encoding, XML and writetolist...


On 4/3/06, Martin Kolařík wrote:

 which is not good. And I am not able, when not using cp1250.tcx, recode
win1250 (default for win) to latin2. There I am able to write regime for
myself (cp1250), but I suppose, that whenever characters will not expand to
\char XXX form, cp1250.tcx still will be working and usable.

Hans, I would guess that more than 50% of Slavic Windows users (ie.
Slovenian, Croatian, Chech, Slovak, ...) use the cp1250 encoding
(including me). Would it be possible to add at least this file
http://pub.mojca.org/tex/enco/contextbase/regi-cp1250.tex to the
default ConTeXt distribution? (with synonyms windows-1250 and
cp1250).

This has probably nothing to do with the problem described here, but I
believe that many users would appreciate to have that encoding
(called regime in ConTeXt) available.

 when I added \mainlanguage[cz] before \enableregime[windows] in 8bit.tex
and run
 texexec with --translate=cp1250cs, I got:

\enableregime[windows] is cp1252 (Western European Windows) not cp1250
(Central European Windows), --translate=cp1250cs is cp1250 (supposing
that you don't use \enableregime[windows], but the default one):
everything will be mixed up if you use both simultaneously.

If you download the file mentioned above (place it into the current
directory or somewhere in the TeX tree and refresh the filename
database) or if Hans adds it to the distribution, you can use
\input regi-cp1250
\enableregime[cp1250]

This probably won't solve your problem with missing spaces (didn't try
it), but you'll have the proper encoding.

Mojca
___
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] Problem with encoding, XML and writetolist...

2006-04-03 Thread Martin Kolařík
OK, expansion is not encoding, but expansion in this place here is not a
problem (I suppose). The section head is good, but the TOC entry not. So the
inner expansion (or conversion or detokenization or so) around writetolist
is probably affected by something, what now I cannot handle.

And what is strange -- Hans did not reproduce the behaviour (as he wrote),
so I am asking a trying to find the problem on my side (or lucky thougth
:-)...

Thank for your ideas and help,

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Mojca Miklavec
Sent: Monday, April 03, 2006 4:25 PM
To: [EMAIL PROTECTED]; mailing list for ConTeXt users
Subject: Re: [NTG-context] Problem with encoding, XML and writetolist...


On 2/28/06, Martin Kolařík wrote:
 Hi all,

 I have problem with chars encoding now; I have updated ConTeXt sometimes
in
 January; before the time I was using old (year) version. In this
 prehistorical version the problem was not present.

 What is the stuff? The following code generates content with titles
without
 spaces -- accented characters are replaced with \char XXX variant, so
during
 reading TUI line TeX gobbles a space after XXX as a part of number
syntax
 rule.

 Can I do something? With encoding? With XML?

Encoding has nothing to do with it. I don't really understand the
\[un]expanded commands in TeX, but this part could theoretically be
problematic:
 {\expanded
{\section{\XMLflush{title

Consider the following (encoding-independent) minimal example, just in
case that this can help any of the gurus to understand the problem:

\defineXMLenvironment
 [chapter]
 {\defineXMLsave[title]}
 {\expanded
{\section{\XMLflush{title

\starttext
\startbuffer
chapter
 title$a+b$/title
/chapter
\stopbuffer

\processXMLbuffer
\placecontent[criterium=all]
\stoptext

The entry in TOC is different from the title (one is in math mode and
the other one writen with dollars - literally).

Mojca


 Thank you very much, have a nice day, Martin

 Code:

 \defineXMLenvironment
   [chapter]
   {\defineXMLsave[title]}
   {\expanded
  {\chapter\XMLflush{title}}}

 \starttext

 \startbuffer

 chapter
   titleAhojá hojč kuna/title
 /chapter

 \stopbuffer

 \processXMLbuffer

 \completecontent[criterium=all]

 \stoptext
___
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] Problem with encoding, XML and writetolist...

2006-03-31 Thread Martin Kolařík
Hi Hans,

isn't there some news with the stuff?

Thank you and have a nice day,

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Martin Kolařík
Sent: Tuesday, February 28, 2006 10:33 AM
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] Problem with encoding, XML and writetolist...


Here the file with 8bit chars is,

Martin

-Original Message-
From: Hans Hagen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 28, 2006 10:16 AM
To: [EMAIL PROTECTED]; mailing list for ConTeXt users
Subject: Re: [NTG-context] Problem with encoding, XML and writetolist...


� wrote:
 Hi all,

 I have problem with chars encoding now; I have updated ConTeXt sometimes in
 January; before the time I was using old (year) version. In this
 prehistorical version the problem was not present.

 What is the stuff? The following code generates content with titles without
 spaces -- accented characters are replaced with \char XXX variant, so during
 reading TUI line TeX gobbles a space after XXX as a part of number syntax
 rule.
   
can you send me a zip with the test file so that the 8 bit chars are ok? 

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] Problem with encoding, XML and writetolist...

2006-02-27 Thread Martin Kolařík
Hi all,

I have problem with chars encoding now; I have updated ConTeXt sometimes in
January; before the time I was using old (year) version. In this
prehistorical version the problem was not present.

What is the stuff? The following code generates content with titles without
spaces -- accented characters are replaced with \char XXX variant, so during
reading TUI line TeX gobbles a space after XXX as a part of number syntax
rule.

Can I do something? With encoding? With XML?

Thank you very much, have a nice day, Martin

Code:

\defineXMLenvironment
  [chapter]
  {\defineXMLsave[title]}
  {\expanded
 {\chapter\XMLflush{title}}}

\starttext

\startbuffer

chapter
  titleAhojá hojč kuna/title
/chapter

\stopbuffer

\processXMLbuffer

\completecontent[criterium=all]

\stoptext

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


[NTG-context] Problem with encoding, XML and writetolist...

2006-02-27 Thread Martin Kolařík
Hi Hans,

I have problem with chars encoding now; I have updated ConTeXt sometimes in
January; before the time I was using old (year) version. In this
prehistorical version the problem was not present.

What is the stuff? The following code generates content with titles without
spaces -- accented characters are replaced with \char XXX variant, so during
reading TUI line TeX gobbles a space after XXX as a part of number syntax
rule.

Can I do something? With encoding? With XML?

Thank you very much, have a nice day, Martin

Code:

\defineXMLenvironment
  [chapter]
  {\defineXMLsave[title]}
  {\expanded
 {\chapter\XMLflush{title}}}

\starttext

\startbuffer

chapter
  titleAhojá hojč kuna/title
/chapter

\stopbuffer

\processXMLbuffer

\completecontent[criterium=all]

\stoptext

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


[NTG-context] [force, here] floats and its bad placement -- LONG mail

2005-03-08 Thread Martin Kolařík
Hi Hans (and all),

I have difficulties with [force,here] floats. Even if such floats are something 
a bit degraded, they occured in publication text and they should be handled 
correctly.

I am sorry I do not send a minimal example, but the minimal example from me 
would be XML + XML mapping + some included tex files and styles; and these 
together are really not minimal example... I hope I succeed with text 
description :-)

The description:

-- subject disallows page breaks after self and recommends page break before 
self (\goodbreak),

-- the first page fills up with title, subject A + paragraphs, second subject B 
+ [force]-float,

-- which produces three pages: the *first* correctly ended (before subject B); 
the *second* with subject B only and the *third* with the [force]-float and the 
rest of the text.

This is bad, as the [force]-float should be placed immediately after subject B 
onto the same (second) page.

The tracing pages reports for this case, the ### lines are my comments:

...
% t=378.42076 plus 53.50006 minus 13.50006 g=526.37599 b=2111 p=0 c=2111#
% t=389.22081 plus 53.50006 minus 13.50006 g=526.37599 b=1681 p=0 c=1681#
% t=400.02086 plus 53.50006 minus 13.50006 g=526.37599 b=1314 p=0 c=1314#
% t=410.8209 plus 53.50006 minus 13.50006 g=526.37599 b=1005 p=2000 c=3005
% t=421.62096 plus 53.50006 minus 13.50006 g=526.37599 b=748 p=-500 c=248#
subject : - Ozna?en a vznam svorek

 here the [force] float starts, it is a table, so ModulePins is used more 
times

figures : dimensions of img/ModulePins.pdf loaded from figurefile itself
figures : figureobject ModulePins.pdf is reused
figures : figureobject ModulePins.pdf is reused
floatblocks : order disturbed
% t=897.74492 plus 56.20007 minus 16.20007 g=526.37599 b=* p=-500 c=*

 now the first page is too high -- and it will be break in c=248 (which is
 \goodbreak before subject

interaction : pdftex code inserted
[1.1{d:/TeXLocal/Private/fonts/map/pdftex/updmap/pdftex.map}{d:/TeXLocal/Privat
e/fonts/map/private.map}{d:/TeXLocal/Private/fonts/map/adobe.map}{d:/TeXLocal/P
rivate/fonts/map/stormtype.map}{d:/TeXLocal/Private/fonts/map/microsoft.map}{d:
/TeXLocal/Private/fonts/map/suitcase.map}]
%% goal height=526.37599, max depth=3.19995
% t=465.13591 plus 40.0 g=526.37599 b=357 p=-500 c=-143#

 the page 1 is flushed, 465 pts rests, this is subject B + [force]-float.
 But \OTRONEdocheckiffloatfits finds the float cannot be placed and, 
moreover,
 it prepares \goodbreak before it.

floatblocks : order disturbed
floatblocks : 3 saved
% t=465.13591 plus 40.0 g=526.37599 b=357 p=-500 c=-143#
% t=465.13591 plus 40.0 g=526.37599 b=357 p=0 c=357
subject : - Parametry modulu
% t=505.02203 plus 44.05002 minus 4.05002 g=526.37599 b=11 p=0 c=11
% t=530.67215 plus 45.40002 minus 5.40002 g=526.37599 b=50 p=0 c=50
% t=545.5 plus 46.75003 minus 6.75003 g=526.37599 b=* p=0 c=*
[2.2]

 This goodbreak leads to break candidate with cost=-143 and
 HERE the second page is broken. And the float is saved and placed
 now onto the third page.

floatblocks : 3 moved
%% goal height=526.37599, max depth=3.19995
% t=0.0 g=359.6518 b=1 p=0 c=10#
% t=30.78607 plus 41.35 minus 1.35 g=359.6518 b=1 p=0 c=10# 
...

By tweaking into \OTRONEdocheckiffloatfits, I found there is the line:

% new per 31/5/2004, should be an option, only one column mode

which creates \goodbreak. But I seems to me this \goodbreak should be generated
only if there is a room for the float? It the room is not here -- which leads
to float save -- the break causes unexpected page breaks.

For second -- it seems to me the checking of room for float in described case
counts the float size twice -- the float is counted inside
\pagetotal of page material pending from the overfilled page 1 and
for second its dimension is counted again with second call.

For third -- the described behaviour saves float even if it can be correctly
placed in currently filled page, so the float is pulled up from [force,here]
positioning and it starts flow -- but this is not proper behaviour for such
float.

As a result, IMHO (which can be completly bad, I really do not known all the
consequencies and mechanisms of ConTeXt) it should be corrected using following
way:

1. \OTRONEdocheckiffloatfits (and maybe another OTR routines) should respect the
float is [force,here]. For such floats the routine *always* should set
\roomforfloattrue and *not to* generate \goodbreak, as [force,here] floats 
should
be left to be placed by normal page builder TeX mechanism.

2. \goodbreak in % new per 31/5... block should be generated only if the float
is placed -- if it is saved, the break corresponding to the float should not 
appear
without the float.

3. maybe implement the option for \goodbreak :-) But there I cannot say more,
because I do not know the primary motivation. 

I experimented with \OTRONEdocheckiffloatfits in desribed 

RE: [NTG-context] PDF bounding box problem?

2005-02-10 Thread Martin Kolařík
Hi all,

I have problem with paragraph background in columnset environment:

\definetextbackground
  [TXBG]
  [frame=no,offset=0.25em,location=paragraph]

\definecolumnset[main][n=2]

\startcolumnset[main]
...
\starttextbackground[TXBG]
  \typebuffer[BUFFER]
\stoptextbackground
...
\stopcolumnset

Using the background in left column (as the text flows) causes shifting
whole column down }(including both text and properly placed background).

Sorry, I have no minimal example now, as the source is XML. But the mapping
macros lead into the code described above.

Are there some problems with backs in columnsets?

Thank you,

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Hans Hagen
Sent: Thursday, February 10, 2005 10:11 AM
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] PDF bounding box problem?


cormullion wrote:
 Hans Hagen [EMAIL PROTECTED] said on 2005-02-09, 18:20 (+0100 GMT):
 
 
To my untutored eye it looks like the MediaBox is being
used - at least, the graphic takes up  an area about
Letter size.  Is there  some setting Ive missed that
lets me get the bounds of the graphics rather than the
file?

\externalfigure[whatever.pdf][width=10cm,size=artbox]
 
 
 Great! I didnt spot the artbox option...

it's a rather new option, because pdftex only supports it in later versions

Hans

ps. be aware of the fact that sometimes those boxes are wrong; has to do
with 
illustrator defaults and such (there is a technote on that on our site)

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
attachment: winmail.dat___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] RE: \defaultinterface for cont-cz

2005-02-08 Thread Martin Kolařík
Hi all,

I'm using english interface in cont-cz too... But, maybe, it could be useful
to determine interface in the highest level -- during making the format
like:

texexec --make cz --commands en

I know --interface cz cannot be used as --interface is used to select
ConTeXt format (to rewrite texexec defaults).

What about this?

Have a nice day,

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Vit Zyka
Sent: Tuesday, February 08, 2005 10:56 AM
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] alpha release / latin modern


Hans Hagen wrote:
 Vit Zyka wrote:
 
 I save time to install new release and start to test. Good news:
 1) The hyphen code can be processed with cont-cz.
 Bad news:
 1) \c!compoundhyphen atc. are not defined in cont-con.tex
 
 they are in mult-con (in the alpha)

Sorry Hans, I did not distinguish between current and alpha, only 
between alpha-betha.

Now it works well, indeed...

So can we move

\unprotected \setuplanguage
 [cz]
 [\c!compoundhyphen=-,
  \c!leftcompoundhyphen=-,
  \c!rightcompoundhyphen=-]

onto cont-cz.tex ?

And related question. Is there ANY czech user who uses cz interface, 
like \definujramovani? I guess not. It is very unconfortable and 
confusing especially for unskilled ConTeXter to edit cont-cz.tex to switch
   \def\defaultinterface{czech}
to
   \def\defaultinterface{english}

If nobody complain I suggest \def\defaultinterface{english}
to be default for cont-cz.

Thanks
Vit Zyka
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context
attachment: winmail.dat___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context