6

I'm using egreg's code to use UTF-8 in Plain TeX so I can use Donald Knuth and Silvio Levy's CWEB. However, not every TeX font supports foreign language characters such as \"{y} or ç or ã.

So this code...

\input cwebmac
\input utfplainmac
\input plain-t1

\N{1}{1} Introdução. Lorem ipsum dolor...

... produces this result:

enter image description here

The problem is shown by the log file:

Missing character: There is no ç in font cmr8!
Missing character: There is no ã in font cmr8!

How could I switch cmr8 to another font that does have these characters?

2
  • 1
    You could try pinging @egreg on that answer so that this gets his attention — there may be a solution without switching away from cmr8. (I think this may be something about uppercase... haven't looked deeply.) Commented Feb 20, 2019 at 16:34
  • Also, CWEB redefines a bunch of things, and has some strict rules about what can go inside section names... this may be violating some of that. (Have you considered using XeTeX / LuaTeX instead of the above?) Commented Feb 21, 2019 at 0:36

3 Answers 3

4

You have to define a suitable font for \eightrm, but also setup some uppercase conversions; here I define only those necessary for the examples.

There was also an unfortunate typo in utfplainmac.tex, with \c{A} instead of the correct \c{C}. Fix it in the file.

\input cwebmac
\input utfplainmac
\input plain-t1

\font\eightrm=ecrm0800

\uccode"A7="87 % ç is <C3><A7>, Ç is <C3><87>
\uccode"A3="83 % ã is <C3><A3>, Ã is <C3><83>

\N{1}{1} Introdução. Lorem ipsum dolor...

\bye

enter image description here

2

There is an alternative using pdfcsplain:

\input cwebmac
\input utf8lat1
\input lmfonts

\N{1}{1} Introdução. Lorem ipsum dolor...

\end
1

Add to limbo:

\font\eightrm=<your font>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .