diff options
Diffstat (limited to 'macros/latex/contrib/babel-contrib/greek/test-greek.tex')
-rw-r--r-- | macros/latex/contrib/babel-contrib/greek/test-greek.tex | 115 |
1 files changed, 84 insertions, 31 deletions
diff --git a/macros/latex/contrib/babel-contrib/greek/test-greek.tex b/macros/latex/contrib/babel-contrib/greek/test-greek.tex index 8c72c355a6..a2c59ed48e 100644 --- a/macros/latex/contrib/babel-contrib/greek/test-greek.tex +++ b/macros/latex/contrib/babel-contrib/greek/test-greek.tex @@ -1,5 +1,5 @@ % Test document for Babel-Greek -% © 2013, 2022 Günter Milde +% © 2013, 2023 Günter Milde % Configuration constants (see test-greek-8bit-luatex.tex for a use case) @@ -33,29 +33,32 @@ % Load and configure Babel: - % Default: modern monotonic Greek \usepackage[greek,% comment out "greek" to test the "basic support" % greek.local-LGR-fixes, english]{babel} % Uncomment the desired language variant + % Default: modern monotonic Greek + % \languageattribute{greek}{polutoniko} % "modern" polytonic Greek + % \languageattribute{greek}{polytonic} % alias for polutoniko % \languageattribute{greek}{ancient} % ancient Greek - - % The "polytonic" language attribute is an alias for "polutoniko" matching - % the spelling in polyglossia and Babel *.ini files. - % \languageattribute{greek}{polytonic} - + % % Support for the pseudo-language "polutonikogreek", used instead of "greek", % is kept for backwards compatibility: % \usepackage[polutonikogreek,english]{babel} - + % % For backwards compatibility, you can also use % \selectlanguage{polutonikogreek} instead of \selectlanguage{greek} etc. % if the "polutoniko" Greek language variant is selected. -} -\providecommand{\SETUPDOC}{} + % Make ; active to prevent mapping to a middle dot: + \languageattribute{greek}{keep-semicolon} +} +\providecommand{\SETUPDOC}{ + Test the support for the Greek language as defined in the file + \file{greek.ldf} (source \file{greek.dtx}). +} \documentclass[a4paper]{article} @@ -115,9 +118,6 @@ \date{\today} \maketitle -Test support for the Greek language as defined in the file -\file{greek.ldf} (source \file{greek.dtx}). - \SETUPDOC % print additional setup information. \tableofcontents @@ -134,6 +134,18 @@ The declaration \verb|\selectlanguage| switches between languages. ἐρῶν άπῆλθες εὐθύς; \end{quote} +\textbf{Warning: With 8-bit TeX, Latin letters and some symbols in the input +are mapped to Greek equivalents!}. +Without precautions, quotes copied from external sources (like this Wikpedia +entry about the question mark) may come out simply wrong: +\begin{quote} + \selectlanguage{greek} + Το \textbf{ερωτηματικό} (ελλ. \textbf{;} , λατ. \textbf{?}) είναι το + σημείο στίξης το οποίο τοποθετείται στο τέλος κάθε ευθείας ερωτηματικής + πρότασης σε πολλές γλώσσες. +\end{quote} +See section~\ref{Latin transliteration} for remedies. + The command \verb|\foreignlanguage| sets its second argument in the language specified as first argument. This is intended for short text parts or single words like \foreignlanguage{greek}{Βιβλιοθήκη}. @@ -147,13 +159,13 @@ There should be no inserted space before or after the language switch (this may happen if there are unescaped linebreaks in the font or language definitions): \begin{quotation} - Change script with \verb|ensuregreek|: |\ensuregreek{δοῦλος}|. + Change script with \cs{ensuregreek}: |\ensuregreek{δοῦλος}|. - Change - language with \verb|\foreignlanguage|: |\foreignlanguage{greek}{δοῦλος}|. + Change language with \cs{foreignlanguage}: + |\foreignlanguage{greek}{δοῦλος}|. - Change language with \verb|\selectlanguage|: - |\selectlanguage{greek}δοῦλος\selectlanguage{english}|. + Change language with \cs{selectlanguage}: + |\selectlanguage{greek}δοῦλος\selectlanguage{english}|. \end{quotation} @@ -286,8 +298,9 @@ English paragraph with Greek script (\verb|\ensuregreek|): no hypenation \verb|\Greeknumeral| for the conversion of Arabic numbers from 1 to 999\,999 into their Greek counterparts (\greeknumeral{1}, \greeknumeral{2}, \greeknumeral{3}, \ldots, \greeknumeral{999999}). -See \file{babel-greek.pdf} for the formation rules and configuration -options and \file{test-greeknum.pdf} for samples. +See \href{babel-greek-doc.html#greek-numerals}{babel-greek-doc} +for the formation rules and configuration options +and \file{test-greeknum.pdf} for samples. Examples: @@ -383,7 +396,8 @@ If it is TU, \emph{babel-greek} loads Greek LICR definitions from the file \fi -\subsection{LGR's \emph{Latin transliteration}} +\subsection{LGR's \emph{Latin transliteration}% + \label{Latin transliteration}} LGR has Greek characters in the slots reserved for Latin characters and other symbols in a TeX \emph{standard text font encoding}. @@ -438,6 +452,44 @@ The Latin transliteration works in LGR but not TU: \end{quote} \fi +\subsubsection{The \texttt{keep-semicolon} attribute} + +The LGR font encoding uses the Latin question mark as input for the +\emph{erotimatiko} and maps the semicolon to a middle dot (\emph{ano +teleia}). As a result, Unicode-encoded texts that use the semicolon as +\emph{erotimatiko} end up with an \emph{ano teleia} in its place: + +The character 037E GREEK QUESTION MARK works with both, Xe/LuaTeX and 8-bit +TeX. However it is deprecated and Unicode normalizes it to 003B SEMICOLON. +This means that even texts wich use the GREEK QUESTION MARK may and up with +SEMICOLON after drag-and-drop or other processing and with a middle dot in +the final output. + +With the \texttt{keep-semicolon} language attribute, 003B SEMICOLON is made +active and inserts an \emph{erotimatiko} also with LGR encoded fonts, if the +text language is set to Greek: + +\begin{tabular}{lcccl} + Input & \latinencoding{} & \greekfontencoding & Greek \\ + 003F QUESTION MARK & ? & \ensuregreek{?} + & \foreignlanguage{greek}{?} \\ + \\ + 037E GREEK QUESTION MARK & ␣ & \ensuregreek{;} + & \foreignlanguage{greek}{;} + & not defined for T1 \\ + 003B SEMICOLON & ; & \ensuregreek{;} + & \foreignlanguage{greek}{;} \\ + 00B7 MIDDLE DOT & · & \ensuregreek{·} + & \foreignlanguage{greek}{·} \\ +\end{tabular} + +This attribute is ignored with Unicode fonts (where the SEMICOLON literal +always prints a semicolon character). + +Test in math mode: +\newcommand{\semicolontest}{ab; $a b; a\;b, (\mathrm{a;}\textrm{a;}2)$} +English: \semicolontest, Greek: \foreignlanguage{greek}{\semicolontest}. + \subsubsection{LGR-proofed macros} \emph{Babel-greek} provides LGR-local variants for some @@ -464,6 +516,7 @@ LGR fonts have a middle dot glyph at the place of the ampersand. The new % \lgrfont{|\textcopyright|\textregistered|\texttrademark| % A\textampersand W.} + \ifdefined\lgrfont% babel-greek and LGR font encoding loaded \subsection{LGR re-definitions \label{sec:LGR-redefinitions}} @@ -481,7 +534,7 @@ LGR fonts have a middle dot glyph at the place of the ampersand. The new \makeatletter \newcommand{\RomanNumeralTest}{\f@encoding: \romannumeral 1, \romannumeral 2, \romannumeral 3, - \romannumeral 4, \ldots, \romannumeral 1975} + \romannumeral 4, \ldots, \romannumeral 1975} \makeatother \begin{quote} \RomanNumeralTest\\ @@ -605,8 +658,7 @@ With the pre-2022/06 \cs{MakeUppercase}, automatic upcasing of words with letters as macro or via the Latin transliteration. With the current (2023/02/10) \cs{MakeUppercase}, it works for literal -Unicode input and named accents. The definitions in \texttt{*enc.def} files, -\texttt{uccode}s and the \texttt{@uclclist} are ignored. +Unicode input and named accents. The \cs{uccode} changes are ignored. \subsection{Changed uccode/lccode values for LGR} @@ -619,13 +671,13 @@ To minimise side-effects (see below), uc/lccodes are only changed: \begin{itemize} \item if \cs{greekfontencoding} is a ``short macro'' expanding to LGR,% \footnote{i.e. not in documents using Unicode fonts unless - \cs{greekfontencoding} is explicitly set to \texttt{LGR} before - loading \emph{babel-greek}} - \item if the LaTeX version is older than 2022/06, as uccodes are ignored - by the \cs{MakeUppercase} implementation introduced in this version + \cs{greekfontencoding} is explicitly set to \texttt{LGR} before + loading \emph{babel-greek}} + \item if the LaTeX version is older than 2022/06, as \cs{uccode}s are ignored + by the \cs{MakeUppercase} implementation introduced in this version, \item for accents that are actually required in the selcected language variant (i.e. only for the \emph{tonos}, if the language variant - is the default ``monotonic''. + is the default ``monotonic''. \end{itemize} With \cs{greekfontencoding} \greekfontencoding, LaTeX version \fmtversion, @@ -671,10 +723,11 @@ With babel-greek versions up to 1.11, using the tilde for the {LaTeX News 28}} Version 1.12 fixes the issue so that all three input variants work again (with LaTeX versions up to 2022/06)% -\footnote{There are new issues with the implementation of \cs{MakeUppercase} +\footnote{The implementation of \cs{MakeUppercase} introduced in the 2022/06 LaTeX release, cf.\ \href{https://www.latex-project.org/news/latex2e-news/ltnews35.pdf}% - {LaTeX News 35}} + {LaTeX News 35}, works (almost) fine with literal input but currently + fails with the Latin transliteration and standard accent macros.} \begin{quote} \selectlanguage{greek} \greektext |