ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* context -> docx ??
@ 2015-01-13 19:59 Idris Samawi Hamid ادريس سماوي حامد
  2015-01-13 21:34 ` Marcin Borkowski
  2015-01-14 19:58 ` Pablo Rodriguez
  0 siblings, 2 replies; 23+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-01-13 19:59 UTC (permalink / raw)
  To: ntg-context

Dear gang,

I'm currently writing a paper with very basic typographical needs:  
blockquotes, emphasis, bibliography, perhaps a graphic or two. The  
publisher wants the thing in Word, naturally. The last time I did  
something like this I set up a markdown document and just exported it to  
both docx and to context. For simple documents this is at least workable,  
but I'd prefer to write in context, not markdown.

Now it's been a while since I've experimented with ConTeXt and epub. From  
lightly perusing the list it seems that there has been considerable  
movement on this front. So my question: Has anyone here succeeded in the  
following workflow:

context -> xml -> docx

[perhaps via pandoc]?

If so, do any of you have any samples of such a workflow that work with  
the latest context? Or am I stuck with markdown?

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-13 19:59 context -> docx ?? Idris Samawi Hamid ادريس سماوي حامد
@ 2015-01-13 21:34 ` Marcin Borkowski
  2015-01-14 17:55   ` Alan BRASLAU
  2015-01-14 18:44   ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-14 19:58 ` Pablo Rodriguez
  1 sibling, 2 replies; 23+ messages in thread
From: Marcin Borkowski @ 2015-01-13 21:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On 2015-01-13, at 20:59, Idris Samawi Hamid ادريس سماوي حامد <ishamid@colostate.edu> wrote:

> Dear gang,
>
> I'm currently writing a paper with very basic typographical needs:  
> blockquotes, emphasis, bibliography, perhaps a graphic or two. The  
> publisher wants the thing in Word, naturally. The last time I did  
> something like this I set up a markdown document and just exported it to  
> both docx and to context. For simple documents this is at least workable,  
> but I'd prefer to write in context, not markdown.

While I /do/ understand you (it's the same with me, only that I'm more
comfortable with LaTeX), have you considered Org-mode?  It's
similar to markdown (though better IMHO), but it comes with great
support in Emacs.  And you get export to odt "for free".  (Also to
LaTeX, though unfortunately not to ConTeXt; OTOH, writing a ConTeXt
exporter should be fairly easy, and a simple exporter could be done in
a few days - the framework for writing exporters to different formats is
very well done.  Incidentally, there's also a Markdown exporter, so you
could probably get to ConTeXt via markdown).

> Best wishes
> Idris

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-13 21:34 ` Marcin Borkowski
@ 2015-01-14 17:55   ` Alan BRASLAU
  2015-01-14 18:58     ` Idris Samawi Hamid ادريس سماوي حامد
                       ` (2 more replies)
  2015-01-14 18:44   ` Idris Samawi Hamid ادريس سماوي حامد
  1 sibling, 3 replies; 23+ messages in thread
From: Alan BRASLAU @ 2015-01-14 17:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Tue, 13 Jan 2015 22:34:21 +0100
Marcin Borkowski <mbork@wmi.amu.edu.pl> wrote:

> 
> On 2015-01-13, at 20:59, Idris Samawi Hamid ادريس سماوي حامد
> <ishamid@colostate.edu> wrote:
> 
> > Dear gang,
> >
> > I'm currently writing a paper with very basic typographical needs:  
> > blockquotes, emphasis, bibliography, perhaps a graphic or two. The  
> > publisher wants the thing in Word, naturally. The last time I did  
> > something like this I set up a markdown document and just exported
> > it to both docx and to context. For simple documents this is at
> > least workable, but I'd prefer to write in context, not markdown.
> 
> While I /do/ understand you (it's the same with me, only that I'm more
> comfortable with LaTeX), have you considered Org-mode?  It's
> similar to markdown (though better IMHO), but it comes with great
> support in Emacs.  And you get export to odt "for free".  (Also to
> LaTeX, though unfortunately not to ConTeXt; OTOH, writing a ConTeXt
> exporter should be fairly easy, and a simple exporter could be done in
> a few days - the framework for writing exporters to different formats
> is very well done.  Incidentally, there's also a Markdown exporter,
> so you could probably get to ConTeXt via markdown).
> 
> > Best wishes
> > Idris
> 
> Best,
> 

Org-mode does not simply come with great support in Emacs, it is
essentially an emacs module I believe.

Using ConTeXt (not emacs, markdown, or other such things...) you can
indeed export to xml, xhtml, and create epub files.  How these can get
converted to Word is another problem that is to be addressed to the
MS-Word community.

Hans showed us at the last ConTeXt conference:

MWE:


\enablemode[export]

\startmode[export]

    \setupbackend
      [export=yes,
       xhtml=yes,
       css=export-example.css]

    \setupexport
      [hyphen=yes,
       width=60em]

\stopmode

\starttext

\startquotation
    \input darwin
\stopquotation

\stoptext


The css example file can be found in the standalone:
tex/texmf-context/tex/context/base/export-example.css


