summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/fink/fink.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/fink/fink.dtx
Initial commit
Diffstat (limited to 'macros/latex/contrib/fink/fink.dtx')
-rw-r--r--macros/latex/contrib/fink/fink.dtx379
1 files changed, 379 insertions, 0 deletions
diff --git a/macros/latex/contrib/fink/fink.dtx b/macros/latex/contrib/fink/fink.dtx
new file mode 100644
index 0000000000..b2764b8dab
--- /dev/null
+++ b/macros/latex/contrib/fink/fink.dtx
@@ -0,0 +1,379 @@
+% \iffalse
+%
+% fink.dtx --- Doc file for the FiNK package (code and documentation)
+%
+% Copyright (C) 1999, 2000, 2001, 2002, 2007, 2010, 2011 Didier Verna
+%
+% Author: Didier Verna <didier@lrde.epita.fr>
+% Maintainer: Didier Verna <didier@lrde.epita.fr>
+% Created: Thu Sep 23 18:23:48 1999
+% Last Revision: Wed Oct 19 12:14:15 2011
+%
+% This file is part of FiNK.
+%
+% FiNK may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.1
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.1 or later is part of all distributions of LaTeX
+% version 1999/06/01 or later.
+%
+% FiNK consists of all files listed in the file `README'.
+%
+%
+% Commentary:
+%
+% Contents management by FCM version 0.1.
+%
+%
+% Code:
+%
+%<*driver>
+\documentclass[a4paper]{ltxdoc}
+\usepackage[T1]{fontenc}
+\usepackage{xspace}
+\newcommand{\fink}{%
+ \mbox{\fontfamily{ptm}\fontseries{b}\fontshape{it}\selectfont%
+ F\hspace{-.4ex}\protect\raisebox{-.5ex}{\textmd{i}}\hspace{0.2ex}NK}%
+ \xspace}
+\makeatletter
+ \def\@currname{fink}
+ \def\@currext{inc}
+\makeatother
+\input{header.inc}
+% \OnlyDescription
+\CodelineIndex
+% \RecordChanges
+\begin{document}
+\DocInput{fink.dtx}
+\end{document}
+%</driver>
+%
+% \fi
+%
+% \catcode`\¡=14
+% \CheckSum{159}
+% \GetFileInfo{fink.inc}
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%
+% \MakeShortVerb{\|}
+%
+% \makeatletter
+% \def\ps@mystyle{
+% \def\@oddfoot{\hfil\thepage\hfil}
+% \def\@evenfoot{\hfil\thepage\hfil}
+% \def\@evenhead{\hfil\slshape\leftmark}
+% \def\@oddhead{\slshape\rightmark\hfil}}
+% \makeatother
+%
+% \newcommand\packagecopyright{Copyright \copyright{} 1999, 2000, 2001, 2002,
+% 2007, 2008, 2010, 2011 Didier Verna}
+%
+% \newcommand\auctex{AUC-\TeX\xspace}
+%
+% \pagestyle{mystyle}
+% \markright{\hskip-.5\marginparwidth \fink \fileversion{} (\filedate)}
+%
+% \date{\texttt{\fileversion{} (\filedate)}}
+% \title{\fink{} -- the \LaTeXe{} \textbf{Fi}le \textbf{N}ame
+% \textbf{K}eeper\footnote{\fink homepage:
+% \texttt{http://www.lrde.epita.fr/\~{}didier/software/latex.php\#fink}}}
+% \author{Didier Verna\\
+% \texttt{mailto:didier@lrde.epita.fr}\\
+% \texttt{http://www.lrde.epita.fr/\~{}didier/}}
+% \maketitle
+%
+% \noindent\textbf{Warning!} As of version 2.2.1, \fink has been deprecated
+% and is not maintained anymore. People interested in \fink's functionality
+% are invited to use a package named \texttt{currfile} instead.
+%
+% \section{Description}
+% This package is a real fink indeed: it looks over your shoulder and keeps
+% track of files |\input|'ed (the \LaTeX{} way) or |\include|'ed in your
+% document. You then have a permanent access to the directory, name and
+% extension of the file currently being processed through several macros. Dis
+% packache fas orichinally a hack dat I used somefere elss, but since it might
+% be off a cheneral interest, I'fe decided to make it a separate
+% fink\ldots\par
+% The \fink package is \packagecopyright{}, and distributed under the terms
+% of the LPPL license.
+%
+% \section{User Interface}
+% To use the package, simply say |\usepackage[|\meta{options}|]{fink}| in the
+% preamble of your document. This will do everything for you. Available
+% options will be described when appropriate.
+%
+% \subsection{Retrieving the current file's name components}
+% \begin{macro}{\finkdir}
+% \begin{macro}{\finkbase}
+% \begin{macro}{\finkext}
+% The file currently being processed is described by the macros
+% |\finkdir|, |\finkbase| and |\finkext| which expand (as you may have
+% guessed) to the directory, base name (sans extension), and extension
+% of the file.
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \begin{macro}{\finkfile}
+% \begin{macro}{\finkpath}
+% Additionally, the macro |\finkfile| is defined to be
+% |\finkbase|.|\finkext| (as in previous versions), and the macro
+% |\finkpath| (new in version 2.0) is defined to be |\finkdir\finkfile|.
+% Feel free to use these macros in your sources.
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Main file's name components}
+% \begin{macro}{maindir}
+% \begin{macro}{mainext}
+% Because there's no way \TeX{} can give you back information about the
+% file being processed (apart from its base name), \fink provides the
+% options |maindir| (defaults to |./|) and |mainext| (defaults to |tex|)
+% for changing the directory and the extension of the main source file.
+% For instance, suppose your source file is in |src/foo.ltx| and you are
+% compiling in |pdf/|. You can then use the package as follows:
+% \begin{verbatim}
+% \usepackage[maindir=../src,mainext=ltx]{fink}
+% \end{verbatim}
+% \end{macro}
+% \end{macro}
+%
+% \section{\auctex support}
+% \auctex is a powerful major mode for editing \TeX{} documents in
+% \textsf{Emacs} or \textsf{XEmacs}. In particular, it provides automatic
+% completion of macro names once they are known. \fink supports \auctex
+% by providing a style file named \texttt{fink.el} which contains \auctex
+% definitions for the relevant macros. This file should be installed to a
+% location where \auctex can find it (usually in a subdirectory of your
+% \LaTeX{} styles directory). Please refer to the \auctex documentation for
+% more information on this.
+%
+% \section{Caveat}
+% \fink cannot follow files included with the \TeX{} |\input| primitive.
+% That's because \TeX{} has a very insensible way of defining primitives whose
+% argument parsing syntax is not available for macros. As a consequence, it's
+% almost impossible to redefine the |\input| primitive without breaking its
+% syntax (one would have to parse the characters one by one, and I'm not ready
+% to do so\ldots). \fink currently does not follow auxiliary files either.
+%
+% \section{Hints, Tricks, Tips}
+%
+% \subsection{File names with special characters}
+% Here, ``special'' is to be taken in the \LaTeX{} sense, for instance, a
+% directory or file name containing an underscore. If this situation occurs,
+% you're likely to face problems with \fink macros because they don't try to
+% properly escape those characters. So for instance, an underscore alone will
+% make \LaTeX{} think that you forgot the math mode |$| sign before it. There
+% are actually two problems that you may encounter:
+% \begin{description}
+% \item[Characters not displayed properly] Try to change your font encoding by
+% putting this in your document's preamble: |\usepackage[T1]{fontenc}|.
+% \item[Compilation breakage] The |url| package might be of some help here.
+% Put |\usepackage{url}| in your document's preamble first. Then (assuming
+% that |\finkfile| is the culprit), instead of using |\finkfile| directly,
+% use this instead: |\expandafter\url\expandafter{\finkfile}|. You might
+% also want to play with |\urlstyle| to have your file name displayed in
+% the font you prefer.
+% \end{description}
+%
+% \section{Changes}
+% \begin{itemize}
+% \item[v2.2.1] Declare package as obsolete.\\
+% \item[v2.2] Fix incompatibility with the |memoir| class, reported by Lars
+% Madsen\\
+% \item[v2.1.1] Fix trailing whitespace in |\fink@restore|, reported by
+% Maverick Woo\\
+% Added some hints about filenames with special characters, suggested by
+% David P. Goodall
+% \item[v2.1] Fix bug preventing expansion in math mode, reported by Alain
+% Schremmer, fixed by Morten Hoegholm before I could even raise my little
+% finger.
+% \item[v2.0] New macros |\finkdir|, |\finkbase|, |\finkext| and |\finkpath|
+% suggested by Alain Schremmer\\
+% New options |mainext| and |maindir|, use |kvoptions| for options
+% management
+% \item[v1.2] Fixed conflict with |\includegraphics|, reported by Jim Crumley
+% \item[v1.1] Fixed missing 3rd arg to |\PackageError| call from
+% |\finkextension|
+% \end{itemize}
+%
+% \StopEventually{\par Well, I think that's it. Enjoy using \fink!
+% \vfill\hfill\small \packagecopyright{}}
+%
+% \section{The Code}
+% \begin{macrocode}
+%<fink>\NeedsTeXFormat{LaTeX2e}
+%<*header>
+\ProvidesPackage{fink}[2011/10/19 v2.2.1 Keep track of the current filename]
+
+%</header>
+%<*fink>
+\PackageWarning{FiNK}{as of version 2.2.1, FiNK has been deprecated and is
+ not\MessageBreak
+ maintained anymore. People interested in FiNK's\MessageBreak
+ functionality are invited to use a package named\MessageBreak
+ "currfile" instead,}
+
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{family=fnk,prefix=fnk@}
+
+% \end{macrocode}
+%
+% \subsection{Main file initial settings}
+% \DescribeEnv{maindir}
+% \DescribeEnv{mainext}
+% \begin{macrocode}
+\DeclareStringOption[\@currdir]{maindir}
+\DeclareStringOption[tex]{mainext}
+
+% \end{macrocode}
+% The following is for backward compatibility only (not documented anymore).
+% It provides support for the old |tex| and |ltx| options (still functionnal),
+% and for the |\finkextension| macro. However, this macro is now defined to
+% trigger an error, begging the user to use the new option instead.
+% \begin{macrocode}
+\newcommand*\@fink@mainext[1]{\setkeys{fnk}{mainext={#1}}}
+\newcommand*\fink@mainext{%
+ \expandafter\@fink@mainext\expandafter{\CurrentOption}}
+\DeclareVoidOption{tex}{\fink@mainext}
+\DeclareVoidOption{ltx}{\fink@mainext}
+
+\newcommand*\finkextension[1]{%
+ \PackageError{FiNK}{%
+ \protect\finkextension\space shouldn't be used anymore.\MessageBreak
+ Please use the `mainext' package option instead.}{%
+ No big deal right ?\MessageBreak
+ Type X to quit and modify your source.}}
+\@onlypreamble\finkextension
+
+\ProcessKeyvalOptions*
+
+% \end{macrocode}
+%
+% \subsection{File's name components macros}
+% \begin{macro}{\finkdir}
+% \begin{macro}{\finkbase}
+% \begin{macro}{\finkext}
+% \begin{macro}{\finkfile}
+% \begin{macro}{\finkpath}
+% We declare the user-level macros here. |\fink@file| is used to
+% compute file names, possibly with no extension.
+% \begin{macrocode}
+\newcommand*\finkdir{\fnk@maindir}
+\newcommand*\finkbase{\jobname}
+\newcommand*\finkext{\fnk@mainext}
+
+\newcommand*\finkfile{}
+\newcommand*\fink@file[2]{#1\ifx\\#2\\\else.#2\fi}
+\xdef\finkfile{\fink@file{\jobname}{\fnk@mainext}}
+
+\newcommand*\finkpath{}
+\xdef\finkpath{\finkdir\finkfile}
+
+\PackageInfo{FiNK}{main file set to "\finkpath"}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
+% \subsection{Commands overriding}
+% \begin{macro}{\fink@beginfile}
+% \begin{macro}{\fink@endfile}
+% The |memoir| class redefines \cs{InputIfFileExists} as well, in order to
+% provide its file hooks. Since we override its definition, we need to take
+% care of those hooks ourselves.
+% \begin{macrocode}
+\@ifclassloaded{memoir}{
+ \let\fink@beginfile\m@matbeginf
+ \def\fink@endfile#1{\m@matendf{#1}\killm@matf{#1}}}{%
+ \def\fink@beginfile#1{}
+ \def\fink@endfile#1{}}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Note: as of version 1.2, every call to \cs{filename@parse} is done in a
+% group of its own. This fixes a problem that appeared when using
+% |\includegraphics| with a filename with an explicit extension.
+% |\includegraphics| calls |\filename@parse| itself, so it is important that
+% our call(s) only have a local effect.
+% \begin{macro}{\fink@input}
+% \begin{macro}{\fink@restore}
+% These macros are defined for a convenient use of |\expandafter|. They
+% save and restore the current filename. Remember that |\@@input| is
+% \LaTeX's redefinition of the \TeX{} input primitive.
+% \begin{macrocode}
+\newcommand*\fink@input[1]{%
+ \begingroup%
+ \filename@parse{#1}%
+ \xdef\finkdir{%
+ \ifx\filename@area\@empty%
+ \fnk@maindir%
+ \else%
+ \fnk@maindir\filename@area%
+ \fi}%
+ \xdef\finkbase{\filename@base}%
+ \xdef\finkext{\ifx\filename@ext\relax tex\else\filename@ext\fi}%
+ \xdef\finkfile{\fink@file{\finkbase}{\finkext}}%
+ \xdef\finkpath{\finkdir\finkfile}%
+ \endgroup%
+ \fink@beginfile{#1}%
+ \@@input\@filef@und%
+ \fink@endfile{#1}}
+
+\newcommand*\fink@restore[1]{%
+ \begingroup%
+ \filename@parse{#1}%
+ \xdef\finkdir{\filename@area}%
+ \xdef\finkbase{\filename@base}%
+ \xdef\finkext{\filename@ext}%
+ \xdef\finkfile{\fink@file{\finkbase}{\finkext}}%
+ \xdef\finkpath{\finkdir\finkfile}%
+ \endgroup}
+
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% Note: in earlier versions, we redefined |\IfFileExists| to prepare the name
+% of the next file, but this is bad because it can be used outside of \fink's
+% scope. We also redefined |\@input|, but neither |\include| nor |\input| use
+% it.
+% \begin{macro}{\InputIfFileExists}
+% \LaTeX's |\input| and |\include| commands use |\InputIfFileExists|, so
+% let's redefine it here:
+% \begin{macrocode}
+\long\def\InputIfFileExists#1#2{%
+ \IfFileExists{#1}{%
+ #2\@addtofilelist{#1}%
+ \edef\fink@before{\noexpand\fink@input{#1}}%
+ \edef\fink@after{\noexpand\fink@restore{\finkpath}}%
+ \expandafter\fink@before\fink@after}}
+
+%</fink>
+% \end{macrocode}
+% \end{macro}
+% ^^A \PrintChanges
+% ^^A \PrintIndex
+% \Finale
+%
+% ^^A fink.dtx ends here.