From 254f9a49d8a4dc9c19816e0369bfcfec67ba455e Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Wed, 19 Oct 2016 18:30:03 +0200
Subject: starting optimizing the code before going further

---
 ekdosis.dtx | 40 ++++++++++++++--------------------------
 1 file changed, 14 insertions(+), 26 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index 2a9a864..439ae5f 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -210,8 +210,10 @@ Running "make install" installs the files in the local TeX tree.
 \documentclass{ltxdoc}
 \usepackage[a4paper,margin=25mm,left=50mm,nohead]{geometry}
 \usepackage[numbered]{hypdoc}
+\usepackage[toc,lot]{multitoc}
 \usepackage{\jobname}
 \usepackage{fontspec,luatextra}
+\setmainfont{Old Standard}[RawFeature={+ss05;+ss06}]
 \usepackage{authblk}
 \newcommand{\package}[1]{\textsf{#1}\index{#1=#1 (package)}}
 \EnableCrossrefs
@@ -254,7 +256,10 @@ Running "make install" installs the files in the local TeX tree.
 % \affil{CNRS UMR 8167 (Paris, France)\footnote{\url{robert.alessi@cnrs.fr}}}
 % \date{\fileversion\ released \filedate}
 %
-%\maketitle
+% \maketitle
+% \footnotesize
+% \tableofcontents
+% \normalsize
 %
 %\changes{v1.00}{2016/08/03}{First public release}
 %
@@ -335,44 +340,27 @@ Running "make install" installs the files in the local TeX tree.
     \stepcounter{ekd@lab}}{}}
 \NewDocumentCommand{\obappend}{+m}%
   {\luadirect{tex.sprint(mdv(\luastringN{#1}))}}
-\NewDocumentCommand{\myappend}{+m}{%
-  \ifbool{ekdstate}{%
-    \label{\getlab}%
-    \luadirect{appin(\luastring{<\getpagerefnumber{\getlab}>}, "no")}%
-    \luadirect{appin(\luastringN{#1}, "no")}%
-    \luadirect{appin(\luastring{</\getpagerefnumber{\getlab}>}, "yes")}%
-    \mklab}{}}
 \NewDocumentCommand{\apparatus}{}{\luadirect{tex.sprint(appout())}}
 \NewDocumentCommand{\testapparatus}{}{\luadirect{tex.sprint(testapparatus())}}
 \def\blfootnote{\gdef\@thefnmark{\relax}\@footnotetext}
-\def\addapp{%
+\def\add@@apparatus{%
   \testapparatus%
   \ifbool{isapp}{%
     \begin{apparat}[b!]
       \rule{5cm}{0.5pt}\\
-      \footnotesize\textbf{Apparat:} \apparatus
-    \end{apparat}}{}%
-  % \blfootnote{\apparatus}}{}
-  \afterpage{\addapp}}
+      \footnotesize\apparatus
+    \end{apparat}}{}}
+\def\add@apparatus{%
+  \add@@apparatus%
+  \afterpage{\add@apparatus}}
 \NewDocumentCommand{\EkdosisStart}{}{%
-  \testapparatus%
-  \ifbool{isapp}{%
-    \begin{apparat}[b!]
-      \rule{5cm}{0.5pt}\\
-      \footnotesize\textbf{Apparat:} \apparatus
-    \end{apparat}}{}%
-  % \blfootnote{\apparatus}}{}%
-  \afterpage{\addapp}}
+  \add@@apparatus%
+  \afterpage{\add@apparatus}}
 \NewDocumentCommand{\EkdosisOn}{}{\setbool{ekdstate}{true}}
 \NewDocumentCommand{\EkdosisOff}{}{\setbool{ekdstate}{false}}
 \newenvironment{ekdosis}{%
 \ifbool{ekdstarted}{}{\EkdosisStart\global\setbool{ekdstarted}{true}}
 \EkdosisOn}{\EkdosisOff}
-\newenvironment{countlines}%
-{\directlua{luatexbase.add_to_callback("post_linebreak_filter",
-    count_lines, "count_lines")}}%
-{\par
-\directlua{luatexbase.remove_from_callback("post_linebreak_filter", "count_lines")}}
 %    \end{macrocode}
 % That is it. Say goodbye before leaving.
 %    \begin{macrocode}
-- 
cgit v1.2.3

