Re: [NTG-context] Captials in section head

2010-05-06 Thread Carsten Fechtmann

Is there also a way how to achieve this in MkII ? (other than by hand) 

Cheers 
Carsten 

Am 04.06.2009 um 16:34 schrieb richard.steph...@converteam.com:

 
 Am 04.06.2009 um 14:56 schrieb richard.steph...@converteam.com:
 
 
 I need all section heads to be in full-size capitals, so I tried:
 
 \setuphead[section][textcommand=\uppercase]
 
 \starttext
 \section{New section}
 \input knuth
 \stoptext
 
 But I still get lowercase.
 Using 'textcommand=\cap' gives me small capitals, but I want full-size
 capitals.
 Is there a way to get what I want?
 
 In MkIV you can say \setuphead[section][style=WORD] or
 \setuphead[section][style=\WORD]
 
 Wolfgang
 
 That's fantastic, thanks Wolfgang.
 
 Richard
 
 
 
 Converteam UK Ltd. Registration Number: 5571739 and Converteam Ltd. 
 Registration Number: 2416188  
 Registered in England and Wales.  
 Registered office: Boughton Road, Rugby, Warwickshire, CV21 1BU.  
 
 CONFIDENTIALITY : This e-mail and any attachments are confidential and may be 
 privileged. If you are not a named recipient, please notify the sender 
 immediately and do not disclose the contents to another person, use it for 
 any purpose or store or copy the information in any medium.  
 
 Please consider the environment before printing this e-mail 
 ___
 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  : https://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] Creating a nomenclature section?

2009-02-27 Thread Carsten Fechtmann


On 18.02.2009 at 16:45 wrote Michael Bynum:

Yes, I think this will suit my needs.  Thank you.  I have one  
additional question though.  In the command

\definesynonyms[nomenclature][nomenclatures][\infull]

What does the [nomenclatures] field do?  Looking at the manual it
seems to be the plural name input, but what purpose does it serve?


Other than letting ConTeXt know that

\completelistofnomenclatures  % - note the plural
and
\placelistofnomenclatures % - same here

belong to the 'nomenclature' definition...

No idea, but since one can (easily) define commands / synonyms in  
other languages and not all use a simple 'add an s for plural' ...

My guess is, it is just for that (and very convenient at that)

Cheers
Carsten

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Creating a nomenclature section?

2009-02-17 Thread Carsten Fechtmann

Dear Mike

if something simple is what you had in mind for this, you might want  
to try this:


\definesynonyms[nomenclature][nomenclatures][\infull]
\setupsynonyms[nomenclature] %[criterium=all]

\starttext
\completelistofnomenclatures

\section{Some section}

% these could be placed anywhere
\nomenclature[PI]{$\pi$}{the ratio of the circumference with respect  
to the diameter of a circle}

\nomenclature[Dia]{$d$}{the diameter of a circle}
% References to them can be placed inside the definition,
% you might want to write a macro for that if that is a feature you  
use often


\input knuth

This is the symbol \PI. Please note that no math mode has to be used  
here as that is taken care of in the definition.

% Nor for the diameter \Dia.

And just using the list of nomenclatures again:

\placelistofnomenclatures
Produces a list (sorted) of all or all used 'nomenclatures'. See also  
the section about abbreviations in the ConTeXt handbook.


There is also the \type{...register} suite of commands if page entries  
etc.\ are more what is needed.

\stoptext

Cheers
Carsten

Am 12.02.2009 um 21:00 schrieb Michael Bynum:


I haven't been able to find any documentation about producing a
nomenclature section in a document using context.  In the absence of a
command/module providing the functionality of something like the
nomencl package in latex, I was wondering if anyone else had an
elegant work around for this issue.  I guess I could just use a list
to make a nomenclature section, but that would lose a lot of the
functionality that makes something like nomencl useful.

Mike

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bug: Messy results when using table in head and multi-page tables in text

2008-01-23 Thread Carsten Fechtmann

Dear Peter and Wolfgang,