This creates a filename-export directory.

The xhtml file can be read in a browser.
(some tools seem to have problem with the hyphen=yes option)


You will also notice the message:

backend         > export > create epub with: mtxrun --script epub
--make "filename" [--purge --rename --svgmath]

Running mtxrun will create the epub file. I have tested reading it on
an iPad.


There must be some way to get this into Word...


Alan
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-13 21:34 ` Marcin Borkowski
  2015-01-14 17:55   ` Alan BRASLAU
@ 2015-01-14 18:44   ` Idris Samawi Hamid ادريس سماوي حامد
  1 sibling, 0 replies; 23+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-01-14 18:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Marcin,

On Tue, 13 Jan 2015 14:34:21 -0700, Marcin Borkowski  
<mbork@wmi.amu.edu.pl> wrote:

>
> On 2015-01-13, at 20:59, Idris Samawi Hamid ادريس سماوي حامد  
> <ishamid@colostate.edu> wrote:
>
>> Dear gang,
>>
>> I'm currently writing a paper with very basic typographical needs:
>> blockquotes, emphasis, bibliography, perhaps a graphic or two. The
>> publisher wants the thing in Word, naturally. The last time I did
>> something like this I set up a markdown document and just exported it to
>> both docx and to context. For simple documents this is at least  
>> workable,
>> but I'd prefer to write in context, not markdown.
>
> While I /do/ understand you (it's the same with me, only that I'm more
> comfortable with LaTeX), have you considered Org-mode?  It's
> similar to markdown (though better IMHO), but it comes with great
> support in Emacs.  And you get export to odt "for free".  (Also to
> LaTeX, though unfortunately not to ConTeXt; OTOH, writing a ConTeXt
> exporter should be fairly easy, and a simple exporter could be done in
> a few days - the framework for writing exporters to different formats is
> very well done.  Incidentally, there's also a Markdown exporter, so you
> could probably get to ConTeXt via markdown).

Thank you, Marcin, for introducing me to Org-mode. OTOH, I decided some  
years ago that the Emacs lifestyle is a bit too much for me :-)

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 17:55   ` Alan BRASLAU
@ 2015-01-14 18:58     ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-14 19:58       ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-14 20:15     ` Pablo Rodriguez
  2015-01-14 20:50     ` Marcin Borkowski
  2 siblings, 1 reply; 23+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-01-14 18:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Alan,

On Wed, 14 Jan 2015 10:55:50 -0700, Alan BRASLAU <alan.braslau@cea.fr>  
wrote:

> \enablemode[export]
> \startmode[export]
>    \setupbackend
>       [export=yes,
>        xhtml=yes,
>        css=export-example.css]
>    \setupexport
>       [hyphen=yes,
>        width=60em]
> \stopmode
> \starttext
> \startquotation
>     \input darwin
> \stopquotation
> \stoptext

LuaTeX, Version beta-0.79.2
ConTeXt  ver: 2014.12.30 09:48 MKIV beta  fmt: 2014.12.30

Your example doesn't work here. After 800 lines of overfull hboxes I get

tex error       > error on line 19 in file darwin.tex: ! TeX capacity  
exceeded, sorry [text input levels=127]

l.19     \input darwin


  9
10         \setupexport
11           [hyphen=yes,
12            width=60em]
13
14     \stopmode
15
16     \starttext
17
18     \startquotation
19 >>      \input darwin
20     \stopquotation
21
22     \stoptext

Please advise.

Best wishes
Idris

