Re: [NTG-context] Error

2012-12-17 Thread Hans Hagen

On 12/16/2012 4:28 PM, Wolfgang Werners-Lucchini wrote:

Hallo,

can someon please translate the following error to me?

*TeXExec | runtime: 26.109375

Exit code: -1073741510


not without a (as small as possible) example doc

maybe a wrong image or font inclusion?


I have

ConTeXt  ver: 2011.10.03 12:59 MKII  fmt: 2011.10.3  int:
english/english

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
___




--

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


Re: [NTG-context] here is ae

2012-12-17 Thread Hans Hagen

On 12/16/2012 10:07 PM, Schmitz Thomas A. wrote:


On Dec 16, 2012, at 2:46 PM, Hans Hagen pra...@wxs.nl wrote:


Using xml sounds ok to me (esp as you know how to do it) ... with xinclude you 
mean combining multiple files into one? It's what we do in all xml related 
projects here. There is actually an \xmlinclude command

\xmlinclude{main}{include}{filename|href|name}

this will include from elements with tags 'include' and one of the attributes 
mentioned. Do this as one of the first steps as it merges xml trees.

Hans


Hi Hans,

thanks for your suggestion. Yes, I mean combining multiple files into one 
document. Sorry that I didn't see \xmlinclude, that's of course just what I was 
looking for. But after searching the list, I saw a couple old messages by Hans 
dan der Meer which made me realise I have no idea yet how to use it. Something 
like this?

file chapter_1.xml
chapter
   text
/chapter

file chapter_2.xml
chapter
   text
/chapter

and then

file master.xml
document
   xi:include href=chapter_1.xml/
   xi:include href=chapter_2.xml/
/document

Would translate to

\startxmlsetups xml:xi:include
   \startchapter
  \xmltext{#1}{chapter}
\stopchapter
\stopchapter

Is that the basic structure, or am I misunderstanding the way this could be 
used?


well, that bit of code is *not* going so save the world

(1) master tex file

\startxmlsetups xml:setups
\xmlinclude{#1}{xi:include}{href}
\xmlsetsetup{#1}{document|chapter}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:setups}

\startxmlsetups xml:document
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:chapter
\startchapter[title=\xmltext{#1}{title}]
\xmlall{#1}{content}
\stopchapter
\stopxmlsetups

\starttext

\xmlprocessfile{main}{master.xml}{}

\stoptext

(2) master xml file (with balanced quotes)

document
  xi:include href=chapter_1.xml/
  xi:include href=chapter_2.xml/
/document

(3) proper chapters:

chapter
  titleone/title
  contenttext/content
/chapter

and

chapter
  titletwo/title
  contenttext/content
/chapter

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
___


Re: [NTG-context] here is ae

2012-12-17 Thread Thomas A. Schmitz

On 12/17/2012 10:15 AM, Hans Hagen wrote:

well, that bit of code is *not* going so save the world


It's going to save my world... Will wikify as soon as I've played a bit 
with it, thanks a lot!



(2) master xml file (with balanced quotes)


that's what I meant - someone forgets to balance their quotes, and next 
thing we know, the entire internet is coming down and the world ends.


All best

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] framed algorithm / float: problems with line break

2012-12-17 Thread Andreas Mang
Dear all,

Quick access: there is no line break in case algorithmic is used together with 
framed as a float.

I'd like to put some pseudocode in my document. I've used the algorithmic 
module. Since I'd like to refer to the algorithm in the text, I've defined a 
float environment. However, putting the pseudocode into my document, I've 
realised that it does not really stand out from the text. My first idea was to 
put some box around it. In the garden I've found some example for using framed 
together with floats:

http://wiki.contextgarden.net/Framed

However, this screws up the line break in the algorithmic environment. I could 
define manually the size of the box, but I think there might be better 
solutions. Any ideas or better ways for achieving this or a similar behaviour?!

Thanks in advance.

Cheers,
Andreas 

ConTeXt  ver: 2012.12.10 23:20 MKIV  fmt: 2012.12.14

%%% MINIMAL EXAMPLE %%%
\usemodule[algorithmic]


\definefloat[algorithm][algorithms] 

\setuplabeltext[de][algorithm=Algorithmus ]

\setupcaption[algorithm][
headstyle=bold,
location=top,
width=0.95\textwidth]


\starttext

\placealgorithm[top][alg:some-algorithm]{Some description of some algorithm.}{
\framed
  [background=color,backgroundcolor=darkblue,
   foreground=color,foregroundcolor=white,width=broad]{
\startalgorithmic
\STATE choose $\alpha\in(0,1)$
\WHILE{$\alpha  100$}
\STATE $\alpha \leftarrow \alpha + \alpha$
\ENDWHILE
\stopalgorithmic
}
}

\stoptext
%%% MINIMAL EXAMPLE %%%

___
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] here is ae

2012-12-17 Thread Thomas A. Schmitz

On 12/17/2012 10:15 AM, Hans Hagen wrote:

well, that bit of code is *not* going so save the world


OK, after playing with it for a while now:

1. Is it possible to have the benefits of components, i.e. compiling 
just one chapter with crossrefs, pagenumbers etc. taken over from the 
main file?


2. Bibliography: I have trouble getting normal bibliography to work, so 
I guess it would be best to embark on putting the references into an xml 
file and then writing my own macros for that?


Thanks a lot

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
___


Re: [NTG-context] Count the words per line

2012-12-17 Thread Philipp Gesang
Hey Huseyin,

···date: 2012-12-14, Friday···from: H. Özoguz···

 I am setting with grid-set, and I am wondering, if there is a
 possibility to count the number of words in the lines (not for each
 single line, but in average over all lines).

take a look at this:

t-wordsperline.mkvi   http://pastebin.com/ZjEY1w1p
wordsperline.lua  http://pastebin.com/YW2R97Cm

Usage:

\usemodule[wordsperline]
\starttext

  \startlinestats
\dorecurse{42}{%
  \input knuth\par
  \input ward\par
  \input tufte\par
  \input zapf\par
}
  \stoplinestats

\stoptext

(Works best with the --silent flag!)

  That would be helpful
 to get a perfectly readably book (words per row is one of these
 readability-measures). That tool could ignore hyphenated words at
 the end of a line, or count it with 0.5, or whatever.

Hyphenated words are counted as half a word on both lines so each
word amounts to exactly one. This does not account for more
complex horizontal material like boxes which may contain words.
Also the word model is extremely simplistic, so some kinds of
punctuation and effects like letter spacing can distort the
values. Thus depending on the content of your document the
figures might not be accurate; ymmv.

(Took a bit longer because initially I planned on placing the
stats in the inner and outer margin for each line. Turns out this
can’t be done with simple (Lua) means in Context because it would
interfere with the margin mechanism. So I had to scrap the first
approach and rewrote it to display stats only at the end of the
document.)

Regards
Philipp


-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments


pgpSeEEGeGKRS.pgp
Description: PGP signature
___
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
___