sorry for taking a bit longer to come back to you and your suggestions  
here.
But I got some strange results and did some further testing and trying  
on all this.
What got me a bit, was/is that your suggestion below works as is, but  
fails with only slightly more complicated tables. Specifically, in the  
case where there is more than one row.
Furthermore, one can't leave out
\starttablehead\stoptablehead
\starttabletail\stoptabletail
even in the case of just using the table environment, instead of  
tables. Don't ask me why.
In short, Peter, while your solution works as is, I would not  
recommend it for anything more complicated then the example below, and  
in that case one is probably better of using the framed solution from  
Wolfgang. Either that, or using the earlier idea with overlay from  
Wolfgang
 \definelayer
  [pagehead]
  [width=\paperwidth,
   height=\paperheight,
   state=repeat]

 \setlayer
  [pagehead]
  [hoffset=\backspace,
   voffset=\topspace]
  {\setups{pagehead}}

 \setupbackgrounds[page][background=pagehead]

This works just fine. THANKS A LOT for this. :-D

I had been playing around with overlays at the very beginning of my  
ConTeXt tries and had soon come to the conclusion to do some more  
basic stuff first and ... somehow never got back around to it up till  
now.
However, it is the way to go here, as it does indeed separate -  
somehow - the inner workings of the table structures enough so that  
ConTeXt is no longer getting confused about them anymore.
In short, this works as advertised.

Cheers
Carsten

P.S.: Still would be nice to have this issue fixed.
P.S.S.: It does not help with the second bug within the tables  
environment, i.e. the starting \HL line in the tabletail introducing  
an extra and unwanted! gap in the table.
Ugly workaround for me at the moment is drawing a not completely line  
by using \framed[width=broad,topframe=on]{} above the text.
While slightly better than either no line or a line with said gap, it  
is not exactly what I had in mind here, either...


Am 21.01.2008 um 12:45 schrieb Peter Rolf:

 Peter Rolf schrieb:
 Hi Carsten,
 I'm not quite sure if this is a help (was just playing around with  
 it while watching snooker).
 I had to clear|redefine the table head|tail in the page head (or is  
 this intended?). There are still some unwanted vertical offsets  
 above|below the page head. If you use a hbox instead of a vbox for  
 the page head you will see the difference on the last page. So this  
 space is introduced by the splitted table somehow. Don't ask me for  
 details ;)
 Best wishes,
 Peter

 oeps... some details were missing :D
 \setupcolors[state=start]

 \setuppagenumbering[location=]
 \setupheadertexts[{\setups[pagehead]}] [] [{\setups[pagehead]}] []

 \startsetups[pagehead]
  \vbox\bgroup
  \starttablehead\stoptablehead
  \starttabletail\stoptabletail
  \setuptables[rulecolor=blue]%
  \SetTableToWidth\makeupwidth
  \starttable[|p(40mm)|p(60mm)|p(40mm)|]
 %  \TABLEnoalign{\vskip-1.75pt} % ugly
  \HL
  \VL \leftaligned{left} \VL \midaligned{middle} \VL
  \rightaligned{right} \VL\SR
  \HL
  \stoptable
  \egroup
 \stopsetups

 \starttext

 \showframe
 \showskips

 \start

 \SetTableToWidth\makeupwidth
 \setuptables[split=repeat]

 \starttablehead
 \HL
 \VL Head \VL\SR
 \HL
 \stoptablehead

 \starttabletail
 \HL   % This results in an additional bug,
   % i.e. an extra / unwanted gap
 \VL   Foot \VL\SR
 \HL
 \stoptabletail

 \starttables[|p(.95\textwidth)|]
 \VL \input knuth \VL\FR
 %\dorecurse{1}{\VL \input tufte \VL\MR}
 \dorecurse{10}{\VL \input tufte \VL\MR}
 \VL \input knuth \VL\LR
 % \HL % putting \HL here does not introduce
   % that unwanted gap ...?!?
 \stoptables

 \stop

 \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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Bug: Messy results when using table in head and multi-page tables in text

2008-01-20 Thread Carsten Fechtmann

Dear ConTeXt experts,

