From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/47592 Path: news.gmane.org!not-for-mail From: Ilda Khaki Newsgroups: gmane.comp.tex.context Subject: automatic footnote rule in MKIV Date: Sun, 22 Feb 2009 03:13:14 +1100 Message-ID: <598a61650902210813n5db5f660pf2d0b0190a88d721@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0899417096==" X-Trace: ger.gmane.org 1235333820 15887 80.91.229.12 (22 Feb 2009 20:17:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 22 Feb 2009 20:17:00 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Feb 22 21:18:14 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1LbKmC-0001E3-FW for gctc-ntg-context-518@m.gmane.org; Sun, 22 Feb 2009 21:18:12 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 282811FC0B; Sun, 22 Feb 2009 21:16:50 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 08809-05-4; Sun, 22 Feb 2009 21:16:02 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DC95A1FC74; Sun, 22 Feb 2009 21:01:21 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E9F9E1FF05 for ; Sun, 22 Feb 2009 14:46:15 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 03193-04-43 for ; Sun, 22 Feb 2009 14:45:06 +0100 (CET) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by ronja.ntg.nl (Postfix) with ESMTP id 490C61FE73 for ; Sat, 21 Feb 2009 17:13:17 +0100 (CET) Original-Received: from mail-bw0-f165.google.com (mail-bw0-f165.google.com [209.85.218.165]) by filter1-ams.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n1LGDF5A015930 for ; Sat, 21 Feb 2009 17:13:16 +0100 Original-Received: by bwz9 with SMTP id 9so3649254bwz.2 for ; Sat, 21 Feb 2009 08:13:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=iVXX67nwmENi2TQRrjZ0Q9NO+D8uuSsmOV5mSPYQHX0=; b=nXMgU3HLUG4i8udDcasDzYsKrHw2G1MYcveO1a7NG5xNXwBpmB5QEK4uPwPW4FG7bS SeWcEJvBQ7AW14wu57vd7M+AgyBijG+b2NzMTyWPMIw2TguVOPvgTTMFv4kOfRejysff 3K8UhZ4LJwNL3z5h2rrQ9O1WdsHVLi99eOL3o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=JAHdbztLHQ9FuaZZ0j9l11P6NWKZ/LMGdkR2JiRu/HxnrkO5j6DEWJAKb1EczOuYbd /UWmcJ7sme07bxvhSbhkwilWPyaRnhmy/KyRfjYZ8PcaesmkFBc4HJidgTlf3Vbp+9WN 1jnh6izx50j7/SQtqKxKD8X2+pwaJ3NVYWrYc= Original-Received: by 10.103.220.18 with SMTP id x18mr2423223muq.38.1235232794730; Sat, 21 Feb 2009 08:13:14 -0800 (PST) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.218.165; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 183342285 - 3c2d317b57ab X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:47592 Archived-At: --===============0899417096== Content-Type: multipart/alternative; boundary=0016e6de005ef1e1100463700b1e --0016e6de005ef1e1100463700b1e Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit as I said before, in Persian we have two footnotes, one for Persian and the other for English, if the first footnote in a pageis English, then footnote rule will appear on left hand side and if the first footnote in a pgeis persian, the footnote appears on right . handside. this is the code taken from xepersian which does automatic footnoterule, it produces a file-name.fot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % footnote setup % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ifx \CatEscape\undefined \chardef\CatEscape=0 \chardef\CatOpen=1 \chardef\CatClose=2 \chardef\CatIgnore=9 \chardef\CatLetter=11 \chardef\CatOther=12 \chardef\CatActive=13 % is defined in Plain already \chardef\CatUsCode=\catcode`\_ \fi \catcode`\_=\CatLetter % top level macro file \def\r@fn{% \hbox to \columnwidth {\beginR \vbox{\kern -3\p@ \hrule width .4\columnwidth \kern2.6\p@}\hfil\endR}} \def\l@fn{% \hrule width .4\columnwidth\kern 2.6\p@} \def\@makefnmark{\hbox{$^{\hbox{\scriptsize\@thefnmark}}\m@th$}} \def\leftfootnoterule{\global\def\footnoterule{\l@fn}} \def\rightfootnoterule{\global\def\footnoterule{\r@fn}} \leftfootnoterule %%% \beginprog \newread\old_foot_file \newwrite\foot_file \def\foot_file_name{\jobname.fot\relax} \def\init_footnote{% \openin\old_foot_file\foot_file_name \ifeof\old_foot_file \closein\old_foot_file \else \closein\old_foot_file \read_foot_file \fi \immediate\openout\foot_file\foot_file_name \immediate\write\foot_file{\relax}% \global\let\init_footnote\relax } \newcount\foot_name_no % for generating footnote mark names \newcount\autofootnote \def\fnpp_next_footnote{% \init_footnote \global\advance\foot_name_no\@ne \global\advance\c@footnote\@ne \edef\do_write{% \immediate\write\foot_file{% \string\advance\autofootnote\@ne \string\expandafter\xdef \string\csname\space f@\number\foot_name_no \endcsname{% \string\number\autofootnote }% }% }% \do_write \global\autofootnote 0\csname f@\number\foot_name_no \endcsname \relax } \def\read_foot_file{% \begingroup \catcode`\@\CatLetter \catcode`\^^M\CatIgnore \input \foot_file_name \endgroup } \let\fnpp_orig_outputpage=\@outputpage \def\@outputpage{% \ifx \init_footnote\relax \immediate\write\foot_file{\autofootnote\z@}% \fi \fnpp_orig_outputpage } \let\FnppOrigFootnote=\footnote % save original bindings \let\FnppOrigFootnotemark=\footnotemark \def\footnote{% \@ifnextchar[% % ] (Emacs) \@xfootnote {\fnpp_next_footnote \ifnum\autofootnote=1\rightfootnoterule\fi \@xfootnote[\the\c@footnote] % }% } \def\footnotemark{% \@ifnextchar[% % ] (Emacs) \@xfootnotemark {\fnpp_next_footnote \ifnum\autofootnote=1\rightfootnoterule\fi \@xfootnotemark[\the\c@footnote]}% } \def\footnotemarkLR{% \@ifnextchar[% % ] (Emacs) \@xfootnotemark {\fnpp_next_footnote \ifnum\autofootnote=1\leftfootnoterule\fi\@xfootnotemark[\the\c@footnote]}% } \newif\if@RomanFootNum \providerobustcmd{\Footnote}[1]{% \bgroup \footnotemarkLR% \renewcommand{\thefootnote}{\if@RomanFootNum\rmfamily{\@arabic\c@footnote }\else\@arabic\c@footnote\fi}% \@RTLfalse\footnotetext{\rmfamily#1}% \egroup } \@RomanFootNumfalse \def\PersianFootNum{\@RomanFootNumfalse} \def\RomanFootNum{\@RomanFootNumtrue} \DeclareOption{RomanFootNum}{\@RomanFootNumtrue} \ProcessOptions \ifx \@minipagerestore\relax \let\@minipagerestore\@empty \fi \g@addto@macro\@minipagerestore{% \let\footnote\FnppOrigFootnote } \let\fnpp_orig_maketitle=\maketitle \def\maketitle{% \begingroup \let\footnotemark\FnppOrigFootnotemark \fnpp_orig_maketitle \endgroup } \catcode`\_=\CatUsCode %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % End of footnote setup % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --0016e6de005ef1e1100463700b1e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable as I said before, in Persian we have two footnotes, one for Persian and the= other for English, if the first footnote in a pageis English, then footnot= e rule will appear on left hand side and if the first footnote in a pgeis p= ersian, the footnote appears on right .
handside.

