accents in plain tex

David Carlisle d.p.carlisle at gmail.com
Tue Jun 25 20:38:39 CEST 2024


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 <rdtennent at gmail.com> 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.
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texhax/attachments/20240625/ebb08d74/attachment.htm>


More information about the texhax mailing list.