%%
%% This file will generate fast loadable files and documentation
%% driver files from the doc files in this package when run through
%% LaTeX or TeX.
%%
%% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.
%% Copyright 1989-2008 Johannes L. Braams and any individual authors
%% listed elsewhere in this file.  All rights reserved.
%% 
%% This file is part of the Babel system.
%% --------------------------------------
%% 
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% 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.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% The Current Maintainer of this work is Javier Bezos.
%% 
%% The list of derived (unpacked) files belonging to the distribution
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
%%
%% --------------- start of docstrip commands ------------------
%%
%% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.
%% Copyright 2005-2008 Johannes L. Braams
%%
%% This file is part of the `babel' system.
%%
%%
\def\filedate{2016/02/05}
\def\batchfile{babel.ins}
\input docstrip.tex

{\ifx\generate\undefined
\Msg{**********************************************}
\Msg{*}
\Msg{* This installation requires docstrip}
\Msg{* version 2.3c or later.}
\Msg{*}
\Msg{* An older version of docstrip has been input}
\Msg{*}
\Msg{**********************************************}
\errhelp{Move or rename old docstrip.tex.}
\errmessage{Old docstrip in input path}
\batchmode
\csname @@end\endcsname
\fi}

% Modify docstrip. A pseudo-guard is defined to set variables:
% <<name=value>>. These variables are used with <@name@> Two further
% pseudo-guards define "block" variables: <<*name>> and <</name>>
% delimite the lines to be retrived with <@name@>. Note the verbatim
% guard is overridden, but it's not used here.  This is done in two
% passes: 1) with saving true, there is a dummy pass, generating
% nothing, but blocks are read and saved; 2) with saving false, blocks
% are always ignored, but replacing <@name@>.  While <@name@> can be
% used freely outside <<>>, it's only allowed inside <<>> if
% previously defined. Deeper nesting is not allowed.

\def\replaceVar#1<@#2{%
  #1%
  \ifx\endLine#2\else
    \expandafter\replaceVarX\expandafter#2%
  \fi}

\def\replaceVarX#1@>{\csname #1Var\endcsname\replaceVar}

\def\normalLine#1\endLine{%
  \advance\codeLinesPassed\@ne
  \maybeMsg{.}%
  \edef\inLine{\replaceVar#1<@\endLine}%
  \let\do\putline@do
  \ifcollect
    \xdef\varCollect{\varCollect^^J\inLine}%
  \else
    \activefiles
  \fi}

\newif\ifcollect
\newif\ifsaving

\def\verbOption<#1#2>>#3{%
  \ifx#1*%
    \maybeMsg{<<*#2>>}%
    \global\collecttrue
    \gdef\varCollect##1{}%
  \else\ifx#1/%
    \global\collectfalse
    \ifsaving
      \expandafter\ifx\csname #2Var\endcsname\relax
        \global\expandafter\let\csname #2Var\endcsname\varCollect
      \else
        \toks@\expandafter\expandafter\expandafter{%
          \csname #2Var\expandafter\endcsname\expandafter^^J%
          \varCollect}%
        \expandafter\xdef\csname #2Var\endcsname{\the\toks@}%
      \fi
    \fi
  \else
    \varOptionI#1#2>%
  \fi\fi}

\def\varOptionI#1=#2>{%
  \maybeMsg{<<#1=#2>>}%
  \ifsaving
    \expandafter\gdef\csname #1Var\endcsname{#2}%
  \fi}

% Preambles

\declarepreamble\mainpreamble
This is a generated file.

Copyright 2012-2016 Javier Bezos and Johannes L. Braams.
Copyright 1989-2008 Johannes L. Braams and any individual authors
listed elsewhere in this file.  All rights reserved.

This file was generated from file(s) of the Babel system.
---------------------------------------------------------

It may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3
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.3 or later is part of all distributions of LaTeX
version 2003/12/01 or later.

This work has the LPPL maintenance status "maintained".

The Current Maintainer of this work is Javier Bezos.

This file may only be distributed together with a copy of the Babel
system. You may however distribute the Babel system without
such generated files.

The list of all files belonging to the Babel distribution is
given in the file `manifest.bbl'. See also `legal.bbl for additional
information.

The list of derived (unpacked) files belonging to the distribution
and covered by LPPL is defined by the unpacking scripts (with
extension .ins) which are part of the distribution.
\endpreamble

\declarepreamble\drvpreamble

This file was generated from file(s) of the Babel system.
---------------------------------------------------------

Copyright 2012-2016 Javier Bezos and Johannes L. Braams.
Copyright (C) 2008 Johannes Braams. All rights reserved.

To produce the documentation in the way you like you are allowed
to change this driver file.

\endpreamble

