ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* little coding assistance (please)
@ 2007-11-16 11:55 Steffen Wolfrum
  2007-11-17  8:06 ` luigi scarso
  0 siblings, 1 reply; 4+ messages in thread
From: Steffen Wolfrum @ 2007-11-16 11:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: little coding assistance (please)
  2007-11-16 11:55 little coding assistance (please) Steffen Wolfrum
@ 2007-11-17  8:06 ` luigi scarso
  2007-11-17  9:26   ` Steffen Wolfrum
  0 siblings, 1 reply; 4+ messages in thread
From: luigi scarso @ 2007-11-17  8:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 213 bytes --]

On Nov 16, 2007 12:55 PM, Steffen Wolfrum <context@st.estfiles.de> wrote:

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

-- 
luigi

[-- Attachment #1.2: Type: text/html, Size: 470 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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: little coding assistance (please)
  2007-11-17  8:06 ` luigi scarso
@ 2007-11-17  9:26   ` Steffen Wolfrum
  2007-11-18  2:36     ` luigi scarso
  0 siblings, 1 reply; 4+ messages in thread
From: Steffen Wolfrum @ 2007-11-17  9:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Luigi,


Am 17.11.2007 um 09:06 schrieb luigi scarso:

>
>
> On Nov 16, 2007 12:55 PM, Steffen Wolfrum <context@st.estfiles.de>  
> 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
___________________________________________________________________________________


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

* Re: little coding assistance (please)
  2007-11-17  9:26   ` Steffen Wolfrum
@ 2007-11-18  2:36     ` luigi scarso
  0 siblings, 0 replies; 4+ messages in thread
From: luigi scarso @ 2007-11-18  2:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1259 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 2198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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:[~2007-11-18  2:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-16 11:55 little coding assistance (please) Steffen Wolfrum
2007-11-17  8:06 ` luigi scarso
2007-11-17  9:26   ` Steffen Wolfrum
2007-11-18  2:36     ` luigi scarso

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).