-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-13 19:59 context -> docx ?? Idris Samawi Hamid ادريس سماوي حامد
  2015-01-13 21:34 ` Marcin Borkowski
@ 2015-01-14 19:58 ` Pablo Rodriguez
  2015-01-17 14:45   ` Idris Samawi Hamid ادريس سماوي حامد
  1 sibling, 1 reply; 23+ messages in thread
From: Pablo Rodriguez @ 2015-01-14 19:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 01/13/2015 08:59 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> Dear gang,
> 
> I'm currently writing a paper with very basic typographical needs:  
> blockquotes, emphasis, bibliography, perhaps a graphic or two. The  
> publisher wants the thing in Word, naturally. The last time I did  
> something like this I set up a markdown document and just exported it to  
> both docx and to context. For simple documents this is at least workable,  
> but I'd prefer to write in context, not markdown.

Hi Idris,

I think it is better to use a markdown source with pandoc. It is the
closest model to its native format.

I have written a small book from a markdown source. The PDF document was
generated by ConTeXt, previously converted with pandoc.

I think this is the wrong way to go. Mainly because conversion to
ConTeXt doesn’t rettain language information and special attributes. I
had to edit the ConTeXt source to add the missing features.

[pandoc’s internal document format only allows attributes for certain
elements, not for all of them. A workaround is to wrap then in divs an
spans.]

In my opinion, the right way to go is to convert the markdown source to
HTML and to parse it with an environment. Otherwise, updating the source
is not straightforward (either you have two sources: markdown and ConTeXt).

Why do you prefer to avoid markdown as a source document format?

> Now it's been a while since I've experimented with ConTeXt and epub. From  
> lightly perusing the list it seems that there has been considerable  
> movement on this front. So my question: Has anyone here succeeded in the  
> following workflow:
> 
> context -> xml -> docx
> 
> [perhaps via pandoc]?

I don’t have any samples of this workflow, since I never worked this way.

pandoc doesn’t even have a ConTeXt reader
(https://github.com/jgm/pandoc/issues/1423). You will need a way to
generate a document in an XML format that pandoc understands.

XHTML is an option. And I guess that would be easy to generate with
ConTeXt (I have never done it).

Just in case it helps,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 18:58     ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-01-14 19:58       ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-14 20:03         ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 1 reply; 23+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-01-14 19:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 14 Jan 2015 11:58:15 -0700, Idris Samawi Hamid ادريس سماوي حامد  
<ishamid@colostate.edu> wrote:

> Your example doesn't work here. After 800 lines of overfull hboxes I get
>
> tex error       > error on line 19 in file darwin.tex: ! TeX capacity  
> exceeded, sorry [text input levels=127]
>
> l.19     \input darwin
>
>
>   9
> 10         \setupexport
> 11           [hyphen=yes,
> 12            width=60em]
> 13
> 14     \stopmode
> 15
> 16     \starttext
> 17
> 18     \startquotation
> 19 >>      \input darwin
> 20     \stopquotation
> 21
> 22     \stoptext
>
> Please advise.
>
> Best wishes
> Idris

It's one of those weird things: Alan sent me the same file as a text  
attachment and it ran just fine. But the text I copied from his first  
email did not. Doing a quick compare of the two files in Notepad++  
indicated that the two files are identical, but there must be some unseen  
spurious character caused by the email that context doesn't like..

This sort of thing happens once in a while: Have any of you researched  
this phenomenon at all? Luigi?

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 19:58       ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-01-14 20:03         ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 0 replies; 23+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-01-14 20:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 14 Jan 2015 12:58:35 -0700, Idris Samawi Hamid ادريس سماوي حامد  
<ishamid@colostate.edu> wrote:

> It's one of those weird things: Alan sent me the same file as a text  
> attachment and it ran just fine. But the text I copied from his first  
> email did not. Doing a quick compare of the two files in Notepad++  
> indicated that the two files are identical, but there must be some  
> unseen spurious character caused by the email that context doesn't like..

No, this is totally off-track. The problem was that silly me named the  
test file darwin.tex, while there was an "\input darwin" in the test file.  
My apologies for the noise.

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 17:55   ` Alan BRASLAU
  2015-01-14 18:58     ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-01-14 20:15     ` Pablo Rodriguez
  2015-01-14 20:29       ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-14 20:50     ` Marcin Borkowski
  2 siblings, 1 reply; 23+ messages in thread
From: Pablo Rodriguez @ 2015-01-14 20:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 01/14/2015 06:55 PM, Alan BRASLAU wrote:
> Using ConTeXt (not emacs, markdown, or other such things...) you can
> indeed export to xml, xhtml, and create epub files.
> [...]
> The xhtml file can be read in a browser.
> (some tools seem to have problem with the hyphen=yes option)