\declarepreamble\istpreamble
This file was generated from file(s) of the Babel system.
---------------------------------------------------------

Copyright 2012-2016 Javier Bezos and Johannes L. Braams.
Copyright (C) 2008 Johannes Braams. All rights reserved.

This file is a style file for the MakeIndex program

\endpreamble

\declarepostamble\istpost
\endpostamble

\keepsilent
\askonceonly

\usedir{tex/generic/babel}

\usepreamble\mainpreamble

% Dummy, it just read "modules" to be used when generating
% the actual file. There must be a better way.
\savingtrue
\generate{\usepreamble\empty
          \usepostamble\empty
          \file{babel.aux}{\from{babel.dtx}{dummy}}}
\savingfalse

\generate{\file{babel.sty}{\from{babel.dtx}{package}}
          \file{babel.def}{\from{babel.dtx}{core}}
          \file{switch.def}{\from{babel.dtx}{kernel}}
          \file{hyphen.cfg}{\from{babel.dtx}{patterns}}
          \file{nil.ldf}{\from{babel.dtx}{nil}}
          }
          
% Support for plain users
\generate{\file{plain.def}{\from{babel.dtx}{plain}}
          \file{bplain.tex}{\from{babel.dtx}{bplain}}
          \file{blplain.tex}{\from{babel.dtx}{blplain}}
         }
         
% Support for Unicode-based engines
\savingtrue
\generate{\usepreamble\empty
          \usepostamble\empty
          \file{babel.aux}{\from{bbunicode.dtx}{dummy}}}
\savingfalse

\generate{\file{xebabel.def}{\from{bbunicode.dtx}{xetex}}
          \file{luababel.def}{\from{bbunicode.dtx}{luatex}}
         }

% compatibility files
\def\compatfile#1{\file{#1.sty}{\from{bbcompat.dtx}{#1}}}

\generate{%
          \compatfile{esperanto}
          \compatfile{afrikaans}
          \compatfile{dutch}
          \compatfile{american}
          \compatfile{british}
          \compatfile{english}
          \compatfile{UKenglish}
          \compatfile{USenglish}
          \compatfile{germanb}
          \compatfile{austrian}
          \compatfile{ngermanb}
          \compatfile{naustrian}
          \compatfile{irish}
          \compatfile{scottish}
          \compatfile{welsh}
          \compatfile{breton}
          }
\generate{%
          \compatfile{francais}
          \compatfile{italian}
          \compatfile{portuges}
          \compatfile{spanish}
          \compatfile{catalan}
          \compatfile{galician}
          \compatfile{danish}
          \compatfile{norsk}
          \compatfile{swedish}
          \compatfile{finnish}
          \compatfile{magyar}
          \compatfile{greek}
          \compatfile{croatian}
          \compatfile{czech}
          \compatfile{slovak}
          \compatfile{polish}
          }
\generate{%
          \compatfile{estonian}
          \compatfile{romanian}
          \compatfile{slovene}
          \compatfile{russianb}
          \compatfile{ukraineb}
          \compatfile{turkish}
          \compatfile{lsorbian}
          \compatfile{usorbian}
          \compatfile{bahasa}
          \compatfile{hebrew}
          %\compatfile{sanskrit}
          \compatfile{basque}
          \compatfile{latin}
          \compatfile{icelandic}
          \compatfile{serbian}
          \compatfile{bulgarian}
          }
\generate{%
          \compatfile{samin}
          \compatfile{interlingua}
          \compatfile{albanian}
          \compatfile{bahasam}
          }

% MakeIndex style files

\usepreamble\istpreamble
\usepostamble\istpost
\usedir{makeindex/babel}

\generate{\file{bbind.ist}{\from{bbidxglo.dtx}{idx}}
          \file{bbglo.ist}{\from{bbidxglo.dtx}{glo}}}

\Msg{***********************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move all the files}
\Msg{* with names ending in .ldf, .sty, .def or .fd into a}
\Msg{* directory searched by TeX}
\Msg{*}
\Msg{* For making a format the following files have to be in a}
\Msg{* directory which is searched by IniTeX:}
\Msg{* \space\space hyphen.cfg}
\Msg{* \space\space language.dat}
\Msg{* \space\space and files with hyphenation patterns}
\Msg{*}
\Msg{* To produce source listings you can run files with names}
\Msg{* ending in .dtx and/or .drv through LaTeX}
\Msg{*}
\Msg{* To produce the complete source listing MakeIndex needs to be}
\Msg{* able to find the following files}
\Msg{* \space\space bbind.ist}
\Msg{* \space\space bbglo.ist}
\Msg{*}
\Msg{* Happy TeXing}
\Msg{*}
\Msg{***********************************************************}