this is the code taken from xepersian which does automatic= footnoterule, it produces a file-name.fot

    &= nbsp;           &nbs= p;            &= nbsp;      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            &nb= sp;            =            %  &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;       %
    &nbs= p;            &= nbsp;           &nbs= p;      %       = ;            &n= bsp;           footnote s= etup            = ;            &n= bsp;            = ;   %
            &nb= sp;            =            %  &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;       %
    &nbs= p;            &= nbsp;           &nbs= p;      %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\ifx \CatEscape\undefined
    \chardef\CatEscape=3D0<= br>    \chardef\CatOpen=3D1
    \chardef\C= atClose=3D2
    \chardef\CatIgnore=3D9
  &nb= sp; \chardef\CatLetter=3D11
    \chardef\CatOther=3D12    \chardef\CatActive=3D13      &= nbsp; % is defined in Plain already

    \chardef\CatUsCode=3D\catcode`\_
\fi

\catc= ode`\_=3D\CatLetter           = % top level macro file


\def\r@fn{%
  \hbox to \columnwi= dth
  {\beginR \vbox{\kern -3\p@
   \hrule width .4\co= lumnwidth \kern2.6\p@}\hfil\endR}}
\def\l@fn{%
   \hrule width .4\columnwidth\kern 2.6\p@}

\def\@makefnmark{\hbox{$^{\hbox{\scriptsize\@thefnmark}}\m@th$}}

