% \iffalse
%%
%% File: nccfoots.dtx Copyright (C) 1998-2005 by Alexander I. Rozhenko
%%
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{nccfoots}
%<package>      [2005/02/03 v1.2 NCC Footnotes Package (NCC)]
%
% \changes{v1.0}{1998/12/18}{Initial version}
% \changes{v1.1}{2004/11/23}{Minor corrections of the documentation}
% \changes{v1.2}{2005/02/03}{\NCC@makemark rename to \NCC@makefnmark}
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{nccfoots}
\GetFileInfo{nccfoots.sty}
\begin{document}
\title{The \textsf{nccfoots} package\thanks{This file
        has version number \fileversion, last
        revised \filedate.}}
\author{Alexander I. Rozhenko\\rozhenko@oapmg.sscc.ru}
\date{\filedate}
\maketitle
\DocInput{nccfoots.dtx}
\end{document}
%</driver>
% \fi
%
% The package implements commands for generating footnotes marked by
% hands.
%
% \section{User Interface}
%
% \DescribeMacro\Footnotemark
% \DescribeMacro\Footnotetext
% \DescribeMacro\Footnote
% These commands are acompany to the ordinary \LaTeX's footnote mark
% command. They allow user to mark footnotes by hands. Their syntax is
% the following:
% \begin{quote}
%     |\Footnotemark|\marg{marker}\\
%     |\Footnotetext|\marg{marker}\marg{inserted text}\\
%     |\Footnote|\marg{marker}\marg{inserted text}
% \end{quote}
% When \meta{marker} is empty the previous marker will be used. Hence,
% |\Footnote| command is equal to
% \begin{quote}
%     |\Footnotemark|\marg{marker}|\Footnotetext{}|\marg{inserted text}
% \end{quote}
%
% \StopEventually{}
%
% \section{The Implementation}
%
% \begin{macro}{\NCC@makefnmark}
% We begin with the internal command |\NCC@makemark| which tests the
% footnote marker to be empty and globally redefines \LaTeX{}
% internal command |\@thefnmark| to be equal to this marker.
% We use exactly the same expansion method as in \LaTeXe{}.
% We also initialize |\@thefnmark| command to avoid error when the
% first marking command has an empty marker.
%    \begin{macrocode}
%<*package>
\def\NCC@makefnmark#1{\def\@tempa{#1}%
  \ifx\@tempa\@empty \else
    \begingroup
      \unrestored@protected@xdef\@thefnmark{#1}%
    \endgroup
  \fi
}
\let\@thefnmark\@empty
%    \end{macrocode}
% \textbf{Note}. If you use an automatic enumeration and produce
% marker by |\the|\meta{counter} the internal command producing the
% shape of number have to be \emph{robust}. All standard shaping
% commands like |\arabic|, |\roman|, etc., are robust. Take it
% into account if you want design your own shape.
% \end{macro}
%
% \begin{macro}{\Footnote}
% \begin{macro}{\Footnotemark}
% \begin{macro}{\Footnotetext}
% Finally, we add the handle style footnote commands which are
% companions to the respective standard ones.
%    \begin{macrocode}
\newcommand*{\Footnote}[1]{\Footnotemark{#1}\@footnotetext}
\newcommand*{\Footnotemark}[1]{\NCC@makefnmark{#1}\@footnotemark}
\newcommand*{\Footnotetext}[1]{\NCC@makefnmark{#1}\@footnotetext}
%</package>
%    \end{macrocode}
% \end{macro}
% \end{macro}
% \end{macro}
\endinput
