 
 %%%%% CaesarCM.tex 
   %%% April 1992 -- Jan 1994; (version 2)
   %%% L. Siebenmann, Orsay <siebenmann@LALCLS.IN2P3.FR>
 
  \chardef\JDCatAt=\the\catcode`\@
  \catcode`\@=11
 
 \def\Space{ }%
 \def\W@{\immediate\write16}%
  \W@{ ************************************************** }
  \W@{ CaesarCM FONT-DEPENDANT ACCENTUATION MECHANISM}
  \W@{ for Computer Modern fonts, POSSIBLY EXTENDED }
  \W@{ to 128-255 according to the Cork norm of 1990.}
  \W@{ Font-sensitive accentuation and hyphenation.}
  \W@{ For installation and operation see CaesarCM.doc.}
  \W@{ Version 2, Sept 1992 -- Jan 1994.}
  \W@{ Updates: on CTAN TeX servers and ftp matups.matups.fr.}
  \W@{ *************************************************** }

  %% Prevent this sort of file being loaded twice!
  \let\temp\relax
  \ifx\JDaccents\undefined
  \else\W@{}%
      \W@{ *** \string\JDaccents\space already defined.}%
      \def\temp{\errmessage{}}
  \fi
  \temp
  \global\let\CaesarCMLoaded\relax

 
  %% Prevent use of TeX < 3!
  \let\temp\relax
  \ifx\undefined\inputlineno
      \W@{}%
      \W@{ *** This is not TeX version 3.x }%
      \W@{ *** You cannot use CaesarCM\string!}%
      \def\temp{\errmessage{}}
  \fi
  \temp

 %%% Require 128-255 be category 12
   %
   \newcount\Ct@
   \count@="80
   \def\temp{\W@{}%
      \W@{ *** You should input CaesarCM }%
      \W@{ *** while the characters 128-255}%
      \W@{ *** still have category 12.}%
      \errmessage{}\end
       }
   %
   \loop
     \Ct@=\catcode\count@
     \ifnum\Ct@=12\else\temp\fi
     \ifnum\count@<"FF
     \relax\advance\count@ by \@ne
   \repeat

   \global\let\primuppercase\uppercase
   \global\let\primlowercase\lowercase

   \newbox\hy@accbox
   \def\empty{}
   \let\EX@\expandafter

  %%% \IN@0#1@#2@ : Is 1st exp of #1 in 1st exp of #2 ??
   %% Answer in \ifIN@
 \newif\ifIN@\def\IN@{\expandafter\INN@\expandafter}
  \long\def\INN@0#1@#2@{\long\def\NI@##1#1##2##3\ENDNI@
    {\ifx\m@rker##2\IN@false\else\IN@true\fi}%
     \expandafter\NI@#2@@#1\m@rker\ENDNI@}
  \def\m@rker{\m@@rker}

\def\stringer@#1{% \Temp is cat 12 string recipient
    \ifx#1\endstringer@
      \let\temp\relax
    \else
      \edef\Temp{\Temp\string#1}
      \let\temp\stringer@
    \fi
    \temp}

   \def\hyaccent#1#2{{\accent#1 #2}\@Allowhyphens{#2}\empty}

 %% fragments to be reused
   %%% double-strike accent character trick (DSaccents)
   \def\@@@Allowhyphens#1{\setbox\hy@accbox\hbox{#1}%
     \penalty\@M\hskip-\wd\hy@accbox #1}

   %%% Next an ad hoc alternative to avoid double-strikes
   %%% in emergencies when these cause trouble at 
   %%% low resolution <300 dpi.
   \let\@dodo\empty
    %% \font\@dodo=dodo %% not yet! see \noDSaccents
   %%% dodo.tfm is a .tfm  having null definition 
   %%% for "9F and nothing else.
   %%% It must be installed for this alternative to work. 
   \def\@@@allowhyphens#1{\penalty\@M\hskip\z@{\@dodo ^^9f}}
   %% Possible problem: if \lccode"9F is >0 (which is abnormal),
   %% you should add \lccode"9F=0 just before \@dodo.
   %% For printing, dodo .pk files may have to be installed
   %% at suitable resolutions.  A dodo.pk is provided. 
   %% A copy of any 128 char cm .pk font at all would do as well.

   %% \def\@Allowhyphens{\@@Allowhyphens} %% default, see \JDaccents
   %% \def\@Allowhyphens{\empty} %% not default, see \noJDaccents
   %% \let\@@Allowhyphens\@@@Allowhyphens %% default  see \DSAccents
   %% \let\@@Allowhyphens\@@@allowhyphens %% not default, see \noDSAccents

 %% temporary catcode changes
 \catcode`\/=13 
 \catcode`\~=12 
 \catcode`\*=11 
 
 %%% Composite accents for CM fonts
 %% TeXbook p. 52

 \def\DoCMAccents{%% cf \dospecials in Plain.tex
  /`'22..%% grave 
  /''23..%% acute
  /^'136..%% hat
  /"'177..%% umlaut
  /~'176..%% tilde 
  /='26..%% macron (bar over) 
  /.'137..%% dot over
  /u'25..%% breve
  /v'24..%% check
  /H'175..%% long umlaut
   %%\t tie absent, see below
  }


