% This is the file vietnam.sty which provides Vietnamese captions for the
% standard classes.
%
% written by Werner Lemberg <wl@gnu.org> and
%            Han The Thanh <thanh@fi.muni.cz>

\ProvidesPackage{vietnam}[2000/01/27 v1.0 Vietnamese captions]

\RequirePackage{ifthen}
\newboolean{optenc}
\newboolean{dblaccnt}
\newboolean{noinputenc}
\newboolean{nocaptions}
\newboolean{vnutf8}

\DeclareOption{viscii}{\PassOptionsToPackage{viscii}{inputenc}\setboolean{optenc}{true}}
\DeclareOption{tcvn}{\PassOptionsToPackage{tcvn}{inputenc}\setboolean{optenc}{true}}
\DeclareOption{utf8}{\PassOptionsToPackage{utf8}{inputenc}\setboolean{optenc}{true}\setboolean{vnutf8}{true}}
\DeclareOption{vps}{\PassOptionsToPackage{vps}{inputenc}\setboolean{optenc}{true}}
\DeclareOption{mviscii}{\PassOptionsToPackage{mviscii}{inputenc}\setboolean{optenc}{true}}
\DeclareOption{dblaccnt}{\setboolean{dblaccnt}{true}}
\DeclareOption{noinputenc}{\setboolean{noinputenc}{true}}
\DeclareOption{nocaptions}{\setboolean{nocaptions}{true}}

\ProcessOptions

\ifthenelse{\boolean{dblaccnt}}
    {\RequirePackage{dblaccnt}}
    {}

\RequirePackage[T5]{fontenc}

\ifthenelse{\boolean{noinputenc}}
    {\ifthenelse{\boolean{optenc}}
        {\PackageWarning{vietnam}{Input encodings will be ignored when
            `noinputenc' is used}}
        {}}
    {\ifthenelse{\boolean{optenc}}
        {}
        {\PackageWarning{vietnam}{No input encoding specified, used VISCII
            as default}
         \PassOptionsToPackage{viscii}{inputenc}}
         \RequirePackage{inputenc}}

\ifthenelse{\boolean{nocaptions}}
    {}
    {\input{vncaps.tex}
     \AtBeginDocument{\captionsvietnam\datevietnam}}

\AtBeginDocument{%
    \frenchspacing
    \ifthenelse{\boolean{vnutf8}}{%
        \PreloadUnicodePage{0}%
        \PreloadUnicodePage{1}%
        \PreloadUnicodePage{30}%
        \ifx \UnicodeCharFilter \@undefined
%             \UCSProtectionUnichar
            \UCSProtectionIeC
        \else
            \UnicodeCharFilter\IeC
        \fi
    }{}}


% end of vietnam.sty