I have setup a page layout where I use table in the page-head for  
formatting quite a bit of stuff. (The example below is just a simple  
as can be basic idea, to show the overall effect)
Now - as I can't prevent later users of this layout environment - to  
not use \starttables ... \stoptables I naturally would like for this  
to work in the text region as well.
This works fine and as advertised (well mostly, see below) as long as  
the table does not spill over to the next page. In which case, things  
start to look very messy, indeed.

 From my (simple) point of view it looks like ConTeXt gets confused  
about which format to use for which table and tries to do them all at  
the same place or something.

Any chance to get this fixed ?

Thanks in advance
Carsten

P.S.: There is an additional bug (also concerning the single page  
version and not related to having a table in the pagehead), which  
puts in an extra (empty) gap in between the end of the tablebody and  
the tablefoot when the tablefoot starts with \HL (and there is no \HL  
at the end of tablebody).
Things work when putting the \HL at the end of the tablebody, but then  
no \HL will be put on top of the foot for any intermediate pages of  
the table, which is certainly not what one would usually want in this  
case.


Anyway, here a simple version of this to demonstrate the effect(s)

\setuppagenumbering[location=]
\setupheadertexts[\setups{pagehead}][][\setups{pagehead}][]
\startsetups[pagehead]
\SetTableToWidth{\makeupwidth}
\starttable[|p(40mm)|p(60mm)|p(40mm)|]
\HL
\VL \leftaligned{left} \VL \midaligned{middle} \VL  
\rightaligned{right} \VL\SR
\HL
\stoptable
\stopsetups

\starttext

\start
\SetTableToWidth{\makeupwidth}
\setuptables[split=repeat]
\starttablehead
\HL
\VL Head \VL\SR
\HL
\stoptablehead
\starttabletail
\HL % This results in an additional bug,
% i.e. an extra / unwanted gap
\VL   Foot \VL\SR
\HL
\stoptabletail
\starttables[|p(.95\textwidth)|]
\VL \input knuth \VL\FR
%\dorecurse{1}{\VL \input tufte \VL\MR}
\dorecurse{10}{\VL \input tufte \VL\MR}
\VL \input knuth \VL\LR
% \HL   % putting \HL here does not introduce
% that unwanted gap ...?!?
\stoptables
\stop

\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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bug: Messy results when using table in head and multi-page tables in text

2008-01-20 Thread Carsten Fechtmann

Dear Wolfgang,

I tried that too already, but unfortunately I run into the same problem:
That is, if I use the natural tables in the header, I can't use them  
for multi-page tables in the text, as again the results ain't pretty,  
to say the least.

Here the ConTeXt to show what happens in that case
(and using your suggestion for the page-head with natural tables)

\setuppagenumbering[location=]
\setupheadertexts[\setups{pagehead}][][\setups{pagehead}][]
\startsetups[pagehead]
\bTABLE[option=stretch,strut=no,offset=.5em]
  \bTR
\bTD[align={right,lohi},width=4cm] left \eTD
\bTD[align={middle,lohi},width=6cm] middle \eTD
\bTD[align={left,lohi},width=4cm] right \eTD
  \eTR
\eTABLE
\stopsetups

\starttext

\bTABLE[split=repeat,option=stretch,strut=no,offset=.5em]
\bTABLEhead[rulethickness=1pt]
   \bTR
  \bTH[align={middle,lohi},width=6cm] head \eTH
   \eTR
