summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/greek-fontenc/lgr2licr.lua.html
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/greek-fontenc/lgr2licr.lua.html')
-rw-r--r--Master/texmf-dist/doc/latex/greek-fontenc/lgr2licr.lua.html139
1 files changed, 139 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/greek-fontenc/lgr2licr.lua.html b/Master/texmf-dist/doc/latex/greek-fontenc/lgr2licr.lua.html
new file mode 100644
index 00000000000..7762506cab8
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/greek-fontenc/lgr2licr.lua.html
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.11: http://docutils.sourceforge.net/" />
+<title>LGR Transcription to Greek LICR transformation</title>
+<meta name="copyright" content="© 2010 Günter Milde" />
+<link rel="stylesheet" href="../../../../../Python/docutils-svn/docutils/docutils/writers/html4strict/html4css1.css" type="text/css" />
+<link rel="stylesheet" href="../../../../../Python/docutils-svn/docutils/docutils/writers/html4strict/html4css2.css" type="text/css" />
+</head>
+<body>
+<div class="document" id="lgr-transcription-to-greek-licr-transformation">
+<h1 class="title">LGR Transcription to Greek LICR transformation</h1>
+
+<dl class="docinfo simple">
+<dt class="copyright">Copyright</dt>
+<dd class="copyright">© 2010 Günter Milde</dd>
+<dt>Licence</dt>
+<dd><p>This work may be distributed and/or modified under the
+conditions of the <a class="reference external" href="http://www.latex-project.org/lppl.txt">LaTeX Project Public License</a>, either
+version&nbsp;1.3 of this license or any later version.</p>
+</dd>
+</dl>
+<!-- #!/usr/bin/env lua
+- - -*- coding: utf-8 -*- -->
+<p>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.</p>
+<pre class="literal-block">usage = [[
+Usage: lua lgr2licr.lua [OPTIONS] [STRING]
+ Convert STRING from Latin transcription to LICR macros for Greek symbols.
+ Without argument, the script reads from standard input, e.g., a
+ redirected file or interactive input ended with Ctrl-D.
+Options: -h, --help show this help
+]]
+
+if arg[1] == &quot;-h&quot; or arg[1] == &quot;--help&quot; then
+ print(usage)
+ return
+end
+</pre>
+<p>Get input string:</p>
+<pre class="literal-block">if ... then
+ s = string.gsub(..., &quot;\t&quot;, &quot; &quot;)
+else
+ s = io.read(&quot;*all&quot;)
+end
+</pre>
+<p>The mapping from the LGR Latin transcription to LICR macros:</p>
+<pre class="literal-block">LGR_map = {
+ A = &quot;\\textAlpha{}&quot;,
+ B = &quot;\\textBeta{}&quot;,
+ G = &quot;\\textGamma{}&quot;,
+ D = &quot;\\textDelta{}&quot;,
+ E = &quot;\\textEpsilon{}&quot;,
+ Z = &quot;\\textZeta{}&quot;,
+ H = &quot;\\textEta{}&quot;,
+ J = &quot;\\textTheta{}&quot;,
+ I = &quot;\\textIota{}&quot;,
+ K = &quot;\\textKappa{}&quot;,
+ L = &quot;\\textLambda{}&quot;,
+ M = &quot;\\textMu{}&quot;,
+ N = &quot;\\textNu{}&quot;,
+ K = &quot;\\textXi{}&quot;,
+ O = &quot;\\textOmicron{}&quot;,
+ P = &quot;\\textPi{}&quot;,
+ R = &quot;\\textRho{}&quot;,
+ S = &quot;\\textSigma{}&quot;,
+ T = &quot;\\textTau{}&quot;,
+ U = &quot;\\textUpsilon{}&quot;,
+ F = &quot;\\textPhi{}&quot;,
+ Q = &quot;\\textChi{}&quot;,
+ Y = &quot;\\textPsi{}&quot;,
+ W = &quot;\\textOmega{}&quot;,
+
+ a = &quot;\\textalpha{}&quot;,
+ b = &quot;\\textbeta{}&quot;,
+ g = &quot;\\textgamma{}&quot;,
+ d = &quot;\\textdelta{}&quot;,
+ e = &quot;\\textepsilon{}&quot;,
+ z = &quot;\\textzeta{}&quot;,
+ h = &quot;\\texteta{}&quot;,
+ j = &quot;\\texttheta{}&quot;,
+ i = &quot;\\textiota{}&quot;,
+ k = &quot;\\textkappa{}&quot;,
+ l = &quot;\\textlambda{}&quot;,
+ m = &quot;\\textmu{}&quot;,
+ n = &quot;\\textnu{}&quot;,
+ x = &quot;\\textxi{}&quot;,
+ o = &quot;\\textomicron{}&quot;,
+ p = &quot;\\textpi{}&quot;,
+ r = &quot;\\textrho{}&quot;,
+ s = &quot;\\textautosigma{}&quot;,
+ c = &quot;\\textfinalsigma{}&quot;,
+ t = &quot;\\texttau{}&quot;,
+ u = &quot;\\textupsilon{}&quot;,
+ f = &quot;\\textphi{}&quot;,
+ q = &quot;\\textchi{}&quot;,
+ y = &quot;\\textpsi{}&quot;,
+ w = &quot;\\textomega{}&quot;,
+ v = &quot;\\noboundary{}&quot;,
+
+ [&quot;'&quot;] = &quot;\\'&quot;,
+ [&quot;`&quot;] = &quot;\\`&quot;,
+ [&quot;~&quot;] = &quot;\\~&quot;,
+ [&quot;&lt;&quot;] = &quot;\\&lt;&quot;,
+ [&quot;&gt;&quot;] = &quot;\\&gt;&quot;,
+ [&quot;|&quot;] = &quot;\\|&quot;,
+ ['&quot;'] = '\\&quot;',
+ [&quot;;&quot;] = &quot;\\textanoteleia{}&quot;,
+ [&quot;?&quot;] = &quot;\\texterotimatiko{}&quot;,
+}
+</pre>
+<p>Replace the “autosigma” (s) with “sigma” (sv) if followed by another
+character and with “finalsigma” (c) if followed by space or punctuation:</p>
+<pre class="literal-block">s = string.gsub(s, &quot;s([a-z'`~&lt;&gt;])&quot;, &quot;sv%1&quot;)
+s = string.gsub(s, &quot;s([ ,.:;?!])&quot;, &quot;c%1&quot;)
+s = string.gsub(s, 's&quot;(%s)', 'c&quot;%1') -- &quot; before whitespace is quote/apostrophe
+</pre>
+<p>Use the mapping to replace every ASCII-character with
+non-standard meaning to the corresponding LICR macro:</p>
+<pre class="literal-block">s = string.gsub(s, &quot;([a-zA-Z'`~&lt;&gt;|\&quot;;?])&quot;, LGR_map)
+</pre>
+<p>Some cleanup operations:</p>
+<pre class="literal-block">s = string.gsub(s, &quot;\\'\\'&quot;, &quot;\\textquoteright{}&quot;) -- ''
+s = string.gsub(s, &quot;\\`\\`&quot;, &quot;\\textquoteleft{}&quot;) -- ``
+s = string.gsub(s, &quot;\\textautosigma{}\\noboundary{}&quot;, &quot;\\textsigma{}&quot;) -- sv
+s = string.gsub(s, &quot;{}\\&quot;, &quot;\\&quot;)
+</pre>
+<p>The quotation mark (“) denotes a quote/apostrophe if followed by a space:</p>
+<pre class="literal-block">s = string.gsub(s, '\&quot;(%s)', &quot;\\textquoteright{}%1&quot;)
+</pre>
+<p>Write the result to stdout:</p>
+<pre class="literal-block">io.write(s)
+</pre>
+</div>
+</body>
+</html>