[issue:320] Re: italian.ldf error on platex

Claudio Beccari claudio.beccari @ gmail.com
2019年 11月 16日 (土) 19:21:40 JST


Hi Yamashita.

I inserted your patch in my working copy of italian.ldf; you certainly 
already dit it in your working copy of italian.ldf. Now I try to verify 
id the patch is working, and I use the following short file

% !TEX TS-program = pdfLaTeX
% !TEX encoding = UTF-8 Unicode
% Test babel+italian.ldf under xelatex, pdflatex, uplatex

\documentclass{article}\errorcontextlines=100
\usepackage{iftex}

\ifPDFTeX
\usepackage[english, italian]{babel}
\else
\usepackage[japanese, english, italian]{babel}
\fi
\ifPDFTeX
   \usepackage[utf8]{inputenc}
   \usepackage[T1]{fontenc}
   \usepackage{lmodern}
\fi

\begin{document}
\textbf{Babel}

Lingua \languagename,  pattern \the\language.

\bigskip

l'avvedutezza avanti l'articolo away ayo abaco l'accidente acerrimo 
l'adirato aedo
un'affranta afisico afoso l'agone ahhhh l'aiuto ajta alternativa ambedue 
ancora
annichilire l'aorta l'appurare acqua Aristarco artistica L'albero 
l'alternativa
l'enfasi l'eccezionalità l'altra l'ircocervo l'Illiria l'omeopatia 
l'astrattismo atroce
un'automobile avere avicola awak ayno l'azalea l'uguaglianza un'umanità 
l'abecedario
accolito un'acqua l'addomesticare l'aeroplano affidare l'agone l'aiuto 
l'assurdo l'abaco
un elemento un'eccezionalità un'inedia un'aorta un'occasione l'Occitania 
l'allampanato
ampolla annoso l'inutilità l'artatamente l'astrologia l'attenzione 
autore avanti avventure
away ayo azzardo L'Australia L'Europa l'uguaglianza l'umanità
\bigskip

\textbf{Italiano}

Lingua \languagename\ sillabazione \the\language


Codice minuscolo di ': \the\lccode`'

\unless\ifcsname pdfmatch\endcsname  Codice minuscolo di ' con pdfmatch: 
\the\lccode\string"2019\fi

\ifcsname Umathcode\endcsname Codice minuscolo di ' con Umathcode:
\the\lccode\string"2019\fi

I'I N'P H'E I'F U'P

\selectlanguage{english}
\textbf{English}

Lingua \languagename,  pattern \the\language.


Codice minuscolo di ': \the\lccode`'

\unless\ifcsname pdfmatch\endcsname Codice minuscolo di ' con pdfmatch: 
\the\lccode\string"2019\fi

\ifcsname Umathcode\endcsname Codice minuscolo di ' con Umathcode
\the\lccode\string"2019\fi

I'I N'P H'E I'F U'P

\unless\ifPDFTeX
\selectlanguage{japanese}
\textbf{Japanese}

Lingua \languagename,  pattern \the\language.


Codice minuscolo di ': \the\lccode`'

\unless\ifcsname pdfmatch\endcsname Codice minuscolo di ' con pdfmatch: 
\the\lccode\string"2019\fi

\ifcsname Umathcode\endcsname Codice minuscolo di ' con Umathcode
\the\lccode\string"2019\fi

I'I N'P H'E I'F U'P
\fi

\end{document}

This is not a perfect test file, because I actually do not know how to 
use uplatex with babel.

In any case the first two lines are the so called “magic lines” that 
configure the shell editor to run with the specified program; if your 
shell editor does not understand these auto-configuration lines, never 
mind; just use the engine you want to test the file by giving the 
suitable command from the command line.

Now the tests with "pdfmatch" and "Umathcode" are not understood by 
pdflatex; this is why I use package iftex, that defines the switches 
\ifPDFTeX, \ifXeTeX and \ifLuaTeX; these tests are false with any other 
engine. I do not know any package that defines the equivalent of 
\ifUPTeX, therefore I cannot really test with uplatex.

If you run the file with XeLaTeX or LuaLaTeX you get all the output 
lines of the document body. If you run the file with pdfLaTeX you get 
only some output, because the tests \unless\ifcsname pdfmatch\endcsame 
and \ifcsname Umathcode\endcsname are both false; nevertheless the lc 
code of the apostrophe is correct with "italian" and "english" (babel 
language names).

If you run the file with uplatex you get the same output as with 
pdflatex, just because the last test \unless\ifPDFTeX is false by default.

If you comment the opening and closing lines of such final test and run 
the file with uplatex,  you get an error from babel that complains 
saying that the used engine does not match the engines for which babel 
can work; among these engines there are ptex and uptex! I do not know if 
this is a babel glitch or if it is my fault because I do not know how to 
use uplatex; probably the second.

Therefore at the moment I have some doubts to upload to CTAN my working 
italian.ldf file; it certainly behaves as the current version, but I am 
not sure it works when Japanese is one of the languages specified to babel.

Please, can you give me some instructions on the correct way to use uplatex?

Thank you
Claudio





On 15/11/2019 17:30, Hironobu Yamashita wrote:
> Hi Claudio,
>
> Thanks for maintaining the package babel-italian.
> But I noticed that \usepackage[italian]{babel} cannot
> be used on platex and uplatex after TeX Live 2018:
>
> MWE:
>      \documentclass{article}
>      \usepackage[italian]{babel}
>      \begin{document}
>      a
>      \end{document}
>
> Error:
>      ! Bad character code (8217).
>      <to be read again>
>                         =
>      l.3 \begin{document}
>
>      ?
>
> The problem lies in \lccode"2019, as
>    * pTeX and upTeX are not Unicode-compliant, so \lccode allows
>      only 0--255.
>    * pdfTeX is not Unicode-compilant either, so \lccode should never
>      work for 256 or larger code (silently ignored without error?)
>
> Therefore, I propose the patch attached;
> here I used \Umathcode for detecting truely
> Unicode-compilant engines (= LuaTeX and XeTeX).
>
> Best regards,
> Hironobu
>
>
> ---
> Hironobu YAMASHITA
> GitHub: https://github.com/aminophen
> Japanese TeX Development Community https://texjp.org/



issue メーリングリストの案内