[NTG-context] Problem with ownnumber

2011-01-22 Thread Achim Jander

Hi all,
I want to have my headings numbered via ownnumber, and they sometimes 
should include a dot.
Everything works fine except when the ownnumber is numeric. In that case 
the dot is omitted, can anyone show my my fault?


\definehead [chapter] [section=section-2, sectionsegments=2:100]
\setuphead[chapter][ownnumber=yes, headaling=flushleft,distance=0.5em]

\definehead [section] [section=section-3, sectionsegments=3:100]
\setuphead[section][ownnumber=yes, headaling=flushleft,distance=0.5em]


\starttext
\startchapter[ownnumber=I., title={chapterhead}] % the dot is kept
text\par
\startsection[ownnumber=1.,  title={sectionhead}] % no dot at all
text\par
\stopsection
\stopchapter
\stoptext

Thanks,
Achim
___
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] Fwd: Re: xml-processing: missing or ungrouped '='

2011-01-09 Thread Achim Jander

Hi Thomas,
sorry, I dont want to bother you. But in fact that is not what I'm 
looking for. Maybe its my fault that I mixed a - as I thougt - related 
problem in my second mail.
What I try to do is reduce redundancy. I cannot see where my 
explanations differ. In fact, I started with something like your 
example. But from a redundancy point of view

thats a mess so I tried to improve it. I came to something like

