summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/babel-contrib/greek/test-greek-ini.tex
blob: f6fe1e15be678b7e550bb6ff141953a6aa2bd84c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
% Test Babel's "ini" file for Greek
% © 2023 Günter Milde

% Setup for Greek with localisation from the "ini" files.
\newcommand{\SETUP}{

  \ifdefined\UnicodeEncodingName % set by XeTeX/LuaTeX
  \else  % 8-bit TeX
    \usepackage{lmodern}
    \usepackage[LGR,T1]{fontenc}
    % \usepackage{textalpha}
    \ProvideTextCommandDefault{\greekscript}{\fontencoding{LGR}\selectfont
                               \def\encodingdefault{\greekfontencoding}}
    \ProvideTextCommandDefault{\ensuregreek}[1]{\leavevmode{\greekscript ##1}}
    % Babel <= (3.84) misses the automatic font encoding switch to LGR
    % \addto\extrasgreek{\greekscript}
    % \addto\noextrasgreek{\latintext}
  \fi

  \usepackage[greek, english, provide*=*]{babel}

  \ifdefined\UnicodeEncodingName % set by XeTeX/LuaTeX
    \babelfont{rm}[Scale=0.92]{DejaVu Serif}
    % The "ini" Greek setup does not load extended Greek definitions for TU.
    % Load textalpha or provide dummy definitions:
    % \usepackage{textalpha}
    \ProvideTextCommand{\ensuregreek}{TU}[1]{##1}
    \ProvideTextCommand{\greekscript}{TU}{}
    \ProvideTextCommand{\textalpha}{TU}{\cs{textalpha}}
    \ProvideTextCommand{\textOmega}{TU}{\cs{textOmega}}
  \fi

  \usepackage{hyperref}
  \hypersetup{unicode, colorlinks=true,linkcolor=blue,urlcolor=blue}

  % fallbacks for commands defined in babel-greek:
  \providecommand*\greekfontencoding{None}
  % \providecommand*\lgrfont[1]{\cs{lgrfont} \emph{missing}}
  \ProvideTextCommandDefault{\textampersand}{\&}
  \providecommand*\greeknumeral[1]{\{##1\}}
}

\newcommand{\SETUPDOC}{%
This test uses Babel's built-in Greek support (``ini'' file,
cf. \href{https://latex3.github.io/babel/guides/locale-greek.html}
{Babel guides ``Greek''}).

The following problems can be easily fixed by loading the \emph{textalpha}
package.
\begin{itemize}
  \item Accents not dropped with old (pre 2022/06) \cs{MakeUppercase}.
  \item Greek LICR macros unknown in TU.
\end{itemize}

The new 2023/02/10 \cs{MakeUppercase} code fixes the UPPERCASE of Greek
Unicode literals (including a fix for the ``hiatus'' problem).

}

\input{test-greek.tex}