\eTABLEhead
\bTABLEbody%
%\dorecurse{1}{ % works
\dorecurse{10}{ % works NOT
   \bTR
 \bTD
{\input knuth \par}
 \eTD
   \eTR
}
\eTABLEbody
\bTABLEfoot
   \bTR
 \bTH footer  \eTH
   \eTR
\eTABLEfoot
\eTABLE

\stoptext

The thing is, I rather tell the users of this page-layout NOT to use  
the \starttables ... \stoptables for multi-page tables, but rely on  
the natural tables for those (which work nicely, even though I  
_really_ would like to have a dedicated footer for each page here and  
not just one for the last page! Which by the way is something one  
doesn't need a dedicated command for, as one could _always_ just place  
that part at the end of the body part, as that will be then at the end  
of the table, i.e. the right place, no matter how many pages the table  
has.)
However, given, that \starttables ... \stoptables doesn't give me the  
correct footer in my case anyway, I rather have one type of table that  
is quite a bit easier for me and my colleagues to use and adapt for  
the multi-page tables, i.e. the 'natural' ones, and therefore keep  
using table in the header.

But yes, thanks for the suggestion, unfortunately, TABLE seems to rely  
on the same sort of buffer / storage / whatever mechanism, to do it's  
multi-page magic

And that just doesn't work with having the same table-type in the  
header, too.
(This is probably also true in case of the footer...)

Overall, things do work, as long as one does use the other type of  
table or tables / TABLE in either header or text, but it works NOT  
when you use the same in both...

Not quite sure, what's the reason for that or (and more importantly)  
what can be done about it

With best regards
Carsten

P.S.: What is interesting is that on the last pages of a multi-page  
table things do become sorted out again in either case and everything  
looks more or less as it should (i.e. like in the single-page table)

Am 20.01.2008 um 14:10 schrieb Wolfgang Schuster:

 On Sun, 20 Jan 2008 12:37:13 +0100
 Carsten Fechtmann [EMAIL PROTECTED] wrote:


 Dear ConTeXt experts,

 I have setup a page layout where I use table in the page-head for
 formatting quite a bit of stuff. (The example below is just a simple
 as can be basic idea, to show the overall effect)
 Now - as I can't prevent later users of this layout environment - to
 not use \starttables ... \stoptables I naturally would like for this
 to work in the text region as well.
 This works fine and as advertised (well mostly, see below) as long as
 the table does not spill over to the next page. In which case, things
 start to look very messy, indeed.

 From my (simple) point of view it looks like ConTeXt gets confused
 about which format to use for which table and tries to do them all at
 the same place or something.

 Any chance to get this fixed ?

 Use the following setup for the header, it use natural tables.

 \startsetups pagehead

 \bTABLE[option=stretch,strut=no,offset=.5em]
  \bTR
\bTD[align={right,lohi},width=4cm] left \eTD
\bTD[align={middle,lohi},width=6cm] middle \eTD
\bTD[align={left,lohi},width=4cm] right \eTD
  \eTR
 \eTABLE

 \stopsetups

 Thanks in advance
 Carsten

 P.S.: There is an additional bug (also concerning the single page
 version and not related to having a table in the pagehead), which
 puts in an extra (empty) gap in between the end of the tablebody and
 the tablefoot when the tablefoot starts with \HL (and there is no \HL
 at the end of tablebody).
 Things work when putting the \HL at the end of the tablebody, but  
 then
 no \HL will be put on top of the foot for any intermediate pages of
 the table, which is certainly not what one would usually want in this
 case.

 I have no solution for this.

 Anyway, here a simple version of this to demonstrate the effect(s)

 \setuppagenumbering[location=]
 \setupheadertexts[\setups{pagehead}][][\setups{pagehead}][]
 \startsetups[pagehead]
 \SetTableToWidth{\makeupwidth}
 \starttable[|p(40mm)|p(60mm)|p(40mm)|]
 \HL
 \VL \leftaligned{left} \VL \midaligned{middle} \VL
 \rightaligned{right} \VL\SR
 \HL
 \stoptable

Re: [NTG-context] Bug: Messy results when using table in head and multi-page tables in text

2008-01-20 Thread Carsten Fechtmann

Dear Wolfgang,

first, I _really_ appreciate your effort. Unfortunately, for me  
\framed is not likely to do the job, as the header is a bit more  
complicated in real-life (I told you so ;-).
And yes, actually, using framed had been my very first approach as the  
original LaTeX layout had been using \begin{picture} ...  
\end{picture}. Therefore, I thought at that time going the \framed  
route should do the trick

Here is an (still simplified) example why I don't think it would

\setuplayout[%
   width=160mm,
   topspace=10mm,
   header=35mm,
   headerdistance=5mm,
]
\setuppagenumbering[location=]
\setupheadertexts[\setups{pagehead}][][\setups{pagehead}][]

\startsetups[pagehead]
   \setupframed[offset=3pt]
   \setupcombinations[distance=-\linewidth,width=160mm,align=no]
   \dontleavehmode
   \startcombination[3]
   {\framed[align={right,lohi},height=27mm,width=35mm\relax]
 { LOGO  } }
   {\framed[align={right,lohi},width=35mm\relax]
 {left} }
   {\framed[align={middle,lohi},height=27mm,width=80mm\relax]
 {titel } }
   {\framed[align={middle,lohi},width=80mm\relax]
 {middle} }
   {\framed[align={right,lohi},height=27mm,width=45mm\relax]
 {other stuff}  }
   {\framed[align={middle,lohi},width=45mm\relax]
 {Page:~\pagenumber\ of \lastpage}}
   \stopcombination
\stopsetups

\starttext
\input knuth
\stoptext

Again, as I am still new to ConTeXt, there might be a way to get rid  
of the spaces between the frames, somehow. But I still would -- in the  
real version -- also need some extra alignments within some cells and  
in short this gets just more ugly with every further step.

I also had been thinking about going the metafun route. However, I  
do need a simple, out of the box solution that even the greenest TeX  
newbie could use and setup on all sorts of OS's ...
In short, I fear that is also not going to be a choice at the moment.

Open to suggestions
Yours
Carsten

Am 20.01.2008 um 17:18 schrieb Wolfgang Schuster:

 next solution, framed:

 \startsetups[pagehead]
 \setupframed[strut=no,offset=.5em,height=1cm]
 \dontleavehmode
 \framed[align={right,lohi},width=\dimexpr(\textwidth/7)*2+\linewidth
 \relax]{left} \hskip-\linewidth
 \framed[align={middle,lohi},width=\dimexpr(\textwidth/7)*3\relax]
 {middle} \hskip-\linewidth
 \framed[align={left,lohi},width=\dimexpr(\textwidth/7)*2+\linewidth
 \relax]{right} \stopsetups
___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] place figures at the end of document

