From 6260d5667d5e96af19fe070ae9887b459ac00577 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Tue, 16 Oct 2018 12:28:41 +0200
Subject: better formatting of lua code

---
 ekdosis.dtx | 39 ++++++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 17 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 91b9c4b..eaa13b2 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -139,6 +139,10 @@ Running "make install" installs the files in the local TeX tree.
 \setmainfont{Old Standard}[RawFeature={+ss05;+ss06}]
 \usepackage{relsize}
 \usepackage{minted}
+\newminted[ekdlua]{lua}{linenos, fontsize=\relsize{-0.5},
+  xleftmargin=12pt,
+  numberblanklines=false, numbersep=3pt, firstnumber=last}
+\renewcommand{\theFancyVerbLine}{\rmfamily\smaller\arabic{FancyVerbLine}}
 \usepackage[contents]{colordoc}
 \usepackage{authblk}
 \newcommand{\package}[1]{\textsf{#1}\index{#1=#1 (package)}}
@@ -298,11 +302,11 @@ Running "make install" installs the files in the local TeX tree.
 % \iffalse `'
 %<*lua>
 % \fi
-% \begin{minted}[linenos,fontsize=\relsize{-0.5}]{lua}     
+% \begin{ekdlua}
 function closestream()
-      os.remove(tex.jobname..".ekd")
-      os.rename(tex.jobname.."_tmp.ekd", tex.jobname..".ekd")
-      return true
+   os.remove(tex.jobname..".ekd")
+   os.rename(tex.jobname.."_tmp.ekd", tex.jobname..".ekd")
+   return true
 end
 
 function remove()
@@ -317,14 +321,14 @@ function isintable(table, value)
 end
 
 function appin(str, nl)
-      local f = io.open(tex.jobname.."_tmp.ekd", "a+")
-      if nl == "yes" then
-	 f:write(str, "\n")
-      else
-	 f:write(str)
-      end
-      f:close()
-      return true
+   local f = io.open(tex.jobname.."_tmp.ekd", "a+")
+   if nl == "yes" then
+      f:write(str, "\n")
+   else
+      f:write(str)
+   end
+   f:close()
+   return true
 end
 
 function appout()
@@ -333,7 +337,8 @@ function appout()
       f = assert(io.open(tex.jobname..".ekd", "r"))
       t = f:read("*a")
       local output = {}
-      for i in string.gmatch(t, "<"..tex.count[0]..">.-</"..tex.count[0]..">")
+      for i in string.gmatch(t,
+			     "<"..tex.count[0]..">.-</"..tex.count[0]..">")
       do
 	 table.insert(output, i)
       end
@@ -350,7 +355,7 @@ function testapparatus()
    if file ~= nil then
       local t = file:read("*a")
       if string.find(t, "<"..tex.count[0]..">") then
-      return "\\booltrue{isapp}" else return "\\boolfalse{isapp}" end
+	 return "\\booltrue{isapp}" else return "\\boolfalse{isapp}" end
    else return "\\boolfalse{isapp}" end
    file:close()
 end
@@ -371,15 +376,15 @@ function mdvappend(str)
 end
 
 --[[ -- of no use
-function writemdv(str)
+   function writemdv(str)
    str = md5.sumhexa(str)
    local f = io.open(tex.jobname.."_tmp.ekd", "a+")
    f:write("<md5>", str, "</md5>", "\n")
    f:close()
    return true
-end
+   end
 --]]
-% \end{minted}
+% \end{ekdlua}
 % \iffalse
 %</lua>
 % \fi
-- 
cgit v1.2.3