I don’t know whether it makes sense to add discretionary hyphens to
texts, ewhen a browser can hyphenate it
(http://css-tricks.com/almanac/properties/h/hyphenate/).

This would make also searching harder.

And my experience with ePub readers (Adobe Reader Mobile 9) is that they
are interpreted as zero-width spaces
(http://www.mobileread.com/forums/showthread.php?t=28139).

BTW, ARM 9 doesn’t handle zero-width spaces right either. It interprets
them as standard spaces.

> There must be some way to get this into Word...

pandoc may be the way.

I say “may be” instead of “is” because pandoc ignores some attributes
when converting from XHTML
(http://pandoc.org/try/?text=%3Cp%3EThis+is+sample+with+a+foreign+word%3A+%3Cem+lang%3D%22de%22%3EFremdsprache%3C%2Fem%3E.%3C%2Fp%3E&from=html&to=markdown).

Just in case it helps,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 20:15     ` Pablo Rodriguez
@ 2015-01-14 20:29       ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-14 21:25         ` Peter Münster
                           ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-01-14 20:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Pablo,

On Wed, 14 Jan 2015 13:15:38 -0700, Pablo Rodriguez <oinos@gmx.es> wrote:

>> There must be some way to get this into Word...

> pandoc may be the way.

> I say “may be” instead of “is” because pandoc ignores some attributes
> when converting from XHTML

> (http://pandoc.org/try/?text=%3Cp%3EThis+is+sample+with+a+foreign+word%3A+%3Cem+lang%3D%22de%22%3EFremdsprache%3C%2Fem%3E.%3C%2Fp%3E&from=html&to=markdown).

I was just about to ask about how pandoc handles xhtml. Some questions for  
you:

Context produces three relevant files:

darwin-xml-div.xhtml
darwin-xml-tag.xhtml
darwin-xml-raw.xml

1. Which one of these three files is the one we want to convert to docx?

2. I modified Alan's test file [same preamble]:

====
\starttext

\startquotation
\input darwin

\bf \input darwin
\stopquotation

\stoptext
====

darwin-xml-div.xhtml and darwin-xml-tag.xhtml show up in the browser, but  
the bold does not. In Opera 12.17, darwin-xml-raw.xml gives a syntax error

====
XML parsing failed: syntax error (Line: 17, Character: 0)
====

But the "Reparse document as HTML" does work.

In each of the three cases, there is no bold effect at all.

What is needed to get the typography info transmitted?

3. My assumption is this: If I can get the xml/xhtml file looking right in  
the browser, I should be able to build a working docx file via pandoc.

Thanks for any and all advice! and

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 17:55   ` Alan BRASLAU
  2015-01-14 18:58     ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-14 20:15     ` Pablo Rodriguez
@ 2015-01-14 20:50     ` Marcin Borkowski
  2 siblings, 0 replies; 23+ messages in thread
From: Marcin Borkowski @ 2015-01-14 20:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On 2015-01-14, at 18:55, Alan BRASLAU <alan.braslau@cea.fr> wrote:

> On Tue, 13 Jan 2015 22:34:21 +0100
> Marcin Borkowski <mbork@wmi.amu.edu.pl> wrote:
>
>> While I /do/ understand you (it's the same with me, only that I'm more
>> comfortable with LaTeX), have you considered Org-mode?  It's
>> similar to markdown (though better IMHO), but it comes with great
>> support in Emacs.  And you get export to odt "for free".  (Also to
>> LaTeX, though unfortunately not to ConTeXt; OTOH, writing a ConTeXt
>> exporter should be fairly easy, and a simple exporter could be done in
>> a few days - the framework for writing exporters to different formats
>> is very well done.  Incidentally, there's also a Markdown exporter,
>> so you could probably get to ConTeXt via markdown).
>
> Org-mode does not simply come with great support in Emacs, it is
> essentially an emacs module I believe.

Yes.  But Org is _also_ a file format, very similar to markdown (only
better).  You might write Org files in Vim and fire Emacs from the
command line to export them to HTML, for instance.  (Not that it would
be a particularly great idea, but definitely possible.)  So Org (the
format) has great support in Emacs Org-mode (an Emacs major mode).

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 20:29       ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-01-14 21:25         ` Peter Münster
  2015-01-14 21:38         ` Aditya Mahajan
  2015-01-14 21:59         ` Pablo Rodriguez
  2 siblings, 0 replies; 23+ messages in thread
From: Peter Münster @ 2015-01-14 21:25 UTC (permalink / raw)
  To: ntg-context

On Wed, Jan 14 2015, Idris Samawi Hamid ادريس سماوي حامد wrote:

> 3. My assumption is this: If I can get the xml/xhtml file looking right in the
> browser, I should be able to build a working docx file via pandoc.

Can't Office-Word load html and save it as docx?

-- 
           Peter
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 20:29       ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-14 21:25         ` Peter Münster
@ 2015-01-14 21:38         ` Aditya Mahajan
  2015-01-14 22:11           ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-14 21:59         ` Pablo Rodriguez
  2 siblings, 1 reply; 23+ messages in thread
From: Aditya Mahajan @ 2015-01-14 21:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 573 bytes --]

On Wed, 14 Jan 2015, Idris Samawi Hamid ادريس سماوي حامد wrote:

> ====
> \starttext
>
> \startquotation
> \input darwin
>
> \bf \input darwin
> \stopquotation
>
> \stoptext
> ====
>
> darwin-xml-div.xhtml and darwin-xml-tag.xhtml show up in the browser, but 
> the bold does not.

> What is needed to get the typography info transmitted?

Structural elements are exported; raw typographical commands are not. So, 
you would need:

\definehighlight[important][style=bold]

\starttext
\important{This is important}
\stoptext

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 20:29       ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-14 21:25         ` Peter Münster
  2015-01-14 21:38         ` Aditya Mahajan
@ 2015-01-14 21:59         ` Pablo Rodriguez
  2015-01-14 22:22           ` Idris Samawi Hamid ادريس سماوي حامد
  2 siblings, 1 reply; 23+ messages in thread
From: Pablo Rodriguez @ 2015-01-14 21:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 01/14/2015 09:29 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> [...]
> I was just about to ask about how pandoc handles xhtml. Some questions for  
> you:

Hi Idris,

> Context produces three relevant files:
> 
> darwin-xml-div.xhtml
> darwin-xml-tag.xhtml
> darwin-xml-raw.xml
> 
> 1. Which one of these three files is the one we want to convert to docx?

Only *-div.xhtml are (X)HTML files.

> 2. I modified Alan's test file [same preamble]:
> 
> ====
> \starttext
> 
> \startquotation
> \input darwin
> 
> \bf \input darwin
> \stopquotation
> 
> \stoptext
> ====
> 
> darwin-xml-div.xhtml and darwin-xml-tag.xhtml show up in the browser, but  
> the bold does not.

Well, I cannot see any bold in "<div class="break"><!--empty--></div>".
It seems to be how ConTeXt handles the blank line and the \bf command.

BTW, the quotation environment is not translated as blockquote and
paragraphs lack their <p> tags.

> In Opera 12.17, darwin-xml-raw.xml gives a syntax error
> 
> ====
> XML parsing failed: syntax error (Line: 17, Character: 0)
> ====

It seems weird to me (that should be the error in Opera), that a <break
/> element is placed outside the <document> element.

> But the "Reparse document as HTML" does work.

I guess this format won’t be understood by pandoc (unless you write an
specific reader for it).

-raw.xml is not what you need.

> In each of the three cases, there is no bold effect at all.
> 
> What is needed to get the typography info transmitted?

I have no experience with xhtml export in ConTeXt. This is beyond my
knowledge. Sorry.

> 3. My assumption is this: If I can get the xml/xhtml file looking right in  
> the browser, I should be able to build a working docx file via pandoc.

If it doesn’t look good in the browser, you won’t get it in pandoc. But
it might be that you get it right in the browser and not in pandoc.

It depends how ConTeXt outputs the XHTML.

I hope it helps,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 21:38         ` Aditya Mahajan
@ 2015-01-14 22:11           ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 0 replies; 23+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-01-14 22:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Aditya,

On Wed, 14 Jan 2015 14:38:25 -0700, Aditya Mahajan <adityam@umich.edu>  
wrote:

> Structural elements are exported; raw typographical commands are not.  
> So, you would need:
> \definehighlight[important][style=bold]
> \starttext
> \important{This is important}
> \stoptext

Ok, thanks for this info!

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 21:59         ` Pablo Rodriguez
@ 2015-01-14 22:22           ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-15  8:01             ` Alan BRASLAU
  0 siblings, 1 reply; 23+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-01-14 22:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 14 Jan 2015 14:59:01 -0700, Pablo Rodriguez <oinos@gmx.es> wrote:

>> Context produces three relevant files:
>>
>> darwin-xml-div.xhtml
>> darwin-xml-tag.xhtml
>> darwin-xml-raw.xml
>>
>> 1. Which one of these three files is the one we want to convert to docx?
>
> Only *-div.xhtml are (X)HTML files.

That was my guess, thanks.

>> 2. I modified Alan's test file [same preamble]:
>>
>> ====
>> \starttext
>>
>> \startquotation
>> \input darwin
>>
>> \bf \input darwin
>> \stopquotation
>>
>> \stoptext
>> ====
>>
>> darwin-xml-div.xhtml and darwin-xml-tag.xhtml show up in the browser,  
>> but
>> the bold does not.
>
> Well, I cannot see any bold in "<div class="break"><!--empty--></div>".
> It seems to be how ConTeXt handles the blank line and the \bf command.
>
> BTW, the quotation environment is not translated as blockquote and
> paragraphs lack their <p> tags.

Hmm, perhaps a showstopper...

>> In Opera 12.17, darwin-xml-raw.xml gives a syntax error
>>
>> ====
>> XML parsing failed: syntax error (Line: 17, Character: 0)
>> ====
>
> It seems weird to me (that should be the error in Opera), that a <break
> /> element is placed outside the <document> element.
>
>> But the "Reparse document as HTML" does work.
>
> I guess this format won’t be understood by pandoc (unless you write an
> specific reader for it).

Ouch, another showstopper...

> -raw.xml is not what you need.
>
>> In each of the three cases, there is no bold effect at all.
>>
>> What is needed to get the typography info transmitted?
>
> I have no experience with xhtml export in ConTeXt. This is beyond my
> knowledge. Sorry.

Aditya gave some of the answer. But his answer implies that I will have to  
define a whole bunch of

\definehighlight[typography][style=mystyle]

commands and change my entire style of writing... Yet another showstopper

>> 3. My assumption is this: If I can get the xml/xhtml file looking right  
>> in
>> the browser, I should be able to build a working docx file via pandoc.
>
> If it doesn’t look good in the browser, you won’t get it in pandoc. But
> it might be that you get it right in the browser and not in pandoc.
>
> It depends how ConTeXt outputs the XHTML.

But I may be able to save the browser output in an html format that pandoc  
could read, right?
=====

So the conclusion would appear to be: There is as yet no easy solution to  
convert context to docx. Given the bibliographical needs of this article:  
It may be that I'll do it in ConTeXt and then ask the editors to let the  
publisher -- it's a major publisher -- foot the bill for the conversion to  
docx. The ironic thing is that this publisher may very well have the final  
book done in TeX -- many of their books are typeset in TeX --, so we'll  
see what happens.

Thanks to all of you for your help!

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-14 22:22           ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-01-15  8:01             ` Alan BRASLAU
  2015-01-15 14:43               ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 1 reply; 23+ messages in thread
From: Alan BRASLAU @ 2015-01-15  8:01 UTC (permalink / raw)
  To: Idris Samawi Hamid ادريس
	سماوي حامد
  Cc: mailing list for ConTeXt users

On Wed, 14 Jan 2015 15:22:39 -0700
Idris Samawi Hamid ادريس سماوي حامد <ishamid@colostate.edu> wrote:

> > BTW, the quotation environment is not translated as blockquote and
> > paragraphs lack their <p> tags.  
> 
> Hmm, perhaps a showstopper.

Hans has often promoted the use of
\startparagraph
\stopparagraph
for the particular reason that rigorous structure can thus be correctly
exported.

I still have a hard time following this in practice, as I find that
paragraphs of text separated by blank lines to be more readable,
although I do try to use \startxxx\stopxxx forms as much as possible.
Example:
\startitemize
    \startitem item one \stopitem
    \startitem item two \stopitem
\stopitemize
(although can someone indicate how to replace \sym{} ?)


\startdigression
Curiously, I sometimes work with coauthors who only know Word as their
text editor. A work flow that we share is to edit ConTeXt source files
that are easily editable by them. This means paragraphs without any
line breaks, and the maximum use of UTF8 characters (no \alpha nor \int
for example). I have trained them to understand math versus text mode
and I place context commands on separate lines when possible.

Since they still have a hard time understanding the significance
(and the non-significance) of blank lines, I try to end all paragraphs
with \par. I imagine that \startparagraph ...\stopparagraph would be a
better practice in this workflow.
\stopdigression

The suggestion of using \definehighlight, etc. is good practice, too.

Alan

P.S. Mailers, certain text editors, and systems (MacOS for example)
often add hidden characters or change the encoding of files. Many text
editors hide these differences, so one must be careful. I understand,
though, that the problem was that of recursion with an problematic
choice of filename.
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-15  8:01             ` Alan BRASLAU
@ 2015-01-15 14:43               ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-15 16:03                 ` Wolfgang Schuster
  0 siblings, 1 reply; 23+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-01-15 14:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 15 Jan 2015 01:01:37 -0700, Alan BRASLAU <alan.braslau@cea.fr>  
wrote:

> The suggestion of using \definehighlight, etc. is good practice, too.

But to be consistent we would have to do this:

\definehighlight[important][style=bold]

\starttext
\startimportant This is important \stopimportant
\stoptext

For many/most structural elements this might be ok. But doing this with  
every typographical function... at some point the main text (paragraph  
content) just becomes unwieldy and too verbose, even unreadable. Like  
trying to proofread paragraph content in pure xml...

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-15 14:43               ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-01-15 16:03                 ` Wolfgang Schuster
  0 siblings, 0 replies; 23+ messages in thread
From: Wolfgang Schuster @ 2015-01-15 16:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 15.01.2015 um 15:43 schrieb Idris Samawi Hamid ادريس سماوي حامد <ishamid@colostate.edu>:
> 
> On Thu, 15 Jan 2015 01:01:37 -0700, Alan BRASLAU <alan.braslau@cea.fr> wrote:
> 
>> The suggestion of using \definehighlight, etc. is good practice, too.
> 
> But to be consistent we would have to do this:
> 
> \definehighlight[important][style=bold]

\definestartstop[important][style=bold]

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
___________________________________________________________________________________

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

* Re: context -> docx ??
  2015-01-14 19:58 ` Pablo Rodriguez
@ 2015-01-17 14:45   ` Idris Samawi Hamid ادريس سماوي حامد
  2015-01-17 20:32     ` Pablo Rodriguez
  0 siblings, 1 reply; 23+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-01-17 14:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Pablo Rodríguez

Hi Pablo,

Thanks for your detailed reply: Somehow I missed it till just now.  
Comments:

On Wed, 14 Jan 2015 12:58:11 -0700, Pablo Rodriguez <oinos@gmx.es> wrote:

> On 01/13/2015 08:59 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
>> Dear gang,
>>
>> I'm currently writing a paper with very basic typographical needs:
>> blockquotes, emphasis, bibliography, perhaps a graphic or two. The
>> publisher wants the thing in Word, naturally. The last time I did
>> something like this I set up a markdown document and just exported it to
>> both docx and to context. For simple documents this is at least  
>> workable,
>> but I'd prefer to write in context, not markdown.
>
> Hi Idris,
>
> I think it is better to use a markdown source with pandoc. It is the
> closest model to its native format.
>
> I have written a small book from a markdown source. The PDF document was
> generated by ConTeXt, previously converted with pandoc.
>
> I think this is the wrong way to go. Mainly because conversion to
> ConTeXt doesn’t rettain language information and special attributes. I
> had to edit the ConTeXt source to add the missing features.

Similar experience here; see below. But even the conversion to epub had  
issues, especially in getting the front matter to come out right.

> [pandoc’s internal document format only allows attributes for certain
> elements, not for all of them. A workaround is to wrap then in divs an
> spans.]
>
> In my opinion, the right way to go is to convert the markdown source to
> HTML and to parse it with an environment. Otherwise, updating the source
> is not straightforward (either you have two sources: markdown and  
> ConTeXt).

What do you mean by 'parse it with an environment'? Could you give an  
example?

> Why do you prefer to avoid markdown as a source document format?

I did a small-book project last year with markdown as source, with pdf and  
epub output. 95% or so was good but towards the end I had no choice but to  
decouple the context and epub files (so I had to deal with two sources).  
For that project I would say that the markdown/pandoc workflow was a  
qualified success.

OTOH I was not the author of that small book. As a writer I am more used  
to writing in ConTeXt than in markdown; the flow of ideas is less  
disturbed that way. Closely related, the current project has a lot of  
bibliographical references and I don't want to manually write a  
bibliography in markdown.

>> Now it's been a while since I've experimented with ConTeXt and epub.  
>> From
>> lightly perusing the list it seems that there has been considerable
>> movement on this front. So my question: Has anyone here succeeded in the
>> following workflow:
>>
>> context -> xml -> docx
>>
>> [perhaps via pandoc]?
>
> I don’t have any samples of this workflow, since I never worked this way.

It seems from this round of experimentation that the pain of context->docx  
via xml and pandoc will be more pain than it's worth. At some point I  
suspect this sort of workflow will get sorted out for ConTeXt, especially  
since it is somewhat unavoidable for many users.

> pandoc doesn’t even have a ConTeXt reader
> (https://github.com/jgm/pandoc/issues/1423). You will need a way to
> generate a document in an XML format that pandoc understands.
>
> XHTML is an option. And I guess that would be easy to generate with
> ConTeXt (I have never done it).
>
> Just in case it helps,

Indeed, your comments are always helpful, Pablo: Thanks again!!

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-17 14:45   ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-01-17 20:32     ` Pablo Rodriguez
  2015-01-17 21:06       ` Idris Samawi Hamid ادريس   سماوي حامد
  0 siblings, 1 reply; 23+ messages in thread
From: Pablo Rodriguez @ 2015-01-17 20:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 01/17/2015 03:45 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
> Hi Pablo,
> 
> Thanks for your detailed reply: Somehow I missed it till just now.  
> Comments:

Hi Idris,

> On Wed, 14 Jan 2015 12:58:11 -0700, Pablo Rodriguez wrote:
>> [...]
>> I have written a small book from a markdown source. The PDF document was
>> generated by ConTeXt, previously converted with pandoc.
>>
>> I think this is the wrong way to go. Mainly because conversion to
>> ConTeXt doesn’t rettain language information and special attributes. I
>> had to edit the ConTeXt source to add the missing features.
> 
> Similar experience here; see below. But even the conversion to epub had  
> issues, especially in getting the front matter to come out right.

Sorry, what was wrong in the conversion to ePub?

Unless you number your headings manually, you won’t get numbers in them.

As far as I know, automatic numbering is impossible in ePub 2 (there
seem to be no counters available).

Is there any other feature you miss when converting to ePub.

>> In my opinion, the right way to go is to convert the markdown source to
>> HTML and to parse it with an environment. Otherwise, updating the source
>> is not straightforward (either you have two sources: markdown and  
>> ConTeXt).
> 
> What do you mean by 'parse it with an environment'? Could you give an  
> example?

Well, the ConTeXt Suite has at least one:
tex/texmf-context/tex/context/base/x-html.mkiv.

Environments are the standard way that ConTeXt has to directly typeset
XML files (http://www.pragma-ade.com/general/manuals/xml-mkiv.pdf).

Sorry, but I cannot send a more elaborate sample right now.

>> Why do you prefer to avoid markdown as a source document format?
> 
> I did a small-book project last year with markdown as source, with pdf and  
> epub output. 95% or so was good but towards the end I had no choice but to  
> decouple the context and epub files (so I had to deal with two sources).  
> For that project I would say that the markdown/pandoc workflow was a  
> qualified success.

Well, two sources is suboptimal at best.

> OTOH I was not the author of that small book. As a writer I am more used  
> to writing in ConTeXt than in markdown; the flow of ideas is less  
> disturbed that way. Closely related, the current project has a lot of  
> bibliographical references and I don't want to manually write a  
> bibliography in markdown.

pandoc itself seems to be able to deal with bibliographies (I have never
used them myself [either in pandoc, or in TeX]).

I hope it helps,


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-17 20:32     ` Pablo Rodriguez
@ 2015-01-17 21:06       ` Idris Samawi Hamid ادريس   سماوي حامد
  2015-01-20 17:46         ` Pablo Rodriguez
  0 siblings, 1 reply; 23+ messages in thread
From: Idris Samawi Hamid ادريس   سماوي حامد @ 2015-01-17 21:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 17 Jan 2015 13:32:07 -0700, Pablo Rodriguez <oinos@gmx.es> wrote:

> On 01/17/2015 03:45 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:

>> Similar experience here; see below. But even the conversion to epub had
>> issues, especially in getting the front matter to come out right.
>
> Sorry, what was wrong in the conversion to ePub?

Just getting a simple copyright page prior to the TOC page was a pain. I  
ended up having to patch the xml manually (IIRC you helped me in that  
thread...)

> Unless you number your headings manually, you won’t get numbers in them.
>
> As far as I know, automatic numbering is impossible in ePub 2 (there
> seem to be no counters available).
>
> Is there any other feature you miss when converting to ePub.

As mentioned above, pandoc seems to have issues in getting the correct  
flow for Title-Page=>Copyright-Page=>TOC=>Main-Text. Transmitting this  
info to ConTeXt was also problematic. That's why I finally had to decouple  
things at the end of the process.

>>> In my opinion, the right way to go is to convert the markdown source to
>>> HTML and to parse it with an environment. Otherwise, updating the  
>>> source
>>> is not straightforward (either you have two sources: markdown and
>>> ConTeXt).
>>
>> What do you mean by 'parse it with an environment'? Could you give an
>> example?
>
> Well, the ConTeXt Suite has at least one:
> tex/texmf-context/tex/context/base/x-html.mkiv.
>
> Environments are the standard way that ConTeXt has to directly typeset
> XML files (http://www.pragma-ade.com/general/manuals/xml-mkiv.pdf).
>
> Sorry, but I cannot send a more elaborate sample right now.

I understand now, thanks!

>>> Why do you prefer to avoid markdown as a source document format?
>>
>> I did a small-book project last year with markdown as source, with pdf  
>> and
>> epub output. 95% or so was good but towards the end I had no choice but  
>> to
>> decouple the context and epub files (so I had to deal with two sources).
>> For that project I would say that the markdown/pandoc workflow was a
>> qualified success.
>
> Well, two sources is suboptimal at best.

Indeed!

>> OTOH I was not the author of that small book. As a writer I am more used
>> to writing in ConTeXt than in markdown; the flow of ideas is less
>> disturbed that way. Closely related, the current project has a lot of
>> bibliographical references and I don't want to manually write a
>> bibliography in markdown.
>
> pandoc itself seems to be able to deal with bibliographies (I have never
> used them myself [either in pandoc, or in TeX]).

Perhaps I'll experiment, but *after* this article is finished :-)

Thanks and best wishes
Idris
-- 
Idris Samawi Hamid, Professor
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 23+ messages in thread

* Re: context -> docx ??
  2015-01-17 21:06       ` Idris Samawi Hamid ادريس   سماوي حامد
@ 2015-01-20 17:46         ` Pablo Rodriguez
  0 siblings, 0 replies; 23+ messages in thread
From: Pablo Rodriguez @ 2015-01-20 17:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 01/17/2015 10:06 PM, Idris Samawi Hamid ادريس   سماوي حامد wrote:
> On Sat, 17 Jan 2015 13:32:07 -0700, Pablo Rodriguez wrote:
>> [...]
>> Sorry, what was wrong in the conversion to ePub?
> 
> Just getting a simple copyright page prior to the TOC page was a pain. I  
> ended up having to patch the xml manually (IIRC you helped me in that  
> thread...)
> [...]
>> Is there any other feature you miss when converting to ePub.
>
> As mentioned above, pandoc seems to have issues in getting the correct  
> flow for Title-Page=>Copyright-Page=>TOC=>Main-Text. Transmitting this  
> info to ConTeXt was also problematic. That's why I finally had to decouple  
> things at the end of the process.

This was caused because the TOC page cannot be placed anywhere in the
document.

I think that having an option to place the TOC is essential
(https://github.com/jgm/pandoc/issues/1612).

pandoc-1.13.2 has a workaround for what you needed: the metadata field
rights.

>> pandoc itself seems to be able to deal with bibliographies (I have never
>> used them myself [either in pandoc, or in TeX]).
> 
> Perhaps I'll experiment, but *after* this article is finished :-)

This is a wise decision ;-).


Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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] 23+ messages in thread

end of thread, other threads:[~2015-01-20 17:46 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-13 19:59 context -> docx ?? Idris Samawi Hamid ادريس سماوي حامد
2015-01-13 21:34 ` Marcin Borkowski
2015-01-14 17:55   ` Alan BRASLAU
2015-01-14 18:58     ` Idris Samawi Hamid ادريس سماوي حامد
2015-01-14 19:58       ` Idris Samawi Hamid ادريس سماوي حامد
2015-01-14 20:03         ` Idris Samawi Hamid ادريس سماوي حامد
2015-01-14 20:15     ` Pablo Rodriguez
2015-01-14 20:29       ` Idris Samawi Hamid ادريس سماوي حامد
2015-01-14 21:25         ` Peter Münster
2015-01-14 21:38         ` Aditya Mahajan
2015-01-14 22:11           ` Idris Samawi Hamid ادريس سماوي حامد
2015-01-14 21:59         ` Pablo Rodriguez
2015-01-14 22:22           ` Idris Samawi Hamid ادريس سماوي حامد
2015-01-15  8:01             ` Alan BRASLAU
2015-01-15 14:43               ` Idris Samawi Hamid ادريس سماوي حامد
2015-01-15 16:03                 ` Wolfgang Schuster
2015-01-14 20:50     ` Marcin Borkowski
2015-01-14 18:44   ` Idris Samawi Hamid ادريس سماوي حامد
2015-01-14 19:58 ` Pablo Rodriguez
2015-01-17 14:45   ` Idris Samawi Hamid ادريس سماوي حامد
2015-01-17 20:32     ` Pablo Rodriguez
2015-01-17 21:06       ` Idris Samawi Hamid ادريس   سماوي حامد
2015-01-20 17:46         ` Pablo Rodriguez

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