[tex-eplain] accents problem in pdf generated by eplain

Luis Rivera jlrn77 at gmail.com
Sun Jan 30 20:01:44 CET 2022


Hello!

Have you ever tried the plnfss package? It is a set of macros which
make LaTeX's font definition (fd) files readable for Plain. You simply
need to specify the main font and encoding, and it works out of the
box.

Good luck and Happy eplainTeXing,

Luis Rivera

Il giorno gio 20 gen 2022 alle ore 16:01 Laurence Finston
<Laurence.Finston at gmx.de> ha scritto:
>
> Come to think of it, the EC fonts are probably set up so that they use the same encoding as standard keyboards.  So, it might "just work" to type á, é, etc., without using \char or \chardef or any macros.  I don't know, I don't use accents enough to make it worthwhile switching to EC.
>
> As far as switching math fonts is concerned, I'm not sure whether EC even includes math fonts.  They're designed to look like the CM fonts so there should be no problem is using the default math fonts and one is unlikely to need the additional accented characters defined in EC for math.
>
> Switching the fonts used for math isn't particularly difficult but I would normally not bother.  I've done it when I wanted different sizes but it's not like there are lot of math fonts other than CM available.
>
>
> Gesendet: Donnerstag, 20. Januar 2022 um 22:36 Uhr
> Von: "Laurence Finston" <Laurence.Finston at gmx.de>
> An: "Gérald Tenenbaum" <gerald.ten at free.fr>
> Cc: tex-eplain at tug.org
> Betreff: Aw: Re: Re: Re: Re: [tex-eplain] accents problem in pdf generated by eplain
> > [...] still produces a pdf which cannot recognize the word.
>
> You need to switch to \rm after resetting it.
>
> \font\rm=ecrm1000
> \rm
> th{\char233}orie
>
> should do the trick.  There are probably \chardef definitions that go along with the EC fonts so you don't have to use \char explicitly.
> TeX also has a \chardef primitive but I'd have to look up how it works.  I'd check the documentation for the EC fonts.  This looks like a good place to start:  https://www.ctan.org/pkg/ec
>
> Without looking anything up, I could suggest something like this:
>
> \catcode`\é=\active
> \defé{\char233}
> \catcode`\á=\active
> \defá{\char225}
>
> However, if your editor uses two or more bytes to represent the é, á, etc., characters, this won't work.  I once had this problem with Emacs, when I was using characters I thought were ASCII but were being represented in another way.  There is probably a way of changing this in Emacs, but I would guess that you're using something else, anyway.
>
> Gesendet: Donnerstag, 20. Januar 2022 um 22:20 Uhr
> Von: "Gérald Tenenbaum" <gerald.ten at free.fr>
> An: "Laurence Finston" <Laurence.Finston at gmx.de>
> Betreff: Re: Aw: Re: Re: Re: [tex-eplain] accents problem in pdf generated by eplain
> The file
>
> \magnification 1200
> \font\rm=ecrm1000
> th\'eorie
> \end
> still produces a pdf which cannot recognize the word. See screen capture.
> When you say "you can run `tex testfont'." how do you do this. In Terminal?
>
>
>
> Laurence Finston a écrit le 20/01/2022 à 21:59 :
>
> > Produces a pdf which is correct for viewing but fails finding the word "théorie".
>
> This can't work with the CM fonts because an é is not a character 'e with acute' but rather a normal 'e' (at position 101 in the CM fonts)
> together with an acute accent character (at position 19) which is typeset over it.  You therefore can't find it by searching for 'é'.  In addition,
> you can't specify hyphenation for words with accents with CM.
>
> For this and other reasons, the EC (European Computer Modern) fonts were created, which do have single characters with accents.  I suspect LaTeX is using them (or some other font with this feature) by default or because of some package or other that you're loading, but I have to pass on questions relating to LaTeX.
>
> Of course, there's no reason why you can't use the EC fonts together with eplain:
> \font\rm=ecrm1000
> \font\it=ecti1000
> etc.
>
> Personally, I wouldn't bother changing the math fonts.
>
> If you want to see the characters of a font and their encodings (in octal and hexadecimal), you can run `tex testfont'.  I've attached the output (with tables -- there are other options) for cmr10 and ecrm1000.
>
>
> Gesendet: Donnerstag, 20. Januar 2022 um 21:16 Uhr
> Von: "Gérald Tenenbaum" <gerald.ten at free.fr>
> An: "Laurence Finston" <Laurence.Finston at gmx.de>
> Betreff: Re: Aw: Re: Re: [tex-eplain] accents problem in pdf generated by eplain
> Hello again,
>
> TeXShop actually works with (and depends on) MacTeX.
> When I type in LaTeX with TeXShop, the problem does not arise.
> When I type in Plain TeX and eplain I use the appended file to avoid typing TeX accents (i.e. type é instead of \'e).
> However even the code
>
> \magnification 1200
> th\'eorie
> \end
>
> Produces a pdf which is correct for viewing but fails finding the word "théorie".
> I suspect it is an encoding issue, but have no idea of where to look.
> I tried all the manipulations with postscript, dvi, ps2pdf, etc. Nothing works.
>
>
> Laurence Finston a écrit le 20/01/2022 à 20:28 :
>
> > I view pdf's with Adobe Acrobat DC. When I open wit Aperçu, I still get no result.
> > Printing the page is OK, accents are there.
>
> How about if you look at the PDF in your browser?
>
> At any rate, it would appear that it is not a TeX or eplain problem.   I'm not familiar with TeXShop.  I would try the following:
>
> If you're generating PDF directly, I would try the following:
>
> 1. Generate a DVI file, i.e., by using TeX the "normal" way.
>
> 2. Look at it with xdvi or YAP or some other DVI viewer.
>
> 3.  Convert the DVI to PostScript with dvips (dvips -o <ps-filename> <dvi-filename>).
>
> 4.  Look at the result with Ghostview (gv) or evince ("Document Viewer") or some other PostScript viewer.
>
> If that works, as I expect it would, you could try:
>
> 5.  Convert the PostScript to PDF with ps2pdf (ps2pdf <ps-filename>) and then check the result.  You could try downloading evince, if you don't already have it.
>
> If the problem lies with TeXShop, you could try installing MacTeX:  https://tug.org/mactex/index.html
>
> Gesendet: Donnerstag, 20. Januar 2022 um 19:12 Uhr
> Von: "Gérald Tenenbaum" <gerald.ten at free.fr>
> An: "Laurence Finston" <Laurence.Finston at gmx.de>
> Betreff: Re: Aw: Re: [tex-eplain] accents problem in pdf generated by eplain
> I view pdf's with Adobe Acrobat DC. When I open wit Aperçu, I still get no result.
> Printing the page is OK, accents are there.
>
>
> Laurence Finston a écrit le 20/01/2022 à 18:39 :
>
> By "example", I meant of the source code.  However, it may not be necessary:
>
> > Please find attached one page extracted from the whole document. You will see that searching for "théorie" returns no result.
>
> It does on my computer (see attachment).  Maybe the problem is with your PDF viewer.  Have you tried printing the page?
>
> To the best of my knowledge, PDFs embed the fonts used, so I don't know why any PDF viewer on the market would be unable to display this document correctly.  However, I'm not an expert on the subject.
>
> Gesendet: Donnerstag, 20. Januar 2022 um 18:27 Uhr
> Von: "Gérald Tenenbaum" <gerald.ten at free.fr>
> An: "Laurence Finston" <Laurence.Finston at gmx.de>
> Betreff: Re: Aw: [tex-eplain] accents problem in pdf generated by eplain
> Many thanks for helping.
> Please find attached one page extracted from the whole document. You will see that searching for "théorie" returns no result.
> I use TeXShop + eplain on a mac.
> Regards,
>
> Gérald
>
> Laurence Finston a écrit le 20/01/2022 à 18:07 :
>
> It would be helpful if you would supply an example and also explain exactly what version of TeX, etc., you're using; specifically how you are generating the PDF file.
>
> I don't know if this could be the problem, but I have occasionally had issues with things not working when using pdftex that do work with tex + dvips + ps2pdf.  This applies, logically enough, to features specific to dvips.  However, it might be worth a try, anyway.
>
> A typical cause of problems with accented letters not being printed is when using accented letters in the input with fonts with no corresponding glyphs.  With a "normal" version of TeX and the CM fonts, you're on the safe side if you use control sequences, e.g., {\'a}, {\"a}, etc.  It is possible to set up characters as being "active", but that may not be relevant here.
>
> Since CM doesn't contain accented characters as single glyphs, you will get characters plus an accent by using the control sequences.  If you are using some other font that does define single characters with accents, you must use the correct characters in your input, corresponding to the encoding of the font.  If you are using characters in the input that aren't assigned to characters in the current font, nothing will be printed.
>
> Laurence
>
> Gesendet: Donnerstag, 20. Januar 2022 um 17:45 Uhr
> Von: "Gérald Tenenbaum" <gerald.ten at free.fr>
> An: tex-eplain at tug.org
> Betreff: [tex-eplain] accents problem in pdf generated by eplain
> Hello,
>
> I come across  an unexpected issue with the pdf file of a book written with eplain. I turns out that accented letters are not recognized by the pdf. is there anything I can modify either in the source or in the pdf to make accents recognized?
> Many thanks in advance for any help.
> Gérald Tenenbaum



More information about the tex-eplain mailing list.