%%%% email-fr.fix %%% Error correction utility for email-fr.sty (same postings) %%% Laurent Siebenmann, October 1993 %%% Master Posting in 1993: anonymous ftp matups.matups.fr %%% (perhaps) in directory TypingTeX.dir %%% Support: lcs@matups.matups.fr %%% Documentation: after \endinput \catcode`\@=11 \def\wlog#1{\relax} %%% \SIN@0#1@#2@ : Is 1st exp of #1 in 1st exp of #2 ?? %% Answer in \ifIN@ %% Further if true, then \Initialtoks@ \Terminaltoks@ %% contain the parts before and after. %% while \Initialtoks@{#2}% \newif\ifIN@ \newtoks\Initialtoks@ \newtoks\Terminaltoks@ \def\m@rker{\m@@rker}% \long\def\DeleteMarker@ #1@@#2\m@rker{\Terminaltoks@{#1}}% \def\SIN@{\expandafter\SINN@\expandafter}% \long\def\SINN@0#1@#2@{% \long\def\NI@##1#1##2##3\ENDNI@ {\ifx\m@rker##2\IN@false\Initialtoks@\expandafter{#2}% \else \IN@true \Initialtoks@{##1}\DeleteMarker@##2##3% \fi}% \expandafter\NI@#2@@#1\m@rker\ENDNI@} \def\END{\output{\shipout\box255}\end{document}} \catcode`\!=12\catcode`\;=12\catcode`\:=12\catcode`\?=12 \catcode`\'=12 \catcode`\/=12 \catcode`\>=12 \catcode`\"=12 \catcode`\_=12 \catcode9=4 \newread\emailFile@ \newwrite\emailNFile@ \def\ms@g{\immediate\write16}% \def\iWrite#1#2{\toks0\expandafter{#2}% \immediate\write#1{\the\toks0}} \def\iWr@#1{\iWrite\emailNFile@{#1}} \begingroup\lccode`_=32\lccode`C=`C\lccode`C=`C \lccode`S=`S\lccode`T=`T\lccode`E=`E \catcode`\^=12% \lowercase{\endgroup \gdef\FirstScreen@{\ms@g{}% \ms@g{_***********************************************}% \ms@g{_**************__email-fr.fix__*****************}% \ms@g{_*******__Correcteur_pour__email-fr.sty__*******}% \ms@g{_**_Sert_`a_assurer_que__/__est_employ'e_pour_}% \ms@g{_**_`a_la_place_de___'___l`a_o`u_il_convient}% \ms@g{_**_d/'eviter_une_confusion_'eventuelle_avec_.}% \ms@g{_***********************************************}% \ms@g{_****_Taper_le_nom_du_fichier_`a_corriger,_se_trouvant}% \ms@g{_****_dans_le_m^eme_directory_que__email-fr.fix.}% \ms@g{_****_Ensuite_taper____(=_retour_de_chariot).}% \ms@g{_*******_Le_nom_par__d'efaut_est__corr.in.}% \ms@g{_**********_Taper__x__et____pour_avorter.}% \ms@g{_***********************************************}% \let\FirstScreen@\relax}} \gdef\ConfigScreen@{\ms@g{}% \ms@g{ ***********************************************}% \ms@g{ ** Les tabs sont interdits dans le fichier d'entr'ee.}% \ms@g{ ** Le nom du fichier de sortie sera corr.out.}% \ms@g{ ** Le traitement co^ute quelques secondes par page.}% \ms@g{ ** La documentation se trouve apr`es \space\string\endinput.}% \ms@g{ ***********************************************}% \ms@g{ ** Tapez pour les choix par d'efaut.}% \ms@g{ ** (ie. "automatique" et "dialogue")}% \ms@g{ ** Tapez \space o \space et pour d'autres options.}% \let\ConfigScreen@\relax}% \gdef\OptionsScreen@{\ms@g{}% \ms@g{ ***********************************************} \ms@g{ ** \space a \space pour "mode intelligence automatique"} \ms@g{ ** \space d \space pour "mode dialogue"} \ms@g{ ** \space f \space pour "mode flag" (avertisseurs dans la sortie).} \ms@g{ ** \space p \space pour "protection par espaces" des modifications.} \ms@g{ ** \space i \space pour "ignore protection" `a l/entr'ee.} \ms@g{ ** \space m \space pour l'insertion d'un espace `a la marge.} \ms@g{ ** \space '' \space pour *ne pas* convertir \space l''etat \space en \space l/'etat \space etc.} \ms@g{ *** --- toute combinaison et order, puis .} } %\ms@g{ ** \space e \space ent^ete autonome de macros email-fr.} \gdef\DialogScreen@{\ms@g{}% \ms@g{ *** Frappe douteuse >>> \DialogWord@}% \ifHomonym@ \ms@g{ *** In the line : }% \ms@g{ \emailLine@}%% guarantees enough context \Homonym@false \fi \DialogSubScreen@ } \def\DialogSubScreen@{\ms@g{ *** Taper pour confirmer; \space n \space d/abord sinon; }% \ms@g{ *** et \space f \space pour flag (avertisseur dans la sortie). }% } \let\EX@=\expandafter \newif\ifDialogs@ %% not dialog \newif\ifSmart@ %% \newif\ifSpProtect@ %% \newif\ifFFlag@ {\catcode32=12\relax\gdef\OtherSp@{ }} \edef\dOtherSp@{\OtherSp@\OtherSp@\OtherSp@}% \gdef\Preamble@{\FirstScreen@ \read16 to \YourChoice@ \def\Temp{\let\emailFileSpec@\YourChoice@ } \def\temp{\par} \ifx\YourChoice@\temp \def\Temp{\def\emailFileSpec@{corr.in }} \fi \def\temp{x } \ifx\YourChoice@\temp \def\Temp{\end{document}} \fi \Temp % %\show\emailFileSpec@ \openin\emailFile@\emailFileSpec@ \immediate\openout\emailNFile@ corr.out \relax %necessary to prevent precocious expansion of \ifeof? \ifeof\emailFile@ \ms@g{}% \ms@g{ !!! FILE NOT FOUND !!!}\show\Perseverence \EX@\END \fi \ConfigScreen@ \read16 to \YourChoice@ %\show\YourChoice@ \SIN@0o@\YourChoice@ @% \ifIN@ \OptionsScreen@ \read16 to \YourChoice@ %\show\YourChoice@ \else \def\YourChoice@{ad }% \fi \SIN@0a@\YourChoice@ @% \ifIN@ \Smart@true \let\AutoAccCalc@\AutoAccCalc@Full \else \Smart@false \let\AutoAccCalc@\AutoAccCalc@Nul \fi \SIN@0d@\YourChoice@ @% \ifIN@ \Dialogs@true \ifSmart@ \let\Acc@Dialog\Acc@Dialog@Option \else \let\Acc@Dialog\Acc@Dialog@Full \fi \else \let\Acc@Dialog\Acc@Dialog@Nul \Dialogs@false \fi \SendOutputSyntaxHeader@ \SIN@0f@\YourChoice@ @%\show\YourChoice@ \ifIN@ %\message{ *** f is IN!}% \edef\Flag@{\XXXX }%\show\Flag@ \SendOutputBatchHeader@ \else \edef\Flag@{} \fi \SIN@0p@\YourChoice@ @% \ifIN@ \SpProtect@true \edef\Flag@{\OtherSp@\Flag@}% \fi \SIN@0m@\YourChoice@ @% \ifIN@ \let\Mspace@\OtherSp@ \else \let\Mspace@\empty \fi \SIN@0i@\YourChoice@ @% \ifIN@ \def\IgnorePD@test{\SIN@0\dOtherSp@\@@z@zg @\Spacy@\@@z@zg @ %%\@@z@zg "unique"! \ifIN@\DoubleSp@true\else\DoubleSp@false\fi} \else \let\IgnorePD@test\relax\DoubleSp@false \fi \SIN@0''@\YourChoice@ @% \ifIN@ \let\AigAigFix@\relax \fi } \let\XXXX\relax \begingroup %%\catcode`*`=12 %%troublesome; by hand \catcode`\%=12 \catcode`\<=12 \catcode`\>=12 \catcode`\^=12 \catcode`\_=12 \catcode`\#=12 \catcode`\'=12 \catcode`\"=12 \catcode`\~=12 \catcode`\*=0 *catcode`*\=12 *gdef*SendOutputSyntaxHeader@{ *iWr@{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} *iWr@{ %% La frappe des accents fran_cais pour email-fr.sty :} *iWr@{ %% / sert comme , du moins devant e et E } *iWr@{ %% ' ` ^ _ pour \' \` \^ \c respectivement; \" est inchang'e} *iWr@{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} *iWr@{ %% Commandes utiles `a l/'epreuvage : } *iWr@{ %\input email-fr.sty %% master posting ftp matups.matups.fr} *iWr@{ %% in directory TeX/TypingTeX.dir} *iWr@{ %\frenchemail } *iWr@{ %\BlockNonASCII } *iWr@{ %\SmartQuotes %\noSmartQuotes %\flexcat! } *iWr@{} *gdef*SendOutputSyntaxHeader@{}} *gdef*SendOutputBatchHeader@{ *iWr@{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} *iWr@{ %% Dans le texte modifi'e suivant construit par email-fr.fix,} *iWr@{ %% \XXXX marque les les sites d'erreurs 'eventuelles, par } *iWr@{ %% confusion entre / et ' .} *iWr@{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} *iWr@{ %% Apr`es avoir apport'e les corrections, il convient de} *iWr@{ %% supprimer tous les \XXXX (faites-le automatiquement} *iWr@{ %% si possible). Ensuite, transportez le} *iWr@{ %% texte corrig'e dans son fichier d'origine.} *iWr@{ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%} *gdef*SendOutputBatchHeader@{}} *endgroup %%% Will use tripply (or more) nested loops: %% \def\Loop@#1\Repeat@{% \def\Iterate@{#1\expandafter\Iterate@\fi}% \Iterate@} \def\Loop@@#1\Repeat@@{% \def\Iterate@@{#1\expandafter\Iterate@@\fi}% \Iterate@@} \def\Loop@@@#1\Repeat@@@{% \def\Iterate@@@{#1\expandafter\Iterate@@@\fi}% \Iterate@@@} \def\Loop@@@@#1\Repeat@@@@{% \def\Iterate@@@@{#1\expandafter\Iterate@@@@\fi}% \Iterate@@@@} %{\catcode 9=13\relax \global\let ^^09\OtherSp@} \newcount \aux@count \def\HighASCIIOther@{% \count@=128\relax \aux@count=256 \loop \catcode\count@=12 \advance\count@ by \@ne \ifnum\count@ < \aux@count % \repeat} \def\Transfer@{\let\OptionScreen@\relax\begingroup \HighASCIIOther@ \endlinechar=-1 for above two lines \catcode9=15 %% invalid because tabs spoil fix \relax\catcode`\%=12 \catcode`\#=12 \catcode`\_=12 \catcode`\^=12 %\showthe\catcode`\^% \catcode`\-=12 \catcode`\{=12 \catcode`\}=12 \catcode`\ =12 \catcode`\'=12 \catcode`\\=12 \Loop@ %\message{ * }% \ifeof\emailFile@ \else \read\emailFile@ to \emailLine@ %\edef\emailLine@{\emailLine@} \TreatLine@ %\let\emailNLine@\emailLine@ \iWrite\emailNFile@{\emailNLine@}% \Repeat@ \closein\emailFile@ \immediate\closeout\emailNFile@ \ClosingDialog \endgroup} \def\ClosingDialog{% \ms@g{ *** FINI! : }% \ms@g{ *** Voir \space corr.out \space `a c^ot'e du fichier d'entr'ee.}% \ms@g{ *** Taper pout sortir. }% \read16 to \byebye \aftergroup\stopp} \def\stopp{\end{document}} \newtoks\Remaindertoks@ \newtoks\emailNLinetoks@ \newif\ifLMargin@ \def\TreatLine@{%\message{**TreatLine@}% \LMargin@true \Remaindertoks@\expandafter{\emailLine@} \let\Remainder@\emailLine@ \emailNLinetoks@\EX@{\Mspace@}% \let\emailNLine@\Mspace@ %% \Loop@@ %\message{**TreatLine@loop}% %\show\Remainder@ %\showthe\Remaindertoks@ \ifx\empty\Remainder@ \else \LopLine@ \Repeat@@ \relax %\show\emailNLine@ } \newif\ifDanger@ \newtoks\BeforeAcc@etoks \def\acc@e{'e}% %\def\AutoAcc@{/e}\def\AltAcc@{'e}% %\def\ChosenAcc@{/e}% %%% \SetQWord@ gets \QWord@ for machine \def\SetQWord@{%\show\Remainder@ \SIN@0\OtherSp@ @\Remainder@ @%% defines \Initialtoks@ %% no need revise remainder \edef\QWord@{\space\the\Dangeroustoks@ ?e\the\Initialtoks@\space}% %\show\QWord@ %% space? } %%% \SetDialogWord@ gets \DialogWord@ for man %% also \def\SetDialogWord@{% \SIN@0\OtherSp@ @\Remainder@ @%% defines \Initialtoks@ \edef\DialogWord@{\the\Dangeroustoks@\AutoAcc@\the\Initialtoks@}% } \newcount\uc@cnt \def\Cest@{C/est} %%% Nibble@#1\endNibble@\endNibble@ %% gives \Nibblet@ (first token of #1) and \Butt@ rest (or empty) %% If no token in #1 then \Butt@ is xequal \endNibble@ %% Spaces are omitted for \Nibblet@; not for \Butt@ \def\Nibble@#1\endNibble@{% \expandafter\Nibble@@#1\endNibble@\endNibble@} \def\endNibble@{\Term@}\let\Term@\relax \def\Nibble@@#1#2\endNibble@{% \def\Nibblet@{#1}\edef\Butt@{#2}% %\show\Nibblet@\show\Butt@ } \newif\ifHomonym@ %%% \Acc@Dialog@Option that is the question %% \def\Acc@Dialog@Option{% \Nibble@\DialogWord@\endNibble@ \EX@\count@\EX@`\Nibblet@ \uc@cnt=\uccode\count@ \ifnum \uc@cnt=\count@ \relax %\show\Cest@\show\DialogWord@ \SIN@0\EX@\relax\Cest@ @\EX@\relax\DialogWord@ @% \ifIN@ \EX@\Acc@Dialog@Nul \else \EX@\Acc@Dialog@Full \fi \else %\show\DialogWord@ \SIN@0\DialogWord@\relax @ n'es\relax n/es\relax @% \ifIN@ \Homonym@true %\edef\BeforeDangerous@{\emailNLine@\Spacy@}% \edef\DialogWord@{% \the\Dangeroustoks@\AutoAcc@\the\Remaindertoks@}% \EX@\Acc@Dialog@Full \else \EX@\Acc@Dialog@Nul \fi \fi} %%% \AutoAccCalc@ : fn \acc@e and context %% gives \AutoAcc@ and \AltAcc@ %%% \Acc@Dialog@Full : fn \AutoAcc@ and USER input give \ChosenAcc@ \def\Acc@Dialog@Full{\DialogScreen@ \catcode"D=5\read16 to \YourChoice@\catcode"D=14 %%must not break above line! 5=endline; 14=comment \ifx\par\YourChoice@ \let\ChosenAcc@=\AutoAcc@ \else \EX@\OtherDialogActions@ \fi } \def\OtherDialogActions@{% \SIN@0n@\YourChoice@ @% \ifIN@ %\message{** n IN**}% \let\ChosenAcc@=\AltAcc@ %\show\ChosenAcc@ \else \let\ChosenAcc@=\AutoAcc@ \fi \OtherDialogActions@@} \def\FFlag@{} \def\FFlag@@{\XXXX} \let\FFlag@reset\relax \def\OtherDialogActions@@{% \SIN@0f@\YourChoice@ @% \ifIN@ %\message{** f IN**}% \ifx\Flag@\empty \let\FFlag@\FFlag@@ \def\FFlag@reset{\let\FFlag@\empty}% \else \let\FFlag@\empty \fi \fi \SIN@0F@\YourChoice@ @% \ifIN@ %\message{** F IN**}% \ifx\Flag@\empty \def\FFlag@reset{}% \let\OtherDialogActions@@\relax \def\DialogSubScreen@{\ms@g{ *** Taper pour confirmer; d'abord \space n \space sinon.}} \fi \fi } %%% \Acc@Dialog@Nul : fn \AutoAcc@ and USER input give \ChosenAcc@ \def \Acc@Dialog@Nul{\let\ChosenAcc@\AutoAcc@} \def \LopLine@{% \message{**LopLine@}% \SIN@0\acc@e @\Remainder@ @% \ifIN@ %\show\ifIN@ %\message{**IN}% \edef\BeforeAcc@e{\the\Initialtoks@}% \BeforeAcc@etoks=\Initialtoks@ \Remaindertoks@=\Terminaltoks@ \edef\Remainder@{\the\Remaindertoks@}% maybe need later \DangerTest@ %% result in ifDanger@ %% Spacy , Danger splitting %\LMargin@false \ifDanger@\message{*}% \SetQWord@\relax%\show\QWord@ \AutoAccCalc@\relax%\show\AutoAccCalc@ \SetDialogWord@ \Acc@Dialog \edef\emailNLine@{\the\emailNLinetoks@ \the\Spacytoks@\Flag@\FFlag@\the\Dangeroustoks@\ChosenAcc@}% \FFlag@reset \emailNLinetoks@\expandafter{\emailNLine@}% \else \edef\emailNLine@{\the\emailNLinetoks@ \the\BeforeAcc@etoks\acc@e}% \emailNLinetoks@\expandafter{\emailNLine@}% \fi \else \edef\emailNLine@{\the\emailNLinetoks@\the\Remaindertoks@}% \emailNLinetoks@\expandafter{\emailNLine@}% \Remaindertoks@{}\let\Remainder@\empty \fi % %\show\emailNLine@ %\show\Remainder@ } %%% New splitting of \BeforeAcc@e %% into abutting initial %\Spacy@ \newtoks\Spacytoks@ %% and terminal (no spaces) %\Dangerous@ \newtoks\Dangeroustoks@ \def\DPrefixes@{ c d j l m n s t qu C D J L M N S T Qu QU } \def\DangerTest@{% \FindLastSpace@ %% last space in \BeforeAcc@e %% Spacy, Dangerous : is splitting \AigAigFix@ \ParenFix@ \SIN@0\Dangerous@ @\DPrefixes@ @% \ifIN@ \Danger@true% \else \Danger@false \fi \ifx\Dangerous@\empty\Danger@false\fi%% correction \ifx\Spacy@\empty \ifLMargin@%\message{***Lmargin}% \ifSpProtect@ \let\Spacy@\OtherSp@% \Spacytoks@\expandafter{\Spacy@}% %\LMargin@false \fi \else \Danger@false \fi %\else \LMargin@false \fi%% correction \ifDoubleSp@\Danger@false\fi%% correction \ifDanger@ %\message{ !!!!DANGER!!! }% \else%\message{ ***No Danger*** }% \fi \LMargin@false} \def\AigAigFix@{%% Following for l''ecart ==> l/'ecart %% "not Dangerous" no dialog etc??? \SIN@0'\relax @\Dangerous@\relax @%% Is ' at end?? \ifIN@\message{*}% \edef\Dangerous@{\Flag@\the\Initialtoks@ /}% \Dangeroustoks@\EX@{\Dangerous@}% \edef\BeforeAcc@e{\the\Spacytoks@\the\Dangeroustoks@}% \BeforeAcc@etoks\EX@{\BeforeAcc@e}% %\show\BeforeAcc@e \fi} \edef\Parens@{\string`\string"([\string{} %\show\Panens@ \def\ParenFix@{% \Loop@@@@ \Nibble@\Dangerous@ \endNibble@%\show\Nibblet@ \SIN@0\Nibblet@ @\Parens@ @% %% Does \Dangerous@ begin with one of `"([{?? \ifIN@ % \message{ ***IN*** } \let\Dangerous@\Butt@\Dangeroustoks@\EX@{\Dangerous@}% %\show\Dangerous@\showthe\Dangeroustoks@ \edef\Spacy@{\Spacy@\Nibblet@}\Spacytoks@\EX@{\Spacy@}% \Repeat@@@@ %\show\Dangerous@ } \newif\ifDoubleSp@ \def\FindLastSpace@{%gives possibly degen splitting \Dangeroustoks@\expandafter{\BeforeAcc@e}% \edef\Dangerous@{\the\Dangeroustoks@}% \let\Spacy@\empty\Spacytoks@{}% \Loop@@@ \SIN@0\OtherSp@ @\Dangerous@ @% \ifIN@ \edef\Spacy@{\the\Spacytoks@\the\Initialtoks@\OtherSp@}% \Spacytoks@\expandafter{\Spacy@}% \Dangeroustoks@=\Terminaltoks@ \edef\Dangerous@{\the\Dangeroustoks@}% \Repeat@@@ \IgnorePD@test %% always gives false unless ignore option on %\show\Spacy@ %\show\Dangerous@ %\ifDoubleSp@\message{ ***DoubleSp@*** }\fi } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% Syllable Counting macros %\let\CountPause\relax %% Conserve count registers by local use. \countdef\TY@cnt=190 \dimendef\TY@hsize=200 \dimendef\TY@everypar=201 %%%% \PrepCounts@ \def\PrepCounts@{% %%% Impose a suitable language %% Check for and call language \l@emailFR \ifSmart@ \ifx\undefined\l@emailFR \ms@g{}% \ms@g{ !!! Pardon, le mode "automatique" est disponible seulement avec}% \ms@g{ !!! le language artificiel "emailFR" (fourni par email-fr.dmp).}% \show\Perseverence \def\empty{\END} \fi \fi\empty \language\l@emailFR %%% Exotic convention / hyphen character %% (for display and to enable some hyphenation) \hyphenchar\font=`\/ %%% Exotic convention '?- are letters for hyphenation \lccode`\'=`\' % \lccode`\?=`\? % \lccode`\-=`\- % %% prevents extraneous hyphenation at hyphen! \lccode 32=32 %% just in case %%% Clearly: \lefthyphenmin=0 \righthyphenmin=0 %%% Horizontal changes \SetTY@everypar \SetTY@hsize \hbadness=10000 \hfuzz=\maxdimen %\pretolerance=100000 %% Alas no effect! %%% Vertical changes \topskip=0pt plus \vsize \baselineskip=\vsize\relax %%% Output changes \maxdeadcycles=2000000000 %% two billion words at most! \csname output\endcsname{\global\setbox255=\box\voidb@x}% %%% use a standard font \font\ft=cmr10 \ft } %%%% Gen@Count: the main macro. %% will always be surrounded by grouping \def\Gen@Count{% \vfil\par\break \let\Gen@Count\undefined \let\endGen@Count\endGen@@Count \deadcycles=0} \def\endGen@@Count{%% defined \endGen@Count in time \vfil\par\break \errorcontextlines=0 \global\TY@cnt=\deadcycles %\message{*}% %\immediate\write16{\space % *** \Count@Mode\space= \the\TY@cnt\space\TY@Msg}% %\CountPause\CountPause %% gives pause \deadcycles=0} %%% Some defaults \def\TY@Msg{(starting at input line \the\inputlineno) ***}% \def\SetTY@hsize{\hsize=\z@\relax \let\hsize\TY@hsize} %% uproot! \def\SetTY@everypar{\everypar\expandafter{\the\everypar\ } %% "\ " is glue allowing hyphenation of 1st word \let\everypar\TY@everypar %% uproot! } %%% \SyllableCount: Simple! \def\Count@Mode{SyllableCount} \def\SyllableCount{\begingroup \Gen@Count} %% language variation OK!? \def\endSyllableCount{\endGen@Count\endgroup} %%%%% End Syllable Counting macros %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% \AutoAccCalc@Full %% uses \QWord@ %% will define \AutoAcc@ \AltAcc@ \def\AutoAccCalc@Full{%\show\Remainder@\show\QWord@ \SyllableCount \QWord@ \endSyllableCount \ifnum\TY@cnt>1 \def\AutoAcc@{/e}\def\AltAcc@{'e}% \else \def\AutoAcc@{'e}\def\AltAcc@{/e}% \fi} %%% \AutoAccCalc@Nul %% must define \AutoAcc@ \AltAcc@ \def\AutoAccCalc@Nul{\def\AutoAcc@{'e}\def\AltAcc@{/e}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% The action! \Preamble@ \PrepCounts@ \Transfer@ \END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%% Documentation for email-fr.fix %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Apology to French readers: This documentation is in English to facilitate construction of similar programs for other languages. However the user interface is in French. *** Motivation *** In typing French according to the email-fr rules, there is one unfortunate change of standard typing habits that one must cope with. An apostrophe followed by e or E should be typed as a slash / and not as ' . This is unambiguous and visually acceptable --- at least more so than a backslash in the middle of a word. The problem is that few typists are able to avoid reverting several times per page to ' for apostrophe, which may produce or in TeX. One can, of course, correct the errors after typesetting; however this is inefficient to the point of nearly cancelling the time gain over Knuth's rather clumsy typing system. A portable but tiresome solution consists in searching for and examining all occurrences of 'e or 'E. An effective but elitist solution is to use a good text editor to search for the quadruple ' and replace it where appropriate by /e (or /E). As is one of many c d j l m n s t (not counting capitalisation and occurrences of qu) it should be treated as a wildcard or multiple choice; but only a sophisticated text editor operated by a sophisticated user can do that. Thus a portable and preferably automatic typing correction tool should be made available to every TeX user wherever he may be. It is provided by the present ".tex" utility called email-fr.fix in conjunction with email-fe.dmp. Both are distributed with email-fr.sty. Alternative utilities to accomplish the same tasks as email-fr.fix could be be based on on programmable word processors such as emacs or on a spelling checker that has the means to read email-fr typing. However TeX has proved a quite appropriate tool for this job because the tiresome part is rather trivial for TeX's hyphenation mechanism. Clearly, no alternative could be quite so portable. **** Use of email-fr.fix **** If you have many pages of typing to correct, you will want a format containing the special language "emailFR", for only with this language present is the action of email-fr.fix essentially automatic --- use default or the the "a" option. For just a few pages of typing, the "d" or "dialog mode" of operation is adequate on its own without language "emailFR". Any French format built with the mechanism "format-dumper" in 1994 or later will contain the (tiny) language emailFR (the master posting of format-dumper is on matups.matups.fr in 1993-1994). If your format does not have this language, you can quickly build one that does with the help of email-fr.dmp and initex. Note that the format for email-fr.fix need not be the one that composes your ".tex" typescript. Here is how to start using email-fr.fix. Save your email-fr typescript under the name corr.in along side of email-fr.fix. Then "compose" email-fr.fix (not corr.in!) under a TeX format containing (if possible) the language emailFR. Do so just as though email-fr.fix were a typescript. Instructions are given interactively. Ultimately the corrected typescript will apear in corr.out along side of corr.in. KEY TO OPTIONS The full gammut of options is only offered only if a default choice has been declined. Each option is commanded by a one-letter key; one types any (unordered) subset of the keys listed below and then hits return. For example : ad commands "Automatic" and "Dialog"; this is the default choice. ******************************** m --- Margin space : add a space at the beginning of every line that does not already begin with one. Lines that do not begin with a space are occasionally subject to corruption in the email network. f --- Flag All: always insert a "flag" \XXXX before the spot where where a possible error is detected. (Compare d.) If you wish to examine absolutely every change introduced (or even contemplated) by email-fr.fix this is the one and only way to do it. The dialog option below will reveal only changes that risk being wrong. i --- Space ignore : ignore potential errors that are preceeded by at least three spaces. p --- Space protect : "protect" all errors corrected by inserting three preceeding spaces in the output. a --- Automatic mode : use the hyphenation patterns of the special language emailFR to make (or propose) corrections. Here lies the power of email-fr.fix --- use it! An asterisk is printed to the screen each time a significant automatic decision is made. '' --- leave l''etat (etc.) as is. By default, there is otherwise an automatic conversion to l/'etat (etc.), which seems noticeably mode readable to me. d --- Dialog mode : In this mode of action the user is asked to choose between / and ' whenever email-fr.fix cannot decide. Let us spell out what this means. In case Smart mode is on at the same time, dialog is rare : it is skipped as unnecessary, unless a capital letter begins the possible error. In this case a proper name with non-French spelling may be involved and so dialog serves a purpose. The program proposes for the user's approval a correction by the automatic mechanism. In case Smart mode is off, dialog always occurs and it just proposes what was found in corr.in. In either case, the user has several choices to approve the dialog proposal The other choices are provided by preceeding the with one or more of the following letters in any order: n to decide the opposite of the proposal f to flag this possible error in the output F to impose f for all remaining dialogs A flag may be vital to permit later correction of a nonstandard error that you spot. ****** Leftovers and Extensions ****** 1) ns and nes are both legitimate in French. This is one of the extremely rare occasions when the change <---> e preserves French. It is treated as an exception, via dialog if possible. 2) Remember that one can suppress all action of email-fr.fix at a given spot by insertion of three or more preceeding spaces, and then always using the "p" option above. For example the sentence of documentation: Pour 'eviter l/erreur : `` Freud et l'ego'' would be left intact --- as we clearly want. When it is not possible to protect in this way, insertion of {} (although visually disturbing) should do the job --- indeed without calling on the "p" option: Pour 'eviter l/erreur : Freud et ``{}l'ego'' 3) Some 'e occurring in mathematics may be wrongly converted into /e by email-fr.fix. This is statistically extremely rare. Furthermore, email-fr.sty (not .fix!) has been programmed to stop and warn the reader whenever it meets /e in math mode. (The user is then asked to insert a space to prevent recurrence of the confusion.) Thus, such rare errors will be mechanically caught before they get into print. 4) The case of 'E in place of 'e is not treated by email-fr.fix although it could be. The reason is that such problems are rare and in any case risk involving a proper name. Direct search for 'E seems a perfectly adequate correction procedure. For example La vie d'Egas, architecte espagnol, 1455-1534. would be maintained by email-fr.fix *if* e and E were treated alike, whereas only d/Egas is correct. The matter is complicated by frequent omission of accents on capitals. 5) Proper names especially those of non-French origin, will be a small but inexhaustible source of failure of the automatic choices offered by email-fr.fix. For example, email-fr.fix changes l'ego ==> l/ego But what of the S'ego lily of the American Indians (which would surely have an accute accent in Cajun French of Louisiana). As first based on existing French dictionaries, email-fr.fix wrongly proposed S/ego, and the user had to respond by switching back to S'ego. Progressively such exceptions (and others below) are handled by augmenting the tables in email-fr.dmp. Thus, dialog may gradually become superfluous. 6) Bits of English used in French (often illigimately) will also be an inexhaustable supply of exceptions. Computer science is a big contributor because the spelling of English is usually retained and lower case is usual. Here here sample patterns from email-fr.dmp that handle such exceptions: ?3email ?3emacs Here ? stands for a ' that may or may not become a /. NB. Users are kindly requested to report exceptions as well as true bugs. Laurent Siebenmann **** Appendix : %%%%%%%%%%%%%%%%%%%% A test file: corr.in ``c'est bon'' "c'est bon" (c'est bon) [c'est bon] {{}c'est bon} Donc, tu n'es pas n'e hier; et vous autres vous n'^etes pas n'es hier non plus. %%%%%%%%%%%%%%%%%%%% corr.out : ``c/est bon'' "c/est bon" (c/est bon) [c/est bon] {{}c'est bon} Donc, tu n/es pas n'e hier; et vous autres vous n'^etes pas n'es hier non plus.