\newif\ifRawPS

 \def\DoRawPSAccents{%
  /`'301C1..%% grave 
  /''302..%% acute
  /"'303..%% hat
  /"'310..%% umlaut
  /~'304..%% tilde
  /='305..%% macron (bar over)
  /.'307..%% dot over
  /u'306..%% breve
  /v'317..%% check
  /H'315..%% long umlaut
   %%\t tie absent, see below
   }

 \def\CheckPeriod#1{\if#1.\else
        \errmessage{ !!! Error in character data}\fi}

 \def\Do@Accent@#1#2.#3{\CheckPeriod{#3}%
    \expandafter
    \def\csname @#1@\endcsname##1{%
        \empty\hyaccent{#2}{##1}\empty}%
    }
 %%eg. '"13.. gives ##1 ---> \empty\hyaccent{"13}{##1}\empty

 %%  And an alternative syntax
 \def\DoAccent#1#2.#3{\CheckPeriod{#3}% 
    \expandafter
    \def\csname #1\endcsname##1{%
        \empty\hyaccent{#2}{##1}\empty}%
    }

  %%% Residual cases:\c,\aa,\AA,\l,\L

  \def\oldCedilla#1#2{\setbox0\hbox{#2}%
    \ifdim .98\ht0<1ex\accent#1#2%
    \else{\ooalign{\hidewidth
    \char#1\hidewidth\crcr\unhbox0}}\fi}

 \def\oldOgonek#1{\setbox\hy@accbox=\hbox{`}\ooalign{\hidewidth
                  \lower\ht\hy@accbox\copy\hy@accbox%\hidewidth
                  \crcr#1\crcr}}
 \def\ogonek#1{{\oldOgonek#1}\@Allowhyphens{#1}}% ogonek

  \def\oldL{\setbox0\hbox{L}\hbox to\wd0{\hss\char32L}}%
  \def\oldl{\char32l}

  \def\CrossBar#1#2{%
      \if#2L\empty
         \ifRawPS ^^e8\else\oldL\fi
      \else
        \if#2l\empty
           \ifRawPS ^^f8\else\oldl\fi
        \else#1#2%
        \fi
      \fi}
  
  \def\oldAA{\leavevmode\setbox0\hbox{h}%
     \dimen@\ht0\advance\dimen@-1ex%
     \rlap{\raise.67\dimen@\hbox{\char'27}}A}

  \def\psAA{\leavevmode\raise0.4ex\rlap{\kern0.2em\char'312}A}%
  \def\psaa{\leavevmode\raise0.1ex\rlap{\kern0.05em\char'312}a}%

  \def\OverCircle#1#2{%
      \if#2A\empty
         \ifRawPS\psAA\else\oldAA\fi
      \else
         \if#2a\empty
            \ifRawPS\psaa\fi
         \else{\accent#1#2}%
         \fi
      \fi}%

  \def\oldUnderBar#1#2{\oalign{#2\crcr\hidewidth%
    \vbox to.2ex{\hbox{\char#1}\vss}\hidewidth}}%

  \def\d#1{%
    \oalign{#1\crcr\hidewidth.\hidewidth}\@Allowhyphens{#1}}%
    %%\d pure ASCII ascii, and no such in 128-255
    %% hence totally invariant

  \def\oldt#1{{\edef\next{\the\font}\the\textfont1\accent'177\next#1}}
    %% not in Cork norm 128-255
    %% hence invariant provided \textfont1=cmmi

 \def\SetCompositeCMAccents{%
   \let/\Do@Accent@ \DoCMAccents %% the \@?@ are reguluar
   \def\=##1{\\@=@##1}%
   \def\t##1{\oldt##1\@Allowhyphens{##1}}%% uses "7F from cmmi
   \def\b##1{\oldUnderBar{'26}##1\@Allowhyphens{##1}\empty}% underbar
   \def\@c@##1{\oldCedilla{'30}##1\@Allowhyphens{##1}\empty}%%%relax!
   \def\@g@##1{\oldOgonek##1\@Allowhyphens{##1}\empty}%%%relax!
   \def\@*@##1{\OverCircle{'27}##1\@Allowhyphens{##1}\empty}%
            %% overcircle; \aa,\AA
   \def\@**@##1{\CrossBar{'40}##1}% \l,\L
   }
    %%\=,\t,\b appear already since not in Cork 128-255
    %%\@c@,\@*@,\@**@ opposite case
    %% \c,\*,\**,\b contain \empty since tailor made
    
 \def\SetCompositeRawPSAccents{%
   \let/\DoAccent\DoRawPSAccents %% these are the regular \', \` etc.
   \def\t##1{\oldt##1\@Allowhyphens{##1}}%% uses "7F of cmmi
   \def\c##1{\oldCedilla{'313}##1\@Allowhyphens{##1}\empty}%
   \def\*##1{{\accent'305 ##1}\@Allowhyphens{##1}\empty}%
                     %% overcircle; \aa,\AA
   \def\**##1{\CrossBar{'261}##1\@Allowhyphens{##1}\empty}
                     %% \l,\L
   \def\b##1{\oldUnderBar{'305}##1\@Allowhyphens{##1}\empty}%
   \def\g##1{\oldOgonek##1\@Allowhyphens{##1}\empty}%
   }
   %% No smart accent features with RawPS, so no \@?@

 %%%% Exotics switch-macros
 \catcode"02=13 \catcode"03=13 %% were other

\def\SetRawPSExotics{% PS foreign text char locations:
   \let^^02^^fb \def\ss{^^02} %%% see \ULprotect 
   \def^^03{SS} \def\SS{^^03} %%% see \ULprotect  
  \edef\ae{\string^^f1} \lccode"F1="F1 \uccode"F1="E1
  \edef\AE{\string^^e1} \lccode"E1="F1 \uccode"E1="E1 \sfcode"E1=999
  \edef\oe{\string^^fa} \lccode"FA="FA \uccode"FA="EA
  \edef\OE{\string^^ea} \lccode"EA="FA \uccode"EA="EA \sfcode"EA=999
  \edef\o{\string^^f9} \lccode"F9="F9 \uccode"F9="E9
  \edef\O{\string^^e9} \lccode"E9="F9 \uccode"E9="E9 \sfcode"E9=999
  \edef\i{\string^^f5} \lccode"F5="F5 \uccode"F5=`\I
  }

 \gdef\SetCMExotics{% CM foreign text char locations:
   \let^^02^^19 \def\ss{^^02} %%% see \ULprotect 
   \def^^03{SS}\def\SS{^^03} %%% see \ULprotect 
  \edef\ae{\string^^1a}\lccode"1A="1A \uccode"1A="1D
  \edef\AE{\string^^1d}\lccode"1D="1A \uccode"1D="1D \sfcode"1D=999
  \edef\oe{\string^^1b}\lccode"1B="1B \uccode"1B="1E
  \edef\OE{\string^^1e}\lccode"1E="1B \uccode"1E="1E \sfcode"1E=999
  \edef\o{\string^^1c}\lccode"1C="1C \uccode"1C="1F
  \edef\O{\string^^1f}\lccode"1F="1C \uccode"1F="1F \sfcode"1F=999
  \edef\i{\string^^10}\lccode"10="10 \uccode"10=`\I
  }

 \def\SetKnuthExotics{% CM foreign text char locations:
 \lccode"19=0 \uccode"19=0
 \lccode"1A=0 \uccode"1D=0
 \lccode"1D=0 \uccode"1D=0
 \lccode"1B=0 \uccode"1B=0
 \lccode"1E=0 \uccode"1E=0
 \lccode"1C=0 \uccode"1C=0
 \lccode"1F=0 \uccode"1F=0
 \lccode"10=0 \uccode"10=0
  }

 %%% LaTeX protection??
  %\def\SS{\ULprotect^^??}\def\ULprotect{}

 \catcode"02=12 \catcode"03=12 %% were other

 %%% end of Exotics switch-macros


%%% Misc Symbols
   %%
  \gdef\Symb@#1{\SmartTest@
    \EX@ \EX@\EX@ \ifx\EX@ \csname \FontClsTag@ @#1\endcsname\relax
       \relax
       \EX@ \ifx \csname#1@\endcsname\relax
          ^^58%% Print X if nothing better
       \else
          \csname#1@\endcsname
       \fi
     \else
          \csname \FontClsTag@ @#1\endcsname
     \fi}

  %%% eCM "flexible definition" high level definitions
  %% RHS will be defined class by class
  \xdef\questiondown{\string^^3e}%% direct
  \xdef\exclamdown{\string^^3c}%% direct
  \gdef\guillemotleft{\Symb@{guillemotleft}}
  \gdef\guillemotright{\Symb@{guillemotright}}
  \gdef\pound{\Symb@{pound}}
  \gdef\section{\Symb@{section}}
  \gdef\dagger{\Symb@{dagger}}
  \gdef\daggerdbl{\Symb@{daggerdbl}}
  \gdef\paragraph{\Symb@{paragraph}}
  \gdef\perthousand{\Symb@{perthousand}}%% 

   %%% CM (nontrivial) low level defaults
   %%
  %\xdef\questiondown@{\string^^3e}%% no need!
  %\xdef\exclamdown@{\string^^3c}%% no need!
  %\def\guillemotleft@{\DLG}%% in gllmts.tex
  %\def\guillemotright@{\DRG}%% in gllmts.tex
  \def\dagger@{$\m@th\dag$}%
  \gdef\daggerdbl@{$\m@th\ddag$}%
  \gdef\section@{$\m@th\S$}
  \gdef\paragraph@{$\m@th\P$}
  \gdef\pound@{{\ifdim\fontdimen\@ne\font >\z@
      \it\else \font\ft=cmu10\ft\fi\char`\$}}%% cheat
    %% but need u-style to do better, or NFSS
    %%\def\ppounds{\nfss@text{\ifdim \fontdimen\@ne\font >\z@
    %%    \it \else \fontshape u\selectfont \fi \char'44}}
  
  %%% Set lc et uc codes
   %% following Cork norm 128-255.
   %% lccode >0 for each letter is a necessary 
   %% condition for hyphenation

 \newcount\Ct@@
 \newcount\Ct@@@
 \toks0={% 
 \loop
 \Ct@=\count@\advance\Ct@ by 32 
    %% \count@ is Plain scratch counter \count255
 \uccode\count@=\count@\sfcode\count@=999
 \lccode\count@=\Ct@
 \uccode\Ct@=\count@
 \lccode\Ct@=\Ct@
 \ifnum\count@<\Ct@@
 \relax\advance\count@ by 1
 \repeat
 }

  %%% Impose Cork lc uc and sf codes
  \count@="80 \Ct@@="9E \the\toks0 %% segment "80 to "BF
 %%  Cork "9F is \S and "BF  is pound sign lc/uc codes 0
  \count@="C0 \Ct@@="DF \the\toks0 %% segment "C0 to "FF
  
 \toks0={} %% clean up

 \def\DoAccChars{%% Non-TM commented out!
 %%acute                 %^^10 is \i
 /'a^^e1./'e^^e9./'i^^ed./'^^10^^ed./'o^^f3./'u^^fa.
 /'A^^c1./'E^^c9./'I^^cd./'O^^d3./'U^^da.
 /'y^^fd./'Y^^dd.
  %/'l^^a8./'L^^88./'n^^ab./'N^^8b./'r^^af./'R^^8f.
  %/'s^^b1./'S^^91./'z^^b9./'Z^^99.
 %%grave 
 /`a^^e0./`e^^e8./`i^^ec./`^^10^^ec./`o^^f2./`u^^f9.
 /`A^^c0./`E^^c8./`I^^cc./`O^^d2./`U^^d9.
 %%hat
 /^a^^e2./^e^^ea./^i^^ee./^{^^10}^^ee./^o^^f4./^u^^fb.
 /^A^^c2./^E^^ca./^I^^ce./^O^^d4./^U^^db.
 %%cedilla
 /cc^^e7./cC^^c7.
  %/cs^^b3./cS^^93.
  %/ct^^b5./cT^^95.
 %%tilde
 /~a^^e3./~n^^f1./~o^^f5./~A^^c3./~N^^d1./~O^^d5.
 %%umlaut (diaise)
 /"a^^e4./"e^^eb./"i^^ef./"^^10^^ef./"o^^f6./"u^^fc.
 /"A^^c4./"E^^cb./"I^^cf./"O^^d6./"U^^dc.
 %/"Y^^98./"y^^b8.%% these two isolated in TM
 %%hungarian umlaut
 %/Ho^^ae./HO^^8e./Hu^^b6./HU^^96.
 %%breve
 %/ua^^a0./uA^^80./ug^^a7./uG^^87.
 %%cech (caron)
 %/vC^^83./vD^^84./vE^^85./vN^^8c.
 %/vR^^8c./vS^^92./vT^^94./vZ^^9a.%% and lc
 %%ogonek (Polish)
 %/gA^^83./gE^^84./gS^^85./gT^^8c.%% and lc
 %%dot over
 %/.i^^bd./.^^10^^bd./.I^^9d./.z^^bb./.Z^^9b.%
 %%circle over
 /*a^^e5./*A^^c5./*u^^b7./*U^^97.
 %%cross bar
  %/{**}l^^aa./{**}L^^8a.
 }

  \def\SetAccCharOctet#1#2#3#4{\CheckPeriod{#4}%
   \EX@\xdef\csname TO#1@#2\endcsname {\string#3}%
   }

 \let/\SetAccCharOctet
 \DoAccChars %% once and for all
 \let\DoAccChars\relax %% save space


 %%%%%%%%% Master formula
 \def\Smart@Acc{\SmartTest@\Smart@@Acc}
 %%% where \Smart@@Acc#1#2 with eg #1=' and #2=e
 %%% varies for different font classes: 
 %%% -10 (presumed) CM; -20 TM; -21 xA(=xAdobe for Mac) 
 %%% -30 rawPS; -40 CK(=Cork)
 %%% Only CM, TM currently active% 10-92
     
 \newcount\FontCls@
 \FontCls@=-10
 \def\ShowCurrentFontClass{%
       \ufcr\count255=-10
       \ifnum\FontCls@=\count255\relax\toks0{CM}\else\toks0{TM}\fi
       \immediate\write16{}
       \immediate\write16{ *** Current font \fontname\font}
       \immediate\write16{ *** is in class \the\toks0}}
         
 \def\SmartTest@{\ifnum\skewchar\font
            =\FontCls@\else\SwitchFontCls@\fi}

 \def\SwitchFontCls@{%
    \ifnum\skewchar\font=\defaultskewchar\empty %% "new" font
       \ReadFontCls@
    \fi
    \FontCls@=\skewchar\font
    \EX@\let\EX@\Smart@@Acc
              \csname\the\FontCls@ Acc\endcsname
    \edef\FontClsTag@{\csname\the\FontCls@ Tag@\endcsname}% try
    }

 %%% Macro-access for user
 \let\UpdateFontClassRegister\SmartTest@
 \let\ufcr\SmartTest@

 %% Stronger version of above needed 
 %% at point when unmarked fonts are introduced
 \let\UpdateFontClass\SwitchFontCls@ % 
 \let\ufc\SwitchFontCls@
 
 %%%% Prepare ReadFontCls tools
 
 \newbox\Smartbox@
 
 %%% \eAcuteCrit@: if Cork eacute of pos width,
  %% then make class TM
  \def\eAcuteCrit@{%
    \tracinglostchars=0\setbox\Smartbox@=\hbox{\char"E9}%
    \tracinglostchars=1
    %\showthe\wd\Smartbox@
    \ifdim\wd\Smartbox@>\z@\relax
       \SetTwotakeCls@
    \fi}
     
  \def\SetTwotakeCls@{%
     \edef\temp{\csname CaesarClass\tw@take\endcsname}%
       %\show\temp
       \global\skewchar\font=\temp\relax 
       %\showthe\skewchar\font
       \FontCls@=\temp\relax %% TM
       }

 %%% Set up \CMexClasses@ cat 12 list of prefixes (for TM)
  \def\Temp{}
  \stringer@ ,cm,CM,dm,DM,tm,TM\endstringer@ 
  \let\CMexClasses@\Temp
 
 %%% \taketw@ put next two tokens in \tw@take
  \let\tw@take\empty
  \def\taketw@ #1#2#3\endtaketw@{%
              \def\tw@take{#1#2}}
  %% at least two must be there 

 \def\ReadFontCls@{% error conditions
      \ifmmode %\show\mathoops %% diagnostic
      \else
         \ifnum\skewchar\font>-1\empty
           \show\mathfontoops
         \else\ReadFontCls@@
         \fi
      \fi}

 \def\ReadFontCls@@{%
   \setbox\Smartbox@\hbox{\char"5E}%
    %\showthe\dp\Smartbox@
   %% TM XA DM (many variants via fontdimen 8 etc)
   \ifdim\dp\Smartbox@>\z@\empty 
     \global\skewchar\font=-22
     \FontCls@=-22 %% DM
     \tracinglostchars=0
     \setbox\Smartbox@\hbox{\char"81}%% test provisional
     \tracinglostchars=1
     \ifdim\wd\Smartbox@>\z@\empty
        \global\skewchar\font=-21
        \FontCls@=-21 %% XA extended Adobe xTimes series
     \fi
   \fi
    \expandafter\taketw@\fontname\font..\endtaketw@
        %\show\tw@take\show\CMexClasses@
   \IN@0\tw@take @\CMexClasses@ @%
   \ifIN@ 
     \eAcuteCrit@ %% if ok assign class of \tw@take 
   \fi
   \ifnum\skewchar\font=\defaultskewchar\empty%% residual
     \global\skewchar\font=\CaesarDefaultClass\relax
     \FontCls@=\CaesarDefaultClass\relax
   \fi}
  
 \global\def\CaesarDefaultClass{-10\empty} 
  
 %%% \SetCaesarClass\font{DM} for example
 \def\SetCaesarClass#1#2{% #1 is font, #2 is font class tag
     \edef\temp{\global\skewchar#1=\csname CaesarClass#2\endcsname}%
     \temp}

 %%% Moved foreward for CM class
    
 \def\Safe@Acc#1#2{%
       \if i#2%
            \csname @#1@\endcsname \i
       \else
            \csname @#1@\endcsname #2\empty%
       \fi
       }

 %%%%%% FONT CLASSES 
 %%% CM
 \def\CaesarClassCM{-10\empty}
 \let\CaesarClasscm\CaesarClassCM
 \EX@\def\csname-10Tag@\endcsname{CM}% try
 \EX@\let\csname-10Acc\endcsname\Safe@Acc

 %%%%%% TM 
 \def\CaesarClassTM{-20\empty}
 \let\CaesarClasstm\CaesarClassTM
 \EX@\def\csname-20Tag@\endcsname{TM}% try
 %% define "\-20Acc"
 %% currently \"y, \"Y remains composite
 %% also \ae, \oe, \o, \ss not used in 128--255.
 %%% Basic accent macro  currently shared for TM, XA, DM classes
 \EX@\def\csname -20Acc\endcsname#1#2{%
  %\show\relax
  %\tracingcommands=2
  \expandafter
  \ifx\csname TO#1@#2\endcsname\relax
     \Safe@Acc{#1}{#2}%
  \else\SmartMsg@
     \csname TO#1@#2\endcsname
  \fi 
  }

  \gdef\TM@guillemotleft{\hbox{\char'327\kern-.25em\char'327}}
  \gdef\TM@guillemotright{\hbox{\char'367\kern-.2em\char'367}}

 %%%%%% XA = "mac-vec" eXtended Adobe: xTimes xHelvetica etc
 \def\CaesarClassXA{-21\empty}
 \let\CaesarClassxa\CaesarClassXA
 \EX@\def\csname-21Tag@\endcsname{XA}% try
 %% define "\-21Acc" to be "\-20Acc"
 %% as XA and TM classes same for accented chars
 \edef\temp{\let\expandafter\noexpand\csname -21Acc\endcsname
     \expandafter\noexpand\csname -20Acc\endcsname}
 %\show\temp
 \temp
 %% but want to include some extra diacritics
 %% cf.  Active8TimesCM.tex 
  %% XA for xTimes Adobe series (extended cm)
     %\gdef\XA@guillemotleft{^^85}
     %\gdef\XA@guillemotright{^^86}
     \gdef\XA@pound{^^bf}
     \gdef\XA@section{^^9f}
      %*\XA@dagger.^^81.
      %*\XA@daggerdbl.^^82.
      %*\XA@paragraph.^^8b.
      %*\XA@perthousand.^^8c.
      \xdef\SS@{SS}


 %%%%%% DM Dislexic-Modern of Brouard-Sullivan
 \def\CaesarClassDM{-22\empty}
 \let\CaesarClassdm\CaesarClassDM
 \EX@\def\csname-22Tag@\endcsname{DM}% try
 %% define "\-22Acc" to be "\-20Acc"
 %% as DM and TM classes same for accented chars
 \edef\temp{\let\expandafter\noexpand\csname -22Acc\endcsname
     \expandafter\noexpand\csname -20Acc\endcsname}
 %\show\temp
 \temp
 %% no extra diacritics
 %% DM is poorest class; hence default once extended status
 %% established

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 \let\Smart@@Acc\Safe@Acc 
  %% some initialisation necessary in \halign

 \def\ShowCaesar{\def\SmartMsg@{%% spoils kerning when on
     \W@{}\W@{ *** Caesar has used ready-made accent ***
              %%\csname TO##1@##2\endcsname
              }}%
     }   
 \def\HideCaesar{\def\SmartMsg@{}}
 \HideCaesar

  \def\'#1{\@Acc'{#1}} %acute
  \def\`#1{\@Acc`{#1}} %grave
  \def\^#1{\@Acc^{#1}} %hat
  \def\"#1{\@Acc"{#1}} %umlaut
  \def\c#1{\@Acc c{#1}} %cedilla
  \def\g#1{\@Acc g{#1}} %ogonek
  \def\~#1{\@Acc ~{#1}} %tilde 
  \def\.#1{\@Acc.{#1}} %dot over
  \def\u#1{\@Acc u{#1}} %breve
  \def\v#1{\@Acc v{#1}} %check=caron
  \def\H#1{\@Acc H{#1}} %Hungarian long umlaut
  \def\r#1{\@Acc *{#1}} %circle over (for \aa,\AA)
  \def\*#1{\@Acc *{#1}} %circle over (for \aa,\AA)
  \def\**#1{\@Acc {**}{#1}} %crossed (for \l,\L)
  %% \=,\t,\b,\d  already defined; not in Cork norm

   \def\aa{\* a}\def\AA{\* A}% always valid
   \def\l{\** l}\def\L{\** L}% always valid

 %% return to Plain codes
 \catcode`\/=12 
 \catcode`\~=13 
 \catcode`\*=12 
 
 %% JD for Jacques Desarmenien
 \def\JDaccents{\def\@Allowhyphens{\@@Allowhyphens}}
 \def\noJDaccents{\def\@Allowhyphens##1{\empty}}

 %% DS for Double Strike; relevant only while JD option on
 %% otherwise action delayed
 \def\DSaccents{\let\@@Allowhyphens\@@@Allowhyphens}
 \def\noDSaccents{\font\@dodo=dodo
           \let\@@Allowhyphens\@@@allowhyphens}

 %% ML for MLTeX,
 \def\noMLcodes{\SetKnuthExotics}
 \def\MLcodes{\ifRawPS\SetPSExotics\else\SetCMExotics\fi}

 \newif\ifCaesar

 \def\Caesar{\let\@Acc\Smart@Acc
  \ifRawPS\M@{}%
    \M@{ !!! Caesar's smart accents not available %
                   with raw PS font \the\font.}%
  \fi\Caesartrue}

 \def\noCaesar{\let\@Acc\Safe@Acc\Caesarfalse}

 \def\CMText{\RawPSfalse\SetCMExotics
            \SetCompositeCMAccents}

 \def\RawPSText{%
      \RawPStrue\SetRawPSExotics\SetCompositeRawPSAccents}
 \let\OzPSTeX\RawPSText

 \def\PSText{\W@{}%
     \W@{ !!! \string\PSText\Space 
           not defined! PS text is not all the same.}%
     \W@{ Define as \string\RawPSText\Space for OzTeX, 
              \string\relax\Space for Textures,...}%
     \W@{}\errmessage{}}

 \JDaccents %% default;  JD for J. Desarmenien
 \DSaccents %% default; DS for Double Strike
 \CMText %% default
 \Caesar %% default
 %\noCaesar

 %%%%% Switching uppercase accents off and on
 %%
\def\noucAccents{\def\Smart@Acc{\SmartTest@\Smart@@@Acc}%
 \def\Smart@@@Acc##1##2{%
     \ifnum\uccode`##2=`##2 
       ##2%
     \else
       \Smart@@Acc{##1}{##2}%
     \fi
     }
 \def\Safe@Acc##1##2{%
     \ifnum\uccode`##2=`##2 
       ##2%
     \else
       \if i##2%
            \csname @##1@\endcsname \i
       \else
            \csname @##1@\endcsname ##2\empty%
       \fi
     \fi
     }
  \ifCaesar\Caesar\else\noCaesar\fi
  %%initialization necessary
  }

\def\ucAccents{\def\Smart@Acc{\SmartTest@\Smart@@Acc}%
  \def\Safe@Acc##1##2{%
       \if i##2%
            \csname @##1@\endcsname \i
       \else
            \csname @##1@\endcsname ##2\empty%
       \fi
     }
  \ifCaesar\Caesar\else\noCaesar\fi
  %%initialization necessary
  }

 \let\UCAccents\ucAccents
 \let\noUCAccents\noucAccents

 %%% Alternative to \uppercase, \lowercase

   \catcode"02=13\catcode"03=13
 \gdef\eCasePrep@{%
     \let\c\relax\let\g\relax \let\H\relax \let\*\relax
     \let\v\relax\let\^\relax
     \let^^02\relax\let^^03\relax
     \let\guillemotleft\relax
     \let\guillemotright\relax
     \let\pound\relax
     \let\section\relax
     \let\dagger\relax
     \let\daggerdbl\relax
     \let\paragraph\relax
     \let\perthousand\relax
     %% anticipates \gdef^^e4{\Symb@@{perthousand}} %% no sym there
     \let\UCtemp@\relax\let\LCtemp@\relax 
     %%\let\eUppercase\relax\let\eLowercase\relax%% fails; why? 
     %% nec up to here, rest for speed
     \let\'\relax \let\`\relax \let\"\relax
     }
   \catcode"02=12\catcode"03=12

  \def\LCtemp@{%
    \lccode"02="02\lccode"03="02
    \Ctemp@
    \lccode"02=0\lccode"03=0
    }

 \def\UCtemp@{%
    \uccode"02="03\uccode"03="03
    \Ctemp@
    \uccode"02=0\uccode"03=0
    }

 \global\let\Ctemp@\relax
  \catcode"DF=13
 \gdef\eLowercase#1{\ufcr
      \bgroup\eCasePrep@
      \xdef\Ctemp@{\primlowercase{#1}}%\show\Ctemp@
      \egroup
      \LCtemp@%% could be \edef if \expandafter before \egroup
      \global\let\Ctemp@\relax %% then unnec
      }
  \catcode"DF=12
  %\show\eLowercase

 \gdef\eUppercase#1{\ufcr
      \bgroup\eCasePrep@
      \xdef\Ctemp@{\primuppercase{#1}}%\show\Ctemp@
      \egroup\UCtemp@
      \global\let\Ctemp@\relax
      }

 \catcode`\@=\JDCatAt 

 \endinput

 %%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 %%%%%% Misc tests

 \def\tst{\AE\ae\par}

 \tst \eUppercase{\tst}\eLowercase{\tst}%
     \eLowercase{\eUppercase{\tst}}\eUppercase{\eLowercase{\tst}} 

\end

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %%% test for case change
  \parindent=0pt
  \font\ft=dmr10  \ft %\ShowCaesar %\^\i\end
 
  \let\e\expandafter
  \def\xuppercase{\e\primuppercase\e}
  \def\xlowercase{\e\primlowercase\e}
  \long\def\gobble#1{}
  \long\def\tst{Aa \`A\`a \^A\^a \"A\"a \'E\'e \`E\`e \^I\^i\^\i{}
   \"I\"i\"\i{} \^O\^o \"O\"o \^U\^u \"U\"u \c C\c c
   \OE\oe{} \AE\ae{} \O\o{} 
   \SS\ss\ \H O\H o \v S\v s \g E\g e \*E\*e %% Eastern Europe
   \par}

     Bad:\par
 \tst \uppercase{\tst} \lowercase{\tst} \lowercase{\uppercase{\tst}}
  \smallskip\hrule\smallskip%\end
     Fair:\par
 \tst \xuppercase{\tst} \xlowercase{\tst} \xlowercase{\xuppercase{\tst}}
  \smallskip\hrule\smallskip%\end
     Correct:\par
 \tst \eUppercase{\tst}\eLowercase{\tst}%
     \eLowercase{\eUppercase{\tst}}\eUppercase{\eLowercase{\tst}} 

  \end


\input gllmts
\input gllmts_a.sty

 \def\tst{\guillemotleft
  \guillemotright
  \pound
  \section
  \dagger
  \daggerdbl
  \paragraph
  \perthousand\par}

 \tst \eUppercase{\tst}\eLowercase{\tst}%
     \eLowercase{\eUppercase{\tst}}\eUppercase{\eLowercase{\tst}} 

\end


 \ss\ \eLowercase{\ss} \eUppercase{\ss} 
 \eLowercase{\eUppercase{\ss}} \eUppercase{\eLowercase{\ss}} 

 \SS\ \eLowercase{\SS} \eUppercase{\SS} 
 \eLowercase{\eUppercase{\SS}} \eUppercase{\eLowercase{\SS}} 


 \end


