latex3 / latex2e

The LaTeX2e kernel
https://www.latex-project.org/
LaTeX Project Public License v1.3c
1.91k stars 264 forks source link

fontenc error message #1102

Closed rdtennent closed 4 months ago

rdtennent commented 1 year ago

It is easily confirmed by a google search that many users encounter the fontenc error message "Encoding file `t2aenc.def' not found." But the comment that follows is not helpful: "You might have misspelt the name of the encoding." In fact the problem is that the user has not installed the cyrillic package. I suggest replacing the unhelpful message by: "Have you installed the cyrillic package?".

Bob Tennent

davidcarlisle commented 1 year ago

This is a very generic message,

\usepackage[wibble]{fontenc}

produces

! Package fontenc Error: Encoding file `wibbleenc.def' not found.
(fontenc)                You might have misspelt the name of the encoding.

In general there might be no package.

Of course it would in theory be possible to add tests for some known names, but just T2A, or T2B, OT2, ... as well?

Rather than add code adding special case tests and custom messages it would probably be simpler, if we wanted to do anything, just to re-assert the "required" status of latex/cyrillic so the encoding files are (or should be) there.

rdtennent commented 1 year ago

At least remove the misspelling :+)

FrankMittelbach commented 1 year ago

Given that, thanks to Bob, there are now a large number of fonts useable with pdftex that support the various Cyrillic font encodings (as well as LGR by the way) and TLC3 devotes a whole chapter showing most of them, I think we should at least augment the error message giving a second cause: "or a necessary support package is missing".

But asking for the core encoding files becoming required (which then should, even though it is "L", probably also include LGR) may also be sensible.

davidcarlisle commented 1 year ago

actually the code is

     \InputIfFileExists\reserved@f
          {}{\PackageError{fontenc}%
           {Encoding file `\reserved@f' not found.%
            \MessageBreak
             You might have misspelt the name of the encoding}%
           {Necessary code for this encoding was not
            loaded.\MessageBreak
            Thus calling the encoding later on will
            produce further error messages.}}%
    \let\reserved@f\relax
    \expandafter\in@\expandafter{\CurrentOption}%
                                {T2A,T2B,T2C,X2,LCY,OT2}%
    \ifin@
       \expandafter\in@\expandafter\cyra\expandafter
                                {\@uclclist}%
       \ifin@
       \else
         \update@uclc@with@cyrillic
       \fi

so immediately after this generic message we are testing for cyrillic and branching, so we could move the \InputIfFileExists test into each branch of the \ifin@ and use a customised text for the cyrillic case as you already know it is not a misspelled encoding name if it is one of T2A,T2B,T2C,X2,LCY,OT2

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity.

FrankMittelbach commented 11 months ago

At least remove the misspelling :+)

as in "use US spelling" not British spelling?

rdtennent commented 11 months ago

'Outside America, "misspelled" has been more popular than "misspelt" since the mid-1970s.'

https://books.google.com/ngrams/graph?content=misspelled%2Cmisspelt&year_start=1800&year_end=2000&corpus=18&smoothing=3&share=&direct_url=t1%3B%2Cmisspelled%3B%2Cc0%3B.t1%3B%2Cmisspelt%3B%2Cc0

On Tue, Nov 7, 2023 at 10:04 AM Frank Mittelbach @.***> wrote:

At least remove the misspelling :+)

as in "use US spelling" not British spelling?

— Reply to this email directly, view it on GitHub https://github.com/latex3/latex2e/issues/1102#issuecomment-1798793530, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUZWNQZYUULYOH2SXKSBL3YDJEYTAVCNFSM6AAAAAAZUZ424OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJYG44TGNJTGA . You are receiving this because you authored the thread.Message ID: @.***>

github-actions[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity.