summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/greek-fontenc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-06-15 20:10:54 +0000
committerKarl Berry <karl@freefriends.org>2022-06-15 20:10:54 +0000
commit2cdeb208b2d178d850a41eb9dad210d3b14526e6 (patch)
tree8a0ba2a565818723718607dd29fbca550b050f3f /Master/texmf-dist/tex/latex/greek-fontenc
parent29ef80d3c855001d3deca15a21d4f6a49afb34b4 (diff)
greek-fontenc (15jun22)
git-svn-id: svn://tug.org/texlive/trunk@63604 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/greek-fontenc')
-rw-r--r--Master/texmf-dist/tex/latex/greek-fontenc/alphabeta-tuenc.def9
-rw-r--r--Master/texmf-dist/tex/latex/greek-fontenc/alphabeta.sty2
-rw-r--r--Master/texmf-dist/tex/latex/greek-fontenc/greek-euenc.def2
-rwxr-xr-xMaster/texmf-dist/tex/latex/greek-fontenc/lgr2licr.lua169
-rw-r--r--Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def8
5 files changed, 185 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta-tuenc.def b/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta-tuenc.def
index 663f58c117c..8f86ff01337 100644
--- a/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta-tuenc.def
+++ b/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta-tuenc.def
@@ -13,9 +13,10 @@
\ProvidesFile{alphabeta-tuenc}
[2020/10/30 2.0 Composite definitions for XeTeX and LuaTeX]
-% Composite definitions for ``alphabeta.sty`` with XeTeX and LuaTeX.
+% :Abstract:
+% Composite definitions for ``alphabeta.sty`` with XeTeX and LuaTeX.
%
-% Changelog:
+% :Changelog:
% .. class:: borderless
%
% ====== ========== ========================================================
@@ -244,3 +245,7 @@
% .. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt
% .. _alphabeta: alphabeta.sty.html
% .. _tuenc-greek.def: tuenc-greek.def.html
+%
+% .. fix scaling in mobile browsers
+% .. meta::
+% :viewport: width=device-width, initial-scale=1
diff --git a/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta.sty b/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta.sty
index ddc8df103af..5eb769625fe 100644
--- a/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta.sty
+++ b/Master/texmf-dist/tex/latex/greek-fontenc/alphabeta.sty
@@ -34,6 +34,8 @@
% 2.0 2020/10/13 Provide ``\Koppa``.
% ====== ========== =========================================================
%
+% .. contents::
+%
% Motivation
% ==========
%
diff --git a/Master/texmf-dist/tex/latex/greek-fontenc/greek-euenc.def b/Master/texmf-dist/tex/latex/greek-fontenc/greek-euenc.def
index d5201ac8ff8..7d407be5adf 100644
--- a/Master/texmf-dist/tex/latex/greek-fontenc/greek-euenc.def
+++ b/Master/texmf-dist/tex/latex/greek-fontenc/greek-euenc.def
@@ -9,7 +9,7 @@
% version 1.3 of this license or any later version.
\ProvidesFile{greek-euenc.def}
-[2020/02/28 2.0 Greek LICRs for XeTeX and LuaTeX]
+[2020/10/30 2.0 Greek LICRs for XeTeX and LuaTeX]
% Just in case there is an old fontspec using EU1 or EU2::
diff --git a/Master/texmf-dist/tex/latex/greek-fontenc/lgr2licr.lua b/Master/texmf-dist/tex/latex/greek-fontenc/lgr2licr.lua
new file mode 100755
index 00000000000..74d52f0c92c
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/greek-fontenc/lgr2licr.lua
@@ -0,0 +1,169 @@
+#!/usr/bin/env lua
+
+-- LGR Transcription to Greek LICR transformation
+-- **********************************************
+--
+-- :Copyright: © 2010 Günter Milde
+-- :Licence: This work may be distributed and/or modified under the
+-- conditions of the `LaTeX Project Public License`_, either
+-- version 1.3 of this license or any later version.
+--
+-- .. _LaTeX Project Public License: http://www.latex-project.org/lppl.txt
+--
+-- The LGR font encoding is the de-facto standard for Greek typesetting with
+-- LaTeX. This file provides a translation from the Latin transcription defined
+-- by LGR into the LaTeX Internal Character Representation (LICR) macros.
+--
+-- ::
+
+usage = [[
+Usage: lua lgr2licr.lua [OPTIONS] [STRING]
+ Convert STRING from Latin transcription to LICR macros for Greek symbols.
+ (This dumb conversion fails if the string contains TeX macros.)
+ Without argument, the script reads from standard input like a
+ redirected file. End interactive input with Ctrl-D.
+Options: -h, --help show this help
+ -f, --file read input from file STRING
+]]
+
+if arg[1] == "-h" or arg[1] == "--help" then
+ print(usage)
+ return
+end
+
+-- Get input string::
+
+local s
+
+if arg[1] == "-f" then
+ local f = assert(io.open(arg[2], "r"))
+ s = f:read("*all")
+ f:close()
+elseif arg[1] then
+ s = table.concat(arg, " ") .. "\n"
+else
+ -- test:
+ -- s = "\\emph{x\\'us}"
+ s = io.read("*all")
+end
+
+-- The mapping from the LGR Latin transcription to LICR macros::
+
+LGR_map = {
+ A = "\\textAlpha{}",
+ B = "\\textBeta{}",
+ G = "\\textGamma{}",
+ D = "\\textDelta{}",
+ E = "\\textEpsilon{}",
+ Z = "\\textZeta{}",
+ H = "\\textEta{}",
+ J = "\\textTheta{}",
+ I = "\\textIota{}",
+ K = "\\textKappa{}",
+ L = "\\textLambda{}",
+ M = "\\textMu{}",
+ N = "\\textNu{}",
+ X = "\\textXi{}",
+ O = "\\textOmicron{}",
+ P = "\\textPi{}",
+ R = "\\textRho{}",
+ S = "\\textSigma{}",
+ T = "\\textTau{}",
+ U = "\\textUpsilon{}",
+ F = "\\textPhi{}",
+ Q = "\\textChi{}",
+ Y = "\\textPsi{}",
+ W = "\\textOmega{}",
+
+ a = "\\textalpha{}",
+ b = "\\textbeta{}",
+ g = "\\textgamma{}",
+ d = "\\textdelta{}",
+ e = "\\textepsilon{}",
+ z = "\\textzeta{}",
+ h = "\\texteta{}",
+ j = "\\texttheta{}",
+ i = "\\textiota{}",
+ k = "\\textkappa{}",
+ l = "\\textlambda{}",
+ m = "\\textmu{}",
+ n = "\\textnu{}",
+ x = "\\textxi{}",
+ o = "\\textomicron{}",
+ p = "\\textpi{}",
+ r = "\\textrho{}",
+ s = "\\textautosigma{}",
+ c = "\\textfinalsigma{}",
+ t = "\\texttau{}",
+ u = "\\textupsilon{}",
+ f = "\\textphi{}",
+ q = "\\textchi{}",
+ y = "\\textpsi{}",
+ w = "\\textomega{}",
+ v = "\\noboundary{}",
+
+ ["'"] = "\\'",
+ ["`"] = "\\`",
+ ["~"] = "\\~",
+ ["<"] = "\\<",
+ [">"] = "\\>",
+ ["|"] = "\\|",
+ ['"'] = '\\"',
+ [";"] = "\\textanoteleia{}",
+ ["?"] = "\\texterotimatiko{}",
+}
+
+-- Return substitution string for 3 captures:
+--
+-- `c1` backslash
+-- `c2` a-zA-Z
+-- `c3` any other char
+-- ::
+
+function lgr_replace(c1, c2, c3)
+ -- print (c1, c2, c3)
+ if c1 == "\\" then
+ if c2 and (c2 ~= "") then
+ return c1 .. c2 .. (LGR_map[c3] or c3 or "")
+ end
+ return c1 .. c3
+ end
+ c2 = string.gsub(c2, "s(.)", "sv%1")
+ return (string.gsub(c2, ".", LGR_map) or "") .. (LGR_map[c3] or c3 or "")
+end
+
+-- Use the mapping to replace every ASCII-character with
+-- non-standard meaning to the corresponding LICR macro
+-- (skip macros)::
+ -- *([a-zA-Z'`~<>|\";?]
+s = string.gsub(s, "(\\?)([a-zA-Z]*)([^\\]?)", lgr_replace)
+
+-- Ligatures::
+
+s = string.gsub(s, "%(%(", "\\guillemetleft{}")
+s = string.gsub(s, "%)%)", "\\guillemetright{}")
+s = string.gsub(s, "\\'\\'", "\\textquoteright{}") -- ''
+s = string.gsub(s, "\\`\\`", "\\textquoteleft{}") -- ``
+s = string.gsub(s, '\"(%s)', "\\textquoteright{}%1")
+
+-- Separating empty group "{}" only required if followed by space or ASCII::
+
+s = string.gsub(s, "{}([^ a-zA-Z])", "%1")
+
+-- Autosigma replacements::
+
+s = string.gsub(s, "\\textautosigma\\noboundary", "\\textsigma") -- sv
+s = string.gsub(s, "\\textautosigma(\\['`~<>|\"])", "\\textsigma%1") -- accents
+
+s = string.gsub(s, "\\textautosigma([-%s!#$%%&%(%)*+,./0-9:=%[%]{|}])",
+ "\\textfinalsigma%1")
+
+s = string.gsub(s, "\\textautosigma(\\textquote)", "\\textfinalsigma%1")
+s = string.gsub(s, "\\textautosigma(\\texterotimatiko)", "\\textfinalsigma%1")
+s = string.gsub(s, "\\textautosigma(\\textanoteleia)", "\\textfinalsigma%1")
+
+s = string.gsub(s, "\\textautosigma$", "\\textfinalsigma")
+
+-- Write the result to stdout::
+
+io.write(s)
diff --git a/Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def b/Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def
index a5a9e9d3159..2558c9729f8 100644
--- a/Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def
+++ b/Master/texmf-dist/tex/latex/greek-fontenc/lgrenc.def
@@ -4,7 +4,7 @@
% LGR Greek font encoding definitions
% ===================================
%
-% :Copyright: © 2010, 2014 Günter Milde
+% :Copyright: © 2010 -- 2022 Günter Milde
% :Licence: This work may be distributed and/or modified under the
% conditions of the `LaTeX Project Public License`_, either
% version 1.3 of this license or any later version.
@@ -57,6 +57,7 @@
% 1.0 2020-09-25 ``\textKoppa`` as alias for ``\textkoppa``
% (there is no capital Koppa in LGR).
% 2.0 2020-10-13 Move common alias definitions to ``greek-fontenc.def``.
+% 2.1 2022-06-14 Support the correct spelling ``\guillemet…`` for « ».
% ====== ============ ========================================================
%
% Usage
@@ -96,7 +97,7 @@
% ::
\ProvidesFile{lgrenc.def}
-[2020/10/13 2.0 LGR Greek font encoding definitions]
+[2022/06/14 2.1 LGR Greek font encoding definitions]
% Copyright © 2010 Günter Milde
% This file is part of the "greek-fontenc" package.
% It may be distributed and/or modified under the
@@ -298,6 +299,9 @@
% T1::
+\DeclareTextSymbol{\guillemetleft}{LGR}{123} % «
+\DeclareTextSymbol{\guillemetright}{LGR}{125} % »
+% legacy names
\DeclareTextSymbol{\guillemotleft}{LGR}{123} % «
\DeclareTextSymbol{\guillemotright}{LGR}{125} % »