ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* grouped sections and footnotes
@ 2008-08-16 22:34 Idris Samawi Hamid ادريس سماوي حامد
  2008-08-17 13:22 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2008-08-16 22:34 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Hi Hans,

I am using a module -- non-distributed as far as I know -- created by  
Wolfgang. It provides grouped sectioning and footnotes:

====startstop-t.tex======
\unprotect

\def\????se{@@@@se}

\def\definegroupedsection[#1]%
   {\setvalue{\e!start#1}[##1]%
      {\getparameters[\????se#1][\c!ref=,\c!title=,##1]%
    \getvalue{#1}[\getvalue{\????se#1\c!ref}]{\getvalue{\????se#1\c!title}}}
    \setvalue{\e!stop#1}{\relax}}

\def\definegroupednote[#1]%
   {\edef\currentnote{#1}%
    \def\dostartcurrentnote[##1][##2]{\setnote[##1][##2]\bgroup\ignorespaces}%
    \setvalue{\e!start\currentnote}{\dodoubleempty\dostartcurrentnote[#1]}%
    \setvalue{\e!stop\currentnote}{\removeunwantedspaces\egroup\noteparameter\c!next}}

\definegroupedsection[title]
\definegroupedsection[chapter]
\definegroupedsection[section]
\definegroupedsection[subsection]
\definegroupedsection[subsubsection]
\definegroupednote   [footnote]

\setupfootnotes[next=\autoinsertnextspace]

\protect

\starttext
\starttitle[title=Title]
\stoptitle
\startchapter[title=Chapter]
\startsection[title=Section]
\input knuth
Text
\startfootnote[nabiyy]
A footnote
\stopfootnote
text
\startsubsection[title=Subsection]
Text
\startfootnote
A footnote. See \in{footnote}[nabiyy]
\stopfootnote
text
\startsubsubsection[title=Subsubsection]
Text
\startfootnote
A footnote
\stopfootnote
text
\stopsubsubsection
\stopsubsection
\stopsection
\stopchapter
\stoptext
=========================

Question:

a) Have you added support for grouped sectioning and footnotes in mkiv yet?
b) Does the above code seem safe for mkiv?
c) (For Wolfgang:) Has the above code been updated or extended etc. yet?

For long documents this kind of grouping has become indispensable (easy  
code-folding etc.)

Best wishes
Idris

-- 
Professor Idris Samawi Hamid, Editor-in-Chief
International Journal of Shi`i Studies
Department of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: grouped sections and footnotes
  2008-08-16 22:34 grouped sections and footnotes Idris Samawi Hamid ادريس سماوي حامد
@ 2008-08-17 13:22 ` Hans Hagen
  2008-08-18 12:31   ` Wolfgang Schuster
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2008-08-17 13:22 UTC (permalink / raw)
  To: Idris Samawi Hamid ادريس
	سماوي حامد
  Cc: mailing list for ConTeXt users

Idris Samawi Hamid ادريس سماوي حامد wrote:

> I am using a module -- non-distributed as far as I know -- created by 
> Wolfgang. It provides grouped sectioning and footnotes:

...

> a) Have you added support for grouped sectioning and footnotes in mkiv yet?

there are sectionworlds (core-swd) but i'm not sure if i will extend 
that in mkii (at some point i will freeze mkii in the sense that no new 
fundamental extensions will take place, only fixes and trivial extensions)

i'm working on a new sectioning mechanisms for mkiv (way more info to be 
carried around) but i need to make sure that it also provides proper 
downward compatibility (such mechanisms are rather interwoven with 
lists, numbering etc)

> b) Does the above code seem safe for mkiv?

looks harmless enough to be safe

> c) (For Wolfgang:) Has the above code been updated or extended etc. yet?

i hav eno problems with grouped notes in the core, but it need to be 
done differently

- the proposed code assumes an already defined note
- best do this combined with the normal definition

so .. in core-not we then have:

   ....
   ....
   \unexpanded\setvalue{\currentnote}{\setnote[#1]}%
   \unexpanded\setvalue{\currentnote\v!text}{\setnotetext[#1]}%
 
\unexpanded\setvalue{\e!start\currentnote}{\dodoubleempty\dostartcurrentnote[#1]}%
   \unexpanded\setvalue{\e!stop\currentnote}{dostopcurrentnote}}
   \setupnote[\currentnote][#2]}

\def\dostartcurrentnote[#1][#2]%
   {\setnote[#1][#2]\bgroup\ignorespaces}

\def\dostopcurrentnote
   {\removeunwantedspaces\egroup\noteparameter\c!next}

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: grouped sections and footnotes
  2008-08-17 13:22 ` Hans Hagen
@ 2008-08-18 12:31   ` Wolfgang Schuster
  2008-08-18 14:01     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster @ 2008-08-18 12:31 UTC (permalink / raw)
  To: Hans Hagen
  Cc: mailing list for ConTeXt users,
	Idris Samawi Hamid ادريس
	سماوي حامد

On Sun, Aug 17, 2008 at 3:22 PM, Hans Hagen <pragma@wxs.nl> wrote:
> Idris Samawi Hamid ادريس سماوي حامد wrote:
>
>> I am using a module -- non-distributed as far as I know -- created by
>> Wolfgang. It provides grouped sectioning and footnotes:
>
> ...
>
>> a) Have you added support for grouped sectioning and footnotes in mkiv
>> yet?
>
> there are sectionworlds (core-swd) but i'm not sure if i will extend that in
> mkii (at some point i will freeze mkii in the sense that no new fundamental
> extensions will take place, only fixes and trivial extensions)
>
> i'm working on a new sectioning mechanisms for mkiv (way more info to be
> carried around) but i need to make sure that it also provides proper
> downward compatibility (such mechanisms are rather interwoven with lists,
> numbering etc)
>
>> b) Does the above code seem safe for mkiv?
>
> looks harmless enough to be safe

Do you want to criticise my code :-)

>> c) (For Wolfgang:) Has the above code been updated or extended etc. yet?

No, I never extended the code because I never used it myself.

> i hav eno problems with grouped notes in the core, but it need to be done
> differently
>
> - the proposed code assumes an already defined note

Right but there is no other way to do this in a module.

> - best do this combined with the normal definition
>
> so .. in core-not we then have:
>
>  ....
>  ....
>  \unexpanded\setvalue{\currentnote}{\setnote[#1]}%
>  \unexpanded\setvalue{\currentnote\v!text}{\setnotetext[#1]}%
>
> \unexpanded\setvalue{\e!start\currentnote}{\dodoubleempty\dostartcurrentnote[#1]}%
>  \unexpanded\setvalue{\e!stop\currentnote}{dostopcurrentnote}}
>  \setupnote[\currentnote][#2]}
>
> \def\dostartcurrentnote[#1][#2]%
>  {\setnote[#1][#2]\bgroup\ignorespaces}
>
> \def\dostopcurrentnote
>  {\removeunwantedspaces\egroup\noteparameter\c!next}

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: grouped sections and footnotes
  2008-08-18 12:31   ` Wolfgang Schuster
@ 2008-08-18 14:01     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2008-08-18 14:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users
  Cc: وي حامد,
	=?windows-1256?Q?Idris_Samawi_Hamid_=C7=CF=D1=ED=D3_=D3=E3=C7?=

Wolfgang Schuster wrote:

>>> b) Does the above code seem safe for mkiv?
>> looks harmless enough to be safe
>
> Do you want to criticise my code :-)

i wouldn't dare; but given that it was a few lines and that i could not 
grep the do* macros i was willing to take the gamble -)

(the definition code is in the beta now, but in a way that each note 
gets the start/stop automatically)


Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-18 14:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-16 22:34 grouped sections and footnotes Idris Samawi Hamid ادريس سماوي حامد
2008-08-17 13:22 ` Hans Hagen
2008-08-18 12:31   ` Wolfgang Schuster
2008-08-18 14:01     ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).