
 %%%% Gllmts.tex, version CM, Dec 1992, Mar 1994
   %% One layer of protection for LaTeX
   %% Part of format-dumper for french
   %% Supposes CM math fonts.

  %%% Beware: supposes Plain catcodes, except for @
   %% so this file is for very early loading only
   %% Activation of < > later if at all


 \ifx\gllmtsAt\undefined
 \else
    \expandafter\endinput
 \fi

 \chardef\gllmtsAt=\catcode`\@
 \catcode`\@=11 
 \catcode`\_=11
 \catcode`\<=13
 \catcode`\>=13

 \let\EX@=\expandafter
 \def\gobble_#1{}
 \def\empty{}
 \let\protect\relax

 \def\_LG{\futurelet\next\_LGmole}
 \def\_LGmole{%\show\next
    \ifx <\next
       \def\temp_{\DLG\gobble_}%
    \else
       \ifx \_LG\next
          \def\temp_{\DLG\gobble_}%
       \else
       \edef\temp_{\string<}%
       \fi
    \fi%\show\temp_
    \temp_}

 \def\_RG{\futurelet\next\_RGmole}
 \def\_RGmole{%\show\next
    \ifx >\next
       \def\temp_{\DRG\gobble_}%
    \else
       \ifx \_RG\next
          \def\temp_{\DRG\gobble_}%
       \else
       \edef\temp_{\string>}%
       \fi
    \fi
    \temp_}
 
 \def \_guillemotleft {\leavevmode\mathsurround=\z@ \raise .3ex
    \hbox{$\scriptscriptstyle 
    \langle \kern -.15em \langle$}}
 %
 \def \_guillemotright {\leavevmode\mathsurround=\z@  
    \raise  .3ex \hbox{$\scriptscriptstyle 
    \rangle \kern -.15em  \rangle$}} 
 %
 \def\_DLG{%\string^^13
    \_guillemotleft    %%\Diac@{guillemotleft}
    \kern.4\fontdimen2\font\ignorespaces}
 % 
 \def\_DRG{%
   \unskip\kern.4\fontdimen2\font
    \_guillemotright    %%\Diac@{guillemotright}
    \kern0pt{}}

 \let\DLG\_DLG
 \let\DRG\_DRG

  %%% Std CM defaults, cf caesarcm.tex
  \def\guillemotleft@{\DLG}%% in gllmts.tex
  \def\guillemotright@{\DRG}%% in gllmts.tex


 %%% (La)TeX has \def\>{\mskip\medmuskip}
\def\SetCaesarsGuillemets{%
 \def\<{\DLG} 
 \def\>{\relax\ifmmode\mskip\medmuskip\else\expandafter\DRG\fi}}

 \SetCaesarsGuillemets%% initialize
 \let\protect\relax%% initialize

 \def\ActiveGGuillemets{\ActiveGGuillemets@}
 \def\ActiveGGuillemets@{%
   \chardef\CatLessThan@=\catcode`\<
   \chardef\CatGreaterThan@=\catcode`\>
   \catcode`\<=13\catcode`\>=13 %% 13="active", 12="other"
   \def<{\relax\ifmmode\string<\else\EX@\protect\EX@\_LG\fi}
   \def>{\relax\ifmmode\string>\else\EX@\protect\EX@\_RG\fi}
   \def\ActiveGGuillemets{\errmessage{% 
      \string\ActiveGGuillemets\space already in force.}}%
   \let\noActiveGGuillemets\noActiveGGuillemets@
   }

 \def\noActiveGGuillemets@{%
   \catcode`\<=\CatLessThan@\catcode`\>=\CatGreaterThan@
   \let\ActiveGGuillemets\ActiveGGuillemets@
   \let\noActiveGGuillemets\noActiveGGuillemets@@
   }
 \def\noActiveGGuillemets@@{\errmessage{% 
      \string\ActiveGGuillemets\space not yet in force.}}
 \let\noActiveGGuillemets\noActiveGGuillemets@@ %% default   
 
 \catcode`\_=8
 \catcode`\<=12
 \catcode`\>=12
 \catcode`\@=\gllmtsAt

 \endinput

 aaa aaa \DLG xx\DRG{} zzz zzz
\ActiveGGuillemets
\let\<\relax
\SetCaesarsGuillemets
 aaa aaa \<xx\> zzz zzz
 aaa aaa <<xx>> zzz zzz
 aaa aaa \DLG xx\DRG\ zzz zzz

\noActiveGGuillemets
\ActiveGGuillemets

 aaa aaa \DLG xx\DRG\ zzz zzz
 aaa aaa <<xx>> zzz zzz
\noActiveGGuillemets
\bye

