Next: About this document ... Up: Non-standard versions Previous: Non-standard versions

## Examples

Since we have been prompted, despite our misgivings, to document how to do this by members of the League for Programming Freedom, it seems appropriate to describe here a possible modification of LATEX to produce a system called fsfTEX.

To do this, you should create a file called `fsftex.tex` and then run it using iniTEX and the standard LATEX format.

The contents of the file `fsftex.tex` should be as shown on page . The particular changes to the LATEX kernel that you wish to make need to be added to the file at the position indicated. You can also choose the extensions you want to use for the class and package files in your system.

    % fsftex.tex
    %
    % iniTEX Source code to make a `fsftex' format.
    %
    % To make this format on Unix:
    %
    %   initex \&latex fsftex
    %
    % Then to run the format on file.tex:
    %
    %   tex &fsftex file
    %
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % *** VERY IMPORTANT!!! ***
    % Change the typeout banner so users know that they
    %       are NOT running Standard LaTeX.
    \everyjob{\typeout{fsfTeX 1.0 based on LaTeX2e \fmtversion}}
    \makeatletter

    % fsfTeX changes some LaTeX internals:
    %   ... put what you like here ...
    \def \fsf@xxxx {Some arbitrary \emph{freely modifiable} code goes here}

    % fsfTeX class files have extension .fcl (this week):
    \def \@clsextension {fcl}

    % fsfTeX package files have extension .fsy:
    \def \@pkgextension {fsy}

    % Change the file handling so that when a fsfTeX package or class
    % is not available, the standard LaTeX file will be read.
    %
    % For example, \documentclass{article} will load article.fcl if such
    % a file exists, but article.cls otherwise.  This allows arbitrary
    % processing on `article' documents without changing the standard
    % article.cls file.

    \let\fsf@missingfileerror\@missingfileerror

    \def\@missingfileerror#1#2{%
      \ifx #2\@clsextension
        \InputIfFileExists {#1.cls}%
          {\wlog {fsfTeX: loading #1.cls rather than #1.#2.}}%
          {\fsf@missingfileerror {#1}{#2}}%
      \else
        \ifx #2\@pkgextension
          \InputIfFileExists {#1.sty}%
            {\wlog {fsfTeX: loading #1.sty rather than #1.#2.}}%
            {\fsf@missingfileerror {#1}{#2}}%
        \else
          \fsf@missingfileerror {#1}{#2}%
        \fi
      \fi
    }

    \makeatother
    \dump