diff options
Diffstat (limited to 'macros/latex')
17 files changed, 665 insertions, 169 deletions
diff --git a/macros/latex/contrib/abntexto/README b/macros/latex/contrib/abntexto/README index 3685631270..9392f77fc8 100644 --- a/macros/latex/contrib/abntexto/README +++ b/macros/latex/contrib/abntexto/README @@ -1,8 +1,8 @@ Public Domain Software -2023-10-12 -3.0.1-alpha -Elayson Abreu Barros -abntexto.classe at gmail.com +2023-10-13 +3.0.2-beta +Elayson Abreu +abntexto.classe@gmail.com The abntexto is a LaTeX class for the elaboration of academic works according -to the guidelines of the Associação Brasileira de Normas Técnicas (ABNT). +to the guidelines of the Associação Brasileira de Normas Técnicas (ABNT).
\ No newline at end of file diff --git a/macros/latex/contrib/abntexto/abntexto.cls b/macros/latex/contrib/abntexto/abntexto.cls index cfeb322f0b..4cb87e638b 100644 --- a/macros/latex/contrib/abntexto/abntexto.cls +++ b/macros/latex/contrib/abntexto/abntexto.cls @@ -1,8 +1,8 @@ %! Public Domain Software -%! 2023-10-12 -%! 3.0.1-alpha -%! Elayson Abreu Barros -%! abntexto.classe at gmail.com +%! 2023-10-13 +%! 3.0.2-beta +%! Elayson Abreu +%! abntexto.classe@gmail.com %! RECOMENDAÇÕES %! PRÉ-CONFIGURAÇÕES @@ -30,7 +30,7 @@ % \begin{code} !------------------------------------------------ \NeedsTeXFormat{LaTeX2e} -\ProvidesClass{abntexto}[2023-10-12 3.0.1-alpha Preparation of works in ABNT standards] +\ProvidesClass{abntexto}[2023-10-13 3.0.2-beta Preparation of works in ABNT standards] \LoadClass{article} \RequirePackage{geometry} @@ -679,7 +679,6 @@ % \begin{code} !------------------------------------------------ \def\Enter{\@ifnextchar[\tnba@Enter{\tnba@Enter[]}} \def\tnba@Enter[#1]{\vskip#1\baselineskip} -\def\twonewpage{\newpage\leavevmode\newpage} \long\def\indexcard#1{\hbox{\vrule\vbox to7.5cm{\hsize=12.5cm \advance\hsize by-2cm diff --git a/macros/latex/contrib/abntexto/abntexto.pdf b/macros/latex/contrib/abntexto/abntexto.pdf Binary files differindex 7fb7d1fe2b..feb6a20420 100644 --- a/macros/latex/contrib/abntexto/abntexto.pdf +++ b/macros/latex/contrib/abntexto/abntexto.pdf diff --git a/macros/latex/contrib/abntexto/abntexto.tex b/macros/latex/contrib/abntexto/abntexto.tex index e92a7ca36f..b9210f5b0e 100644 --- a/macros/latex/contrib/abntexto/abntexto.tex +++ b/macros/latex/contrib/abntexto/abntexto.tex @@ -114,13 +114,13 @@ {\centering \LARGE\sffamily\bfseries abntexto\\[0.4em] \Large\itshape\mdseries Classe para {\upshape\LaTeX}\\[2em] \normalfont\large - Elayson\\[1ex] - \href{mailto:abntexto.classe@gmail.com}{abntexto.classe at gmail.com}\\[2.5ex] + Elayson Abreu\\[1ex] + \href{mailto:abntexto.classe@gmail.com}{abntexto.classe@gmail.com}\\[2.5ex] \today \par} \vskip3in -{\centering\large\ttfamily 3.0.1-alpha\par} +{\centering\large\ttfamily 3.0.2-beta\par} \newpage \heading{Sumário} @@ -135,9 +135,19 @@ Este \emph{não} é um manual sobre LaTeX (ou TeX, a ferramenta que o constitui) Já existe uma classe para aplicação das normas ABNT cujo nome é |abntex2|. Mas, diferente desta, o |abntexto| não depende do |memoir|, uma classe de código-fonte e manual extensos e que implementa funções as quais, em sua maioria, não são pertinentes a um documento que use as diretrizes da ABNT. -As normas ABNT as quais o |abntexto| se propõe a seguir são aquelas em vigor até o momento da criação deste manual. +As normas ABNT as quais o |abntexto| se propõe a seguir são aquelas em vigor até o momento da criação deste manual. São elas: -O |abntexto| ainda está em estágio \emph{alpha} e seu uso em documentos sérios não é recomendado, uma vez que \emph{bugs} são esperados. +\begin{topics} + \item NBR 14724-2011 + \item NBR 12225-2004 + \item NBR 6028-2003 + \item NBR 6027-2012 + \item NBR 10520-2002 + \item NBR 6023-2018 + \item NBR 10522-1988 + \item NBR 5892-2019 + \item NBR 6024-2012 +\end{topics} \section{Chamando a classe} @@ -165,6 +175,8 @@ Digite as linhas em \ref{cd:início} e use |abntexto|. \end{document} \endverb +O arquivo exemplo.tex, disponível no CTAN, mostra como elaborar os elementos pré-textuais. + \section{Fonte tipográfica} O tamanho da fonte é 12\,pt de imediato e pode ser configurado com o comando |\setfontsize{<id>}| sendo que 12\,pt é a única opção disponível. Além disso, com os seletores de tamanho |\normalsize| e |\small| que configuram 12\,pt e 10\,pt, nessa ordem, é possível mudar o tamanho da fonte no corpo do documento. diff --git a/macros/latex/contrib/abntexto/exemplo.pdf b/macros/latex/contrib/abntexto/exemplo.pdf Binary files differnew file mode 100644 index 0000000000..b2728cc9c7 --- /dev/null +++ b/macros/latex/contrib/abntexto/exemplo.pdf diff --git a/macros/latex/contrib/abntexto/exemplo.tex b/macros/latex/contrib/abntexto/exemplo.tex new file mode 100644 index 0000000000..22bd4643fe --- /dev/null +++ b/macros/latex/contrib/abntexto/exemplo.tex @@ -0,0 +1,320 @@ +% !TeX TS-program = lualatex + +\documentclass{abntexto} + +\usepackage{lipsum} \def\lip{\lipsum[1][1-2]}\def\lipp{\lipsum[1][-6]} +\usepackage{fontspec} +\usepackage[style=abnt]{biblatex} \addbibresource{mybib.bib} +\usepackage[colorlinks]{hyperref} + +\setmainfont{TeX Gyre Termes} +\setmonofont{Inconsolatazi4-Regular} + +% CONSELHO ------------ +% Você só precisa guardar em macros informações que +% vai utilizar repetidas vezes como o seu nome ou o +% o título do trabalho, por exemplo. + +\def \Author{John Doe} +\def \University{Universidade} +\def \Initials{SIGLA} +\def \City{Cidade} +\def \Date{Ano} +\def \Title{Título do trabalho} +\def \WorkType{Dissertação} +\def \WorkDesc{\WorkType\ apresentada a \University\ como cumprimento às exigências legais para obtenção do título de Mestre.} +\def \Class{Matemática} +\def \Advisor{Nome} +\def \Coadvisor{Nome} + + + +\begin{document} + +\def\Center{\noindent\hfil} +\def\Right{\noindent\hfill} +\def\twonewpage{\newpage\leavevmode\newpage} + +% CONSELHO ------------ +% Você pode preferir usar +% \Center \begin{minipage}{.7\linewidth} +% Lorem ipsum +% \end{minipage} +% Ao invés de +% \Center \vbox{\hsize=.7\hsize +% Lorem ipsum +% } +% É essencialmente a mesma coisa. A diferença é +% que a 1ª forma é uma sintaxe mais familiar ao +% LaTeX. Mas eu prefiro a simples sintaxe TeX. +% É questão de gosto pessoal. + +% CAPA +% ================================================ + +\leavevmode\Enter[2] + +\Center\vbox{\hsize=.7\hsize \centering + \includegraphics[height=4\baselineskip]{example-image}\\ + \University +} +\Enter[9] + +\Center\Author +\Enter[3] + +\Center\vbox{\hsize=.7\hsize \centering + \Title +} +\vfill + +\Center\City % A próxima linha em branco é necessária. + +\Center\Date + +\twonewpage + +% FOLHA DE ROSTO +% ================================================ + +\leavevmode\Enter[2] + +\Center\Author +\Enter[5] + +\Center\vbox{\hsize=.7\hsize \centering + \Title +} +\Enter[2] + +\Right\vbox{\hsize=.5\hsize + \WorkDesc\Enter + Área de concentração: \Class.\\ + Orientador: \Advisor.\\ + Coorientador: \Coadvisor. +} +\vfill + +\Center\City + +\Center\Date + +\newpage + +% FICHA CATALOGRÁFICA +% ================================================ + +\leavevmode\vfill + +\Center Dados Internacionais de Catalogação na Publicação (CIP) \Enter[.5] + +\Center \indexcard{\parindent=1em \sloppy + A000\qquad \Author + + \setbox0=\hbox{A000\qquad}\leftskip=\wd0 % Os espaços em branco antes e depois desta + % intrução são necessários. + + \Title/\Author\ --- \City: \University, UFC, \Date. + + 105\,f. + + \WorkType\ (\MakeUppercase{\Class}) --- \University, UFC: \City, \Date. + + Orientador(a): \Advisor. + + Coorientador(a): \Coadvisor. + + 1. K1. + 2. K2. + 3. K3. + I. Título. + + \Right CDD 000 + + \Right CDU 000 +} + +\newpage + +% ERRATA (OPCIONAL) +% ================================================ + +\heading{Errata} + +\singlesp +FERRIGNO, C. R. A. \textbf{Tratamento de neoplasias ósseas apendiculares com reimplantação de enxerto ósseo autólogo autoclavado associado ao plasma rico em plaquetas}: estudo crítico na cirurgia de preservação de membro em cães. 2011. 128 f. Tese (Livre-Docência) --- Faculdade de Medicina Veterinária e Zootecnia, Universidade de São Paulo, São Paulo, 2011. +\onehalfsp +\Enter + +\Center +\begin{table}{cccc} + \hline + \bfseries Folha & \bfseries Linha & \bfseries Onde se lê & \bfseries Leia-se \\ \hline + 16 & 10 & auto-clavado & autoclavado \\ \hline +\end{table} + +\twonewpage + +% FOLHA DE APROVAÇÃO +% ================================================ + +\leavevmode\Enter[2] + +\Center\Author +\Enter[5] + +\Center\vbox{\hsize=.7\hsize \centering + \Title +} +\Enter[2] + +\Right\vbox{\hsize=.5\hsize + \WorkDesc\Enter + Área de concentração: \Class. +} +\Enter + +{\raggedright \parindent=1.5cm + Aprovado em 00/00/0000. +\par} +\Enter[3] + +\begingroup \centering + \rule{.7\textwidth}{.4pt}\\ + Nome\\ + Universidade\Enter + + \rule{.7\textwidth}{.4pt}\\ + Nome\\ + Universidade\Enter + + \rule{.7\textwidth}{.4pt}\\ + Nome\\ + Universidade +\par\endgroup % Esse \par é necessário para que \centering tenha efeito. + +\twonewpage + +% DEDICATÓRIA (OPCIONAL) +% ================================================ + +\leavevmode\vfil +\Center \vbox{\hsize=5cm \itshape Dedico este trabalho a\dots} +\twonewpage + +% AGRADECIMENTOS (OPCIONAL) +% ================================================ + +\parindent=1.5cm +\heading{Agradecimentos} +\lipp +\twonewpage + +% EPÍGRAFE (OPCIONAL) +% ================================================ + +\leavevmode\vfil +\Right\vbox{\hsize=3cm + \noindent {\itshape Epígrafe}\break + Autor (ano) +} +\twonewpage + +% RESUMO +% ================================================ + +\heading{Resumo} +\lipp\ \lipp + +Palavras-chave: Palavra-chave A. Palavra-chave B. Palavra-chave C. +\twonewpage + +% RESUMO EM LÍNGUA ESTRANGEIRA +% ================================================ + +\heading{Abstract} +\lipp\ \lipp + +Keywords: Keyword A. Keyword B. Keyword C. +\twonewpage + +% LISTA DE FIGURAS (OPCIONAL), TABELAS (OPCIONAL), SUMÁRIO +% ================================================ + +\heading{Lista de figuras} +\makelof +\twonewpage + +\heading{Lista de tabelas} +\makelot +\twonewpage + +\heading{Sumário} +\maketoc + + +\section{Tabelas e figuras} + +\lipp + +\legend{table}{\lip} +\src{o autor.} +\label{tab} +\place{ + \begin{table}{*3{c@{\quad}} c} \hline + Situação do domicílio & Total & Mulheres & Homens \\ \hline + Total & 117\,960\,301 & 59\,595\,332 & 58\,364\,969 \\ + Urbana & 79\,972\,931 & 41\,115\,439 & 38\,857\,492 \\ + Rural & 37\,987\,370 & 18\,479\,893 & 19\,507\,477 \\ \hline + \end{table} +} + +\legend{figure}{\lip} +\src{o autor.} +\label{fig} +\place{\includegraphics[width=.4\linewidth]{example-image}} + +\legend{figure}{\lip} +\src{\lip} +\label{fig2} +\place{\includegraphics[width=.4\linewidth]{example-image}} + +Ver \ref{tab}, \ref{fig}, \ref{fig2}. + +\section{Citações} + +\enquote{\lip} \cite{bibkey}. +\Enquote{\lipp\ \cite{bibkey}} + +\section{Alíneas} + +\lip + +\begin{topics} + \item \lip + \begin{topics} + \item \lip + \item \lip + \end{topics} + \item \lip + \item \lip +\end{topics} + +%\newpage +% +%\begin{corrprint}{Referências} +% \printbibliography +%\end{corrprint} + +\end{document} + + + + + + + + + + +% Concebido em 07 de julho de 2022 diff --git a/macros/latex/contrib/babel-contrib/greek/README.md b/macros/latex/contrib/babel-contrib/greek/README.md index c4158d53c5..b2701925a5 100644 --- a/macros/latex/contrib/babel-contrib/greek/README.md +++ b/macros/latex/contrib/babel-contrib/greek/README.md @@ -4,7 +4,7 @@ babel-greek Comprehensive support for the Greek language and script with [Babel](https://ctan.org/pkg/babel). -**Version**: 1.14 +**Version**: 1.15 **Copyright**: © 1997 Apostolos Syropoulos, Claudio Beccari, Johannes Brahms, © 2013 - 2023 Günter Milde. diff --git a/macros/latex/contrib/babel-contrib/greek/babel-greek-doc.html b/macros/latex/contrib/babel-contrib/greek/babel-greek-doc.html index 49f6092ea7..24e208e561 100644 --- a/macros/latex/contrib/babel-contrib/greek/babel-greek-doc.html +++ b/macros/latex/contrib/babel-contrib/greek/babel-greek-doc.html @@ -794,7 +794,7 @@ mstyle.mathscr, mi.mathscr { <p class="subtitle" id="babel-support-for-the-greek-language-and-script">Babel support for the Greek language and script</p> <dl class="docinfo"> <dt class="version">Version<span class="colon">:</span></dt> -<dd class="version">1.14 (<a class="reference internal" href="#changelog">changelog</a>)</dd> +<dd class="version">1.15 (<a class="reference internal" href="#changelog">changelog</a>)</dd> <dt class="copyright">Copyright<span class="colon">:</span></dt> <dd class="copyright">© 1997 Apostolos Syropoulos, Claudio Beccari, Johannes Brahms, © 2013 – 2023 Günter Milde.</dd> @@ -1144,7 +1144,7 @@ via the ligature definitions in the font (see <a class="reference external" href <td><p><span class="docutils literal">))</span></p></td> <td><p>»</p></td> </tr> -<tr><td><p>perispomeni</p></td> +<tr><td><p>perispomeni<a class="superscript" href="#footnote-4" id="footnote-reference-6" role="doc-noteref"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></a></p></td> <td><p><span class="docutils literal">\~a</span></p></td> <td><p>ᾶ</p></td> <td><p>erotimatiko</p></td> @@ -1154,7 +1154,7 @@ via the ligature definitions in the font (see <a class="reference external" href <tr><td><p>dialytika</p></td> <td><p><span class="docutils literal">"i</span></p></td> <td><p>ϊ</p></td> -<td><p>ano teleia<a class="superscript" href="#footnote-4" id="footnote-reference-6" role="doc-noteref"><span class="fn-bracket">[</span>5<span class="fn-bracket">]</span></a></p></td> +<td><p>ano teleia<a class="superscript" href="#footnote-5" id="footnote-reference-7" role="doc-noteref"><span class="fn-bracket">[</span>6<span class="fn-bracket">]</span></a></p></td> <td><p><span class="docutils literal">;</span></p></td> <td><p>·</p></td> </tr> @@ -1174,6 +1174,12 @@ required.</p> <aside class="footnote-list superscript"> <aside class="footnote superscript" id="footnote-4" role="doc-footnote"> <span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-6">5</a><span class="fn-bracket">]</span></span> +<p>The tilde can be used without backslash in the language variants +“ancient” and “polutoniko”. In monotonic Greek, it keeps its default +expansion to a no-break space.</p> +</aside> +<aside class="footnote superscript" id="footnote-5" role="doc-footnote"> +<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#footnote-reference-7">6</a><span class="fn-bracket">]</span></span> <p>The “<span class="target" id="keep-semicolon">keep-semicolon</span>” language attribute prevents the mapping of a semicolon to a middle dot to allow its use as Greek question mark (erotimatiko).</p> @@ -1405,6 +1411,17 @@ drop accents with <span class="docutils literal">\DeclareUppercaseMapping</span> <li><p>New modifier <cite>local-MakeUppercase-fixes</cite>.</p></li> </ul> </dd> +<dt>1.15 (2023-10-13)</dt> +<dd><ul class="simple"> +<li><p>Switch to the previous <span class="docutils literal">\encodingdefault</span> (not <span class="docutils literal">\cf@encoding</span>) +when exiting Greek text parts. +Exception: use <span class="docutils literal">\latinencoding</span> if the initial <span class="docutils literal">\encodingdefault</span> +is LGR and “greek” is the main document language.</p></li> +<li><p>Fix standard accent macros also with pre-2022 <span class="docutils literal">\MakeUppercase</span>.</p></li> +<li><p>Rename modifier <cite>local-MakeUppercase-fixes</cite> to +<cite>no-MakeUppercase-fixes</cite>.</p></li> +</ul> +</dd> </dl> </section> <section id="references"> diff --git a/macros/latex/contrib/babel-contrib/greek/babel-greek-doc.rst b/macros/latex/contrib/babel-contrib/greek/babel-greek-doc.rst index e714318919..c20fb5b2e7 100644 --- a/macros/latex/contrib/babel-contrib/greek/babel-greek-doc.rst +++ b/macros/latex/contrib/babel-contrib/greek/babel-greek-doc.rst @@ -3,7 +3,7 @@ babel-greek Babel support for the Greek language and script =============================================== -:Version: 1.14 (changelog_) +:Version: 1.15 (changelog_) :Copyright: © 1997 Apostolos Syropoulos, Claudio Beccari, Johannes Brahms, © 2013 -- 2023 Günter Milde. @@ -222,21 +222,25 @@ a b g d e z h j i k l m n x o p r s c t u f q y w Accent symbols and punctuation: -============== ======= == ====================== ======= == -tonos/oxia ``'a`` ά right apostrophe ``''`` ’ -varia ```a`` ὰ left apostrophe \`\` ‘ -dasia ``<a`` ἁ left quotation mark ``((`` « -psili ``>a`` ἀ right quotation mark ``))`` » -perispomeni ``\~a`` ᾶ erotimatiko ``?`` ; -dialytika ``"i`` ϊ ano teleia [#]_ ``;`` · -ypogegrammeni ``a|`` ᾳ zero width non-joiner ``av|`` αͺ -============== ======= == ====================== ======= == +================ ======= == ====================== ======= == +tonos/oxia ``'a`` ά right apostrophe ``''`` ’ +varia ```a`` ὰ left apostrophe \`\` ‘ +dasia ``<a`` ἁ left quotation mark ``((`` « +psili ``>a`` ἀ right quotation mark ``))`` » +perispomeni [#]_ ``\~a`` ᾶ erotimatiko ``?`` ; +dialytika ``"i`` ϊ ano teleia [#]_ ``;`` · +ypogegrammeni ``a|`` ᾳ zero width non-joiner ``av|`` αͺ +================ ======= == ====================== ======= == The downside is, that you cannot print Latin letters and some symbols if LGR is the active font encoding. This means that for every Latin-written word or acronym in a Greek text part, an explicit font encoding switch is required. +.. [#] The tilde can be used without backslash in the language variants + "ancient" and "polutoniko". In monotonic Greek, it keeps its default + expansion to a no-break space. + .. [#] The "_`keep-semicolon`" language attribute prevents the mapping of a semicolon to a middle dot to allow its use as Greek question mark (erotimatiko). @@ -410,6 +414,15 @@ Changelog 1.14 (2023-08-18) - Fix upcasing of Greek letters with standard accent macros. - New modifier `local-MakeUppercase-fixes`. +1.15 (2023-10-13) + - Switch to the previous ``\encodingdefault`` (not ``\cf@encoding``) + when exiting Greek text parts. + Exception: use ``\latinencoding`` if the initial ``\encodingdefault`` + is LGR and "greek" is the main document language. + - Fix standard accent macros also with pre-2022 ``\MakeUppercase``. + - Rename modifier `local-MakeUppercase-fixes` to + `no-MakeUppercase-fixes`. + .. _babel/4303: http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=babel/4303 .. _babel/4305: http://www.latex-project.org/cgi-bin/ltxbugs2html?pr=babel/4305 diff --git a/macros/latex/contrib/babel-contrib/greek/babel-greek.dtx b/macros/latex/contrib/babel-contrib/greek/babel-greek.dtx index bc3060207e..05ac6693f1 100644 --- a/macros/latex/contrib/babel-contrib/greek/babel-greek.dtx +++ b/macros/latex/contrib/babel-contrib/greek/babel-greek.dtx @@ -26,7 +26,7 @@ % and covered by LPPL is defined by the unpacking script (babel-greek.ins) % which is part of the package. % \fi -% \CheckSum{1701} +% \CheckSum{1694} % % \iffalse % Tell the \LaTeX\ system who we are and write an entry on the @@ -37,7 +37,7 @@ %<code>\ProvidesLanguage{greek} %\fi %\ProvidesFile{babel-greek.dtx} - [2023/08/18 1.14 Greek support for the babel system] + [2023/10/13 1.15 Greek support for the babel system] %\iffalse %% File `babel-greek.dtx' %% Greek language Definition File @@ -210,8 +210,11 @@ % % \changes{babel-greek-1.12}{2023/03/04}{ % New modifiers \Lopt{local-LGR-fixes} and \Lopt{no-LGR-fixes}.} -% \changes{babel-greek-1.14}{2023-08-18}{ +% \changes{babel-greek-1.14}{2023/08/18}{ % New modifier \Lopt{local-MakeUppercase-fixes}.} +% \changes{babel-greek-1.15}{2023/10/13}{ +% Rename modifier \Lopt{local-MakeUppercase-fixes} to +% \Lopt{no-MakeUppercase-fixes}.} % % All language attributes may also be used as modifiers, e.g. % \begin{verbatim} @@ -231,7 +234,7 @@ % Check for problems with enumerations in Greek text parts and with % Roman and Greek numerals everywhere (especially in the ToC). % -% The \hyperref[sec:MakeUppercase-fixes]{\Lopt{local-MakeUppercase-fixes}} +% The \hyperref[sec:MakeUppercase-fixes]{\Lopt{no-MakeUppercase-fixes}} % modifier skips the mapping of standard accents to ``capital'' accents % in section~\ref{sec:MakeUppercase-fixes}. % @@ -433,6 +436,11 @@ % \begin{macrocode} \addto\extrasgreek{\languageshorthands{greek}} % \end{macrocode} +% An auxiliary macro allows to test whether a macro holds the string `LGR' +% with |\ifx|: +% \begin{macrocode} +\def\bbl@greek@LGR{LGR} +% \end{macrocode} % % % \subsection{Hyphenation patterns \label{sec:hyphenation-patterns}} @@ -608,8 +616,7 @@ % active and inserts an \emph{erotimatiko} also with LGR encoded fonts: % \begin{macrocode} \bbl@declare@ttribute{greek}{keep-semicolon}{% - \def\bbl@tempa{LGR} - \ifx\greekfontencoding\bbl@tempa + \ifx\greekfontencoding\bbl@greek@LGR \ProvideTextCommandDefault{\textsemicolon}{;} \ProvideTextCommand{\textsemicolon}{LGR}{\texterotimatiko} \initiate@active@char{;} @@ -622,14 +629,14 @@ % % \subsection{Report unsupported modifiers} % -% \changes{babel-greek-1.13.2}{2023-06-01}{Warn of unsupported modifiers.} +% \changes{babel-greek-1.13.2}{2023/06/01}{Warn of unsupported modifiers.} % % Test for unsupported (or misspelled) \hyperref[sec:modifiers]{modifiers} % (code contributed by Javier Bezos). % \begin{macrocode} \def\bbl@greek@modifiers{,% polutoniko,polytonic,ancient,keep-semicolon,% - local-LGR-fixes,no-LGR-fixes,local-MakeUppercase-fixes,} + local-LGR-fixes,no-LGR-fixes,no-MakeUppercase-fixes,} \ifx\BabelModifiers\relax\else \bbl@foreach\BabelModifiers{% \@expandtwoargs\in@{,#1,}{\bbl@greek@modifiers} @@ -687,31 +694,35 @@ \else \providecommand*{\greekfontencoding}{LGR} \providecommand*{\bbl@greek@fontencdef}{lgrenc} - % TODO the more generic version fails :( - % \edef\bbl@greek@fontencdef{\lowercase{\greekfontencoding}enc} \fi % \end{macrocode} +% TODO: Why does the more generic version\\ +% | \edef\bbl@greek@fontencdef{\lowercase{\greekfontencoding}.enc}|\\ +% fail when used in |\ifl@aded|? % \end{macro} % % \subsubsection{Ensure loading of Greek font encoding definitions. % \label{load-greek-font-encoding-definitions}} % % If the \emph{encoding definition file} for |\greekfontencoding| is not yet -% loaded, do this now: +% loaded, do this now. +% (Using |\RequirePackage| fails as we are in an ``Options Section''.) +% TODO: set with |\AtEndOfPackage|? +% (All definitions requiring the font encoding must be delayed as well!) % \begin{macrocode} -\@ifl@aded{def}{\bbl@greek@fontencdef}{} -{% else - \InputIfFileExists{\bbl@greek@fontencdef .def}{} - {% else - \bbl@error{Font support for the Greek script missing.\\ - babel-greek can't typeset Greek.\\ - Install the "greek-fontenc" package\\ - or use XeTeX/LuaTeX with polyglossia.} - {I can't find the \bbl@greek@fontencdef .def file - for the Greek fonts (encoding \greekfontencoding)} - \@@end +\@ifl@aded{def}{\bbl@greek@fontencdef} + {} + {\InputIfFileExists{\bbl@greek@fontencdef .def} + {} + {\bbl@error{Font support for the Greek script missing.\\ + babel-greek can't typeset Greek.\\ + Install the "greek-fontenc" package\\ + or use XeTeX/LuaTeX with polyglossia.} + {I can't find the \bbl@greek@fontencdef .def file + for the Greek fonts (encoding \greekfontencoding)} + \@@end + } } -} % \end{macrocode} % If the PU font encoding is defined (by \pkgref{hyperref}), load extended % Greek support for it. Do this in the |\AtBeginDocument| hook because @@ -734,8 +745,8 @@ \makeatletter \InputIfFileExists{puenc-greek.def}% {}% - {\bbl@warning{I cannot find the "puenc" Greek fixes - from "greek-fontenc".}% + {\bbl@warning{I cannot find the Greek fixes for PDF strings + ("punec-greek.def" from "greek-fontenc").}% }% \RestoreAtCatcode }% @@ -745,6 +756,22 @@ % \end{macrocode} % % \subsubsection{Font encoding switches \label{sec:font-encoding-switches}} +% +% Add font encoding switches (see below) to the language hooks +% (cf.\ section~\ref{sec:language-hooks}) to ensure a font encoding +% supporting the Greek script is used in Greek text parts: +% \changes{greek-1.5}{2013/06/21}{LGR not used with XeTeX/LuaTeX.} +% \changes{babel-greek-1.08}{2013/11/27}{ +% Use EU1 or EU2 for Latin script if available} +% \changes{babel-greek-1.11}{2020/11/20}{Save/restore previous font encoding +% instead of switching to \cs{latinencoding} when leaving Greek.} +% \begin{macrocode} +\addto\extrasgreek{% + \let\BabelGreekPreviousFontEncoding\encodingdefault + \greekscript} +\addto\noextrasgreek{\BabelGreekRestoreFontEncoding} +% \end{macrocode} +% % \begin{macro}{\greekscript} % The TextCommand\footnote{See % \href{https://www.latex-project.org/help/documentation/fntguide.pdf} @@ -775,12 +802,14 @@ % \end{macro} % \begin{macro}{\BabelGreekRestoreFontEncoding} % The declaration |\BabelGreekRestoreFontEncoding| changes the font encoding -% to the value it had before the switch to the Greek language. It does -% nothing, if the language switch did not trigger a font encoding switch. +% to the value of |\encodingdefault| before the switch to the Greek language. +% It does nothing, if there was no font encoding change when entering Greek. % \changes{babel-greek-1.12}{2023/03/04}{New macro.} +% \changes{babel-greek-1.15}{2023/10/13}{ +% Do not ``restore'' LGR when leaving Greek.} % \begin{macrocode} \def\BabelGreekRestoreFontEncoding{% - \ifx\cf@encoding\BabelGreekPreviousFontEncoding + \ifx\encodingdefault\BabelGreekPreviousFontEncoding \else \let\encodingdefault\BabelGreekPreviousFontEncoding \fontencoding{\encodingdefault}\selectfont @@ -788,21 +817,18 @@ } % \end{macrocode} % \end{macro} -% Add font encoding switches to the language hooks -% (cf.\ section~\ref{sec:language-hooks}) to ensure a font encoding -% supporting the Greek script is used in Greek text parts: -% \changes{greek-1.5}{2013/06/21}{LGR not used with XeTeX/LuaTeX.} -% \changes{babel-greek-1.08}{2013/11/27}{ -% Use EU1 or EU2 for Latin script if available} -% \changes{babel-greek-1.11}{2020/11/20}{Save/restore previous font encoding -% instead of switching to \cs{latinencoding} when leaving Greek.} -% \changes{babel-greek-1.12}{2023/03/04}{Save previous font encoding -% in \cs{BabelGreekPreviousFontEncoding}.} +% Exception: don't keep LGR if it was the initial encoding +% as it is clearly unsuited for non-Greek texts. +% If Greek is the main language, |\extrasgreek| is called before +% |\begin{document}| --- we can check the saved value of the previous +% font encoding and replace LGR with the default generic text font encoding. +% ^^A TODO: Use the font encoding detection from \cs{ensureascii}? % \begin{macrocode} -\addto\extrasgreek{% - \let\BabelGreekPreviousFontEncoding\cf@encoding - \greekscript} -\addto\noextrasgreek{\BabelGreekRestoreFontEncoding} +\AtBeginDocument{ + \ifx\BabelGreekPreviousFontEncoding\bbl@greek@LGR + \let\BabelGreekPreviousFontEncoding\latinencoding + \fi +} % \end{macrocode} % % \subsubsection{Additional commands for the LGR font encoding} @@ -912,11 +938,15 @@ % \begin{macrocode} \ProvideTextCommandDefault{\EnsureStandardFontEncoding}{\@firstofone} \ProvideTextCommand{\EnsureStandardFontEncoding}{LGR}[1]{% - \ensureascii{#1}} - \AtBeginDocument{\@ifpackageloaded{hyperref} - {\pdfstringdefDisableCommands{% - \let\EnsureStandardFontEncoding\@firstofone}} - {}} + \ensureascii{#1} + } + \AtBeginDocument{% + \@ifpackageloaded{hyperref} + {\pdfstringdefDisableCommands{% + \let\EnsureStandardFontEncoding\@firstofone} + } + {} + } % \end{macrocode} % \end{macro} % End the LGR additions block: @@ -966,8 +996,7 @@ % Let it use the new defined \emph{TextCommand} |\textampersand| % in text mode. % \begin{macrocode} -\def\bbl@tempa{LGR} -\ifx\greekfontencoding\bbl@tempa +\ifx\greekfontencoding\bbl@greek@LGR \def\bbl@greek@roman#1{\expandafter\EnsureStandardFontEncoding% \expandafter{\romannumeral#1}} \def\bbl@greek@Roman#1{\expandafter\EnsureStandardFontEncoding% @@ -1548,8 +1577,7 @@ % without it becoming a $\varsigma$. % Because of this we make sure its lowercase code is not changed. % \begin{macrocode} -\def\bbl@tempa{LGR} -\ifx\greekfontencoding\bbl@tempa +\ifx\greekfontencoding\bbl@greek@LGR \addto\extrasgreek{% \babel@savevariable{\lccode`v}\lccode`v=`v% \babel@savevariable{\lccode`\'}\lccode`\'=`\'% @@ -1640,10 +1668,12 @@ % are now in greek-euenc.def (the polyglossia version has bugs).} % \changes{babel-greek-1.12}{2023/03/04}{ % Only change uccodes if LaTeX is older than 2022/06/01.} -% \changes{babel-greek-1.13.2}{2023-06-01}{ +% \changes{babel-greek-1.13.2}{2023/06/01}{ % \cs{MakeUppercase} fix for transliteration input.} -% \changes{babel-greek-1.14}{2023-08-18}{ +% \changes{babel-greek-1.14}{2023/08/18}{ % \cs{MakeUppercase} fix for standard accent macros.} +% \changes{babel-greek-1.15}{2023/10/13}{ +% Fix standard accent macros also with pre-2022 \cs{MakeUppercase}.} % In Greek typographical praxis, % letters drop accents (eccept dialytika) and breathings in % UPPERCASE. This is not cared for by the Unicode standard. @@ -1658,21 +1688,17 @@ % macros. % Font-encoding specific definitions for the ``capital'' accent macros % in \pkgref{greek-fontenc}~$\ge 2.4$ suppress them on Greek letters. -% The \Lopt{local-MakeUppercase-fixes} modifier can be used to skip this step +% The \Lopt{no-MakeUppercase-fixes} modifier can be used to skip this step % (cf. section~\ref{sec:modifiers}). % \begin{macrocode} -\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion} % new in 2020 -\bbl@xin@{,local-MakeUppercase-fixes,}{,\BabelModifiers,}% +\bbl@xin@{,no-MakeUppercase-fixes,}{,\BabelModifiers,}% \ifin@ \else - \IfFormatAtLeastTF{2022/06/01} - {\ProvideTextCommandDefault{\accACUTE}{\@tabacckludge'} - \ProvideTextCommandDefault{\accGRAVE}{\@tabacckludge`} - \ProvideTextCommandDefault{\accTILDE}{\@tabacckludge~} - \ProvideTextCommandDefault{\accDIAERESIS}{\@tabacckludge"} - \addto\@uclclist{\'\accACUTE \`\accGRAVE \~\accTILDE \"\accDIAERESIS}% - } - {} + \ProvideTextCommandDefault{\accACUTE}{\@tabacckludge'} + \ProvideTextCommandDefault{\accGRAVE}{\@tabacckludge`} + \ProvideTextCommandDefault{\accTILDE}{\@tabacckludge~} + \ProvideTextCommandDefault{\accDIAERESIS}{\@tabacckludge"} + \addto\@uclclist{\'\accACUTE \`\accGRAVE \~\accTILDE \"\accDIAERESIS}% \fi % \end{macrocode} % Drop diacritics also with ``input ligatures'' defined in LGR fonts: @@ -1684,8 +1710,7 @@ % The optional ``locale'' argument |[el]| restricts the mapping to Greek % text parts. % \begin{macrocode} -\def\bbl@tempa{LGR} -\ifx\greekfontencoding\bbl@tempa +\ifx\greekfontencoding\bbl@greek@LGR \ifdefined\DeclareUppercaseMapping % new in 2023 % \DeclareUppercaseMapping[el]{"1FBE}{\prosgegrammeni}% \DeclareUppercaseMapping[el]{"0027}{}% ' diff --git a/macros/latex/contrib/babel-contrib/greek/babel-greek.pdf b/macros/latex/contrib/babel-contrib/greek/babel-greek.pdf Binary files differindex 20ab08d842..56d9c968de 100644 --- a/macros/latex/contrib/babel-contrib/greek/babel-greek.pdf +++ b/macros/latex/contrib/babel-contrib/greek/babel-greek.pdf diff --git a/macros/latex/contrib/babel-contrib/greek/test-athnum.pdf b/macros/latex/contrib/babel-contrib/greek/test-athnum.pdf Binary files differindex 2f8f10102f..ecdcae7244 100644 --- a/macros/latex/contrib/babel-contrib/greek/test-athnum.pdf +++ b/macros/latex/contrib/babel-contrib/greek/test-athnum.pdf diff --git a/macros/latex/contrib/babel-contrib/greek/test-encoding-switch.tex b/macros/latex/contrib/babel-contrib/greek/test-encoding-switch.tex new file mode 100644 index 0000000000..f30aa8a6ec --- /dev/null +++ b/macros/latex/contrib/babel-contrib/greek/test-encoding-switch.tex @@ -0,0 +1,109 @@ +\documentclass{article} +\usepackage{parskip} +\usepackage{lmodern} + +% We load LGR last, which as a bad idea (see below). +% play with the font encodings: +% \usepackage[T1]{fontenc} +\usepackage[T1,T2A,LGR]{fontenc} + +\DeclareFontFamilySubstitution{T2A}{lmr}{cmr} + +\usepackage[english,greek.ancient]{babel} + +\makeatletter % we want to see the value of some internal macros + +\@ifl@aded{def}{t1enc} + {\newcommand*{\T@one@detected}{loaded}} + {\newcommand*{\T@one@detected}{\textbf{not} loaded}} + +\newcommand*{\cs}[1]{\ensureascii{\texttt{\textbackslash#1}}} + +% the title may be given before or after \begin{document} +\title{\foreignlanguage{english}{Test font encoding switches}} +\author{\ensureascii{Günter Milde}} + +\begin{document} + +\maketitle + +\ensureascii{The document's main language is \texttt{\bbl@main@language}} +(Ελληνικά). + +\ensureascii{The initial font encodings are:} +\cs{cf@encoding}: \cf@encoding, +\cs{encodingdefault}: \encodingdefault. + +\selectlanguage{english} + +After switching to \texttt{english}, we get:\\ +\cs{cf@encoding}: \cf@encoding, +\cs{encodingdefault}: \encodingdefault. + +\subsection*{\LaTeX2e Font Encodings} + +\emph{Fontenc} stores known encodings in \cs{@fontenc@load@list}:\\ +\@fontenc@load@list\ (sic! note the missing comma). +The last encoding in this list becomes the document's +default font encoding. It should be a \emph{standard text encoding} +(cf. encguide.pdf). + +\emph{Babel} defines a \cs{latinencoding} (\latinencoding) and +\cs{ensureascii}, which uses the standard last loaded text encoding +(\ensureascii{\cf@encoding}). + +\emph{Babel-Greek} ensures that a font encoding supporting the Greek +script is used in Greek text parts. +The previous font encoding is restored in \cs{noextrasgreek}. +Exception: +If the default language is \texttt{greek} and the initial +\cs{encodingdefault} is LGR, \cs{noextrasgreek} switches to +\cs{latinencoding} because the LGR font encoding is only suited for the +Greek script. +% cf. https://github.com/latex3/babel/pull/263 +% and https://www.lyx.org/trac/ticket/12882 + +\newpage +\subsection*{Tests} + +Test that we are using a \emph{standard text encoding}: +język polski.\footnote{The ogonek accent fails with LGR or OT1.} + +% A command local to the Polish QX font encoding: \textanglearc + +Call fontencoding T2A: \fontencoding{T2A} \selectfont +\cs{cf@encoding} \cf@encoding, \cs{encodingdefault} \encodingdefault. +\\ +Now I can use Кириллица\footnote{ + exept for footnotes, where encodingdefault is used: + \cf@encoding, \encodingdefault} +and Latin (including the ogonek) język polski +(caveat: wrong result with drag-and-drop from the PDF). + +Greek with \cs{foreignlanguage}: \foreignlanguage{greek}{Ελληνικά \\ +\cs{cf@encoding} \cf@encoding, \cs{encodingdefault}: \encodingdefault{} +} +\\ +Back to English -- the font encoding is restored to what it was +outside the group: +\cs{cf@encoding} \cf@encoding, \cs{encodingdefault} \encodingdefault. +I can still use Кириллица. + +Greek with \cs{selectlanguage}: \selectlanguage{greek} Ελληνικά\\ +\cs{cf@encoding} \cf@encoding, \cs{encodingdefault} \encodingdefault. + +\selectlanguage{english} +Back to English -- the font encoding +is restored by babel-greek to the previous default encoding: +\cs{cf@encoding} \cf@encoding, \cs{encodingdefault} \encodingdefault. +I can use the ogonek (język) but Cyrillic fails because it was not set +as \cs{encodingdefault} before the switch to Greek. +% Кириллица fails + +\subsection*{\emph{fontenc} curiosities} + +The encodings OT1 and T1 are always pre-loaded. +However, according to \cs{@ifl@aded} the encoding file ``t1enc.def'' is +\T@one@detected{}. + +\end{document} diff --git a/macros/latex/contrib/babel-contrib/greek/test-greek.pdf b/macros/latex/contrib/babel-contrib/greek/test-greek.pdf Binary files differindex 9a12610f7c..39bab5d57f 100644 --- a/macros/latex/contrib/babel-contrib/greek/test-greek.pdf +++ b/macros/latex/contrib/babel-contrib/greek/test-greek.pdf diff --git a/macros/latex/contrib/babel-contrib/greek/test-greek.tex b/macros/latex/contrib/babel-contrib/greek/test-greek.tex index 1bae1bb88d..38958418d4 100644 --- a/macros/latex/contrib/babel-contrib/greek/test-greek.tex +++ b/macros/latex/contrib/babel-contrib/greek/test-greek.tex @@ -32,9 +32,12 @@ \fi % Load and configure Babel: - - \usepackage[greek,% comment out "greek" to test the "basic support" + % Support for the pseudo-language "polutonikogreek", + % used instead of "greek", is kept for backwards compatibility. + \usepackage[ + greek,% comment out "greek" to test the "basic support" % greek.local-LGR-fixes, + % polutonikogreek, english]{babel} % Uncomment the desired language variant % Default: modern monotonic Greek @@ -43,9 +46,6 @@ % \languageattribute{greek}{polytonic} % alias for polutoniko % \languageattribute{greek}{ancient} % ancient Greek % - % 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. @@ -125,6 +125,10 @@ \exhyphenpenalty=10000 % \box2 vyšoupnu do vnějšího seznamu \emergencystretch=4em \leavevmode\unhbox2 \endgraf\egroup} +\newcommand*{\TestUppercase}[1]{% + \foreignlanguage{greek}{#1 → \MakeUppercase{#1}}% +} + % -------------------------------------------------------------------------- \begin{document} @@ -487,9 +491,9 @@ The Latin transliteration works in LGR but not TU: \end{quote} \ifdefined\lgrfont - The Latin transliteration can be used with also with - Xe/LuaTeX, if the input text is wrapped in \cs{lgrfont} - \footnote{available, if the LGR encoding is loaded + The Latin transliteration can also be used with + Xe/LuaTeX, if the input text is wrapped in \cs{lgrfont}\footnote{ + available, if the LGR encoding is loaded with the \pkgref{fontenc} package} but may result in non-matching fonts and wrong hyphenation: \begin{quote} @@ -509,12 +513,12 @@ teleia}). As a result, Unicode-encoded texts that use the semicolon as 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 +This means that even texts wich use the GREEK QUESTION MARK may end 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 +active and inserts an \emph{erotimatiko} also with LGR-encoded fonts, if the text language is set to Greek (in this document, the semicolon is \ifnum\catcode59 = 13 @@ -524,17 +528,17 @@ text language is set to Greek \fi \begin{tabular}{lccc} - Input & \latinencoding{} & \greekfontencoding - & Greek language \\ - 003F QUESTION MARK & ? & \ensuregreek{?} - & \foreignlanguage{greek}{?} \\ - \\ - 037E GREEK QUESTION MARK & {\footnotesize n/d} & \ensuregreek{;} - & \foreignlanguage{greek}{;} \\ - 003B SEMICOLON & ; & \ensuregreek{;} - & \foreignlanguage{greek}{;} \\ - 00B7 MIDDLE DOT & · & \ensuregreek{·} - & \foreignlanguage{greek}{·} \\ + Input & \latinencoding{} + & \greekfontencoding & Greek language \\ + 003F QUESTION MARK & ? + & \ensuregreek{?} & \foreignlanguage{greek}{?} \\ + \\ + 037E GREEK QUESTION MARK & {\footnotesize n/d} + & \ensuregreek{;} & \foreignlanguage{greek}{;} \\ + 003B SEMICOLON & ; + & \ensuregreek{;} & \foreignlanguage{greek}{;} \\ + 00B7 MIDDLE DOT & · + & \ensuregreek{·} & \foreignlanguage{greek}{·} \\ \end{tabular} {\footnotesize n/d}: character not defined in T1 encoding. @@ -590,7 +594,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, \romannumeral 5, \romannumeral 6} \makeatother \begin{quote} \RomanNumeralTest\\ @@ -651,7 +655,7 @@ Setting the language back to English should restore the alphabetic numbering: \end{enumerate} \end{enumerate} -More test of the LGR-redefinitions are in \file{test-lgr-fixes.tex}. +More tests of the LGR-redefinitions are in \file{test-lgr-fixes.tex}. \ifdefined\lgrfont \else @@ -663,54 +667,53 @@ More test of the LGR-redefinitions are in \file{test-lgr-fixes.tex}. Capital Greek letters have diacritics (except the dialytika and sub-iota) to the left (instead of above) and drop them in uppercase (except the -dialytika), e.g., \ensuregreek{μαΐστρος $\mapsto$ \MakeUppercase{μαΐστρος}}. +dialytika), e.g., \TestUppercase{μαΐστρος}. Tonos and psili mark a \emph{hiatus} (break-up of a diphthong) if placed on the first vowel of a diphthong. A dialytika must be placed on the second vowel if they are dropped, e.g. % -\newcommand{\HiatusLICR}{\acctonos\textalpha\textiota, - \acctonos\textalpha\textupsilon, - \acctonos\textepsilon\textiota, - \'>\textalpha\textiota, - \'>\textalpha\textupsilon, - \accpsili\textalpha\textupsilon, - \accpsilioxia\textepsilon\textiota}% -\foreignlanguage{greek}{\HiatusLICR\ $\mapsto$ \MakeUppercase{\HiatusLICR}}. +\TestUppercase{\acctonos\textalpha\textiota, + \acctonos\textalpha\textupsilon, + \acctonos\textepsilon\textiota, + \'>\textalpha\textiota, + \'>\textalpha\textupsilon, + \accpsili\textalpha\textupsilon, + \accpsilioxia\textepsilon\textiota}% Some affected words: \begin{quotation} - \selectlanguage{greek} - \newcommand*{\aylos}{% from teubner.sty: άυλος → ΑΫΛΟΣ + % from teubner.sty: + \TestUppercase{% άυλος → ΑΫΛΟΣ \acctonos\textalpha\textupsilon\textlambda\textomicron\textfinalsigma} - \aylos{} $\mapsto$ \MakeUppercase{\aylos}, - \renewcommand*{\aylos}{% polytonic: ἄυλος → ΑΫΛΟΣ + \TestUppercase{% polytonic: ἄυλος → ΑΫΛΟΣ \'>\textalpha\textupsilon\textlambda\textomicron\textfinalsigma} - \aylos{} $\mapsto$ \MakeUppercase{\aylos}, % from http://diacritics.typo.cz/index.php?id=69 - \newcommand*{\maine}{%μάινη → ΜΑΪΝΗ + \TestUppercase{%μάινη → ΜΑΪΝΗ \textmu\acctonos\textalpha\textiota\textnu\texteta} - \maine{} $\mapsto$ \MakeUppercase{\maine}, % from http://de.wikipedia.org/wiki/Neugriechische_Orthographie#Das_Trema - \newcommand*{\keik}{% κέικ → ΚΕΪΚ + \TestUppercase{% κέικ → ΚΕΪΚ \textkappa\acctonos\textepsilon\textiota\textkappa} - \keik{} $\mapsto$ \MakeUppercase{\keik}, - \newcommand*{\ahypnia}{% ἀυπνία → ΑΫΠΝΙΑ + \TestUppercase{% ἀυπνία → ΑΫΠΝΙΑ \accpsili\textalpha\textupsilon\textpi\textnu\acctonos\textiota\textalpha} - \ahypnia{} $\mapsto$ \MakeUppercase{\ahypnia}, % from http://multilingualtypesetting.co.uk/blog/greek-typesetting-tips/ - \newcommand*{\romeika}{\textrho\textomega\textmu - \acctonos\textepsilon\textiota\textkappa\textalpha} - \romeika{} $\mapsto$ \MakeUppercase{\romeika}. + \TestUppercase{% ρωμέικα → ΡΩΜΕΪΚΑ + \textrho\textomega\textmu + \acctonos\textepsilon\textiota\textkappa\textalpha} % from Yannis Haralambous https://hal.science/hal-02101618 - \newcommand*{\aute}{% ἀυτή → ΑΫΤΗ a cry, shout, esp. battle-shout + \TestUppercase{% ἀυτή → ΑΫΤΗ a cry, shout, esp. battle-shout \accpsili\textalpha\textupsilon\texttau\acctonos\texteta} - \aute{} → \MakeUppercase{\aute} + + % from https://r12a.github.io/scripts/grek/el.html#transforms + % νεράιδα -> ΝΕΡΑΪΔΑ + \TestUppercase{νεράιδα}\footnote{ + This example uses literal input. + It fails with pre-2022 \cs{MakeUppercase}.} \end{quotation} The file \file{char-list.tex} in the \pkgref{greek-fontenc} package includes @@ -728,28 +731,22 @@ limitations and problems. With \cs{greekfontencoding} \greekfontencoding, LaTeX version \fmtversion, and language variant ``\GreekLanguageVariant'', we get -\newcommand{\precomposed}{ῶ, ή, ΐ, ᾂ, άι} -\newcommand{\translit}{{~w, 'h, '"i, >`a|, 'ai}} -\newcommand{\acconLICR}{\~\textomega, \'\texteta, \'"\textiota, - \`>\textalpha\ypogegrammeni, \'\textalpha\textiota} -\newcommand{\accontranslit}{{\~w, \'h, \'"i, \`>a|, \'ai}} -\newcommand{\acconliteral}{\~ω, \'η, \'"ι, \`>ᾳ, \'αι} - pre-composed: -\foreignlanguage{greek}{\precomposed\ → \MakeUppercase{\precomposed}} +\TestUppercase{ῶ, ή, ΐ, ᾂ, άι} transliteration: -\foreignlanguage{greek}{\translit\ → \MakeUppercase{\translit}} +\TestUppercase{{~w, 'h, '"i, >`a|, 'ai}} accent macro + LICR: -\foreignlanguage{greek}{\acconLICR\ → \MakeUppercase{\acconLICR}} +\TestUppercase{\~\textomega, \'\texteta, \'"\textiota, + \`>\textalpha\ypogegrammeni, \'\textalpha\textiota} accent macro + transliteration: -\foreignlanguage{greek}{\accontranslit\ → \MakeUppercase{\accontranslit}} +\TestUppercase{{\~w, \'h, \'"i, \`>a|, \'ai}} accent macro + literal: \ifdefined \UnicodeEncodingName - \foreignlanguage{greek}{\acconliteral\ → \MakeUppercase{\acconliteral}} + \TestUppercase{\~ω, \'η, \'"ι, \`>ᾳ, \'αι} \else → inputenc Error: Invalid UTF-8 byte sequence \fi @@ -817,7 +814,7 @@ the ``empty'' character 0x9f = 159. \emph{Composite command} definitions ensure that combined accents also work for accent characters ``upcased'' to the charcter No 159 = 0x9f: -\newcommand{\CombinedAccentSample}{% +\TestUppercase{% \ifdefined \UnicodeEncodingName \"'υ{} \"`υ{} \`"υ{} \'"υ{} \`<α{} \'<α{} \else @@ -825,9 +822,7 @@ No 159 = 0x9f: \fi \'<\textalpha\textiota }% -\foreignlanguage{greek}{% - \CombinedAccentSample{} $\mapsto$ \MakeUppercase{\CombinedAccentSample}% -}. +. \newcommand{\AccentCharacters}{" | ' ` > <} @@ -838,8 +833,7 @@ and language variant ``\GreekLanguageVariant'', we get for is converted to an upper right apostrophe by LGR.}, sub-iota, tonos/oxia, varia, psili, and dasia): \begin{quote} - \selectlanguage{greek} - \AccentCharacters{} $\mapsto$ \MakeUppercase{\AccentCharacters} + \TestUppercase{\AccentCharacters} \end{quote} The changed uc/lccodes have strange effects on Latin text parts @@ -847,10 +841,10 @@ in Greek paragraphs if only the encoding is switched: \begin{quote} \selectlanguage{greek} \foreignlanguage{english}{English: - Let's see: \AccentCharacters{} $\mapsto$ + Let's see: \AccentCharacters{} → \MakeUppercase{Let's see: \AccentCharacters}}\\ \ensureascii{\cs{ensureascii}: - Let's see: \AccentCharacters{} $\mapsto$ + Let's see: \AccentCharacters{} → \MakeUppercase{Let's see: \AccentCharacters}} \end{quote} @@ -883,8 +877,8 @@ characters \ensureascii{MakeLowercase} \MakeLowercase{\alphaypo} \end{quotation} -and letters followed by \verb|\prosgegrammeni| -with literal character + literal GREEK YPOGEGRAMMENI: +and letters followed by \cs{prosgegrammeni} +with literal character + GREEK YPOGEGRAMMENI: \begin{quotation} \selectlanguage{greek} \newcommand{\alphapros}{\textalpha\prosgegrammeni α\prosgegrammeni{} αι / diff --git a/macros/latex/contrib/babel-contrib/greek/test-greeknum.pdf b/macros/latex/contrib/babel-contrib/greek/test-greeknum.pdf Binary files differnew file mode 100644 index 0000000000..22069edef8 --- /dev/null +++ b/macros/latex/contrib/babel-contrib/greek/test-greeknum.pdf diff --git a/macros/latex/contrib/babel-contrib/greek/test-greeknum.tex b/macros/latex/contrib/babel-contrib/greek/test-greeknum.tex index c04699d905..6e86ff15ad 100644 --- a/macros/latex/contrib/babel-contrib/greek/test-greeknum.tex +++ b/macros/latex/contrib/babel-contrib/greek/test-greeknum.tex @@ -16,7 +16,7 @@ \else \usepackage{lmodern} % \usepackage{kerkis} % !! Data loss: \textStigma and \textSampi - % characters missing! + % characters missing! % \usepackage{gfsdidot} % !! Data loss: \textsampi, \textSampi, % and \textStigma characters missing! % \usepackage{dejavu} % !! Data loss: \textSampi character missing! @@ -25,9 +25,9 @@ % \renewcommand*{\greeknumeralNinety}{\textsampi} % default \textSampi \fi - \usepackage[greek,english]{babel} + \begin{document} \section*{Test Greek (Milesian) numerals} \author{Günter Milde} @@ -38,8 +38,15 @@ Babel-greek defines the functions \verb|\greeknumeral| and \verb|\romannumeral|. For details and configuration options, see \texttt{babel-greek.pdf}. -Examples: +% Compare also with the "ready-made" counter styles for CSS +% https://www.w3.org/TR/predefined-counter-styles/#greek-styles +% +% CSS counters greek-lower-modern and greek-upper-modern +% use Sigma+Tau instead of Stigma for 6. +% +% CSS counters greek-lower-ancient and greek-upper-ancient use Stigma +Examples: \newcommand*{\greeknumeralsample}[1]{\mbox{#1 = \greeknumeral{#1}}} \newcommand*{\Greeknumeralsample}[1]{\mbox{#1 = \Greeknumeral{#1}}} |