\def\leftfootnoterule{\global\def\footnoterule{\l@fn}}
\def\rightf= ootnoterule{\global\def\footnoterule{\r@fn}}
\leftfootnoterule

%%% \beginprog
\newread\old_foot_file
\newwr= ite\foot_file
\def\foot_file_name{\jobname.fot\relax}
\def\init_footn= ote{%
   \openin\old_foot_file\foot_file_name
   = \ifeof\old_foot_file  \closein\old_foot_file
   \else  \closein\old_foot_file
    =   \read_foot_file
   \fi
   \immediate\openo= ut\foot_file\foot_file_name
   \immediate\write\foot_file{\rel= ax}%
   \global\let\init_footnote\relax
   }
<= br>\newcount\foot_name_no  % for generating footnote mark names





\newcount\autofootnote
\def\fnpp_next_footnote{%
=     \init_footnote
    \global\advance\foo= t_name_no\@ne
    \global\advance\c@footnote\@ne
 = ;   \edef\do_write{%
    \immediate\write\foot_= file{%
        \string\advance\autofootnote\@ne
&= nbsp;       \string\expandafter\xdef
 &nbs= p;          \string\csname\space f@\numb= er\foot_name_no \endcsname{%
        \stri= ng\number\autofootnote
        }%
 = ;       }%
    }%
    \do_write
    \global\autofootnote 0\c= sname f@\number\foot_name_no \endcsname \relax
    }
<= br>\def\read_foot_file{%
   \begingroup
   &= nbsp;  \catcode`\@\CatLetter \catcode`\^^M\CatIgnore
  &n= bsp;   \input \foot_file_name
   \endgroup
   }

\let\fnpp_orig_outputpage= =3D\@outputpage
\def\@outputpage{%
    \ifx \init_foot= note\relax
    \immediate\write\foot_file{\autofootnote\z= @}%
    \fi
    \fnpp_orig_outputpage    }

\let\FnppOrigFootnote=3D\footnote        = % save original bindings
\let\FnppOrigFootnotemark=3D\footnotemark
\def\footnote{%
    \@ifnextchar[%    &n= bsp;       % ] (Emacs)
    \@xfo= otnote
    {\fnpp_next_footnote \ifnum\autofootnote=3D1\r= ightfootnoterule\fi \@xfootnote[\the\c@footnote] %
}%
    }
\def\footnotemark{%
    \@i= fnextchar[%            % ] (Em= acs)
    \@xfootnotemark
    {\fnpp_nex= t_footnote \ifnum\autofootnote=3D1\rightfootnoterule\fi \@xfootnotemark[\th= e\c@footnote]}%
    }




\def\footnotemarkLR{%
    \@ifnextchar[%&= nbsp;           % ] (Emacs)
&nbs= p;   \@xfootnotemark
    {\fnpp_next_footnote \= ifnum\autofootnote=3D1\leftfootnoterule\fi\@xfootnotemark[\the\c@footnote]}= %
    }

\newif\if@RomanFootNum
\providerobustcmd{\Footnote}[1]{%
\bgroup<= br>\footnotemarkLR%
\renewcommand{\thefootnote}{\if@RomanFootNum\rmfamil= y{\@arabic\c@footnote}\else\@arabic\c@footnote\fi}%
\@RTLfalse\footnotet= ext{\rmfamily#1}%
\egroup
}
\@RomanFootNumfalse
\def\PersianFootNum{\@RomanFootNumfa= lse}
\def\RomanFootNum{\@RomanFootNumtrue}
\DeclareOption{RomanFootNu= m}{\@RomanFootNumtrue}
\ProcessOptions



\ifx \@minipageres= tore\relax
    \let\@minipagerestore\@empty
\fi

\g@addto@macr= o\@minipagerestore{%
    \let\footnote\FnppOrigFootnote    }

\let\fnpp_orig_maketitle=3D\maketitle
\def= \maketitle{%
    \begingroup
     =    \let\footnotemark\FnppOrigFootnotemark
    \fnpp_orig_maketitle
    \endgroup
=     }

\catcode`\_=3D\CatUsCode

  &nb= sp;            =             &nb= sp;        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  &= nbsp;           &nbs= p;            &= nbsp;        %    &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;            = ;            &n= bsp;     %
            &nb= sp;            =            %  &= nbsp;           &nbs= p;             = End of footnote setup         =             &nb= sp;            =   %
          &nb= sp;            =              %&= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;           &nbs= p;            &= nbsp;         %
            &nb= sp;            =            %%%%%%%%%%%%%%= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% --0016e6de005ef1e1100463700b1e-- --===============0899417096== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0899417096==--