Re: [NTG-context] Asciidoc to PDF over Context

2015-02-13 Thread Hans Hagen

On 2/12/2015 10:18 PM, Tobias Famulla wrote:

Hello Mailing-List,

I used Latex for a few years in university to create reports for
assignments and also to write my bachelor thesis (I would have liked to
use Context, but the right schema for citation was not available and I
had no time to create it myself).
Over the time I got a little bit frustrated with Latex, because it has
many modules and most of the time gets the job done, but writing Latex
can sometimes be quite hard sometime to me (you have to have the modules
installed, tweak around with charactersets, imagepositioning, ...).

In between I looked at much smaller and sleaker document representations
languages (asciidoc, restructuredText, Markdown) and writing in it is a
pleasure compared to Latex (I haven't really tried out Context but
looked over the documentation and it looked more promising but shares
the same design ideas).
Asciidoc is even able to declarate source code listings and formulas.
Never the less, the output to Pdf is not always the nicest one.

The reason why I now write to this list, is, that I imagine, that
Context could be the right processor to create beautiful PDFs out of
intermediate formats (DocBook 5 or Asciidoc). For the conversion to
Latex a module for asciidoctor (ruby implementation) is in developement.
The ideal system I imagine would be close to what is used with HTML and
CSS on the web: Having a easy to use file format to writing you
documents (Asciidoc or DocBook as intermediate format) and a system to
create the PDFs (maybe Context and a Context-Template)

So my main questions are:
- Are there straigt forward ways to create PDFs with Context using
Docbook 5?


it's not too hard to implement but so far i never ran into docbook files 
(so it's mostly lack of momentum / motivation / reason)



- Are there not that hard possibilites to write extentions to Context
to do exactly that (maybe using Lua)?


docbook is just xml and as we process quite complex ml here i guess it 
should be doable within the current functionality



- Does it make more sense, when using another input format like
Asciidoc, to write a converter which directly creates a
Context-document? (although it might be more versatile to use DocBook
for other formats like Markdown or DocBook itself)


it depends on your documents ... as soon as you need more structure, 
more control over how it has to look typeset, the advantage of light 
coding quickly disappears; and even if there are escapes the coding then 
looks pretty bad compared to a clean tex (or xml) source


(these ascii based codings remind me of university times long ago, when 
i wrote some basic formatting / pagination code using simple directives 
so that we could handle our thesis on those terminals ... i must have 
the (pascal) source someplace ... a couple of years later I found out 
that on those vax machines there could have been tex running)



Sincerely,

Tobias



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




--

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
 | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Numbers in appendix roman, but want arabic

2015-02-13 Thread Mikael P. Sundqvist
Hi,

with the example below, I have two problems (that are probably
related). In the appendix, the Theorem is numbered Theorem II
instead of Theorem 2, i.e. roman numbers are used instead of arabic
ones.

Also, when I refer to Theorem 1 from the appendix , it says Theorem
I. Again with roman number instead of arabic. I would prefer Theorem
1.

So, the question reads: How can I get arabic numbers also in the appendix?

(The appendix itself has the letter A as I want it to)

/Mikael

\starttext

\defineenumeration[Theorem]


\defineconversionset [bodypart:sectioncounter] [n,n,n] [n]
\defineconversionset [appendix:sectioncounter] [n,n,A] [n]
\setuphead[chapter,section][sectionconversionset=sectioncounter]

\chapter{Foo}
\startTheorem[thm:main]
This is a theorem.
\stopTheorem


\startappendices
\title{Appendix}

\section{This is the first appendix}

\startTheorem
This is another theorem.
\stopTheorem

What if we refer to the first theorem, Theorem~\in[thm:main]?

\stopappendices
\stoptext
___
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] \setupcaptions question

2015-02-13 Thread joerg van den hoff