2008-01-19 Thread Carsten Fechtmann

Dear Peter,

please be aware that I am still a ConTeXt newbie, therefore, I am not  
sure if this is really the way things should be done, only that it  
seems to work with up to a 999 figures (tested) and probably more ;-)

Nonetheless, the following code probably does the trick you were  
looking for

It has the further benefit that only those figures with the option  
[list] will go to the list and that you can do all the other tricks  
with this list of figures that you can do with any sort of list.
Unfortunately you have to change all \placefigure to \PlaceFigure (or  
some other name of your choosing for this macro)

Cheers
Carsten

%-- setting things up -
\definesorting[Figure][Figures]
\setupsorting[Figure][criterium=all]

\newcounter\FigureCounter

\def\PlaceFigure{\dodoubleempty\doPlaceFigure}
\def\doPlaceFigure[#1][#2]#3#4{
\ifsecondargument
\doifsamestringelse{#1}{list}{

\expanded{\Figure[\FigureCounter]{\noexpand\placefigure[#2]{#3} 
{{#4}} }}
\increment\FigureCounter
}{
\placefigure[#1][#2]{#3}{#4}
}
\else
\placefigure[#2]{#3}{#4}
\fi
}
%-- the actual text -
\starttext

\dorecurse{100}{
\PlaceFigure[here][fig:\recurselevel]{Blackbox in text at level  
\recurselevel}{\blackrule[width=6cm,height=4cm]}
\input knuth\par
\PlaceFigure[list][fig:\recurselevel]{Blackbox in list at level   
\recurselevel}{\blackrule[width=6cm,height=4cm]}
}
\page
\placelistofFigures

\stoptext


On 18.01.2008 at 17:36 wrote Peter I. Hansen:

 Hi,

 Is there a way in ConTeXt to place figures (and other floats) at the
 very end of the document?

 More specifically I would like to keep on having to placefigure code
 at the relevant place in the text where I would normally typeset with
 the option [here], but sometimes readers want all figures moved to the
 end of the document and it would be handy if this could be done by
 changing a keyword.

 thanks, 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  : https://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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Bug or feature? Strange counter behaviour in macro

2008-01-12 Thread Carsten Fechtmann

Hello everyone,

first off: I am new to ConTeXt (even if not so new to LaTeX)
and would like to transfer some of my old macros to ConTeXt...

I am well aware, that this means re-programming (most) of them.
So be it.

Furthermore, I am not sure if this is really the right way (read  
ConTeXt Way) to do it.
It just looked like a good idea at the time ...

However, I just hit a snuff with the following:

If one places \NewIssue[Some Time] somewhere in the text, it should  
result in a new (issue / timestamp) to be generated, which can then  
placed in a list of issues / changes.

I also want to be able to make use of the last value Issue to be  
placed in the header, same goes for the last timestamp

Now this is how I went out to do this in ConTeXt (maybe wrongly so?)
following the manual and some examples on contextwiki

%---  code below  ---
\definesynonyms[Issue][issues][\IssueText][\IssueDate]
\setupsynonyms[Issue][criterium=all]

\newcounter\IssueCounter

\definenumber[IssueNumber]

\def\TempIssueText{%
%% This was the (seemingly) only way to get any value beside 0
%%  from \getnumber within doAddIssue
%% Original place for
\incrementnumber[IssueNumber]
Issue~\getnumber[IssueNumber]:
}
\def\NewIssue{\dosingleargument\doNewIssue}
\def\doNewIssue[#1]{%
\increment\IssueCounter  % This one works correctly.
%% Alternative place for
%\incrementnumber[IssueNumber]

%% if placed here instead of in \TempIssueText
%% a DIFFERENT, but still wrong result comes out
%% that is: Debug shows the right progression,
%% but ALL Issue x Numbers are set to the last one
Debug: \IssueCounter / \getnumber[IssueNumber]%
%% but alas I can't seem to make this work with the following lines :-(
\doifempty{#1}{\Issue[\IssueCounter]{\TempIssueText}{\currentdate}}
\doifnotempty{#1}{\Issue[\IssueCounter]{\TempIssueText}{#1}}
%% Note: Using \dofiemptyelse gives the same result,
%% I just wanted to make sure here that I am /really/ not calling it  
twice,
%% somehow, by being able to disable each case, separately and  
definitely.
-- \IssueCounter / \getnumber[IssueNumber]
\crlf
}
% -- -- -- -- -- --
\starttext
\NewIssue[January 9, 2008]
\NewIssue[January 10, 2008]
\NewIssue   % January 11, 2008

List of issue \# and dates:

\placelistofissues \blank

\IssueDate{\IssueCounter} % produces correct result in either case

\stoptext
%---  code above  ---

  Result as printed out by original version
--
  Debug: 1/ 0 – 1/ 0
  Debug: 2/ 0 – 2/ 0
  Debug: 3/ 0 – 3/ 0

  List of issue # and dates:
  Issue 2: January 9, 2008
  Issue 4: January 10, 2008
  Issue 6: January 11, 2008

  January 11, 2008
--
So while \IssueCounter is updated correctly and used with the right  
values,
\getnumber[IssueNumber] always sees / reports the original value
However, the value in \placelistofissues are twice what they should be?!

This is changed if one places \incrementnumber[IssueNumber] INSIDE of  
\doAddIssue
Here, \getnumber[IssueNumber] does report the right value (same as  
IssueCounter)
However, in that case the result looks like this:

  Result as printed out by alternative version
--
Debug: 1/ 1 – 1/ 1
Debug: 2/ 2 – 2/ 2
Debug: 3/ 3 – 3/ 3

List of issue # and dates:

Issue 3: January 9, 2008
Issue 3: January 10, 2008
Issue 3: January 11, 2008

January 11, 2008

In short, while now the value of \getnumber[IssueNumber] is correct  
before and after,
its value in \placelistofissues is always the last value, i.e. equal  
to the total number of issues.

And this does NOT even change, when one replaces
Issue~\getnumber[IssueNumber]:
Issue~\IssueCounter:
in \TempIssueText

So for some reason, \TempIssueText is called twice ? How? Where?

Unfortunately, my ConTeXt.foo is not yet good enough to make it over  
the TeX.bar here
as I haven't found a way to make this work (preferably with  
\IssueCounter
as all this \XXXnumber stuff does not seem to work the way I think it  
should, anyway...)

And yes, ANY help with this is very welcome by now

Sincerely
Carsten

P.S: Context version is 2007.01.12 15:56 / TeXlive / OS X

___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bug or feature? Strange counter behaviour in macro

2008-01-12 Thread Carsten Fechtmann
Hi Aditya,

thanks for taking the time to answer this. And yes, I looked at what  
ConTeXt has already built in.

On 12.01.2008 at 18:44 wrote Aditya Mahajan:

 I haven't looked at your code below. First check if one the in-built  
 stuctural environments of ConTeXt do what you want.

As a matter of fact, I am using the following for all the heavy stuff  
(implementing that in LaTeX is/was a REAL pain)

\definesynonyms[Issue][issues][\IssueText][\IssueDate]
\setupsynonyms[Issue][criterium=all]

\Issue[1]{Issue 1:}{Some Date}
\Issue[2]{Issue 2:}{\currentdate}

and if I just put the values in by hand, it works like a champ. Sorted  
list and all.   ;-D

Took me less than 5 minutes to implement (read: find in the manual).  
Just gonna _love_ ConTeXt for that!

Now, with such a nice success (and because I have much more counter  
stuff on the way)
I was feeling lucky ...
and spent the next 5 hours figuring out / searching on the web / going  
over the source
how to have the number for each issue placed automatically, every  
time a new issue date is set.

Yes, sure, I could just _write_ that in, but then I would have to  
check myself,
which number is exactly the one I need, and not have the computer do  
it for me.
But, hey where is the fun in that? ;-)

What this all burns down is, that I /really/ would like to understand,  
how I can pass a value from a counter as (constant) argument to a self- 
defined function. As that seems to be the core of the matter/problem  
here.

Any suggestions?

Cheers
Carsten



___
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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Bug or feature? Strange counter behaviour in macro

2008-01-12 Thread Carsten Fechtmann
Hi Aditya,

yes, looking at the .tuo did the trick. :-D

I had tried things with expanded already, but at that time I still had
 {\expanded{\Issue[\IssueCounter]{Issue~\IssueCounter:}{\currentdate}}}
as command. Which does NOT work (due to the tilde ~ resulting in an  
error message then)
The rest was actually fine. Now, without it (i.e. ~) it works!
...
{\expanded{\Issue[\IssueCounter]{Issue: \IssueCounter:}{\currentdate}}}
...

Thanks a lot, that had me seriously baffled ;-)
Carsten

On 12.01.2008 at 23:29 wrote Aditya Mahajan:

 Hi Carsten,

 On Sat, 12 Jan 2008, Carsten Fechtmann wrote:

 What this all burns down is, that I /really/ would like to  
 understand,
 how I can pass a value from a counter as (constant) argument to a  
 self-
 defined function. As that seems to be the core of the matter/problem
 here.

 You need to understand how synonyms work. It writes enteries to the  
 tuo
 file, and then uses that in the second pass to sort things. One way to
 make sure that you have the correct entry in the tuo file is to use
 expanded:

 \definesynonyms[Issue][issues][\IssueText][\IssueDate]
 \setupsynonyms[Issue][criterium=all]

 \newcounter\IssueCounter

 \def\NewIssue{\dosingleargument\doNewIssue}

 \def\doNewIssue[#1]%
   {\increment\IssueCounter
 %Debug: \IssueCounter / \getnumber[IssueNumber]%
 \doifelsenothing{#1}
   {\expanded{\Issue[\IssueCounter]{\IssueCounter}{\currentdate}}}
   {\expanded{\Issue[\IssueCounter]{\IssueCounter}{#1

 % Compare the tuo file with and without expanded and you will know  
 what is
 % happening.

 \starttext
 \NewIssue[January 9, 2008]
 \NewIssue[January 10, 2008]
 \NewIssue   % January 11, 2008

 List of issue \# and dates:

 \placelistofissues \blank

 \IssueDate{\IssueCounter} % produces correct result in either case

 \stoptext

 Aditya
 ___
 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  : https://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  : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___