\startxmlsetups xml:chapter
  \startchapter[
 title={\xmlatt{#1}{title}},
 number=\xmldoifelse{#1}{./attribute('num')}{yes}{no},
 ownnumber=\xmldoifelse{#1}{./attribute('num')}{\xmlatt{#1}{num}}{}
  ]
\xmlflush{#1}
  \stopchapter
\stopxmlsetups

which works fine and at least in my eyes has a clearer structure, but 
still some redundancy. Now is the point where I think the 
misunderstandings started, because now I tried two different approaches to
decrease redundancy: First step i tried to simplyfy *this* setup and 
came to something like


\startxmlsetups xml:chapter
  \startchapter[
 title={\xmlatt{#1}{title}},
 
\xmldoifelse{#1}{./attribute('num')}{ownnumber=\xmlatt{#1}{num}}{number=no},

  ]
\xmlflush{#1}
  \stopchapter
\stopxmlsetups

which would nicely eliminate every redundance but doesn't work and 
complains about the mystery missing or ungrouped '='
The other attempt was - though i have not only to deal with chapters but 
up to about 15 hierarchies, all structured in a similar way,

so I tried to delegate the processing like

\startxmlsetups xml:fillTitleAtts
 title={\xmlatt{#1}{title}},
 number=\xmldoifelse{#1}{./attribute('num')}{yes}{no},
 ownnumber=\xmldoifelse{#1}{./attribute('num')}{\xmlatt{#1}{num}}{}
\stopxmlsetups

\startxmlsetups xml:chapter
  \startchapter[
 \xmlcommand{#1}{.}{xml:fillTitleAtts}
  ]
\xmlflush{#1}
  \stopchapter
\stopxmlsetups

which would be nicely reusable but that attempt failed whith the same 
error message - thus I thought they are related.
I have to mention, that I try not to process one file but to write 
setups for a bunch of similar but slightly different books (we're doing 
about 1000 books per year),
so my setups have to be clearly structured and easyly adaptable to 
different needs.


I dunno if that can clear up things, if not, I think its not worth much 
more discussion.


Thanks,
Achim


Am 08.01.2011 18:00, schrieb Thomas A. Schmitz:

On Jan 8, 2011, at 3:23 PM, Achim Jander wrote:


Hi Thomas,
yes, of course you are right, but thats not making the problems. Its switched in while 
making a minimal example.
My problem or maxbe misunderstanding ist what I try to achieve with

Sorry, but I still don't have the faintest idea what it is you want to do. Your 
minimal example doesn't show it, and your explanations differ from one message 
to the next.

In one of your mails, you said this:


If the title comes with an number-element  I want to set ownnumber=..., but if 
they have no numbers, I want to set number=no

If this is what you're looking for, here's what I would suggest:

\startbuffer[test]
a
  chapter title=some text
bmore text/b
bmore text/b
  /chapter
  chapter num=333 title=more text
bmore text/b
bmore text/b
  /chapter
/a
\stopbuffer

\startxmlsetups xml:testsetups
   \xmlsetsetup{\xmldocument}{a|b|chapter}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

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

\startxmlsetups xml:b
   \startparagraph
   \xmlflush{#1}
   \stopparagraph
\stopxmlsetups

\startxmlsetups xml:chapter
  \doifelse {\xmlatt{#1}{num}} {}
  {\setuphead[chapter][number=no]
   \startchapter[title={\xmlatt{#1}{title}}]
 \xmlflush{#1}
   \stopchapter}
  {\setuphead[chapter][number=yes]
   \setupheadnumber[chapter][\xmlatt{#1}{num}]
   \startchapter[title={\xmlatt{#1}{title}}]
 \xmlflush{#1}
   \stopchapter}
\stopxmlsetups

\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext

It's trivial to change the test from an attribute to anum  element, but 
maybe that's not what you're looking for...

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
___



___
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] Fwd: Re: xml-processing: missing or ungrouped '='

2011-01-08 Thread Achim Jander


Am 07.01.2011 22:52, schrieb Hans Hagen:

 On 7-1-2011 7:04, Achim Jander wrote:


 \startxmlsetups xml:title
 \startchapter[
 \xmlcommand{#1}{.}{xml:splitHeader}


 title=...

Thanks.
So it seems not to be possible, to have the whatever= part inside an
xmlcommand?
I even tried things like

\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{ownnumber=123}}{number=no}

to set either ownnumber or number but with the same error

Achim



 %number=\xmldoifelse{#1}{/num}{yes}{no}, %works
 
%ownnumber=\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{},%works


 %title={\xmlflush{#1}},%works


 there's also \xmlraw{#1}{spec} which works nice with tables of content
 as it passes the node id

 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] Fwd: Re: xml-processing: missing or ungrouped '='

2011-01-08 Thread Achim Jander

Hi Hans,
sorry, i'll try to make it more clear:

\startbuffer[test]
a
titlesome text/title
bmore text /b
bmore text /b
titlenum333/numsome text/title
bmore text /b
bmore text /b
/a
\stopbuffer

\startxmlsetups xml:testsetups
\xmlsetsetup{\xmldocument}{a|b|title}{xml:*}
\xmlsetsetup{\xmldocument}{num}{-}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

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

\startxmlsetups xml:b
\startparagraph
\xmlflush{#1}
\stopparagraph
\stopxmlsetups

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

\startxmlsetups xml:getOwnNumber
\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{}
\stopxmlsetups

\startxmlsetups xml:title
\startchapter[
%\xmldoifelse{#1}{/num}{ownnumber=\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{number=no}
title={Testcase}
]
\xmlflush{#1}
\stopchapter
\stopxmlsetups

\setupheader[chapter][ownnumber=yes]

\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext

The relevant part is the line I've commented out because of the error.
In the setup xml:title I start the chapter. If the title comes with an 
number-element  I want to set ownnumber=..., but if they have no 
numbers, I want to set number=no
But this approach seems not to work. In my real application the problem 
is, that I have a more complex setting of defining the title=, 
ownnumber= etc attributes, but equal in different
(up to 15) hierarchies. So I tried to call inside the one setup another 
setup which should do the work, but also without success (this was my 
original example).

The plan was to call that setup from each hierarchy to avoid redundancy
It was like

\startxmlsetups xml:title
\startchapter[
%--- here call another template to set title= ownnumber= etc.
]
\xmlflush{#1}
\stopchapter
\stopxmlsetups

Here again the complete example:

\startbuffer[test]
a
titlesome text/title
bmore text /b
bmore text /b
titlenum333/numsome text/title
bmore text /b
bmore text /b
/a
\stopbuffer

\startxmlsetups xml:testsetups
\xmlsetsetup{\xmldocument}{a|b|title}{xml:*}
\xmlsetsetup{\xmldocument}{num}{-}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

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

\startxmlsetups xml:b
\startparagraph
\xmlflush{#1}
\stopparagraph
\stopxmlsetups

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

\startxmlsetups xml:splitHeader %works not
number=\xmldoifelse{#1}{/num}{yes}{no},
ownnumber=\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{}, 


title={\xmlflush{#1}},
\stopxmlsetups


\startxmlsetups xml:title
\startchapter[

%trying to call another template to set
%title=
%ownnumber=
%and other stuff...
\xmlcommand{#1}{.}{xml:splitHeader}


%number=\xmldoifelse{#1}{/num}{yes}{no}, %works
%ownnumber=\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{},%works 


%title={\xmlflush{#1}},%works
]
\xmlflush{#1}
\stopchapter
\stopxmlsetups

\setupheader[chapter][ownnumber=yes]

\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext


Thanks you and have a nice Weekend
Achim


Am 08.01.2011 12:15, schrieb Hans Hagen:

On 8-1-2011 11:20, Achim Jander wrote:


Am 07.01.2011 22:52, schrieb Hans Hagen:

On 7-1-2011 7:04, Achim Jander wrote:


\startxmlsetups xml:title
\startchapter[
\xmlcommand{#1}{.}{xml:splitHeader}


title=...

Thanks.
So it seems not to be possible, to have the whatever= part inside an
xmlcommand?
I even tried things like

\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{ownnumber=123}}{number=no}

to set either ownnumber or number but with the same error


the \xmlcommand is completely unrelated to (say) \startchapter

\xmlcommand{node number}{lpath expression}{setup id}

so i have no clue what you want to do with it, unless ownnumber=123 is 
the name of a setup


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] Fwd: Re: xml-processing: missing or ungrouped '='

2011-01-08 Thread Achim Jander

Hi Thomas,
yes, of course you are right, but thats not making the problems. Its 
switched in while making a minimal example.

My problem or maxbe misunderstanding ist what I try to achieve with

\xmldoifelse{#1}{/num}{ownnumber=\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{number=no} 



or in a more complex way:

\startxmlsetups xml:title
\startchapter[

%start here
number=\xmldoifelse{#1}{/num}{yes}{no}, %works
ownnumber=\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{},%works 


%stop here

title={\xmlflush{#1}},%works
]
\stopchapter
\stopxmlsetups

what I want to do is to process the part between %start here and %stop 
here in another template

which I can reuse in different hierarchies. But I cant find no way to do so.

Greetings,
Achim


Am 08.01.2011 14:07, schrieb Thomas A. Schmitz:

On Jan 8, 2011, at 1:39 PM, Achim Jander wrote:


Hi Hans,
sorry, i'll try to make it more clear:

Excuse me, your example makes my head spin. Just from looking at it, there appears to 
be a fundamental error: you flush the content oftitle  into a context 
\startchapter \stopchapter environment, AFAICS. But that's not right: the title is 
not the content of the chapter, but just its, errm, title. Can this be the reason why 
your code doesn't work?

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
___



___
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] xml-processing: missing or ungrouped '='

2011-01-07 Thread Achim Jander

Hi all
a problem with processing XML data (maybe a lack of knowledge). If in 
the example below I set the chapter-attributes directly in 
\startxmlsetups xml:title (commented out)
everything is like I expected. Because I have headings to be treated 
equally in multiple hierarchies I tried to delegate the processing to 
splitHeader.
But then the processing always complains about a missing or ungrouped 
'=' in line ... (activated in the examle given).


\startbuffer[test]
a
titlesome text/title
bmore text /b
bmore text /b
titlenum333/numsome text/title
bmore text /b
bmore text /b
/a
\stopbuffer

\startxmlsetups xml:testsetups
\xmlsetsetup{\xmldocument}{a|b|title}{xml:*}
\xmlsetsetup{\xmldocument}{num}{-}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

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

\startxmlsetups xml:b
\startparagraph
\xmlflush{#1}
\stopparagraph
\stopxmlsetups

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

\startxmlsetups xml:splitHeader %works not
number=\xmldoifelse{#1}{/num}{yes}{no},
ownnumber=\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{},
title={\xmlflush{#1}},
\stopxmlsetups


\startxmlsetups xml:title
\startchapter[
\xmlcommand{#1}{.}{xml:splitHeader}
%number=\xmldoifelse{#1}{/num}{yes}{no}, %works
%ownnumber=\xmldoifelse{#1}{/num}{\xmlcommand{#1}{/num}{xml:ueberForceFlush}}{},%works
%title={\xmlflush{#1}},%works
]
\xmlflush{#1}
\stopchapter
\stopxmlsetups

\setupheader[chapter][ownnumber=yes]

\starttext
\xmlprocessbuffer{main}{test}{}
\stoptext



Thanks,
Achim
___
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] still struggling with footnotes

2011-01-06 Thread Achim Jander

Hi Hans,
your're a genious, thats so great! Thank you very very much!
While testing and adapting the code, there are two questions still:

I changed
   pages[number] = range
to
   local order =  v.references.order
pages[order] = range

and accordingly

function document.dosomething()
  local n = structures.notes.getn(footnote,n)

which seems to work, but it would be nice if you could confirm my 
suggestion that these two values are equal.


The other question:
As far as I can understand, structures.lists.collected seems to be 
filled before any typesetting is done yet???
Could you give me some enlightment about that or is it simply the 
ConTeXt magic?


Thank you once again,
Greetings
Achim


Am 06.01.2011 14:49, schrieb Hans Hagen:

something like this

\enabletrackers[structures.notes]

\setupnotedefinition[footnote][location=left,distance=1em,hang=4,headalign=flushright] 



\startluacode
local n, ranges, pages = 0, { }, { }
for k, v in ipairs(structures.lists.collected) do
if v.metadata.kind == description and v.metadata.name == 
footnote then

local realpage = v.references.realpage
local number = v.numberdata.numbers[1]
local range = ranges[realpage]
if not range then
range = { min = 0, max = 0 }
ranges[realpage] = range
end
if number  range.min then
range.min = number
end
if number  range.max then
range.max = number
end
pages[number] = range
end
end
function document.dosomething()
n = n + 1
local range = pages[n]
if range then
context.setupnotedefinition(
{ footnote },
{  sample = range.max }
)
end
end
\stopluacode

\appendtoks
\ctxlua{document.dosomething()}
\to \everybeforenoteinsert

\showframe

\starttext
\dorecurse {200} {test\footnote{test} }
\stoptext


-
  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] still struggling with footnotes

2011-01-05 Thread Achim Jander


Am 03.01.2011 16:51, schrieb Achim Jander:

Hi all,
I am still trying to get the footnote numbers aligned in a special 
way: flushright, but the width depends on the width of the max 
footnote-number on page,

so to get
1
2
and
~9
10

After reading the manuals and the source given in strc-not.lua thats 
how far i am at the moment:


\enabletrackers[structures.notes]

\setupnote[footnote][numbercommand=, way=bypage]
\setupnotedefinition[footnote][location=left,distance=1em,hang=4,headalign={flushright},width=1em] 




\def\getmaxnote[#1]{\ctxlua{
local n = structures.notes.getn(#1,n)
local current = structures.notes.get(#1,n)
local cr = current.references
local result = cr.realpage

-- calculate the width of cr.number and store in maxwidth
-- loop through the notes until act.realpage  cr.realpage
-- and for each note calculate the width, compare with maxwidh and 
store the max

-- then set the width to the correct maxwidth

-- context.setupnotedefinition({footnote}, {width=maxwidth})

}
}

\appendtoks
 \getmaxnote[footnote]
\to\everybeforenoteinsert

\showframe

 \starttext
\dorecurse {100} {
test  \footnote{test }
}
\stoptext

Now I can not figure out how to get the real footnote-number of the 
note (is there any way?) And does this approach make sense at all?

Any hints welcome, i tear my hair for hours now

Greetings,
Achim



Hi again,

now i found out how to get the footnote-number:

  local num = current.numberdata
  local test = num.numbers
  local num = tostring(test[1])

but i also found out, that my plan of iterating through the notes was 
indeed senseless, because at this stage the next footnote is not known. 
(i should have tested that first).
So my new plan is, to calculate the correct width in 
everybeforenoteinsert, and to compare it with the first one of the page.
My question now: is there any possibility to restart the page when i 
find that i need a greater width?

eg to invoke a command \justdoitagainsam??

Sorry that i make so much noise about such a silly footnote-thing, but 
all my books have many footnotes, and all the notes have to be 
typesetted like that (not my idea)

So without, i could hardly use ConTeXt anyway and that would be sad...

Greetings,
Achim
___
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] export and pagebreak

2011-01-03 Thread Achim Jander

Am 02.01.2011 15:57, schrieb Hans Hagen:

On 31-12-2010 7:22, Achim Jander wrote:

is it possible to get a pagebreak/ into the exported XML?


I'll send you a small patch to play wit


Hello Hans,
many thanks! I've tested a bit and it seems to work great!
Two little suggestions for improvement:
- would it possible to switch both (spaces and pagebreak) to on? It 
seems that in the Moment only one of them can be enabled.

- would it be possible to include the pagenumber as attribute?

During my tests i found a strange behaviour of the export-function (not 
related to pagebreak-export).
With certain combinations of \setupalign[hz,hanging] and body-font-size 
most of the text gets eaten:


\setupbackend [export=yes]

\enabledirectives[structures.export.pagebreaks]

\definefontfeature[default][default][%
expansion=quality,
protrusion=quality,
]

\setupbodyfont[rm,8.5pt]
%\setupbodyfont[rm,11pt] %does not work either
%\setupbodyfont[rm,12pt] %this is ok

\definebodyfontenvironment[8.5pt][%
text=8.5pt,
script=8.5pt,
scriptscript=6pt,
x=6pt,
xx=5pt,
big=28pt,
small=17.3pt]

\setupalign[hz,hanging] %without everything ok



\starttext
\input tufte
\stoptext

that gives the export:
?xml version='1.0' standalone='yes' ?

!-- input filename   : xml_test_export   --
!-- processing date  : 01/03/11 12:43:00 --
!-- context version  : 2010.12.31 08:59  --
!-- exporter version : 0.10  --

document language='en' file='xml_test_export' date='01/03/11 12:43:01' 
context='2010.12.31 08:59' version='0.10'
--fiflfiglean, synopsize, winnow the wheat from the chaff and separate 
the sheep from the goats.

/document

Either switching the body-font-size to 12pt or disable the \align gives 
the full export as expected. Very confusing.

Greetings,
Achim




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





___
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] export and pagebreak

2011-01-03 Thread Achim Jander

Am 03.01.2011 15:43, schrieb Hans Hagen:

On 3-1-2011 12:54, Achim Jander wrote:


- would it possible to switch both (spaces and pagebreak) to on? It
seems that in the Moment only one of them can be enabled.


does not make much sense as /S0 equals /pagebreak anyway (the 
default is a space)



Hi Hans,
maybe i got something wrong, but in the given example I have now
filter, lump,pagebreak/skip,
My intent is, to convert the XML eg to  EPUB and use the pagebreak / 
to give the desired Metadata.

So it would be more convenient to have
filter, lump, pagebreak/skip,
but that could be also done in the postprocessing.


- would it be possible to include the pagenumber as attribute?


maybe, keep in mind that we cannot really structure by page as 
elements can span page boundaries


of course, its only a nice-to have, it could get calculated in the 
postprocessing



maybe some attributes gets lost in the hz machinery ... needs checking

(in most cases doing a special export run makes sense, in which case 
some functionality can be turned off)


yes, i see. In my case it is of interest to have the same breaking in 
that run, so i wonder if disabling the hz feature

doesn't change the line-breaking ?

Thanks,
Achim

___
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] export and pagebreak

2011-01-03 Thread Achim Jander

Hi Hans,
thanks again. At least the first tests of the new version give me the 
expected result. Great!!


Achim

Am 03.01.2011 16:19, schrieb Hans Hagen:

On 3-1-2011 4:11, Achim Jander wrote:


So it would be more convenient to have
filter, lump, pagebreak/skip,
but that could be also done in the postprocessing.


indeed this belongs to postprocessing (if only because there is no 
space at a pagebreak) .. similar would be: abclinebreak/def where is 
no linebreak is needed it can become a space)



yes, i see. In my case it is of interest to have the same breaking in
that run, so i wonder if disabling the hz feature
doesn't change the line-breaking ?


it does

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
___


[NTG-context] still struggling with footnotes

2011-01-03 Thread Achim Jander

Hi all,
I am still trying to get the footnote numbers aligned in a special way: 
flushright, but the width depends on the width of the max 
footnote-number on page,

so to get
1
2
and
~9
10

After reading the manuals and the source given in strc-not.lua thats how 
far i am at the moment:


\enabletrackers[structures.notes]

\setupnote[footnote][numbercommand=, way=bypage]
\setupnotedefinition[footnote][location=left,distance=1em,hang=4,headalign={flushright},width=1em]


\def\getmaxnote[#1]{\ctxlua{
local n = structures.notes.getn(#1,n)
local current = structures.notes.get(#1,n)
local cr = current.references
local result = cr.realpage

-- calculate the width of cr.number and store in maxwidth
-- loop through the notes until act.realpage  cr.realpage
-- and for each note calculate the width, compare with maxwidh and store 
the max

-- then set the width to the correct maxwidth

-- context.setupnotedefinition({footnote}, {width=maxwidth})

}
}

\appendtoks
 \getmaxnote[footnote]
\to\everybeforenoteinsert

\showframe

 \starttext
\dorecurse {100} {
test  \footnote{test }
}
\stoptext

Now I can not figure out how to get the real footnote-number of the 
note (is there any way?) And does this approach make sense at all?

Any hints welcome, i tear my hair for hours now

Greetings,
Achim

___
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] export and pagebreak

2010-12-31 Thread Achim Jander

Hi all,
first I wish a very happy new year to everybody! I think, this will be 
my last post for this year, but as i have tasted blood, the next year I 
will post a lot of further questions I think :-)
Now I have Christmas holidays and can play the whole day with ConTeXt. I 
tested a little the export function. There is one thing I have on my 
wishlist:
is it possible to get a pagebreak/ into the exported XML? The 
background is that I have often the requirement to include 
pagebreak-info in online-productions (for citation reasons) and that 
could be a very good starting point. In fact, in the moment at the 
position where a pagebreak occurs, the space (if it occurs at a space) 
is eaten up. Minimal example:

\setupbackend [export=yes]

\starttext

\startchapter [title=Tufte Example]

\startparagraph
\dorecurse{10}{\input tufte}
\stopparagraph

\stopchapter

\stoptext

At the break of pg 2 to pg 3 you will find lump,skip (without the space) 
in the exported file. Having the pagebreaks would be a great thing for me.


Greetings
Achim
___
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] Arrows in symbol font

2010-12-28 Thread Achim Jander

Hi all,
I tried to insert an right arrow in my text via
 \definefontsynonym[Symbol][symbol.ttf]
  \definesymbol[test_ae][\getglyph{Symbol}{\charAE}]
\starttext
 Test ae: \symbol[test_ae]\par
 \stoptext
where AE was the codepoint Windows Char Table gave me. But in the pdf 
there was a Diamond-Sign, which should reside at codepoint A8. So I 
tested a litte more and finally found the arrow at

\definesymbol[rarr][\getglyph{Symbol}{\charC6}]
On the arrow-side i am happy now, but confused how that happens. I did 
some analysis of the font, it includes 2 cmaps, one type 0 cmap which 
declares (converted to xml for analysis):

map code=0xae name=arrowright/
 and a type 4 cmap which has
map code=0xf0ae name=arrowright/
 So I would expect one of this codes to be working (in fact, both 
codepoints work eg in Word). But \charAE gives the diamond and 
\charF0AE gives nothing at all.

Can anyone give me some enlightment?

Thanks,
Achim
___
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] Arrows in symbol font

2010-12-28 Thread Achim Jander

Hi Wolfgang,
thanks a lot.
\definefontsynonym[Symbol][symbol.ttf]
\definesymbol[rarr][\getnamedglyphdirect{Symbol}{arrowright}]
works like i expected.

Greetings,
Achim

Am 28.12.2010 18:32, schrieb Wolfgang Schuster:

Am 28.12.2010 um 16:13 schrieb Achim Jander:

   

Hi all,
I tried to insert an right arrow in my text via
\definefontsynonym[Symbol][symbol.ttf]
  \definesymbol[test_ae][\getglyph{Symbol}{\charAE}]
 

\definefontsynonym[test_ae][\getnamedglyphdirect{Symbol}{arrowright}]

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
___

   


___
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] problem with setupwhitespace

2010-12-19 Thread Achim Jander

Hi Wolfgang,
many thanks, thats what I was looking for.

Am 18.12.2010 19:32, schrieb Wolfgang Schuster:

Am 18.12.2010 um 16:10 schrieb Achim Jander:

   

Hello,
I am trying to setup a layout for a book. Its very simple, consisting only of 
paragraphs. Regularly, there should be no space between them,
but to force the pages getting filled there may be a small space. I cannot 
figure out how to set it up.
In the mailing list I found the sample
\setupwhitespace[3pt plus 2pt minus 1pt]
but in fact, that seems to have no effect, the page ist not filled. The 
Reference-Manual doesnt mention this form, but states that there is some 
stretchability.
How can I define the stretchability?
 

You don’t need \setupwhitespace, \setupalign[line] is enough.

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
___

   


___
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] startcolumns: text runs into footer

2010-12-19 Thread Achim Jander

Hi at all,
now I've run into the next problem: Trying to set text in 2 columns. 
Even in the simples case:


\showframe

\starttext

\startcolumns

\dorecurse{20}{\input knuth}

\stopcolumns

\stoptext


The text goes ca 1 line into the footer-region. I played around with 
various settings (blank, align=yes, setupwhitespace etc), but can not 
figure out

how to keep the text in the main area only.
Another related question: for which purpose is the columns setting in 
setuplayout? It doesnt seem to affect the output?
And still another question: how can i fine-control the amount of 
whitespace, especially the strechability and shrinkability?
is \setupwhitespace[2pt plus 2pt minus 2pt] the right way? And how is 
the equivalent syntax for \blank?


Thanks,
Achim
___
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] problem with setupwhitespace

2010-12-18 Thread Achim Jander

Hello,
I am trying to setup a layout for a book. Its very simple, consisting 
only of paragraphs. Regularly, there should be no space between them,
but to force the pages getting filled there may be a small space. I 
cannot figure out how to set it up.

In the mailing list I found the sample
\setupwhitespace[3pt plus 2pt minus 1pt]

but in fact, that seems to have no effect, the page ist not filled. The 
Reference-Manual doesnt mention this form, but states that there is some 
stretchability.

How can I define the stretchability?
My simple Example:


\definepapersize [NomosLexSozA] [width=125mm, height=210mm]

\setuppapersize [NomosLexSozA] [A4]

\setuplayout[

header=0cm,footer=0cm,

backspace=2.54cm,topspace=1.5cm,

width=middle,height=middle,

location=middle,marking=on,]

\showframe

\setuppagenumbering[alternative=doublesided]

\setupbodyfont[rm,7.5pt,serif]

\setupinterlinespace[line=8pt]

\setupbodyfontenvironment[default][em=italic]


\setupwhitespace[3pt plus 2pt minus 1pt]

%\setupwhitespace[line]

%\setupwhitespace[medium]

%\setupwhitespace[big]


\setuptolerance[horizontal, verytolerant, stretch]

\setuptolerance[vertical, verystrict]

\starttext

\dorecurse{40} {\input knuth}

\stoptext


with big or medium, it seems to work, but that is to much whitespace for 
my layout? Can anyone give me a hint?


Thanks,
Achim
___
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] footnotes

2010-12-12 Thread Achim Jander

Hello!
Nearly one year ago I posted a question about alignment of 
footnote-numbers to the list. I then was occupied by other projects, so 
I now want to catch up and thank you for your replies.I am now again 
trying to make some work using Context. At first, I have to state that I 
am impressed about the advancement of Context. But I still have some 
problems with footnotes:
1. My annoying alignment problem. We now have headalign=flushright, that 
is the right direction, but not sufficient. What I additionally need is 
that the width of the number-box is determined by the broadest number on 
the page, ie I need to have

1
2
3
...
but on the other page:
~8
~9
10
of course the same with 99 and 100 and so on. In an ideal world, the 
indent of the footnote-text would also change, but for the moment I 
could live with an equal indent for all pages having only the alignment 
of the notes change.
I then did some research, read the mail-list etc. What I found on the 
list was a short message about \doifnoteonsamepageelse, I thougt it 
could be a starting-point. But trying the given example

\starttext

\dorecurse {100} {

test \footnote{\doifnoteonsamepageelse[footnote]{ibidem}{aaa}}

}

\stoptext
gave me 100 nice little notes, all containing aaa, which was not what I 
had expected... I then wanted to figure out a little more what was 
happening, tried to enable tracking with 
\enabletrackers[structure.notes], but could not find any of the expected 
messages in the log? What is going on?
Because this problem is a real show stopper for me, I hope you can help 
me getting a solution.



2. The second, but not equal important problem is multicolum footnotes. 
It seems only to work with very short footnotes, in my example

\setupnote[footnote][n=2, columndistance=12pt]

\starttext

This is just for \footnote{note1} testing

This is just for \footnote{note1} testing

This is just for \footnote{note1} testing

This is just for \footnote{note1} testing

This is just for \footnote{This is a very long note which will cover 
multiple lines. This is a very long note which will cover multiple 
lines. This is a very long note which will cover multiple lines. This is 
a very long note which will cover multiple lines. This is a very long 
note which will cover multiple lines. This is a very long note which 
will cover multiple lines.} testing


This is just for \footnote{note1} testing

This is just for \footnote{note1} testing

This is just for \footnote{note1} testing

\stoptext
the long footnote 5 covers both columns.


3. At last I tried to set the footnotes in one paragraph, a layout 
sometimes used in our publications. As I found, the setup should be

\setupnote[footnote][n=0, location=text]

but trying it with the text of problem 2 i only got an Arithmetic overflow.


For clarification, I am using ConTeXt ver: 2010.12.10 15:15 MKIV fmt: 
2010.12.11 int: english/english



Thanks,
Achim



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

2010-12-12 Thread Achim Jander

Hi again,
it seems that i found the solution for problem 3:
\setupnote 
[footnote][paragraph=yes,numbercommand=,inbetween=\hskip.5em\vl\hskip.5em]


\setupdescriptions[footnote][display=no,location=serried,distance=.5em]

at least the first tests seem to work like a charm...


Greetings,
Achim




Am 12.12.2010 12:09, schrieb Achim Jander:

Hello!
Nearly one year ago I posted a question about alignment of 
footnote-numbers to the list. I then was occupied by other projects, 
so I now want to catch up and thank you for your replies.I am now 
again trying to make some work using Context. At first, I have to 
state that I am impressed about the advancement of Context. But I 
still have some problems with footnotes:
1. My annoying alignment problem. We now have headalign=flushright, 
that is the right direction, but not sufficient. What I additionally 
need is that the width of the number-box is determined by the broadest 
number on the page, ie I need to have

1
2
3
...
but on the other page:
~8
~9
10
of course the same with 99 and 100 and so on. In an ideal world, the 
indent of the footnote-text would also change, but for the moment I 
could live with an equal indent for all pages having only the 
alignment of the notes change.
I then did some research, read the mail-list etc. What I found on the 
list was a short message about \doifnoteonsamepageelse, I thougt it 
could be a starting-point. But trying the given example

\starttext

\dorecurse {100} {

test \footnote{\doifnoteonsamepageelse[footnote]{ibidem}{aaa}}

}

\stoptext
gave me 100 nice little notes, all containing aaa, which was not what 
I had expected... I then wanted to figure out a little more what was 
happening, tried to enable tracking with 
\enabletrackers[structure.notes], but could not find any of the 
expected messages in the log? What is going on?
Because this problem is a real show stopper for me, I hope you can 
help me getting a solution.



2. The second, but not equal important problem is multicolum 
footnotes. It seems only to work with very short footnotes, in my example

\setupnote[footnote][n=2, columndistance=12pt]

\starttext

This is just for \footnote{note1} testing

This is just for \footnote{note1} testing

This is just for \footnote{note1} testing

This is just for \footnote{note1} testing

This is just for \footnote{This is a very long note which will cover 
multiple lines. This is a very long note which will cover multiple 
lines. This is a very long note which will cover multiple lines. This 
is a very long note which will cover multiple lines. This is a very 
long note which will cover multiple lines. This is a very long note 
which will cover multiple lines.} testing


This is just for \footnote{note1} testing

This is just for \footnote{note1} testing

This is just for \footnote{note1} testing

\stoptext
the long footnote 5 covers both columns.


3. At last I tried to set the footnotes in one paragraph, a layout 
sometimes used in our publications. As I found, the setup should be

\setupnote[footnote][n=0, location=text]

but trying it with the text of problem 2 i only got an Arithmetic 
overflow.



For clarification, I am using ConTeXt ver: 2010.12.10 15:15 MKIV fmt: 
2010.12.11 int: english/english



Thanks,
Achim



___ 

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
___ 





___
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 about a forum

2010-12-12 Thread Achim Jander

Hi everybody,
I am trying to get into Context again. The documentation seems to be 
somewhat better than one year ago (my last attempt) but still very 
suboptimal. Many information (as well on Contextgarden as on Pragma) is 
outdated, for example, the xml document on Pragma is dated 2001, the 
first document on the context wiki does not mention mkiv (ok, at least 
now there is a hint that something should be done about that). For a 
newbie like me, the best chance of information seems to be the 
mailing-list, where one can find a lot of gems.
After spending this cold and snowy sunday afternoon with the 
mailing-list (and i got no further than to september 2010) I am 
wondering why there ist no forum for Context. I spend a lot of time 
getting into new themes, and I always like the functions of forums.
I think in a forum the acces to the relavant information could be very 
quicklier than in a Mailing-List - which is in my opinion a relict of 
the information possibilities of the 1990 (last century, only a minute 
away from the middle ages :-).
Dont get me wrong, I like the unbelievable support which is done on the 
mailing-list, but i think today there could be more efficient possibilities.

Any suggestions on that?
Thanks,
Achim

___
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] footnote-number-alignment

2009-11-15 Thread Achim Jander

Hello,
after struggling some weeks to get everything to work, i'm now
nearly satisfied with typsetting via context. But there is one
problem left for that i cant find any solution, even after googling
for hours.
I am typesetting documents with a large amount of footnotes, and
want to have the footnote-number aligned to the correct decimal place.
The footnotes appear in an numbered-list style.
To explain:
page one has footnotes 1 to 8, numbers are left-aligned, everything is good

-
1 footnotetext
2 footnotetext
3 footnottext

8 footnotetext

page two has footnotes 9 to 12, so I want to have

9 footnotetext
10 footnotetext
...

but i only get:
9 footnotetext
10 foootnotextex.

I think, there is no easy solution, but maybe someone can give me a push
to the direction how i can realize that behaviour (btw same problem is with
numbered lists, and to make it really complicated, i do need the 
behaviour even

with multicolumn footnotes)
Any hint is welcome,

Thanks a lot
Achim Jander
___
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
___