Re: [NTG-context] little coding assistance (please)

2007-11-17 Thread luigi scarso
On Nov 16, 2007 12:55 PM, Steffen Wolfrum [EMAIL PROTECTED] wrote:

 Hi,

 I need some help for shorten the TeX code in the following example:

Can you give a short and comprensive example ?

-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] little coding assistance (please)

2007-11-17 Thread Steffen Wolfrum
Hi Luigi,


Am 17.11.2007 um 09:06 schrieb luigi scarso:



 On Nov 16, 2007 12:55 PM, Steffen Wolfrum [EMAIL PROTECTED]  
 wrote:
 Hi,

 I need some help for shorten the TeX code in the following example:
 Can you give a short and comprensive example ?


Wolfgang provided me an excellent example that illustrates the idea  
perfectly:

\usemodule[visual]

\def\NFD{9.8pt} % normalfootnotedistance

\def\footnotedistance[#1]%
   {\setupfootnotedefinition[style={\setupinterlinespace[line=\dimexpr 
\NFD*#1\relax]}]}

\starttext

\dorecurse{10}
   {\fakewords{30}{40}\footnote{\fakewords{5}{15}} }

\footnotedistance[4]

\dorecurse{10}
   {\fakewords{30}{40}\footnote{\fakewords{5}{15}} }

\footnotedistance[1]

\dorecurse{10}
   {\fakewords{30}{40}\footnote{\fakewords{5}{15}} }

\stoptext


Now, my problem is that I don't use the footnote definition  
\setupfootnotedefinition[style=...]
but the following instead:
   \def\setnotebodyfont
 {\let\setnotebodyfont\relax
  \restoreglobalbodyfont
 \switchtobodyfont[rm,9pt]\setupinterlinespace[line=9.8pt]
\parskip2pt}

And I couldn't find a way to use this with variables like above (\def 
\footnotedistance[#1]...).

Do you know how this should be coded?

Steffen


___
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] little coding assistance (please)

2007-11-17 Thread luigi scarso


 Do you know how this should be coded?




 Steffen



 ___
 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

 ___


maybe

\long\def\Footnote[#1]#2{%
\def\setnotebodyfont{%
\let\setnotebodyfont\relax
\restoreglobalbodyfont%
\MyFaktor=#1%
\switchtobodyfont[rm,9pt]%
\setupinterlinespace[line=\dimexpr(9.8\MyFaktor)\relax]%
\parskip\dimexpr(2\MyFaktor)\relax%
}%
\footnote{#2}%
}


\starttext
\blank--0---\blank
\dorecurse{05}
  {\fakewords{30}{40}\Footnote[0.987pt]{\fakewords{5}{15}} }
\blank--1---\blank
\dorecurse{10}
  {\fakewords{30}{40}\Footnote[1pt]{\fakewords{5}{15}} }
\blank--2--\blank
\dorecurse{10}
  {\fakewords{30}{40}\Footnote[1.2pt]{\fakewords{5}{15}} }
\blank--3--\blank
\dorecurse{10}
  {\fakewords{30}{40}\Footnote[2pt]{\fakewords{5}{15}} }

\stoptext


-- 
luigi
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


[NTG-context] little coding assistance (please)

2007-11-16 Thread Steffen Wolfrum
Hi,

I need some help for shorten the TeX code in the following example:

My footnotes are defined like this:

  \def\setnotebodyfont
{\let\setnotebodyfont\relax
 \restoreglobalbodyfont
\switchtobodyfont[rm,9pt]\setupinterlinespace[line=9.8pt] 
\parskip2pt}


But sometimes at single pages I need to shrink footnote's  
setupinterlinespace and parskip a bit.
To adjust the percentage of shrinking (setupinterlinespace[line= 
\dimexpr(9.8\MyFaktor)]\parskip\dimexpr(2\MyFaktor)}) I use the  
following:

\newdimen\MyFaktor
\MyFaktor=0.978pt

[Normal body-text ...]
  \def\setnotebodyfont
{\let\setnotebodyfont\relax
 \restoreglobalbodyfont
\switchtobodyfont[rm,9pt]\setupinterlinespace[line=\dimexpr(9.8 
\MyFaktor)]\parskip\dimexpr(2\MyFaktor)}
[...] Text with footnotes [...]
  \def\setnotebodyfont
{\let\setnotebodyfont\relax
 \restoreglobalbodyfont
\switchtobodyfont[rm,9pt]\setupinterlinespace[line=9.8pt] 
\parskip2pt}
[...]


This works great, but looks ugly and not clear at all!!

Could someone please provide me a definition like \ThightNotes[0.978]  
and \NormalNotes that I could hook handy and clear in the respective  
body-text?


Thanks in advance,

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