Re: accents in plain tex

David Carlisle <[email protected]>
Newsgroups gmane.comp.tex.texhax
Message-ID <CAEW6iOh_-fNrjPNsWhyhFhkE6DQhYTSjf7TGVZ6qZ8cqL6erJA@mail.gmail.com>
There is a typo #1 rather than #3 in the code, it could never have worked
as posted.

David

\font\tenrm=pplr8t at 10pt


\edef\catcodeat{\the\catcode`\@}\catcode`\@=11

\catcode`\@=\catcodeat
\ifx\documentclass\undefined
\catcode`\@=11
\def\ProvidesFile#1[#2]{}
\def\DeclareFontEncoding#1#2#3{}
\def\DeclareTextAccent#1#2#3{%
  \def#1##1{%
\expandafter\ifx\csname T1\string#1-\string##1\endcsname\relax
{\accent#3 ##1}%  #3 not #1!!!!!!!!!
\else
\csname T1\string#1-\string##1\expandafter\endcsname
\fi}}
\def\DeclareTextCommand#1#2{\xdtcmd}%not today
\def\xdtcmd#1#{\xxdtcmd}%not today
\def\xxdtcmd#1{}%not today
\def\DeclareTextCompositeCommand#1#2#3#4{}%not today
\def\DeclareTextSymbol#1#2#3{%
\def#1{\char#3\relax}}
\def\DeclareTextComposite#1#2#3#4{%
\expandafter\def\csname T1\string#1-\string#3\endcsname{\char#4\relax}}

\input t1enc.def

% \c needs special treatment
\def\c#1{\leavevmode\ifx c#1\char231
\else\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent11
#1%
     \else{\ooalign{\unhbox\z@\crcr
        \hidewidth\char11\hidewidth}}\fi\fi}
\catcode`\@=\catcodeat
\fi


%
% Redefine accented characters for 8-bit font
%
\tenrm

\'a

\`a

\^a

\~a

\v e

\u a

\v a

\u e

\=a

\bye

On Mon, 24 Jun 2024 at 16:57, Bob Tennent <[email protected]> wrote:

>
>
>
>
> Once upon a time David Carlisle sent me the following code intended to
> allow accented characters in musixtex scores:
>
>
> \ifx\documentclass\undefined
> \catcode`\@=11
> \def\ProvidesFile#1[#2]{}
> \def\DeclareFontEncoding#1#2#3{}
> \def\DeclareTextAccent#1#2#3{%
> \def#1##1{%
> \expandafter\ifx\csname T1\string#1-\string##1\endcsname\relax
> {\accent#1 ##1}%
> \else
> \csname T1\string#1-\string##1\expandafter\endcsname
> \fi}}
> \def\DeclareTextCommand#1#2{\xdtcmd}%not today
> \def\xdtcmd#1#{\xxdtcmd}%not today
> \def\xxdtcmd#1{}%not today
> \def\DeclareTextCompositeCommand#1#2#3#4{}%not today
> \def\DeclareTextSymbol#1#2#3{%
> \def#1{\char#3\relax}}
> \def\DeclareTextComposite#1#2#3#4{%
> \expandafter\def\csname T1\string#1-\string#3\endcsname{\char#4\relax}}
>
> \input t1enc.def
>
> % \c needs special treatment
> \def\c#1{\leavevmode\ifx c#1\char231 \else\setbox\z@\hbox{#1}\ifdim\ht\z@=1ex\accent11
> #1%
>      \else{\ooalign{\unhbox\z@\crcr
>         \hidewidth\char11\hidewidth}}\fi\fi}
>
>
>
>
> This works for several accented characters but not \v a, \u e, \=a.
> Is there any solution?
>
> Bob T.
>
>
>
>
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.