ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Vit Zyka <vit.zyka@seznam.cz>
Subject: Re: Problem with encoding, XML and writetolist...
Date: Wed, 05 Apr 2006 11:54:18 +0200	[thread overview]
Message-ID: <443393CA.6080005@seznam.cz> (raw)
In-Reply-To: <OKEMJBLABHCFPNOIFCNBOEEKCCAA.kolarik@mii.cz>

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

> 
> 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: ntg-context-bounces@ntg.nl [mailto:ntg-context-bounces@ntg.nl]On
>>Behalf Of Hans Hagen
>>Sent: Monday, April 03, 2006 11:57 AM
>>To: martin.kolarik@email.cz; 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

-- 
=======================================================
Ing. Vít Zýka, Ph.D.                         TYPOkvítek

database publishing              databazove publikovani
data maintaining and typesetting in typographic quality
priprava dat a jejich sazba v typograficke kvalite

tel.: (+420) 777 198 189     www: http://typokvitek.com
=======================================================

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

  parent reply	other threads:[~2006-04-05  9:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-28  7:24 Martin Kolařík
2006-02-28  9:15 ` Hans Hagen
2006-02-28  9:33   ` Martin Kolařík
2006-03-31  8:42     ` Martin Kolařík
2006-03-31 17:01       ` Hans Hagen
2006-04-02 21:17         ` Martin Kolařík
2006-04-03  8:36           ` Hans Hagen
2006-04-03  8:57             ` Martin Kolařík
2006-04-03  9:56               ` Hans Hagen
2006-04-03 10:36                 ` Martin Kolařík
2006-04-03 12:33                   ` Mojca Miklavec
2006-04-03 12:39                     ` Martin Kolařík
2006-04-03 11:18                 ` Vit Zyka
2006-04-03 11:45                   ` Martin Kolařík
2006-04-04 20:18                 ` Martin Kolařík
2006-04-04 20:25                 ` Martin Kolařík
2006-04-05  8:17                   ` Hans Hagen
2006-04-05  9:54                   ` Vit Zyka [this message]
2006-04-05 11:03                     ` Hans Hagen
2006-04-05 12:18                       ` Vit Zyka
2006-04-05 14:09                         ` Hans Hagen
2006-04-03 14:25 ` Mojca Miklavec
2006-04-03 14:41   ` Martin Kolařík
  -- strict thread matches above, loose matches on Subject: below --
2006-04-05 11:59 Martin Kolařík
2006-04-06  9:07 ` Hans Hagen
2006-04-02 21:20 Martin Kolařík
2006-02-27 11:58 Martin Kolařík

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=443393CA.6080005@seznam.cz \
    --to=vit.zyka@seznam.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).