Re: [NTG-context] context - docx ??

2015-01-17 Thread Pablo Rodriguez
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
___

[NTG-context] How to draw this picture?

2015-01-17 Thread Rob Heusdens
I am working on an economic book, which I convert from a paper edition
into a digital edition, which contains some figures I want to recreate
using context or other tool.

In logical terms, the picture represents some economic figures and
visualizes how some figure (e.g. National income and the amount) is the
sum of some other figures, in which it can be split up.

In logic terms the figure then explains that:

A can be split up into B and C. B can be split up into D and E. D is F. E
can be split into G,H,I and K.

Graphically this is depicted like a table containing 4 columns and 5 rows,
and the split into is drawn as two diagonal lines (one right-up and
another righ down) which shows how the element on the left column is split
up into the elements on the right column using the diagonal lines that
center in the left element, drawn to the right top and right bottom
element.

I worked this out into context as a simple table, and used instead of the
diagonal lines only vertical lines. Which is less expressive, but still
visualizes the splitting sufficiently I hope.

But I would like to rework this picture, using a brace instead of a
vertical line, similar to how in a formula one uses mathcases.

I tried to use mathcases, but it seems mathcases can't be nested??

I was thinking of other solutions, like replacing the vertical line with a
small column in which to put a vertical stretched brace symbol, at the
appriopriate lowered cell, but don't know how the vertical stretch a
glyph.

What is the best way to code this in ConText? (preferred is to use the
symbol left brace.)

Greetings,

Rob

---

context code now used:

\starttable[s0|cp(.2\textwidth)|cp(.2\textwidth)|cp(.2\textwidth)|cp(.25\textwidth)|]
\NC \NC \VL Variabel\\ kapitaal\\ 10 \VL Arbeidsloon v/d\\
productie-arbeiders\\ 10 \NC \AR
\NC \NC \VL  \NC \NC \AR
\NC \NC \VL  \NC \NC \AR
\NC \VL Nationaal\\ inkomen\\ 30 \VL \VL Winst van de\\ industriële
kapitalist\\ 10 \NC \AR
\NC \VL \VL  \VL \NC \AR
\NC \VL \VL \VL Commerciële\\ winst\\ 3 \NC \AR
\NC Totaal\\ maatschappelijk\\ product\\ 90 \VL \VL Meerwaarde\\ 20 \VL 
Rente\\ 2 \NC \AR
\NC \VL \VL  \VL Grondrente\\ 5 \NC \AR
\NC \VL \NC  \NC  \NC \AR
\NC \VL Vervanging \\ v/h verbruikte \\ constante\\ kapitaal\\ 60 \NC \NC 
\NC \AR
\stoptable

___
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] context - docx ??

2015-01-17 Thread Idris Samawi Hamid ادريس سماوي حامد

On Sat, 17 Jan 2015 13:32:07 -0700, Pablo Rodriguez oi...@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
___

Re: [NTG-context] For the Mac users: AppleScript to launch ConTeXt in a flexile way

2015-01-17 Thread Thomas Floeren

On 17 Jul 2014, at 2:19, Thomas Floeren wrote:


Hello,

Some months ago I wrote a little AppleScript script with one purpose: 
It should be a flexible script to launch ConTeXt typesetting, 
independently of the text editor I’m using and it should be capable 
to typeset the Product file even if I’m currently editing any 
component file belonging to that Product file.


I used it for some time, I improved it, and I shared it with a 
collegue who also works with ConText on OSX. We’re still using it, 
many bugs have been fixed and some features were added.


The script proved to be very useful for us and I thought, why not 
share it with the other Mac-ConTeXt people?



So here it is: …
…



The old link won’t work anymore, the script has a new home: 
http://dflect.net/context-typeset-tool/


Of course it works fine with Yosemite :-)

Best wishes
--
Thomas

___
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] Positioning an arrow between two values (Metapost)

2015-01-17 Thread Fabrice Couvreur
Hi,
I went from PSTricks to Metapost (Metafun) gradually. For positioning arrows
between two values in an array of variations, I used a command like this \
ncline {A}{B}, which avoids fumbling.
Can we do the same with Metapost ?
The idea would be to convert the value into a path or an image, much like in
the code below.

\starttext
\startMPcode
u:=1cm ;
path p, q ;
p=fullsquare scaled u ;
q=fullsquare scaled u shifted (4u,-2u) ;
draw p ;
draw q ;
drawarrow center p--center q ;
label(btex $5$ etex,center p) ;
label(btex $-2 $ etex,center q) ;
\stopMPcode
\stoptext

Best regards,
Fabrice
___
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] What happened to the ePub script?

2015-01-17 Thread Henning Hraban Ramm
Hi there,

I started documenting ConTeXt’s current ePub/export behaviour in 
http://wiki.contextgarden.net/ePub and will merge/delete the content of the 
current wiki pages as soon as I’m content with its content ;)

* Do you think it would be better to document export and ePub separately?


Of course I have questions, e.g.:

* How can I set the current \date in a metadata variable?
(I know it’s also in the date tag of document, but I know how to format \date 
…)

This doesn’t work (i.e. I get „\date“ in XML/XHTML):

\settaggedmetadata[
version={\date}
]

* Can I influence the directory/file names of the export from within the source?
E.g. if I compile „minimal.tex“, I get minimal-export and minimal-epub
The —result switch doesn’t change anything.

* BTW: Can I set —result from within my ConTeXt source?

More to follow ;)



Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___
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] context - docx ??

2015-01-17 Thread Idris Samawi Hamid ادريس سماوي حامد

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 oi...@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
___

[NTG-context] Issues in export

2015-01-17 Thread Henning Hraban Ramm
Hi, please consider the example at 
http://wiki.contextgarden.net/Export#More_useful_example
and its result at http://wiki.contextgarden.net/Export#raw.xml_2 etc.

The metadata tags end up within the first section (in this case: chapter), 
even if they’re defined before \starttext.

Please fix, thanks.



Further, I wonder about the tagging of footnotes (and probably other 
references, didn’t look into them yet):
This is completely visual instead of semantical:

(in *-raw.xml:)

Quothdescriptionsymbol detail=footnotesup1/sup/descriptionsymbol
...
  description detail=footnote chain=footnote
   descriptiontagsup1/sup /descriptiontag
   descriptioncontentby Edgar Al­lan Poe/descriptioncontent
  /description

(in *-div.xhtml:)

Quothdiv class=descriptionsymbol footnotediv class=sup1/div/div
...
  div class=description footnote
   div class=descriptiontagdiv class=sup1/div /div
   div class=descriptioncontentby Edgar Al­lan Poe/div
  /div


In raw.xml I’d prefer something like


Quothdescription detail=footnote id=1by Edgar Allan Poe/description 


or


Quothdescription detail=footnote id=1 /
...
  description detail=footnote id=1
   descriptiontag1/descriptiontag
   descriptioncontentby Edgar Al­lan Poe/descriptioncontent
  /description


and in div.xhtml something that works in HTML, like a title:


Quothdiv class=descriptionsymbol footnote title=by Edgar Al­lan Poediv 
class=sup1/div/div


or a link:


Quotha href=#footnote_1div class=descriptionsymbol footnotediv 
class=sup1/div/div/a
…
a name=„footnote_1“
  div class=description footnote
   div class=descriptiontagdiv class=sup1/div /div
   div class=descriptioncontentby Edgar Al­lan Poe/div
  /div
/a


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

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