I want to use `numberstopper' for figure caption customization like so:

\setupcaptions[numberstopper={:}]

this works fine for the caption itself (i.e. I get, e.g. Figure 1:  
caption text) _but_

references to the figure via a defined label such as [fig:example]
in the body text do include the numberstopper, too, which is highly
undesirable in my view, since, e.g.,

... see Figure 1: for an example. ...

should rather read

... see Figure 1 for an example. ...

i.e. the numberstopper should be omitted (at least optionally) when  
referencing.


question: how can this be achieved?


thx/j
___
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] XML Processing with Verbatim (VIM-Typing)

2015-02-13 Thread Andreas Schneider

Am 12.02.2015 15:44, schrieb Hans Hagen:


so then you have to wikify it (or add it to the t-vim module docu)


You are right ofcourse :-)
Done: http://wiki.contextgarden.net/Verbatim_XML
___
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] Asciidoc to PDF over Context

2015-02-13 Thread luigi scarso
On Thu, Feb 12, 2015 at 10:18 PM, Tobias Famulla u...@famulla.eu wrote:

 Hello Mailing-List,

 I used Latex for a few years in university to create reports for
 assignments and also to write my bachelor thesis (I would have liked to
 use Context, but the right schema for citation was not available and I
 had no time to create it myself).
 Over the time I got a little bit frustrated with Latex, because it has
 many modules and most of the time gets the job done, but writing Latex
 can sometimes be quite hard sometime to me (you have to have the modules
 installed, tweak around with charactersets, imagepositioning, ...).

 In between I looked at much smaller and sleaker document representations
 languages (asciidoc, restructuredText, Markdown) and writing in it is a
 pleasure compared to Latex (I haven't really tried out Context but
 looked over the documentation and it looked more promising but shares
 the same design ideas).
 Asciidoc is even able to declarate source code listings and formulas.
 Never the less, the output to Pdf is not always the nicest one.

 The reason why I now write to this list, is, that I imagine, that
 Context could be the right processor to create beautiful PDFs out of
 intermediate formats (DocBook 5 or Asciidoc). For the conversion to
 Latex a module for asciidoctor (ruby implementation) is in developement.
 The ideal system I imagine would be close to what is used with HTML and
 CSS on the web: Having a easy to use file format to writing you
 documents (Asciidoc or DocBook as intermediate format) and a system to
 create the PDFs (maybe Context and a Context-Template)

 So my main questions are:
 - Are there straigt forward ways to create PDFs with Context using
 Docbook 5?
 - Are there not that hard possibilites to write extentions to Context
 to do exactly that (maybe using Lua)?
 - Does it make more sense, when using another input format like
 Asciidoc, to write a converter which directly creates a
 Context-document? (although it might be more versatile to use DocBook
 for other formats like Markdown or DocBook itself)

 Context alredy has a kind of xslt processor written in lpeg and embedded
into the format.
--- see  for example http://wiki.contextgarden.net/XML
The DocBook is a huge specification, so
I guess that a convert for ConTeXt takes a huge amount of work if you want
to map everything --- but it is feasible if you plan to start with a small
subset.
From this point of view, Docbook already has a xslt to latex,
so  working on a xslt to context maybe makes more sense, if one accepts
that context is still evolving.


-- 
luigi
___
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] Numbers in appendix roman, but want arabic

2015-02-13 Thread Rik Kabel

On 2015-02-13 03:45, Mikael P. Sundqvist wrote:

Hi,

with the example below, I have two problems (that are probably
related). In the appendix, the Theorem is numbered Theorem II
instead of Theorem 2, i.e. roman numbers are used instead of arabic
ones.

Also, when I refer to Theorem 1 from the appendix , it says Theorem
I. Again with roman number instead of arabic. I would prefer Theorem
1.

So, the question reads: How can I get arabic numbers also in the appendix?

(The appendix itself has the letter A as I want it to)

/Mikael

\starttext

\defineenumeration[Theorem]


\defineconversionset [bodypart:sectioncounter] [n,n,n] [n]
\defineconversionset [appendix:sectioncounter] [n,n,A] [n]
\setuphead[chapter,section][sectionconversionset=sectioncounter]

\chapter{Foo}
\startTheorem[thm:main]
This is a theorem.
\stopTheorem


\startappendices
\title{Appendix}

\section{This is the first appendix}

\startTheorem
This is another theorem.
\stopTheorem

What if we refer to the first theorem, Theorem~\in[thm:main]?

\stopappendices
\stoptext
___

In a document that has figures numbered by chapter, I use the following 
so that I get

Figure J.5 instead of J.V -- perhaps this will provide a starting point:

   %%-%%
   %% This ensures that appendix figures have numeric, not Roman,
   numbers %%
   %%-%%

   \defineconversionset [appendix:floatconversionset] [] [n]
   \setupcaption[numberconversionset=floatconversionset]


--
rik
___
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] Numbers in appendix roman, but want arabic

2015-02-13 Thread Mikael P. Sundqvist
On Fri, Feb 13, 2015 at 6:20 PM, Rik Kabel cont...@rik.users.panix.com wrote:
 \defineconversionset [appendix:floatconversionset] [] [n]
 \setupcaption[numberconversionset=floatconversionset]


Thank you very much!

\defineconversionset [appendix:enumconversionset] [] [n]
\setupenumeration[numberconversionset=enumconversionset]

did it for me.

Just out of curiosity, is there some way to do this to automatically
change Roman capitals to numbers in appendix (for enumerations,
captions, ...)?

/Mikel
___
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] Asciidoc to PDF over Context

2015-02-13 Thread Jan Tosovsky
On 2015-02-13 luigi scarso wrote:
 On 2015-02-12 Tobias Famulla u...@famulla.eu wrote:
 
  Context could be the right processor to create beautiful
  PDFs out of intermediate formats (DocBook 5 or Asciidoc).
 
 The DocBook is a huge specification, so I guess that a convert 
 for ConTeXt takes a huge amount of work if you want to map 
 everything --- but it is feasible if you plan to start with
 a small subset.

 From this point of view, Docbook already has a xslt to latex

DocBook has even ConTeXt output
http://sourceforge.net/projects/dblatex/files/dbcontext/

Actually it produces quite obsolete syntax, but it is a good starting point
for further tweaking. Exactly this I did in my recent project.

While my resources are very limited, if any effort in this field will start,
I can share my DocBook/XSLT experience. It could also be a nice GSoC project
for students:
https://lists.oasis-open.org/archives/docbook/201501/msg00027.html

Btw, I prefer DocBook over lightweight markup languages (Markdown, Asciidoc)
as latter lack semantics and advanced structuring, which may be limiting in
some projects requiring advanced formatting.

Jan
attachment: winmail.dat___
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
___