ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Purpose of backend (export=yes)
@ 2010-11-08 14:52 Vladimir Lomov
  2010-11-09 16:40 ` Hans Hagen
       [not found] ` <AANLkTinDVyr+bkU36s2pKmPDsfLDQi1-GLVBLB3L-Pub@mail.gmail.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Vladimir Lomov @ 2010-11-08 14:52 UTC (permalink / raw)
  To: General mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 2032 bytes --]

Hi.

(I'm reading this ML but rarely ask questions.)

I try to understand the purpose of 'setupbackend'.

Consider the following three examples:

----------------------------------------------------------------------

<example name="ex1.tex">
\setupbackend[export=yes]

\starttext

This is simple example. No font switching, no math.

\stoptext
</example>

----------------------------------------------------------------------

<example name="ex2.tex">
\setupbackend[export=yes]

\starttext

This is second example.
This time we try to use font switching mechanism:
This is normal, but this \bold{one is bold}. Normal again.

\stoptext
</example>

----------------------------------------------------------------------

<example name="ex3.tex">
\setupbackend[export=yes]

\starttext

This is third example with 'backend' 'export=yes'. Now we try simple math:

This is inline formula $E=mc^{2}$.

This is display formula
\startformula
  E=mc^{2}
\stopformula

\stoptext
</example>

----------------------------------------------------------------------

I compiled them with context (mkIV, context minimal) and got
ex{1,2,3}.export. I thought that I get not only the document content but
also its logical structure (for example some markup for font switching).

Is it true that 'backend' only output document content not its logic
strcuture? Does it work with math? The third example gives for math only
not letters.

I attached the resulted export files.

P.S. Then I saw the announce about 'backend' & 'export=yes' I thought
that context would be good tool for notes. I imagine that I could wrote
a text file and make from it either pdf (for printing/screening) or html
(for screening) or may be convert xml (using existing tools and
methods) to other formats (rtf/odt/xhtml) that would contain math,
images, tables. But seems that I was wrong or this will be in future
of the backend?

---
WBR, Vladimir Lomov


-- 
If you make people think they're thinking, they'll love you; but if you
really make them think they'll hate you.

[-- Attachment #2: ex1.export --]
[-- Type: text/plain, Size: 407 bytes --]

<?xml version='1.0' standalone='yes' ?>

<!-- input filename   : ex1               -->
<!-- processing date  : Mon Nov  8 22:44:56 2010 -->
<!-- context version  : 2010.11.03 19:42  -->
<!-- exporter version : 0.10              -->

<document language='en' file='ex1' date='Mon Nov  8 22:44:56 2010' context='2010.11.03 19:42' version='0.10'>
This is simple example. No font switching, no math.
</document>

[-- Attachment #3: ex2.export --]
[-- Type: text/plain, Size: 481 bytes --]

<?xml version='1.0' standalone='yes' ?>

<!-- input filename   : ex2               -->
<!-- processing date  : Mon Nov  8 22:45:03 2010 -->
<!-- context version  : 2010.11.03 19:42  -->
<!-- exporter version : 0.10              -->

<document language='en' file='ex2' date='Mon Nov  8 22:45:03 2010' context='2010.11.03 19:42' version='0.10'>
This is second example. This time we try to use font switching mechanism: This is normal, but this one is bold. Normal again.
</document>

[-- Attachment #4: ex3.export --]
[-- Type: text/plain, Size: 641 bytes --]

<?xml version='1.0' standalone='yes' ?>

<!-- input filename   : ex3               -->
<!-- processing date  : Mon Nov  8 22:45:09 2010 -->
<!-- context version  : 2010.11.03 19:42  -->
<!-- exporter version : 0.10              -->

<document language='en' file='ex3' date='Mon Nov  8 22:45:09 2010' context='2010.11.03 19:42' version='0.10'>
This is third example with 'backend' 'export=yes'. Now we try simple math:
  <break/>
 This is inline formula 
  <math>
    <mrow>
      <mi>𝐸</mi>
      <mo>=</mo>
      <mi>𝑚</mi>
      <msup>
        <mi>𝑐</mi>
        <mn>2</mn>
      </msup>
    </mrow>
  </math>

[-- Attachment #5: Type: text/plain, Size: 486 bytes --]

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

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

* Re: Purpose of backend (export=yes)
  2010-11-08 14:52 Purpose of backend (export=yes) Vladimir Lomov
@ 2010-11-09 16:40 ` Hans Hagen
  2010-11-10 14:24   ` Vladimir Lomov
       [not found] ` <AANLkTinDVyr+bkU36s2pKmPDsfLDQi1-GLVBLB3L-Pub@mail.gmail.com>
  1 sibling, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2010-11-09 16:40 UTC (permalink / raw)
  To: Vladimir Lomov, General mailing list for ConTeXt users

On 8-11-2010 3:52, Vladimir Lomov wrote:

> I compiled them with context (mkIV, context minimal) and got
> ex{1,2,3}.export. I thought that I get not only the document content but
> also its logical structure (for example some markup for font switching).

Bold in itself is not structure so best tag it as (e.g.) important:

\setupbackend[export=yes]

\definestartstop[important][style=bold]

\starttext

This is second example.
This time we try to use font switching mechanism:
This is normal, but this \important{one is bold}. Normal again.

\stoptext

> Is it true that 'backend' only output document content not its logic
> strcuture? Does it work with math? The third example gives for math only
> not letters.

Math becomes:

  This is inline formula
   <math>
     <mrow>
       <mi>𝐸</mi>
       <mo>=</mo>
       <mi>𝑚</mi>
       <msup>
         <mi>𝑐</mi>
         <mn>2</mn>
       </msup>
     </mrow>
   </math>
.
   <break/>
  This is display formula
   <formula>
     <formulacontent>
       <math>
         <mrow>
           <mi> 𝐸</mi>
           <mo>=</mo>
           <mi>𝑚</mi>
           <msup>
             <mi>𝑐</mi>
             <mn>2</mn>
           </msup>
         </mrow>
       </math>
     </formulacontent>
   </formula>

> I attached the resulted export files.
>
> P.S. Then I saw the announce about 'backend'&  'export=yes' I thought
> that context would be good tool for notes. I imagine that I could wrote
> a text file and make from it either pdf (for printing/screening) or html
> (for screening) or may be convert xml (using existing tools and
> methods) to other formats (rtf/odt/xhtml) that would contain math,
> images, tables. But seems that I was wrong or this will be in future
> of the backend?

indeed it should be possible to use context that way and afaik the 
export is already quite okay (you might need a recent luatex as there 
have been issues with attributes in math mode that were sorted out a 
while ago)

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
___________________________________________________________________________________

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

* Re: Purpose of backend (export=yes)
       [not found] ` <AANLkTinDVyr+bkU36s2pKmPDsfLDQi1-GLVBLB3L-Pub@mail.gmail.com>
@ 2010-11-10 14:11   ` Vladimir Lomov
  0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Lomov @ 2010-11-10 14:11 UTC (permalink / raw)
  To: Mojca Miklavec, General mailing list for ConTeXt users

Hi Mojca.

** Mojca Miklavec [2010-11-09 08:59:45 +0100]:

>> P.S. Then I saw the announce about 'backend' & 'export=yes' I thought
>> that context would be good tool for notes. I imagine that I could wrote
>> a text file and make from it either pdf (for printing/screening) or html
>> (for screening) or may be convert xml (using existing tools and
>> methods) to other formats (rtf/odt/xhtml) that would contain math,
>> images, tables. But seems that I was wrong or this will be in future
>> of the backend?
> 
> Keep in mind that this mechanism is very very very recent. So it
> probably needs to be debugged extensively ...
Ok, but I'm glad that there is such possibility. I'll see news on the
topic.

---
WBR, Vladimir Lomov

-- 
Keep your eyes wide open before marriage, half shut afterwards.
		-- Benjamin Franklin
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Purpose of backend (export=yes)
  2010-11-09 16:40 ` Hans Hagen
@ 2010-11-10 14:24   ` Vladimir Lomov
  2010-11-10 14:42     ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Lomov @ 2010-11-10 14:24 UTC (permalink / raw)
  To: Hans Hagen, General mailing list for ConTeXt users

Hi Hans.

** Hans Hagen [2010-11-09 17:40:44 +0100]:

> On 8-11-2010 3:52, Vladimir Lomov wrote:
> 
>>I compiled them with context (mkIV, context minimal) and got
>>ex{1,2,3}.export. I thought that I get not only the document content but
>>also its logical structure (for example some markup for font switching).
> 
> Bold in itself is not structure so best tag it as (e.g.) important:
> 
> \setupbackend[export=yes]
> 
> \definestartstop[important][style=bold]
> 
> \starttext
> 
> This is second example.
> This time we try to use font switching mechanism:
> This is normal, but this \important{one is bold}. Normal again.
> 
> \stoptext
So, if I want to get structured xml file I need to either redefine all
usual command to be tagged (start/stop) and, that is more logical define
my own tag commands. IMHO the use of 'important' as in example above is
logical, the actual presentation of 'importtant' words could be define
separately and in different ways (I like idea of xml+styles).

>>Is it true that 'backend' only output document content not its logic
>>strcuture? Does it work with math? The third example gives for math only
>>not letters.
> 
> Math becomes:
> 
>  This is inline formula
>   <math>
>     <mrow>
>       <mi>𝐸</mi>
>       <mo>=</mo>
>       <mi>𝑚</mi>
>       <msup>
>         <mi>𝑐</mi>
>         <mn>2</mn>
>       </msup>
>     </mrow>
>   </math>
> .
>   <break/>
>  This is display formula
>   <formula>
>     <formulacontent>
>       <math>
>         <mrow>
>           <mi> 𝐸</mi>
>           <mo>=</mo>
>           <mi>𝑚</mi>
>           <msup>
>             <mi>𝑐</mi>
>             <mn>2</mn>
>           </msup>
>         </mrow>
>       </math>
>     </formulacontent>
>   </formula>
E-er, yes. I don't see characters (my terminal use UTF8 and good font)
even now. But I saw them in web intterface to ML (contextgarden because
another shows something different). Also I saw tthem in Emacs. AFAIU,
this is in private region of Unicode, these are _italic_ E, m and c. I
thought that there should be letter from ASCII (codes < 127).

>>I attached the resulted export files.
>>
>>P.S. Then I saw the announce about 'backend'&  'export=yes' I thought
>>that context would be good tool for notes. I imagine that I could wrote
>>a text file and make from it either pdf (for printing/screening) or html
>>(for screening) or may be convert xml (using existing tools and
>>methods) to other formats (rtf/odt/xhtml) that would contain math,
>>images, tables. But seems that I was wrong or this will be in future
>>of the backend?
> 
> indeed it should be possible to use context that way and afaik the
> export is already quite okay (you might need a recent luatex as
> there have been issues with attributes in math mode that were sorted
> out a while ago)
Well, this were simple tests. I'll make more complex one in next weeks.
Texts, with font switching, maths, images, tables. I want to have tool
using which I could convert from one source to several formats (pdf,
xhtml, rtf/odt).

---
WBR, Vladimir Lomov

-- 
Have a nice day!
___________________________________________________________________________________
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
___________________________________________________________________________________

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

* Re: Purpose of backend (export=yes)
  2010-11-10 14:24   ` Vladimir Lomov
@ 2010-11-10 14:42     ` Hans Hagen
  2010-11-10 15:17       ` Khaled Hosny
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2010-11-10 14:42 UTC (permalink / raw)
  To: Vladimir Lomov, General mailing list for ConTeXt users

On 10-11-2010 3:24, Vladimir Lomov wrote:

> So, if I want to get structured xml file I need to either redefine all
> usual command to be tagged (start/stop) and, that is more logical define

Did you test the mechanism? Most environments are already dealt with. 
The only think that you need to keep in mind is that you use 
\startchapter ... \stopchapter and \startitem ... \stopitem i.e. avoid 
implicit structure

> E-er, yes. I don't see characters (my terminal use UTF8 and good font)
> even now. But I saw them in web intterface to ML (contextgarden because
> another shows something different). Also I saw tthem in Emacs. AFAIU,
> this is in private region of Unicode, these are _italic_ E, m and c. I
> thought that there should be letter from ASCII (codes<  127).

mkiv uses (and exports) proper math unicode characters .. nothing 
private about that; any renderer of xml should be able to deal with it

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
___________________________________________________________________________________


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

* Re: Purpose of backend (export=yes)
  2010-11-10 14:42     ` Hans Hagen
@ 2010-11-10 15:17       ` Khaled Hosny
  0 siblings, 0 replies; 6+ messages in thread
From: Khaled Hosny @ 2010-11-10 15:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, Nov 10, 2010 at 03:42:58PM +0100, Hans Hagen wrote:
> On 10-11-2010 3:24, Vladimir Lomov wrote:
> >E-er, yes. I don't see characters (my terminal use UTF8 and good font)
> >even now. But I saw them in web intterface to ML (contextgarden because
> >another shows something different). Also I saw tthem in Emacs. AFAIU,
> >this is in private region of Unicode, these are _italic_ E, m and c. I
> >thought that there should be letter from ASCII (codes<  127).
> 
> mkiv uses (and exports) proper math unicode characters .. nothing
> private about that; any renderer of xml should be able to deal with
> it

You under estimate the wisdom of all the developers out there who never
thought of Unicode beyond plane 0 (having played with Unicode math in
SVG, which is XML, 5 out of 5 SVG implementations that I tested have a
bug or another related to broken surrogate pairs handling).

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2010-11-10 15:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-08 14:52 Purpose of backend (export=yes) Vladimir Lomov
2010-11-09 16:40 ` Hans Hagen
2010-11-10 14:24   ` Vladimir Lomov
2010-11-10 14:42     ` Hans Hagen
2010-11-10 15:17       ` Khaled Hosny
     [not found] ` <AANLkTinDVyr+bkU36s2pKmPDsfLDQi1-GLVBLB3L-Pub@mail.gmail.com>
2010-11-10 14:11   ` Vladimir Lomov

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