Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#######
#
# E-scripts about LuaTeX.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/luatex.e>
#           or at <http://angg.twu.net/e/luatex.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




# «.mailing-lists»		(to "mailing-lists")
# «.luatex»			(to "luatex")
# «.lua-repl»			(to "lua-repl")
# «.context-lua»		(to "context-lua")
# «.luacode»			(to "luacode")
# «.luacode-old»		(to "luacode-old")
# «.luamplib»			(to "luamplib")
# «.luatex-upstream»		(to "luatex-upstream")
# «.luatex-0.79.1»		(to "luatex-0.79.1")
# «.luatex-package.searchers»	(to "luatex-package.searchers")
# «.luatex-0.79.1-mplib»	(to "luatex-0.79.1-mplib")
# «.luatex-0.79.1-paths»	(to "luatex-0.79.1-paths")
# «.luatex-0.79.1-minimal»	(to "luatex-0.79.1-minimal")
# «.luatex-0.79.1-min-backup»	(to "luatex-0.79.1-min-backup")
# «.luatex-0.79.1-min-fmtutil»	(to "luatex-0.79.1-min-fmtutil")
# «.luatex-0.79.1-min-revert»	(to "luatex-0.79.1-min-revert")
# «.luatex-0.90»		(to "luatex-0.90")
# «.luatex-0.95.0»		(to "luatex-0.95.0")
# «.luatex-0.95.0-doc»		(to "luatex-0.95.0-doc")
# «.luatex-0.95.0-fmtutil-email»  (to "luatex-0.95.0-fmtutil-email")
# «.luatex-0.95.0-pdfoutput»	(to "luatex-0.95.0-pdfoutput")
# «.luatex-from-sid»		(to "luatex-from-sid")
# «.luatex-from-sid-inis»	(to "luatex-from-sid-inis")
# «.fmtutil»			(to "fmtutil")
# «.LUA_INIT»			(to "LUA_INIT")
# «.picture-mode»		(to "picture-mode")
# «.dvi-output»			(to "dvi-output")
# «.package.loaders»		(to "package.loaders")
# «.require»			(to "require")
# «.lualatex-repl»		(to "lualatex-repl")
# «.nodes»			(to "nodes")
# «.tex-without-tex»		(to "tex-without-tex")
# «.traversing-a-paragraph»	(to "traversing-a-paragraph")
# «.getting-glyph-data»		(to "getting-glyph-data")
# «.tex.inputlineno»		(to "tex.inputlineno")
# «.tex.inputlineno-repl»	(to "tex.inputlineno-repl")
# «.tex.inputlineno-tex»	(to "tex.inputlineno-tex")
# «.skipping-lines»		(to "skipping-lines")
# «.token-library»		(to "token-library")
# «.makecrspecial-1»		(to "makecrspecial-1")
# «.makecrother»		(to "makecrother")
# «.luatexbase-cctb»		(to "luatexbase-cctb")
# «.macros»			(to "macros")
# «.high-catcodes»		(to "high-catcodes")
# «.catcodes»			(to "catcodes")
# «.inspecting-defs»		(to "inspecting-defs")
# «.spurious-omega»		(to "spurious-omega")
# «.comments-in-tex.print»	(to "comments-in-tex.print")
# «.lua-5.2»			(to "lua-5.2")
# «.lua-version»		(to "lua-version")
# «.ufy»			(to "ufy")
# «.texlive-2016»		(to "texlive-2016")
# «.texlive-2017»		(to "texlive-2017")
# «.pdfshellescape»		(to "pdfshellescape")
# «.thislinetag»		(to "thislinetag")


# (find-es "tex" "beamer")




#####
#
# Mailing lists
# 2014may01
#
#####

# «mailing-lists» (to ".mailing-lists")
# http://www.ntg.nl/mailman/private/dev-luatex/
# http://tug.org/mailman/listinfo/luatex
# http://tug.org/pipermail/luatex/
# http://tug.org/pipermail/luatex/2009-January/000040.html
# http://www.ntg.nl/mailman/private/dev-luatex/
# http://www.ntg.nl/mailman/private/dev-luatex/2009-February/002307.html
# http://tug.org/pipermail/luatex/2013-May/004346.html tex.hashtokens()
# http://tug.org/pipermail/luatex/2017-May/006527.html Reusable Code (LuaLaTeX + LuaMPlib)

# http://weblog.elzevir.fr/2009/02/integrer-un-luatex-recent-a-tex-live/



#####
#
# luatex on squeeze
# 2010dec05
#
#####

# «luatex»  (to ".luatex")
# (find-angg ".emacs" "luatex")
# (find-status   "luatex")
# (find-vldifile "luatex.list")
# (find-udfile   "luatex/")
# (find-udfile   "luatex/examples/")
# (find-status   "texlive-luatex")
# (find-vldifile "texlive-luatex.list")
# (find-udfile   "texlive-luatex/")
# (find-zsh "dmissing luatexref")

# (find-fline "/usr/share/texmf-texlive/tex/lualatex/luainputenc/")
# (find-fline "/usr/share/texmf-texlive/tex/luatex/luatextra/")
# (find-fline "/usr/share/texmf-texlive/tex/luatex/luaotfload/")
# (find-fline "/usr/share/texmf-texlive/tex/luatex/luamplib/")
# (find-fline "/usr/share/doc/texlive-luatex/lualatex/luainputenc/")
# (find-fline "/usr/share/doc/texlive-luatex/luatex/luatextra/")
# (find-fline "/usr/share/doc/texlive-luatex/luatex/luaotfload/")
# (find-fline "/usr/share/doc/texlive-luatex/luatex/luamplib/")
# (find-fline "/usr/share/doc/texlive-luatex/")
# (find-fline "/usr/share/doc/texlive-doc/lualatex/")
# (find-fline "/usr/share/doc/texlive-doc/luatex/")

# (find-luatexrefpage 14 "primitive \\directlua")
# (find-luatexreftext    "primitive \\directlua")
# (find-luatexrefpage 19 "--luaonly")
# (find-luatexreftext    "--luaonly")

* (eepitch-luatex)
* (eepitch-kill)
* (eepitch-luatex)
\relax
\tracingonline=1\scrollmode
\edef\foo{\directlua0{tex.print(math.pi)}}
\show\foo

* (eepitch-lualatex)
* (eepitch-kill)
* (eepitch-lualatex)
\relax
\tracingonline=1\scrollmode
\edef\foo{\directlua0{tex.print(math.pi)}}
\show\foo




\catcode`\{=1
\catcode`\}=2
\catcode`\#=6
\def\test#1{%
 \immediate\write16{%
   [#1: \directlua{tex.write(status.luatex_#1)}]%
 }%
}
\test{svn}
\test{version}
\test{revision}
\csname @@end\endcsname\end




#####
#
# Running a Lua REPL in LuaTeX
# 2012dec27
#
#####

# «lua-repl» (to ".lua-repl")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-man "1 texlua")
# (find-man "1 texlua" "--luaonly")
texlua -h
luatex --luaonly

* (eepitch-luatex)
* (eepitch-kill)
* (eepitch-luatex)
\directlua{debug.debug()}
dofile "/home/edrx/LUA/lua50init.lua"
PP {1, 2, 3}
PP(sorted(keys(_G)))
print(table.concat(sorted(keys(_G)), " "))

ikeys = function (G) return ipairs(sorted(keys(G))) end
tablep = function (o) return type(o) == "table" end

for _,name in ikeys(_G) do print(name) end
af = "collectgarbage gcinfo"
a = "callback font fontforge fontloader gzip kpse lang lfs ltn12 lua md5 mime mplib node profiler tex texconfig texio unicode"
for _,name in ipairs(split(a)) do print(name, type(_G[name])) end

for _,name in ikeys(callback) do print(name) end
for _,name in ikeys(font) do print(name) end
for _,name in ikeys(fontforge) do print(name) end
for _,name in ikeys(fontloader) do print(name) end
for _,name in ikeys(gzip) do print(name) end
for _,name in ikeys(kpse) do print(name) end
for _,name in ikeys(lang) do print(name) end
for _,name in ikeys(lfs) do print(name) end
for _,name in ikeys(ltn12) do print(name) end
for _,name in ikeys(lua) do print(name) end
for _,name in ikeys(md5) do print(name) end
for _,name in ikeys(mime) do print(name) end
for _,name in ikeys(mplib) do print(name) end
for _,name in ikeys(node) do print(name) end
for _,name in ikeys(profiler) do print(name) end
for _,name in ikeys(tex) do print(name) end
for _,name in ikeys(texconfig) do print(name) end
for _,name in ikeys(texio) do print(name) end
for _,name in ikeys(unicode) do print(name) end


collectgarbage	function
gcinfo	function

callback	table
font	table
fontforge	table
fontloader	table
gzip	table
kpse	table
lang	table
lfs	table
ltn12	table
lua	table
md5	table
mime	table
mplib	table
node	table
profiler	table
tex	table
texconfig	table
texio	table
unicode	table

PP(A)




#####
#
# ConTeXt Lua documents
# 2013jan24
#
#####

# «context-lua» (to ".context-lua")
# http://www.pragma-ade.com/show-man-44.htm
# http://www.pragma-ade.com/general/manuals/cld-mkiv.pdf




#####
#
# luacode
# 2013apr30
#
#####

# «luacode» (to ".luacode")
# (find-angg ".emacs" "luacode")
# (find-sh "locate luacode")
# (find-fline "/usr/share/doc/texlive-luatex/lualatex/luacode/")
# (find-fline "/usr/share/texlive/texmf-dist/tex/lualatex/luacode/luacode.sty")

# (find-angg ".emacs" "luacode")
# (find-luacodepage)
# (find-luacodetext)

# (find-luatexrefpage)
# (find-luatexreftext)

http://www.unirioja.es/cu/jvarona/downloads/numerical-methods-luatex.pdf
tex.print
\directlua

http://www.readytext.co.uk/?p=1449 Lua code to process a LuaTeX node list
http://www.readytext.co.uk/?cat=15 LuaTeX Examples
http://tex.stackexchange.com/questions/70/what-is-a-simple-example-of-something-you-can-do-with-luatex
http://wiki.contextgarden.net/Programming_in_LuaTeX
http://wiki.contextgarden.net/Programming_in_LuaTeX#Parsing_input_without_exploding_your_head

#*
# (defun c  () (interactive) (eev-bounded) (find-zsh0 "ee"))
# (defun cc () (interactive) (eev-bounded) (find-zsh  "ee"))
# (defun d  () (interactive) (find-xpdfpage "/tmp/tikz/test1.pdf"))
# (find-angg ".emacs.papers" "tikz")

mkdir /tmp/tikz/
cd    /tmp/tikz/
cat > test1.tex <<'%%%'
\documentclass{book}
\usepackage{luacode}
\begin{document}

\begin{luacode}
print("Hello!")
a = 22
\end{luacode}

\begin{luacode}
print("Hello!", a)
\end{luacode}

\begin{luacode}
xyfromuv = function (u,v)
    local x = u + v
    local y = u y v
    tex.print(x..",",,y)
  end
\end{luacode}
\def\xyfromuv#1#2{\directlua{xyfromuv(#1, #2)}}


% xyfromt = function (t)
%     xyfromyv(t, 1/t)
%   end
% \def\xyfromt   #1{\directlua{xyfromt(#1)}}




Hello
\end{document}
%%%
lualatex test1.tex
#*








#####
#
# luacode-old
# 2014jun08
#
#####

# «luacode-old» (to ".luacode-old")
# http://wiki.luatex.org/index.php/Writing_Lua_in_TeX
# (find-angg ".emacs" "luatex")
# (find-blogme3 "anggdefs.lua" "setvbuf" "Without a setvbuf errors are")

%*
% (eeluatex-bounded)
% (eeluatex-view)

Hello

% http://wiki.luatex.org/index.php/Writing_Lua_in_TeX
\def\luacode{%
  \bgroup
  \catcode`\{=12
  \catcode`\}=12
  \catcode`\^^M=12
  \catcode`\#=12
  \catcode`\~=12
  \catcode`\%=12
  \doluacode
}
\bgroup
\catcode`\^^M=12 %
\long\gdef\doluacode#1^^M#2\endluacode{\directlua{#2}\egroup}%
\egroup


\luacode
io.stdout:setvbuf("no")           -- for errors
print(2+3)
\endluacode

%*

# Apparently an extension of the \luacode macro that appears at:
# http://wiki.luatex.org/index.php/Writing_Lua_in_TeX

# http://ctan.tche.br/macros/luatex/latex/luacode/
# http://ctan.tche.br/macros/luatex/latex/luacode/luacode.pdf
# http://ctan.tche.br/macros/luatex/latex/luacode/README




#####
#
# luamplib
# 2013may11
#
#####

# «luamplib» (to ".luamplib")
# (find-udfile "texlive-luatex/luatex/luamplib/")
# (find-zsh "dmissing luamp")
# http://wiki.luatex.org/index.php/Metapost_with_LuaTeX
# (find-angg ".emacs" "luatex")
# http://tex.stackexchange.com/questions/23984/how-to-use-mplib-directly-from-lua
# http://tex.stackexchange.com/questions/3750/ploting-a-function-using-mplib-in-lualatex
# http://math.berkeley.edu/computing/wiki/index.php/Tex_sample_embedded_metapost

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
export LUA_INIT=

I am trying to use luamplib to create some drawings, but all my
attempts to follow the recipes that I found at the web are failing at
essentially the same point... for example, this shell code

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
cat > luamplibtest.tex <<'@@@'
\documentclass[a4paper]{article}
\usepackage{luamplib}
\begin{document}
Some text, a drawing (%
\begin{mplibcode}
beginfig(1);
draw (0,0)--(100,0)--(100,100)--(0,100)--cycle;
endfig;
\end{mplibcode}
), more text
\end{document}
@@@

~/bigsrc/luatex-beta-0.79.1/build/texk/web2c/luatex luamplibtest.tex

lualatex luamplibtest.tex






#####
#
# luatex from upstream
# 2014may01
#
#####

# «luatex-upstream» (to ".luatex-upstream")
# «luatex-0.79.1»   (to ".luatex-0.79.1")
# (find-angg ".emacs" "luatex-src")
# http://www.luatex.org/download.html
# https://foundry.supelec.fr/frs/download.php/file/15762/luatex-beta-0.79.1-doc.tar.bz2
# https://foundry.supelec.fr/frs/download.php/file/15763/luatex-beta-0.79.1-source.tar.bz2
# https://foundry.supelec.fr/frs/download.php/file/15766/metapost-1.902-src.tar.bz2
# http://tug.org/pipermail/luatex/2014-May/004829.html on luamplib
# http://tug.org/pipermail/luatex/2014-May/004830.html on compiling 0.79.0
# http://tug.org/pipermail/luatex/2014-May/004831.html use 0.79.1 instead
# http://tug.org/pipermail/luatex/2014-May/004832.html using the .fmt
# http://tug.org/pipermail/luatex/2014-May/004834.html using the .fmt: answer
#*
rm -Rv ~/bigsrc/luatex-beta-0.79.1/
tar -C ~/bigsrc/ -xvjf \
  $S/https/foundry.supelec.fr/frs/download.php/file/15763/luatex-beta-0.79.1-source.tar.bz2
cd     ~/bigsrc/luatex-beta-0.79.1/

find * -type f | sort > .files

# (find-fline "~/bigsrc/luatex-beta-0.79.1/")
# (find-fline "~/bigsrc/luatex-beta-0.79.1/.files")
# (find-fline "~/bigsrc/luatex-beta-0.79.1/build/texk/kpathsea/paths.h")

#*
cd ~/bigsrc/luatex-beta-0.79.1/
./build.sh  |& tee obsh

#*
# (find-fline "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/")
# (find-fline "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/lualatex.ini")
# (find-fline "/var/lib/texmf/web2c/luatex/" "lualatex.fmt")
# (find-fline "~/.texmf-var/web2c/luatex/" "lualatex.fmt")
# (find-fline "~/.texmf-var/web2c/luatex/lualatex.log")




#####
#
# Where is the source for the modified package.searchers of luatex?
# 2017jul10
#
#####

# «luatex-package.searchers» (to ".luatex-package.searchers")
# http://www.lua.org/manual/5.2/manual.html#pdf-package.searchers
# http://www.lua.org/manual/5.2/manual.html#pdf-dofile
# http://www.lua.org/manual/5.2/manual.html#pdf-loadfile
# (find-fline "~/LATEX/dednat6/lualoader.lua")
# (find-fline "~/LATEX/dednat6/lualoader.lua" "assert")

# (code-c-d "luatex0791" "~/bigsrc/luatex-beta-0.79.1/")
# (find-luatex0791file "")
# (find-luatex0791sh "grep INPUT $(cat .files)")
# (find-luatex0791sh "grep -w INPUT $(cat .files)")
# (find-luatex0791grep "grep -nH -e INPUT $(cat .files)")
# (find-luatex0791grep "grep -nHw -e INPUT $(cat .files)")
# (find-luatex0791grep "grep -nH -e recorder_record_input $(cat .files)")
# (find-luatex0791grep "grep -nH -e luatex_dofile $(cat .files)")
# (find-luatex0791grep "grep -nH -e luatex_loadfile $(cat .files)")
# (find-luatex0791grep "grep -nH -e luaopen_package $(cat .files)")
# (find-luatex0791file "source/texk/web2c/lib/openclose.c" "recorder_record_input" "INPUT")
# (find-luatex0791file "source/texk/web2c/luatexdir/lua/luastuff.w")
# (find-luatex0791file "source/texk/web2c/luatexdir/lua/luastuff.w" "recorder_record_input")
# (find-luatex0791file "source/texk/web2c/luatexdir/lua/luastuff.w" "recorder_record_input" "_input")
# (find-luatex0791file "source/texk/web2c/luatexdir/lua/luastuff.w" "L,luatex_dofile")




#####
#
# luatex-0.79.1: mplib (is broken and segfaults)
# 2017jun24
#
#####

# «luatex-0.79.1-mplib» (to ".luatex-0.79.1-mplib")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -v ~/.texmf-var/web2c/luatex/lualatex*
cd /tmp/
~/bigsrc/luatex-beta-0.79.1/build/texk/web2c/luatex '&lualatex'  2>&1 | tee o

#*
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)

rm -v            ~/bin/luatex

cd /tmp/
cat > luamplibtest.tex <<'@@@'
\documentclass[a4paper]{article}
\usepackage{luamplib}
\begin{document}
Some text, a drawing (%
\begin{mplibcode}
beginfig(1);
draw (0,0)--(100,0)--(100,100)--(0,100)--cycle;
endfig;
\end{mplibcode}
), more text
\end{document}
@@@
lualatex luamplibtest.tex

cd /tmp/
cp -v ~/bigsrc/luatex-beta-0.79.1/build/texk/web2c/luatex /tmp/lualatex
./lualatex luamplibtest.tex   2>&1 | tee ot

NEWLUATEXDIR=$HOME/bigsrc/luatex-beta-0.79.1/build/texk/web2c
NEWLUATEX=$NEWLUATEXDIR/luatex

rm -v            /tmp/luatex
cp -v $NEWLUATEX /tmp/
which luatex
PATH=/tmp:$PATH
which luatex

cp -v /usr/share/texlive/texmf-dist/tex/latex/latexconfig/* .

luatex --ini lualatex.ini
luatex --fmt=lualatex luamplibtest.tex

# (find-fline "/etc/texmf/web2c/texmf.cnf")
# (find-fline "~/bigsrc/luatex-beta-0.79.1/source/texk/kpathsea/texmf.cnf")
# (find-fline "/usr/share/texlive/texmf/web2c/texmf.cnf")
# (find-fline "/usr/share/texmf/web2c/texmf.cnf")
# (find-node "(kpathsea)Top")

# (find-sh "locate texmf.cnf")

$NEWLUATEX --ini lualatex.ini
$NEWLUATEX --fmt=lualatex somefile.tex
$NEWLUATEX --fmt=lualatex luamplibtest.tex

#*
# (find-angg ".emacs" "luatex-src")
# (find-luatexsrcfile "")
# (find-luatexsrcfile "INSTALL")
# (find-luatexsrcfile "obsh")
# (find-luatexsrcfile ".files" "source/texk/web2c/mplibdir/")
# (find-luatexsrcfile "source/texk/web2c/mplibdir/")
# (find-luatexsrcfile "build/texk/web2c/" " luatex")





#####
#
# luatex-0.79.1 lualatex.ini file problem (narrowing down to paths)
# 2014may04
#
#####

# «luatex-0.79.1-paths» (to ".luatex-0.79.1-paths")
# (find-fline "~/.texmf-var/web2c/pdftex/")
# (find-sh "locate texmf.cnf")

# (find-fline "/etc/texmf/web2c/texmf.cnf")
# (find-fline "~/bigsrc/luatex-beta-0.79.1/.files")
# (find-fline "~/bigsrc/luatex-beta-0.79.1/source/texk/kpathsea/texmf.cnf")
# (find-fline "/usr/share/texlive/texmf/web2c/texmf.cnf")
# (find-fline "/usr/share/texmf/web2c/texmf.cnf")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
NEWLUATEXDIR=$HOME/bigsrc/luatex-beta-0.79.1/build/texk/web2c
NEWLUATEX=$NEWLUATEXDIR/luatex

rm -v            /tmp/luatex
cp -v $NEWLUATEX /tmp/

cd ~/luatex/
which luatex
PATH=/tmp:$PATH
which luatex

luatex '&lualatex' |& tee o
# (find-sh "cat ~/luatex/o")
# (find-sh "cat ~/luatex/o | tr : '\n'")




luatex --ini lualatex
luatex --fmt=lualatex luamplibtest.tex
luatex --fmt=lualatex luamplibtest.tex

warning
 kpathsea
 configuration file texmf.cnf not found in these directories
 /tmp
/tmp/share/texmf-local/web2c
/tmp/share/texmf-dist/web2c
/tmp/share/texmf/web2c
/tmp/texmf-local/web2c
/tmp/texmf-dist/web2c
/tmp/texmf/web2c
/
//share/texmf-local/web2c
//share/texmf-dist/web2c
//share/texmf/web2c
//texmf-local/web2c
//texmf-dist/web2c
//texmf/web2c
//texmf-local/web2c
/
//share/texmf-local/web2c
//share/texmf-dist/web2c
//share/texmf/web2c
//texmf-local/web2c
//texmf-dist/web2c
//texmf/web2c.








* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
NEWLUATEXDIR=$HOME/bigsrc/luatex-beta-0.79.1/build/texk/web2c
NEWLUATEX=$NEWLUATEXDIR/luatex
$NEWLUATEX --ini lualatex.ini
$NEWLUATEX --fmt=lualatex somefile.tex






https://foundry.supelec.fr/frs/download.php/latestzip/6/luatex-latest.zip

/usr/bin/lualatex




# (find-man "1 luatex")
# (find-man "1 luatex" "fmt")
* (setenv "NEWLUATEXDIR" "/home/edrx/bigsrc/luatex-beta-0.79.1/build/texk/web2c")


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)

NEWLUATEXDIR=$HOME/bigsrc/luatex-beta-0.79.1/build/texk/web2c
NEWLUATEX=$NEWLUATEXDIR/luatex
cd /tmp/
$NEWLUATEX '&latex'  2>&1 | tee o
$NEWLUATEX '&latex' luamplibtest.tex

# (find-fline "/tmp/o")
# (find-fline "/tmp/o" "kpathsea: Running mktexfmt latex.fmt")
# (find-fline "/tmp/o" "/home/edrx/.texmf-var/web2c/pdftex/latex.fmt")
# (find-fline "/tmp/o" "Fatal format file error")

/home/edrx/.texmf-var/web2c/pdftex/latex.fmt

# (find-zsh "w mktexfmt")
# (find-fline "/usr/bin/mktexfmt")
# (find-man "1 mktexfmt")


# (find-fline "~/.texmf-var/web2c/pdftex/")

$NEWLUATEX --fmt=latex luamplibtest.tex





#####
#
# luatex-0.79.1: minimal installation
# 2017jun24
#
#####

# «luatex-0.79.1-minimal» (to ".luatex-0.79.1-minimal")
# Compile with: (to "luatex-0.79.1")
# Check: (find-fline "/tmp/")
#        (find-fline "~/.texmf-var/web2c/")
#        (find-fline "~/.texmf-var/web2c/luatex/")
#        (find-fline "~/bin/")
# See:
# (find-angg ".emacs" "luatex")
# (find-luatexrefpage (+ 4 27) "--fmt=FORMAT")
# (find-luatexreftext (+ 4 27) "--fmt=FORMAT")
# (find-fline "~/bigsrc/luatex-beta-0.79.1/build/texk/web2c/")
# (find-fline "~/bigsrc/luatex-beta-0.79.1/build/texk/web2c/" " luatex")

# «luatex-0.79.1-min-backup» (to ".luatex-0.79.1-min-backup")
# Save Debian's luatex as /usr/bin/luatex-orig,
# and install luatex-0.79.1 as /usr/bin/luatex.
#
sudo mv -iv /usr/bin/luatex \
            /usr/bin/luatex-orig
sudo rm -v  /usr/bin/luatex
ls -lAF    ~/bigsrc/luatex-beta-0.79.1/build/texk/web2c/luatex
sudo cp -s ~/bigsrc/luatex-beta-0.79.1/build/texk/web2c/luatex \
            /usr/bin/luatex

# «luatex-0.79.1-min-fmtutil» (to ".luatex-0.79.1-min-fmtutil")
# Generate .fmt files using luatex-0.79.1.
# Note that the new .fmt files will be put here:
# (find-fline "~/.texmf-var/web2c/luatex/")
#
cd ~/bigsrc/luatex-beta-0.79.1/
fmtutil --byengine luatex    2>&1 | tee ofmtutil

# ^ Fails. See:
# (find-fline              "~/bigsrc/luatex-beta-0.79.1/ofmtutil")
# (find-sh "grep 'fmtutil:' ~/bigsrc/luatex-beta-0.79.1/ofmtutil")

# «luatex-0.79.1-min-revert» (to ".luatex-0.79.1-min-revert")
# Revert: /usr/bin/luatex-orig becomes /usr/bin/luatex.
# (find-fline "/usr/bin/" "luatex-orig")
#
ls -lAF     /usr/bin/luatex*
sudo rm -v  /usr/bin/luatex
sudo mv -iv /usr/bin/luatex-orig /usr/bin/luatex
fmtutil --byengine luatex   2>&1 | tee /tmp/ofmtutil

# (find-fline   "/tmp/ofmtutil")
# (find-sh "sort /tmp/ofmtutil")
# (find-sh "grep 'fmtutil:' /tmp/ofmtutil")




# Generate .fmt files using luatex-0.95.0.
# Note that the new .fmt files will be put here:
# (find-fline "~/.texmf-var/web2c/luatex/")
#
cd ~/usrc/luatex/0.95.0/
fmtutil --byengine luatex    2>&1 | tee ofmtutil


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
laf    ~/.texmf-var/web2c/luatex/
rm -fv ~/.texmf-var/web2c/luatex/*.fmt
rm -fv ~/.texmf-var/web2c/luatex/*.log







#####
#
# luatex-0.90
# 2016apr22
#
#####

# «luatex-0.90» (to ".luatex-0.90")
# http://www.luatex.org/download.html ->
# https://foundry.supelec.fr/projects/luatex
# https://foundry.supelec.fr/frs/download.php/file/15783/beta-0.90.0.doc.tar.xz
# https://foundry.supelec.fr/frs/download.php/file/15782/beta-0.90.0.tar.xz

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
mkdir ~/usrc/luatex/
rm -Rv ~/usrc/luatex/beta-0.90.0.doc/
tar -C ~/usrc/luatex/ -xvJf \
  $S/https/foundry.supelec.fr/frs/download.php/file/15783/beta-0.90.0.doc.tar.xz
cd     ~/usrc/luatex/beta-0.90.0.doc/

rm -Rv ~/usrc/luatex/beta-0.90.0/
tar -C ~/usrc/luatex/ -xvJf \
  $S/https/foundry.supelec.fr/frs/download.php/file/15782/beta-0.90.0.tar.xz
cd     ~/usrc/luatex/beta-0.90.0/

#*
# (find-node "(tar)Option Summary" "--xz")

(code-c-d "luatexdocmanual" "~/usrc/luatex/beta-0.90.0.doc/manual")
;; (find-luatexdocmanualfile "")

# (find-fline    "~/usrc/luatex/beta-0.90.0.doc/manual/")
# (find-fline    "~/usrc/luatex/beta-0.90.0.doc/manual/old/")
# (find-xpdfpage "~/usrc/luatex/beta-0.90.0.doc/manual/luatex.pdf")
# (find-xpdfpage "~/usrc/luatex/beta-0.90.0.doc/manual/old/functionref.pdf")
# (find-xpdfpage "~/usrc/luatex/beta-0.90.0.doc/manual/old/luatexref-t.pdf")
# (find-fline    "~/usrc/luatex/beta-0.90.0/")
# (find-fline    "~/usrc/luatex/beta-0.90.0/manual/")




#####
#
# luatex 0.95.0
# 2017fev01
#
#####

# «luatex-0.95.0» (to ".luatex-0.95.0")
# http://www.luatex.org/download.html
# http://minimals.contextgarden.net/current/bin/luatex/linux-64/bin/
# https://foundry.supelec.fr/projects/luatex
# https://foundry.supelec.fr/frs/?group_id=10&release_id=430#luatex-_0.95.0-title-content
# https://foundry.supelec.fr/frs/download.php/latestfile/6/0.95.0.doc.tar.xz
# https://foundry.supelec.fr/frs/download.php/latestfile/6/0.95.0.tar.xz
# (find-fline "$S/https/foundry.supelec.fr/frs/download.php/latestfile/6/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "~/usrc/luatex/")
rm -Rv ~/usrc/luatex/
mkdir  ~/usrc/luatex/
cd     ~/usrc/luatex/
tar -xJvf $S/https/foundry.supelec.fr/frs/download.php/latestfile/6/0.95.0.doc.tar.xz
tar -xJvf $S/https/foundry.supelec.fr/frs/download.php/latestfile/6/0.95.0.tar.xz
# (find-fline "~/usrc/luatex/0.95.0.doc/manual/")
# (find-fline "~/usrc/luatex/0.95.0/")
# (find-fline "~/usrc/luatex/0.95.0/INSTALL")
# (find-fline "~/usrc/luatex/0.95.0/INSTALL" "build.sh  ")
cd     ~/usrc/luatex/0.95.0/
./build.sh |& tee ob

# (find-fline "~/usrc/luatex/0.95.0/ob")
# (find-fline "~/usrc/luatex/0.95.0/ob" "build/texk/web2c/luatex")
# (find-fline "~/usrc/luatex/0.95.0/build/texk/web2c/" " luatex")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# Adapted from the next block, but **THIS IS NOT WORKING**
# Install and run fmtutil:
# (find-fline "/usr/bin/" "luatex")
# (find-sh "ls -lAF /usr/bin/luatex*")
R
mv -iv /usr/bin/luatex \
       /usr/bin/luatex-orig
rm -v  /usr/bin/luatex
ls -lAF ~/usrc/luatex/0.95.0/build/texk/web2c/luatex
cp -s   ~/usrc/luatex/0.95.0/build/texk/web2c/luatex \
       /usr/bin/luatex
exit
cd ~/usrc/luatex/0.95.0/
fmtutil --byengine luatex |& tee ofmtutil

# Revert:
# (find-fline "/usr/bin/" "luatex-orig")
ls -lAF /usr/bin/luatex*
sudo rm -v  /usr/bin/luatex
sudo mv -iv /usr/bin/luatex-orig /usr/bin/luatex
fmtutil --byengine luatex   |& tee /tmp/ofmtutil
# (find-fline   "/tmp/ofmtutil")
# (find-sh "sort /tmp/ofmtutil")
# (find-sh "grep 'fmtutil:' /tmp/ofmtutil")


# «luatex-0.95.0-doc» (to ".luatex-0.95.0-doc")

;; (find-fline "~/usrc/luatex/0.95.0.doc/manual/")
(code-xpdf     "luatex" "~/usrc/luatex/0.95.0.doc/manual/luatex.pdf")
(code-pdf-text "luatex" "~/usrc/luatex/0.95.0.doc/manual/luatex.pdf")
;; (find-luatexpage)
;; (find-luatextext)




#####
#
# luatex-0.95.0: e-mail about problem installing it
# 2017mar21
#
#####

# «luatex-0.95.0-fmtutil-email» (to ".luatex-0.95.0-fmtutil-email")
# https://mail.google.com/mail/ca/u/0/#sent/15af31cbb31ee32f
# http://tug.org/pipermail/luatex/2017-March/006433.html My original e-mail
# http://tug.org/pipermail/luatex/2017-March/006434.html Norbert's answer
# http://tug.org/pipermail/luatex/2017-March/006435.html my question about \pdfoutput
#
# https://anonscm.debian.org/cgit/debian-tex/texlive-bin.git/tree/debian/patches/debian-builtin-searchpath
# https://anonscm.debian.org/cgit/debian-tex/texlive-bin.git/plain/debian/patches/debian-builtin-searchpath
# https://anonscm.debian.org/cgit/debian-tex/texlive-bin.git/tree/debian/patches/

luatex-0.95.0 on Debian: fmtutil problem

Hi list,

I am trying to compile and use luatex-0.95.0 on a Debian variant -
Trisquel - but I am getting errors at the "fmtutil" step... the error
messages are quite clear but I couldn't find anything on how to build
LuaTeX in a way that makes it look for ".ini" files where Debian puts
them:

  /usr/share/texlive/texmf-dist/tex/latex/latexconfig/dvilualatex.ini
  /usr/share/texlive/texmf-dist/tex/latex/latexconfig/lualatex.ini
  /usr/share/texlive/texmf-dist/tex/plain/config/dviluatex.ini
  /usr/share/texlive/texmf-dist/tex/plain/config/luatex.ini

The script I used is below. I edited it for readability, but after
editing it I tested it a handful of times by sending it line by line
to an Emacs shell buffer to make sure that the bug remains...




# Compile.
# Note that the things in ~/snarf/ are local copies of:
# https://foundry.supelec.fr/frs/download.php/latestfile/6/0.95.0.doc.tar.xz
# https://foundry.supelec.fr/frs/download.php/latestfile/6/0.95.0.tar.xz
#
rm -Rv ~/usrc/luatex/
mkdir  ~/usrc/luatex/
cd     ~/usrc/luatex/
tar -xJvf ~/snarf/https/foundry.supelec.fr/frs/download.php/latestfile/6/0.95.0.doc.tar.xz
tar -xJvf ~/snarf/https/foundry.supelec.fr/frs/download.php/latestfile/6/0.95.0.tar.xz
cd     ~/usrc/luatex/0.95.0/
./build.sh

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)

# Put a texmf.cnf in a place that luatex can see
rm -v /home/edrx/usrc/luatex/0.95.0/build/texmf.cnf
cp -s /usr/share/texlive/texmf-dist/web2c/texmf.cnf \
      /home/edrx/usrc/luatex/0.95.0/build/

sudo mv -iv /usr/bin/luatex /usr/bin/luatex-orig
sudo rm -v  /usr/bin/luatex
ls -lAF    ~/usrc/luatex/0.95.0/build/texk/web2c/luatex
sudo cp -s ~/usrc/luatex/0.95.0/build/texk/web2c/luatex /usr/bin/luatex
fmtutil --byengine luatex
# fmtutil fails with the error message below:

fmtutil: running `luatex -ini   -jobname=dviluatex -progname=dviluatex dviluatex.ini' ...
(...)
fmtutil: /home/edrx/.texmf-var/web2c/luatex/dviluatex.fmt installed.
fmtutil: running `luatex -ini   -jobname=luatex -progname=luatex luatex.ini' ...
This is LuaTeX, Version 0.95.0 (TeX Live 2016)  (INITEX)
 restricted system commands enabled.
(/usr/share/texlive/texmf-dist/tex/plain/config/luatex.ini
(/usr/share/texlive/texmf-dist/tex/generic/config/luatexiniconfig.tex)
(/usr/share/texlive/texmf-dist/tex/generic/config/luatex-unicode-letters.tex
loading Unicode properties)
(/usr/share/texlive/texmf-dist/tex/plain/config/pdfetex.ini
(/usr/share/texlive/texmf-dist/tex/generic/config/pdftexconfig.tex
! Undefined control sequence.
l.3 \pdfoutput
            =1
? 
! Emergency stop.
l.3 \pdfoutput
            =1
!  ==> Fatal error occurred, bad output DVI file produced!
No pages of output.
Transcript written on luatex.log.



# ! Undefined control sequence.
# l.3 \pdfoutput
#             =1
#
# See:
# http://tex.stackexchange.com/questions/283056/luatex-0-85-pdf-primitive-changes-and-format-file-generation

# Revert to the Debian LuaTeX.
#
ls -lAF /usr/bin/luatex*
sudo rm -v  /usr/bin/luatex
sudo mv -iv /usr/bin/luatex-orig /usr/bin/luatex
fmtutil --byengine luatex


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
locate texmf.cnf
laf \
  /etc/texmf/web2c/texmf.cnf \
  /usr/share/texmf/web2c/texmf.cnf \
  /usr/share/texlive/texmf-dist/web2c/texmf.cnf

# (find-fline "/etc/texmf/web2c/texmf.cnf")
# (find-fline "/usr/share/texlive/texmf-dist/web2c/texmf.cnf")





#####
#
# luatex-0.95.0 doesn't have pdfoutput
# 2017mar23
#
#####

# «luatex-0.95.0-pdfoutput» (to ".luatex-0.95.0-pdfoutput")
# http://tex.stackexchange.com/questions/283056/luatex-0-85-pdf-primitive-changes-and-format-file-generation
# (find-angg ".emacs" "luatex-0.95.0")

;; (find-luatex095file "")
;; (find-luatex095sh "find * | grep ini")
# (find-luatex095page (+ 4 30) "2.1.7 The backend primitives \\pdf *")
# (find-luatex095text (+ 4 30) "2.1.7 The backend primitives \\pdf *")

# (find-sh "locate luatex.ini")
# (find-sh "locate lualatex.ini")
# (find-sh "locate luatexiniconfig.tex")
# (find-fline "/usr/share/texlive/texmf-dist/tex/plain/config/luatex.ini")
# (find-fline "/usr/share/texlive/texmf-dist/tex/plain/config/dviluatex.ini")
# (find-fline "/usr/share/texlive/texmf-dist/tex/generic/config/luatexiniconfig.tex")
# (find-fline "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/lualatex.ini")
# (find-fline "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/dvilualatex.ini")
# (find-fline "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/lualatexiniconfig.tex")



Hi Norbert,

this - a slight modification of your first suggestion - made
the luatex-0.95.0 binary in /usr/bin/ able to access texmf.cnf:

  cp -s /usr/share/texlive/texmf-dist/web2c/texmf.cnf \
        ~/usrc/luatex/0.95.0/build/

However, when I run

  fmtutil --byengine luatex

it says this, and aborts:

  fmtutil: running `luatex -ini   -jobname=dviluatex -progname=dviluatex dviluatex.ini' ...
  (...)
  fmtutil: /home/edrx/.texmf-var/web2c/luatex/dviluatex.fmt installed.
  fmtutil: running `luatex -ini   -jobname=luatex -progname=luatex luatex.ini' ...
  This is LuaTeX, Version 0.95.0 (TeX Live 2016)  (INITEX)
   restricted system commands enabled.
  (/usr/share/texlive/texmf-dist/tex/plain/config/luatex.ini
  (/usr/share/texlive/texmf-dist/tex/generic/config/luatexiniconfig.tex)
  (/usr/share/texlive/texmf-dist/tex/generic/config/luatex-unicode-letters.tex
  loading Unicode properties)
  (/usr/share/texlive/texmf-dist/tex/plain/config/pdfetex.ini
  (/usr/share/texlive/texmf-dist/tex/generic/config/pdftexconfig.tex
  ! Undefined control sequence.
  l.3 \pdfoutput
              =1
  ? 
  ! Emergency stop.
  l.3 \pdfoutput
              =1
  !  ==> Fatal error occurred, bad output DVI file produced!
  No pages of output.
  Transcript written on luatex.log.



It seems that I need to change luatex.ini, or one of the files it
"\input"s, to make it run something like the compatibility code in the
section "2.1.7 The backend primitives \pdf *" of the manual, because
recent luatexes have fewer "\pdf*" primitives that the luatex in
Debian...

Is there a standard way to do that? Where can I find the ".ini"s for
recent luatexes?

  Cheers & thanks,
    Eduardo Ochs
    eduardoochs@gmail.com
    http://angg.twu.net/
    http://angg.twu.net/LATEX/2017planar-has.pdf


# (find-fline "~/.texmf-var/web2c/luatex/")



#####
#
# luatex from Sid
# 2017mar23
#
#####

# «luatex-from-sid» (to ".luatex-from-sid")
# https://linuxaria.com/howto/how-to-install-a-single-package-from-debian-sid-or-debian-testing
# https://wiki.debian.org/DebianUnstable
# https://packages.debian.org/sid/texlive-binaries
# https://packages.debian.org/source/sid/texlive-bin
# https://packages.debian.org/source/sid/texlive-base
# http://http.debian.net/debian/pool/main/t/
# http://http.debian.net/debian/pool/main/t/texlive-bin/
# http://http.debian.net/debian/pool/main/t/texlive-bin/texlive-bin_2016.20160513.41080.dfsg-1.dsc

rm -Rv ~/usrc/texlive-bin/
mkdir  ~/usrc/texlive-bin/
cd $S/http/http.debian.net/debian/pool/main/t/texlive-bin/
cp -v texlive-bin_2016.20160513.41080.dfsg* ~/usrc/texlive-bin/
cd     ~/usrc/texlive-bin/
dpkg-source -sn -x texlive-bin_2016.20160513.41080.dfsg-1.dsc
cd     ~/usrc/texlive-bin/texlive-bin-2016.20160513.41080.dfsg/
dpkg-buildpackage -us -uc -b -rfakeroot     |& tee odb

(code-c-d "texlivebin" "~/usrc/texlive-bin/texlive-bin-2016.20160513.41080.dfsg/")
;; (find-texlivebinfile "")
;; (find-texlivebinsh "find * | grep ini")
# (find-sh "apt-file find luatex.ini")
# (find-vldifile "texlive-base.list")
# (find-vldifile "texlive-base.list" "/luatex.ini")

configure: error: did not find poppler 0.30 or better




#####
#
# LuaTeX from Sid: finding the .ini files
# 2017mar26
#
#####

# «luatex-from-sid-inis» (to ".luatex-from-sid-inis")
# https://packages.debian.org/source/sid/texlive-base
# http://http.debian.net/debian/pool/main/t/texlive-base/
# http://http.debian.net/debian/pool/main/t/texlive-base/texlive-base_2016.20170123-5.dsc
# http://http.debian.net/debian/pool/main/t/texlive-base/texlive-base_2016.20170123-5.debian.tar.xz
# http://http.debian.net/debian/pool/main/t/texlive-base/texlive-base_2016.20170123.orig.tar.xz 276M
# http://http.debian.net/debian/pool/main/t/texlive-base/texlive-base_2016.20170123-5_all.deb

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rv ~/usrc/texlive-base/
mkdir  ~/usrc/texlive-base/
cd     ~/usrc/texlive-base/
ar t $S/http/http.debian.net/debian/pool/main/t/texlive-base/texlive-base_2016.20170123-5_all.deb
ar p $S/http/http.debian.net/debian/pool/main/t/texlive-base/texlive-base_2016.20170123-5_all.deb \
  data.tar.xz | tar -xvJf -

# (find-fline "~/usrc/texlive-base/usr/share/texlive/texmf-dist/tex/generic/tex-ini-files/")
# (find-fline "~/usrc/texlive-base/usr/share/texlive/texmf-dist/tex/generic/unicode-data/")
# (find-fline "~/usrc/tex-ini-files/")
rm -Rv ~/usrc/tex-ini-files/
mkdir  ~/usrc/tex-ini-files/
cd     ~/usrc/tex-ini-files/
cp -v  ~/usrc/texlive-base/usr/share/texlive/texmf-dist/tex/generic/tex-ini-files/* .
cp -v  ~/usrc/texlive-base/usr/share/texlive/texmf-dist/tex/generic/unicode-data/* .

# (find-fline "~/usrc/tex-ini-files/")

* (setenv   "TLC" "/usr/share/texlive/texmf-dist/tex/plain/config")
* (code-c-d "TLC" "/usr/share/texlive/texmf-dist/tex/plain/config/")
* (setenv   "TLL" "/usr/share/texlive/texmf-dist/tex/latex/latexconfig")
* (code-c-d "TLL" "/usr/share/texlive/texmf-dist/tex/latex/latexconfig/")
* (setenv   "TLB" "~/usrc/texlive-base")
* (code-c-d "TLB" "~/usrc/texlive-base/")
* (setenv   "TLI" "~/usrc/texlive-base/usr/share/texlive/texmf-dist/tex/generic/tex-ini-files")
* (code-c-d "TLI" "~/usrc/texlive-base/usr/share/texlive/texmf-dist/tex/generic/tex-ini-files/")
# (find-TLBfile "")
# (find-TLCfile "")
# (find-TLLfile "")
# (find-TLIfile "")
# (find-TLBsh "find * | grep ini")
# (find-TLBsh "find * | grep load-unicode-data.tex")
# (find-TLBfile "usr/share/texlive/texmf-dist/tex/generic/unicode-data/" "load-unicode-data.tex")

tkdiff $TLC/luatex.ini   $TLI/luatex.ini
tkdiff $TLL/lualatex.ini $TLI/lualatex.ini

# (find-sh "locate lualatex.ini")
# (find-sh "locate kpathsea")

# https://anonscm.debian.org/cgit/debian-tex/texlive-bin.git/plain/debian/patches/debian-builtin-searchpath
# (find-fline "$S/https/anonscm.debian.org/cgit/debian-tex/texlive-bin.git/plain/debian/patches/debian-builtin-searchpath")
# (find-node "(kpathsea)Top")
# (find-node "(kpathsea)Supported file formats")

cd ~/usrc/luatex/0.95.0/
TEXINPUTS=$HOME/usrc/tex-ini-files/: \
  fmtutil --byengine luatex |& tee ofmtutil

# (find-sh "locate load-unicode-data.tex")








# (find-status   "luatex")
# (find-vldifile "luatex.list")
# (find-udfile   "luatex/")

apt-cache showsrc luatex

# (find-fline "/var/cache/apt/apt-file/")
http://fr.archive.trisquel.info/trisquel/dists/belenos/


Hi Norbert,

I am using Trisquel, in its stable ("Belenos") version... the
/usr/bin/luatex that comes with it says that its version is:

  This is LuaTeX, Version beta-0.76.0-2013121407 (rev 4627)

it comes from a "luatex_0.76.0-3ubuntu1_amd64.deb" that came from this
place,

  http://fr.archive.trisquel.info/trisquel/pool/main/l/luatex/

the date of the .deb there is 2013dec14 - quite old.



I can try to download, compile and install texlive-bin from Sid

  https://packages.debian.org/source/sid/texlive-bin

if you think it's a good idea... that package is from 20160513.





I can try to download, compile and install "texlive-binaries",
"texlive-luatex" and friends from Sid from these or similar places,

  https://packages.debian.org/sid/texlive-luatex
  https://packages.debian.org/sid/texlive-binaries
  http://ftp.debian.org/debian/pool/main/t/texlive-bin/
  http://ftp.debian.org/debian/pool/main/t/texlive-bin/texlive-bin_2016.20160513.41080.dfsg-1.dsc
  http://ftp.debian.org/debian/pool/main/t/texlive-bin/texlive-binaries_2016.20160513.41080.dfsg-1_amd64.deb

if you think it's a good idea, 

  https://en.wikipedia.org/wiki/Trisquel#Release_history














#####
#
# fmtutil
# 2014may10
#
#####

# «fmtutil» (to ".fmtutil")
# http://tug.org/pipermail/luatex/2014-May/004834.html
# http://tug.org/pipermail/luatex/2016-September/006187.html
# http://tug.org/pipermail/luatex/2016-September/006190.html
# (find-fline "~/.texmf-var/web2c/")

# (find-sh "locate bin/luatex")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
R
mv -iv /usr/bin/luatex \
       /usr/bin/luatex-orig
cp -iv ~/bigsrc/luatex-beta-0.79.1/build/texk/web2c/luatex \
       /usr/bin/luatex
exit
fmtutil --byengine luatex |& tee /tmp/o791

# (find-fline "~/luatex/")
cd ~/luatex/
lualatex luamplibtest.tex |& tee /tmp/ol791


# (find-man "1 fmtutil")
# (find-man "1 fmtutil")

fmtutil --all |& tee /tmp/o
# (find-fline "/tmp/o")

R
mv -v /usr/bin/luatex-orig \
      /usr/bin/luatex
exit

https://www.tug.org/texlive/pretest.html

http://www.preining.info/blog/2014/04/tex-live-news-2013-frozen-2014-pretest-2014-debian/
https://www.preining.info/blog/2014/04/debian-tex-live-preliminary-packages-2014/




#####
#
# LUA_INIT
# 2014jul01
#
#####

# «LUA_INIT» (to ".LUA_INIT")
# (find-sfc "zhas.tex")
# (find-angg "LUA/lua50init.lua")

* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
= os.getenv("LUA_INIT")
= os.getenv("LUA_INIT"):sub(2)

dofile(os.getenv("LUA_INIT"):sub(2))




#####
#
# picture-mode
# 2015feb10
#
#####

# «picture-mode» (to ".picture-mode")
# (find-es "tex" "picture_mode")
# (find-es "tex" "ovals")
# (find-kopkadaly4page (+ 12 288) "13.1   The picture environment")
# (find-kopkadaly4text            "13.1   The picture environment")
# (find-kopkadaly4page (+ 12 296) "\\oval(x dimen,y dimen)[part]")
# (find-kopkadaly4text            "\\oval(x dimen,y dimen)[part]")
# (find-kopkadaly4page (+ 12 301) "13.1.6 Shifting a picture environment")
# (find-kopkadaly4text            "13.1.6 Shifting a picture environment")
# (find-angg ".emacs.papers" "kopkadaly")




#####
#
# DVI output
# 2015feb11
#
#####

# «dvi-output» (to ".dvi-output")
# (find-man "1 texlua")
# (find-man "1 texlua" "--output-format=FORMAT")



#####
#
# package.loaders
# 2015feb11
#
#####

# «package.loaders» (to ".package.loaders")
# (find-angg ".emacs" "luatex")
# (find-luatexrefpage (+ 4  26) "3.2 LUA changes" "3.2 LUA changes")
# (find-luatexreftext (+ 4  26) "3.2 LUA changes" "3.2 LUA changes")
# (find-lua51manualw3m "#pdf-package.loaders")

# (find-google-links "luatex package.loaders")
# http://www.google.com.br/search?tbm=isch&q=luatex+package.loaders
# http://ctan.math.washington.edu/tex-archive/macros/luatex/generic/luatexbase/luatexbase-loader.pdf
# http://tug.org/pipermail/luatex/2010-March/001430.html
# http://ctan.mackichan.com/macros/luatex/generic/luatexbase/luatexbase-loader.dtx

# (find-sh "locate luatexbase")
# (find-zsh "dmisiing luatexbase")
# (find-fline "/usr/share/doc/texlive-luatex/luatex/luatexbase/")
(code-xpdf     "luatexbaseloader" "/usr/share/doc/texlive-luatex/luatex/luatexbase/luatexbase-loader.pdf")
(code-pdf-text "luatexbaseloader" "/usr/share/doc/texlive-luatex/luatex/luatexbase/luatexbase-loader.pdf")
(code-xpdf     "luatexbasemodutils" "/usr/share/doc/texlive-luatex/luatex/luatexbase/luatexbase-modutils.pdf")
(code-pdf-text "luatexbasemodutils" "/usr/share/doc/texlive-luatex/luatex/luatexbase/luatexbase-modutils.pdf")
# (find-luatexbaseloaderpage)
# (find-luatexbaseloadertext)
# (find-luatexbasemodutilspage)
# (find-luatexbasemodutilstext)

# http://ctan.mackichan.com/macros/luatex/generic/luatexbase/luatexbase-loader.dtx

# http://tug.org/pipermail/luatex/2015-February/005071.html

# (find-books "__comp/__comp.el" "ierusalimschy")
# (find-pil2page (+ 19 138) "15.1     The require Function")
# (find-pil2text (+ 19 138) "15.1     The require Function")
# http://www.lua.org/manual/5.1/manual.html#pdf-package.loaders
# (find-lua51manualw3m "#pdf-package.loaders")
#
# (find-fline "~/LOGS/2015feb16.lua")
# http://lua-users.org/wiki/LuaModulesLoader
# http://lua-users.org/wiki/BinaryModulesLoader
# https://git.octaforge.org/tools/octascript.git/tree/octascript/std/init.lua#n441





#####
#
# make "require" in lualatex respect package.path
# 2015feb16
#
#####

# «require» (to ".require")
# http://tug.org/pipermail/luatex/2015-February/005071.html (problem)
# http://tug.org/pipermail/luatex/2015-February/005073.html (solution)

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# Download luarepl-0.5 and untar it into /tmp/lua-repl-0.5/
cd /tmp/
wget https://github.com/hoelzro/lua-repl/archive/0.5.tar.gz
tar -C /tmp/ -xvzf /tmp/0.5.tar.gz

# Create /tmp/lualoader.lua
cat    > /tmp/lualoader.lua <<'%%%'
-- From http://lua-users.org/wiki/LuaModulesLoader
local function lualoader(modulename)
  local errmsg = ""
  -- Find source
  local modulepath = string.gsub(modulename, "%.", "/")
  for path in string.gmatch(package.path, "([^;]+)") do
    local filename = string.gsub(path, "%?", modulepath)
    local file = io.open(filename, "rb")
    if file then
      -- Compile and return the module
      return assert(loadstring(assert(file:read("*a")), filename))
    end
    errmsg = errmsg.."\n\tno file '"..filename.."' (checked with custom loader)"
  end
  return errmsg
end
--
-- See http://www.lua.org/manual/5.1/manual.html#pdf-package.loaders
table.insert(package.loaders, 2, lualoader)
--
-- See also: http://lua-users.org/wiki/BinaryModulesLoader
%%%

# Create /tmp/myrepl.lua
cat    > /tmp/myrepl.lua <<'%%%'
repldir      = "/tmp/lua-repl-0.5/"
package.path = ""
package.path = repldir.."?/init.lua;"..package.path
package.path = repldir.."?.lua;"     ..package.path
repl         = require "repl"
sync         = require "repl.sync"
function sync:showprompt(p) io.write(p == ">" and ">>> " or ">>>> ") end
function sync:lines() return io.stdin:lines() end
function sync:displayerror(err) print(err) end
function sync:displayresults(results)
    if results.n == 0 then return end
    print(unpack(results, 1, results.n))
  end
print()
sync:run()
%%%

# Create /tmp/myrepl.tex
cat    > /tmp/myrepl.tex <<'%%%'
\documentclass{book}
\begin{document}
\directlua{dofile "lualoader.lua"}
\directlua{dofile "myrepl.lua"}
\end{document}
%%%

# Run LuaRepl from LuaLaTeX - the prompt will be ">>> "
cd /tmp/
lualatex myrepl.tex





#####
#
# lualatex-repl
# 2015feb17
#
#####

# «lualatex-repl» (to ".lualatex-repl")
# (find-angg ".emacs" "lualatex-repl")

# Brainstorm with Rob Hoelz in 2015feb17:
# (find-fline "~/LOGS/2015feb17.hoelzro")




#####
#
# nodes
# 2015feb22
#
#####

# «nodes» (to ".nodes")
# http://www.readytext.co.uk/?p=1449 Lua code to process a LuaTeX node list
# https://gist.github.com/pgundlach/556247
# (find-luatexrefpage (+ 4  90) "The node library")
# (find-luatexreftext (+ 4  90) "The node library")
# http://tug.org/pipermail/luatex/2011-July/thread.html
# http://tug.org/pipermail/luatex/2011-July/003115.html
# http://tug.org/pipermail/luatex/2011-July/003116.html
# http://wiki.luatex.org/index.php/TeX_without_TeX




#####
#
# TeX without TeX
# 2015feb22
#
#####

# «tex-without-tex» (to ".tex-without-tex")
# http://wiki.luatex.org/index.php/TeX_without_TeX
# (find-fline "$S/http/wiki.luatex.org/index.php/TeX_without_TeX.src")

# (find-LATEX "twot-myprogram.lua")
# https://raw.github.com/gist/1062041/d3de082e955f6535f3820742cef76fe9e50d5a6f/myprogram.lua
# https://gist.github.com/pgundlach/1063228

* (eepitch-ltrepl)
* (eepitch-kill)
* (eepitch-ltrepl)
dofile "twot-boxes.lua" -- (find-LATEX "twot-boxes.lua")
tex.box[0] = vbox
tex.print("\\box0")


* (eepitch-ltrepl)
* (eepitch-kill)
* (eepitch-ltrepl)
newrule = function (depth, height, width)
    local r  = node.new("rule")
    r.depth  = depth
    r.height = height
    r.width  = width
    return r
  end
--
pt = 65536
r1 = newrule(2*pt, 4*pt, 2*pt)
r2 = newrule(3*pt, 6*pt, 3*pt)
r1.next = r2
r2.prev = r1
--
hbox = node.hpack(r1)
tex.box[0] = hbox
tex.print("\\box0")



* (eepitch-ltrepl)
* (eepitch-kill)
* (eepitch-ltrepl)
dofile "twot-pages.lua" -- (find-LATEX "twot-pages.lua")


* (eepitch-ltrepl)
* (eepitch-kill)
* (eepitch-ltrepl)
dofile "twot-paragraph.lua" -- (find-LATEX "twot-paragraph.lua")
node.write(vbox)





#####
#
# Traversing a paragraph (using an example from TeX_without_TeX)
# 2015feb24
#
#####

# «traversing-a-paragraph» (to ".traversing-a-paragraph")
# http://wiki.luatex.org/index.php/TeX_without_TeX
# http://wiki.luatex.org/images/Nodes_in_sample_paragraph.png
# (find-LATEX "twot.tex")
# (find-xpdfpage "~/LATEX/twot.pdf")

* (eepitch-ltrepl)
* (eepitch-kill)
* (eepitch-ltrepl)
dofile "twot-paragraph.lua" -- (find-LATEX "twot-paragraph.lua")

= vbox -- glue
= vbox.next -- hlist
= vbox.next.head                               -- glue
= vbox.next.head.next                          -- glyph
= vbox.next.head.next.char                     --  65="A"
= vbox.next.head.next.next                     -- glue
= vbox.next.head.next.next.next                -- glyph
= vbox.next.head.next.next.next.char           --  119="w"
= vbox.next.head.next.next.next.next           -- kern
= vbox.next.head.next.next.next.next.next      -- glyph
= vbox.next.head.next.next.next.next.next.char --  111="o"

= vbox.next.next -- penalty
= vbox.next.next.next -- glue
= vbox.next.next.next.next -- hlist
= vbox.next.next.next.next.head                -- glyph
= vbox.next.next.next.next.head.char           -- 109="m"
= vbox.next.next.next.next.head.next           -- kern
= vbox.next.next.next.next.head.next.next      -- glyph
= vbox.next.next.next.next.head.next.next.char -- 121="y"

= vbox.next.next.next.next.next -- nil

node.write(vbox)




** Old stuff:
* (eepitch-ltrepl)
* (eepitch-kill)
* (eepitch-ltrepl)
dofile "twot-paragraph.lua" -- (find-LATEX "twot-paragraph.lua")

= vbox
= type(vbox)
== getmetatable(vbox)
-- (find-luatexrefpage (+ 4  90) "The node library")
-- (find-luatexreftext (+ 4  90) "The node library")

= vbox.id
= vbox.subtype
== node.types()
=  node.types()[vbox.id]
-- (find-luatexrefpage (+ 4 163) "node.types()")
-- (find-luatexreftext (+ 4 163) "node.types()")
-- (find-luatexrefpage (+ 4 163) "8.1.1.1 glue_spec items")
-- (find-luatexreftext (+ 4 163) "8.1.1.1 glue_spec items")
-- (find-luatexrefpage (+ 4 165) "8.1.2.1 hlist nodes")
-- (find-luatexreftext (+ 4 165) "8.1.2.1 hlist nodes")
-- (find-luatexrefpage (+ 4 168) "8.1.2.8 math nodes")
-- (find-luatexreftext (+ 4 168) "8.1.2.8 math nodes")
-- (find-luatexrefpage (+ 4 168) "8.1.2.9 glue nodes")
-- (find-luatexreftext (+ 4 168) "8.1.2.9 glue nodes")
-- (find-luatexrefpage (+ 4 169) "8.1.2.12 glyph nodes")
-- (find-luatexreftext (+ 4 169) "8.1.2.12 glyph nodes")
-- (find-luatexrefpage (+ 4 143) "6.1 Characters and glyphs")
-- (find-luatexreftext (+ 4 143) "6.1 Characters and glyphs")

= vbox      -- glue
= vbox.spec -- glue_spec





#####
#
# getting glyph data
# 2015feb26
#
#####

# «getting-glyph-data» (to ".getting-glyph-data")
* (eepitch-ltrepl2)
* (eepitch-kill)
* (eepitch-ltrepl2)
!\setbox0=\hbox{abc}
!\setbox0=\hbox{a$\{\},$}

= tex.box[0] -- hlist
= tex.box[0].head -- glyph
= tex.box[0].head.next -- math
= tex.box[0].head.next.next -- glyph
= tex.box[0].head.next.next.next -- glyph
= tex.box[0].head.next.next.next.next -- glyph
= tex.box[0].head.next.next.next.next.next -- math
= tex.box[0].head.next.next.next.next.next.next -- nil

= tex.box[0].head.next.next                -- glyph
= tex.box[0].head.next.next.char           --  102
= tex.box[0].head.next.next.next           -- glyph
= tex.box[0].head.next.next.next.char      --  103
= tex.box[0].head.next.next.next.next      -- glyph
= tex.box[0].head.next.next.next.next.char --  59


# (find-angg ".emacs.papers" "texbook")
# (find-texbookpage (+ 11 427) "Font tables")
# (find-texbookpage (+ 12 430) "cmmi10")





#####
#
# using tex.inputlineno to obtain the current line
# 2015feb22
#
#####

# «tex.inputlineno» (to ".tex.inputlineno")
# (find-luatexrefpage (+ 4 110) "tex.jobname")
# (find-luatexreftext (+ 4 110) "tex.jobname")
# (find-luatexrefpage (+ 4 110) "tex.inputlineno")
# (find-luatexreftext (+ 4 110) "tex.inputlineno")

# «tex.inputlineno-repl» (to ".tex.inputlineno-repl")

* (eepitch-ltrepl)
* (eepitch-kill)
* (eepitch-ltrepl)
= tex.inputlineno
= tex.jobname

bigstr = readfile(tex.jobname..".tex")
lines = splitlines(bigstr)
= tex.inputlineno
= lines[tex.inputlineno]



# «tex.inputlineno-tex» (to ".tex.inputlineno-tex")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/

cat > test1.tex <<'%%%'
\documentclass{book}
\begin{document}
\directlua{print()}
\directlua{print(4, tex.inputlineno)}  % print(4, 4)
\directlua{print(5, tex.inputlineno)}  % print(5, 5)
\directlua{tex.inputlineno = tex.inputlineno + 4}
7
8
9
10
11
12
13
14
\directlua{print(15, tex.inputlineno)}  % print(15, 10) <-- why???
\end{document}
%%%

lualatex test1.tex


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/

cat > test.lua <<'%%%'
readfile = function (fname)
    local f = assert(io.open(fname, "r"))
    local bigstr = f:read("*a")
    f:close()
    return bigstr
  end
split = function (str, wordpat)
    local arr = {}
    for word in str:gmatch(wordpat or "([^%s]+)") do
      table.insert(arr, word)
    end
    return arr
  end
splitlines = function (bigstr)
    local arr = split(bigstr, "([^\n]*)\n?")
    table.remove(arr)
    return arr
  end

bigstr = readfile(tex.jobname..".tex")
lines  = splitlines(bigstr)
pl     = function () print(tex.inputlineno, lines[tex.inputlineno]) end
%%%

cat > test1.tex <<'%%%'
\documentclass{book}
\begin{document}
\directlua{dofile "test.lua"}
\directlua{print()}
\directlua{pl()} % a
\directlua{pl()} % bb
\directlua{pl()} % ccc
\end{document}
%%%

lualatex test1.tex





#####
#
# skipping lines
# 2015mar04
#
#####

# «skipping-lines» (to ".skipping-lines")
# (find-texbookpage (+ 12 37) "7: How TEX Reads What You Type")
# (find-texbooktext (+ 12 37) "7: How TEX Reads What You Type")
# http://www.readytext.co.uk/?p=1449 Lua code to process a LuaTeX node list
# http://www.readytext.co.uk/?cat=15 LuaTeX Examples
# http://tex.stackexchange.com/questions/70/what-is-a-simple-example-of-something-you-can-do-with-luatex
# http://wiki.contextgarden.net/Programming_in_LuaTeX
# http://wiki.contextgarden.net/Programming_in_LuaTeX#Parsing_input_without_exploding_your_head




#####
#
# The token library
# 2015mar05
#
#####

# «token-library» (to ".token-library")
# (find-luatexrefpage (+ 4 37) "4.1.3.3 token_filter")
# (find-luatexreftext (+ 4 37) "4.1.3.3 token_filter")
# (find-luatexrefpage (+ 4 126) "4.16 The token library")
# (find-luatexreftext (+ 4 126) "4.16 The token library")
# (find-texbookpage (+ 12 37)  "5      End of line")
# (find-texbooktext (+ 12 37)  "5      End of line")
# (find-texbookpage (+ 12 37) "10      Space")
# (find-texbooktext (+ 12 37) "10      Space")
# (find-texbookpage (+ 12 37) "11      Letter")
# (find-texbooktext (+ 12 37) "11      Letter")
# (find-texbookpage (+ 12 37) "12      Other character")
# (find-texbooktext (+ 12 37) "12      Other character")
# (find-texbookpage (+ 12 37) "13      Active character")
# (find-texbooktext (+ 12 37) "13      Active character")
# (find-texbookpage (+ 12 343) "\\chardef\\active=13")
# (find-texbooktext (+ 12 343) "\\chardef\\active=13")
# (find-texbookpage (+ 12 352) "\\gdef\\obeylines{\\catcode`\\^^M=\\active")
# (find-texbooktext (+ 12 352) "\\gdef\\obeylines{\\catcode`\\^^M=\\active")
# (find-texbookpage (+ 12 39))
# (find-texbookpage (+ 12 271) "codename")
# (find-texbooktext (+ 12 271) "codename")
# (find-texbookpage (+ 12 461) "*\\catcode")
# (find-texbooktext (+ 12 461) "*\\catcode")
# (find-luatexrefpage (+ 4 111) "tex.catcode")
# (find-luatexreftext (+ 4 111) "tex.catcode")

# (find-LATEXfile "diagxy.tex" "\\catcode`\\@=12")
# (find-LATEXfile "diagxy.tex" "\\catcode`\\@=11")
# (find-fline "/usr/share/texlive/texmf-dist/tex/plain/base/plain.tex")

\gdef\obeylines{\catcode`\^^M=\active}
\def\makecreol  {\catcode`\^^M=5}
\def\makecrother{\catcode`\^^M=12}

# http://www.ntg.nl/pipermail/dev-luatex/2007-March/000454.html
# http://tug.org/pipermail/luatex/2014-February/004761.html Using the token_filter callback only for 'some tokens'
# http://tex.stackexchange.com/questions/135319/tracing-group-level-and-position-in-luatex
# http://tug.org/pipermail/luatex/2012-April/003588.html Use cases for the token library
# http://tex.stackexchange.com/questions/45293/can-the-lua-part-of-luatex-know-about-tokens
# http://www.gust.org.pl/bachotex/2014-pl/presentations/luatextalk.pdf
# https://www.gutenberg.eu.org/IMG/pdf/luatextl.pdf



# «makecrspecial-1» (to ".makecrspecial-1")
# (find-LATEX "tmp.tex")

\directlua{
foo = function (c, newcatcode, n)
    print()
    oldcatcode = tex.catcode[c]
    tex.catcode[c] = newcatcode
    print("tex.catcode["..c.."] "..oldcatcode.." -> "..newcatcode)
    for i=1,n do PP(i, token.get_next()) end
    tex.catcode[c] = oldcatcode
  end
}

\directlua{foo(13, 5, 4)}ab
cd

\directlua{foo(13, 12, 6)}ab

cd




#####
#
# Making CR of catcode "other"
# 2015mar06
#
#####

# «makecrother» (to ".makecrother")
# https://mail.google.com/mail/ca/u/0/#search/luatex/14bf1b4a6c4c34ea
# http://tug.org/pipermail/luatex/2015-March/005079.html edrx
# http://tug.org/pipermail/luatex/2015-March/005080.html elie

# creating a "verbatim"-like catcode table from Lua

Hi list,

this code uses token.getnext() to "eat" the CR immediately after the
\directlua{...} and the lines that say "one", "two two", and "three
three three" before returning control to LaTeX's parser:

  cd /tmp/
  cat > test.tex <<'%%%'
  \documentclass{book}
  \begin{document}
  \directlua{
  makecrendofline = function () tex.catcode[13] = 5  end
  makecrother     = function () tex.catcode[13] = 12 end
  nextchar = function () return token.get_next()[2] end
  eatline  = function () repeat until nextchar() == 13 end
  makecrother()
  for i=1,4 do eatline() end
  makecrendofline()
  }
  one
  two two
  three three three
  four four four four
  five five five five five
  \end{document}
  %%%
  lualatex test.tex
  xpdf test.pdf

We can use that idea, combined with something like this,

  texfile = readfile(tex.jobname..".tex")
  lines   = splitlines(texfile)
  for i=0,10 do dosomethingwith(lines[tex.inputlineno + 1]) end

to make Lua interpret the lines after a certain point, and then make
TeX's parser skip them.

The catcode trick that I used above is quite fragile, though - it will
not notice CRs in comments, for example. It would be better to use a
pre-prepared catcode table like the one that "verbatim" uses, instead
of just changing the catcodes of CR, %, and a few other chars.

How do I construct a "verbatim"-ish catcode table? How do I save it
and activate it? Is there a way to do that from pure Lua? How do I
check, for a given number n, if the catcode table "n" exists? I saw in
the reference manual that there are primitives \initcatcodetable and
\savecatcodetable... so there is a way to do that mixing TeX and Lua.

  Thanks in advance! Pointers appreciated!...
  Cheers,
    Eduardo Ochs
    eduardoochs@gmail.com
    http://angg.twu.net/



# «luatexbase-cctb» (to ".luatexbase-cctb")
# http://tug.org/pipermail/luatex/2015-March/005079.html edrx
# http://tug.org/pipermail/luatex/2015-March/005080.html elie
# https://github.com/lualatex/luatexbase/blob/master/luatexbase-cctb.dtx#L510
# (find-sh "locate luatexbase")
# (find-sh "locate luatexbase-cctb")
# (find-fline "/usr/share/texlive/texmf-dist/tex/luatex/luatexbase/luatexbase-cctb.sty")
# (find-udfile "texlive-luatex/luatex/luatexbase/")
# (find-fline "/usr/share/doc/texlive-luatex/luatex/luatexbase/")
# (code-xpdf     "luatexbasecctb" "/usr/share/doc/texlive-luatex/luatex/luatexbase/luatexbase-cctb.pdf")
# (code-pdf-text "luatexbasecctb" "/usr/share/doc/texlive-luatex/luatex/luatexbase/luatexbase-cctb.pdf")
# (find-luatexbasecctbpage)
# (find-luatexbasecctbtext)
# (find-luatexbasecctbpage 6 "2.2      Lua module")
# (find-luatexbasecctbtext 6 "2.2      Lua module")

* (eepitch-lltr)
* (eepitch-kill)
* (eepitch-lltr)
PP(catcodetables)




#####
#
# TeX macros from Lua
# 2015feb22
#
#####

# «macros» (to ".macros")
# http://tug.org/pipermail/luatex/2011-June/002894.html macros




#####
#
# catcodes for utf-8 chars above 256
# 2015mar24
#
#####

# «high-catcodes» (to ".high-catcodes")
# (find-LATEX "tmp.tex")
# (find-efunctiondescr 'find-einsert)
# (find-einsert '((8592 9167)))
# (find-einsert '((8704 8747)))
# (find-LATEX "edrx.sty" "glyphs")
# (find-LATEX "edrx15chars.tex")



#####
#
# inspecting catcodes from Lua
# 2016oct07
#
#####

# «catcodes» (to ".catcodes")
# (find-LATEX "2016-2-GA-algebra.tex" "repl")
# (find-angg ".emacs" "luatex")
# (find-luatexrefpage (+ 4 113) "4.14.1.1 Integer parameters")
# (find-luatexreftext (+ 4 113) "4.14.1.1 Integer parameters")
# (find-luatexrefpage (+ 4 114)   "tex.catcodetable")
# (find-luatexreftext (+ 4 114)   "tex.catcodetable")
# (find-LATEX "edrxchars.tex" "\\Delta")
# (find-texbookpage (+ 12 37) "13      Active character")
# (find-texbooktext (+ 12 37) "13      Active character")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/LATEX/
REPL=1 lualatex -record 2016-2-GA-algebra.tex
PP(tex.catcodetable)
PP(tex.getcatcode(32))
PP(tex.getcatcode(33))
PP(tex.getcatcode(65))
PP(tex.getcatcode(66))
PP(tex.getcatcode(914))  -- uppercase alpha: 11 (letter)
PP(tex.getcatcode(916))  -- uppercase delta: 13 (active)
PP(tex.getcatcode(257))
for i=0,2000 do if tex.getcatcode(i)==13 then printf(" %d", i) end end; print()




#####
#
# inspecting defs from Lua
# 2016oct07
#
#####

# «inspecting-defs» (to ".inspecting-defs")
# (find-luatexrefpage (+ 4 135) "4.17.5 token.create")
# (find-luatexreftext (+ 4 135) "4.17.5 token.create")
# (find-luatexrefpage (+ 4 135) "4.17.2 token.is_expandable")
# (find-luatexreftext (+ 4 135) "4.17.2 token.is_expandable")
# (find-LATEX "edrx15.sty")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/LATEX/
REPL=1 lualatex -record 2016-2-GA-algebra.tex
tc = token.create
PP(tc"bsk")
print(tc"bsk")
print(getmetatable(tc"bsk"))
print(token.is_expandable(tc"bsk"))
print(token.is_expandable(tc"bskoo"))
print(token.expand(tc"bsk"))

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/LATEX/
REPL=1 lualatex -record 2016-2-GA-algebra.tex





#####
#
# Spurious uppercase omega
# 2015apr24
#
#####

# «spurious-omega» (to ".spurious-omega")
# http://tug.org/pipermail/luatex/2010-December/002397.html solution
# http://www.ntg.nl/pipermail/ntg-context/2010/050090.html problem
# http://www.ntg.nl/pipermail/ntg-context/2010/050092.html

\catcode`\^^J=10  % (find-es "luatex" "spurious-omega")
% \catcode 10=10

# (find-angg ".emacs.papers" "texbook")
# (find-texbookpage (+ 12 37) "16 categories")
# (find-texbooktext (+ 12 37) "16 categories")
# (find-texbookpage (+ 12 37) "5      End of line")
# (find-texbooktext (+ 12 37) "5      End of line")
# (find-texbookpage (+ 12 37) "10      Space")
# (find-texbooktext (+ 12 37) "10      Space")
# (find-texbookpage (+ 12 343) "\\catcode`\\{=1")
# (find-texbooktext (+ 12 343) "\\catcode`\\{=1")




#####
#
# Comments in tex.print
# 2015may31
#
#####

# «comments-in-tex.print» (to ".comments-in-tex.print")
# (find-dn6 "output.lua" "deletecomments")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/

cat > testcomments.lua <<'%%%'
 deletecomments = function (str)
     return (str:gsub("%%[^%%\n]*\n[ \t]*", ""))
   end
 mytexprint = function (str)
     tex.print(deletecomments(str))
   end
 mytexprint2 = function (str)
     tex.print(str:gsub("\n", "\r"))
   end
 testA = [[
 \def\testA{AA AAA}
 ]]
 testB = [[
 \def\testB{BB
   BBB}
 ]]
 testC = [[
 \def\testC{CC %
   CCC}
 ]]
%%%

cat > testcomments.tex <<'%%%'
\documentclass{book}
\begin{document}
\directlua{dofile "testcomments.lua"}
                 \directlua{tex.print(testA)}  \testA  % 1
                 \directlua{tex.print(testB)}  \testB  % 2
\catcode`\^^J=10 \directlua{tex.print(testB)}  \testB  % 3
\catcode`\^^J=5 \directlua{mytexprint(testC)} \testC  % 4
                 \directlua{mytexprint2(testC)} \testC  % 5
\end{document}
%%%

lualatex testcomments.tex

# (find-xpdfpage "/tmp/testcomments.pdf")




#####
#
# lua5.2
# 2015jun25
#
#####

# «lua-5.2» (to ".lua-5.2")
# «lua-version» (to ".lua-version")
# http://tug.org/pipermail/luatex/2013-January/004008.html create a cloned texlive
# http://tug.org/pipermail/luatex/2013-January/003991.html
# package.loaders does not exist any more in lua52.

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
cat > a.tex <<'%%%'
% (find-sh "cd /tmp/ && luatex a.tex")
\directlua{print(_VERSION)}
\bye
%%%
luatex a.tex

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
echo '\directlua{print(_VERSION)}\bye' > v.tex
luatex v.tex



#####
#
# ufy
# 2017jan28
#
#####

# «ufy» (to ".ufy")
# https://github.com/deepakjois/ufy
# https://github.com/jgm/cmark-lua




#####
#
# texlive-2016
# 2017mai07
#
#####

# «texlive-2016» (to ".texlive-2016")
# https://www.tug.org/texlive/
# https://www.tug.org/texlive/acquire-netinstall.html
# https://www.tug.org/texlive/quickinstall.html
# http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
# https://www.preining.info/blog/2017/06/tex-live-2017-released/

# (find-fline "/usr/local/texlive/2016")
# (find-fline "~/.texlive2016")
# (find-fline "~/.texlive2017")

rm -rf /usr/local/texlive/2016
rm -rf ~/.texlive2017

# (code-c-d "texlive2016i" "~/usrc/install-tl-20170413/")
# (find-texlive2016ifile "")
# (find-texlive2016ish "find * | sort")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)

# (find-fline "~/usrc/install-tl-20170413/")
rm -Rv ~/usrc/install-tl-20170413/
mkdir  ~/usrc/install-tl-20170413/
tar -C ~/usrc/ -xvzf $S/http/mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
cd     ~/usrc/install-tl-20170413/


rm -rf /usr/local/texlive/
mkdire /usr/local/texlive

rm -rf /usr/local/texlive/2016
rm -rf ~/.texlive2016

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# https://www.tug.org/texlive/quickinstall.html
# (find-texlive2016ifile "")
# (find-texlive2016ifile "install-tl")
# (find-texlive2016ifile "install-tl" "=item B<-portable>")

cd ~/usrc/install-tl-20170413/
./install-tl -gui text     |& tee oi
C
-
a
L
R
I


# (find-fline "/usr/local/texlive/2016/install-tl.log")

# (find-fline "/usr/local/texlive/")
# (find-fline "/usr/local/texlive/2016/texmf-dist/tex/generic/tex-ini-files/")
# (find-fline "/usr/local/texlive/2016/bin/x86_64-linux/")
# (find-sh "cd /usr/local/texlive/ && find | sort")
# (find-sh "cd /usr/local/texlive/ && find | sort | grep ini")




#####
#
# texlive-2017
# 2017jul09
#
#####

# «texlive-2017» (to ".texlive-2017")
# https://www.tug.org/texlive/
# https://www.tug.org/texlive/acquire-netinstall.html
# https://www.tug.org/texlive/quickinstall.html
# http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
#   (find-fline "$S/http/mirror.ctan.org/systems/texlive/tlnet/")
#   (find-fline "$S/http/mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz")
# https://www.tug.org/texlive/doc/install-tl.html
# http://mirror.hmc.edu/ctan/systems/texlive/tlnet/tlpkg/texlive.tlpdb

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -rfv /usr/local/texlive/2016/
rm -rfv ~/.texlive2016/
rm -rfv ~/.texlive2017/

rm -Rv ~/usrc/install-tl-20170709/
tar -C ~/usrc/ -xvzf \
  $S/http/mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
cd     ~/usrc/install-tl-20170709/

# (code-c-d "tlinstall" "~/usrc/install-tl-20170709/")
# (find-tlinstallfile "")
# https://www.tug.org/texlive/doc/install-tl.html

./install-tl -gui text    |& tee oi
install-tl --profile installation.profile

# Loading http://mirror.hmc.edu/ctan/systems/texlive/tlnet/tlpkg/texlive.tlpdb
# Installing TeX Live 2017 from: http://mirror.hmc.edu/ctan/systems/texlive/tlnet (verified)
# Platform: x86_64-linux => 'GNU/Linux on x86_64'
# Distribution: net  (downloading)
# Using URL: http://mirror.hmc.edu/ctan/systems/texlive/tlnet
# Directory for temporary files: /tmp/U4Dz7wu3cs


# http://mirror.hmc.edu/ctan/systems/texlive/tlnet/tlpkg/texlive.tlpdb
# http://mirror.hmc.edu/ctan/systems/texlive/tlnet (verified)
# http://mirror.hmc.edu/ctan/systems/texlive/tlnet
# (find-fline "/tmp/U4Dz7wu3cs")

# (find-fline "/usr/local/texlive/2017/")
# (find-fline "/usr/local/texlive/2017/tlpkg/tlpobj/catechis.tlpobj")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
export PATH=/usr/local/texlive/2017/bin/x86_64-linux:$PATH
lualatex



Installing [2362/2362, time/total: 01:35:45/01:35:47]: zwpagelayout [587k]
Time used for installing the packages: 95:49
running mktexlsr /usr/local/texlive/2017/texmf-dist ...
mktexlsr: Updating /usr/local/texlive/2017/texmf-dist/ls-R... 
mktexlsr: Done.
writing fmtutil.cnf to /usr/local/texlive/2017/texmf-dist/web2c/fmtutil.cnf
writing updmap.cfg to /usr/local/texlive/2017/texmf-dist/web2c/updmap.cfg
writing language.dat to /usr/local/texlive/2017/texmf-var/tex/generic/config/language.dat
writing language.def to /usr/local/texlive/2017/texmf-var/tex/generic/config/language.def
writing language.dat.lua to /usr/local/texlive/2017/texmf-var/tex/generic/config/language.dat.lua
running mktexlsr /usr/local/texlive/2017/texmf-var /usr/local/texlive/2017/texmf-config /usr/local/texlive/2017/texmf-dist ...
mktexlsr: Updating /usr/local/texlive/2017/texmf-config/ls-R... 
mktexlsr: Updating /usr/local/texlive/2017/texmf-dist/ls-R... 
mktexlsr: Updating /usr/local/texlive/2017/texmf-var/ls-R... 
mktexlsr: Done.
running updmap-sys --nohash ...done
re-running mktexlsr /usr/local/texlive/2017/texmf-var /usr/local/texlive/2017/texmf-config ...
mktexlsr: Updating /usr/local/texlive/2017/texmf-config/ls-R... 
mktexlsr: Updating /usr/local/texlive/2017/texmf-var/ls-R... 
mktexlsr: Done.
setting up ConTeXt cache: running mtxrun --generate ...done
pre-generating all format files, be patient...
running fmtutil-sys --no-error-if-no-engine=luajittex,mfluajit --no-strict --all ...done
running package-specific postactions
finished with package-specific postactions

 ----------------------------------------------------------------------
 The following environment variables contain the string "tex"
 (case-independent).  If you're doing anything but adding personal
 directories to the system paths, they may well cause trouble somewhere
 while running TeX.  If you encounter problems, try unsetting them.
 Please ignore spurious matches unrelated to TeX.

    EETEX=/home/edrx/.eev/ee.tex
    MAKEINFODIR=/home/edrx/usrc/texinfo/texinfo-4.11.dfsg.1/makeinfo
    NEWLUATEXDIR=/home/edrx/bigsrc/luatex-beta-0.79.1/build/texk/web2c
 ----------------------------------------------------------------------


Welcome to TeX Live!


See /usr/local/texlive/2017/index.html for links to documentation.
The TeX Live web site (http://tug.org/texlive/) contains any updates and
corrections. TeX Live is a joint project of the TeX user groups around the
world; please consider supporting it by joining the group best for you. The
list of groups is available on the web at http://tug.org/usergroups.html.


Add /usr/local/texlive/2017/texmf-dist/doc/man to MANPATH.
Add /usr/local/texlive/2017/texmf-dist/doc/info to INFOPATH.
Most importantly, add /usr/local/texlive/2017/bin/x86_64-linux
to your PATH for current and future sessions.

Logfile: /usr/local/texlive/2017/install-tl.log
/home/edrx/usrc/install-tl-20170709(edrx:ve)# 





#####
#
# \pdfshellescape
# 2017jul15
#
#####

# «pdfshellescape» (to ".pdfshellescape")
# http://tug.org/pipermail/luatex/2015-December/005549.html
# http://tug.org/pipermail/luatex/2015-December/thread.html#5549
# http://tug.org/pipermail/luatex/2015-December/005552.html




#####
#
# thislinetag
# 2017ago05
#
#####

# «thislinetag» (to ".thislinetag")
# (find-LATEX "2017cwm.tex" "thislinetag")





#####
#
# Other links
# 2014may04
#
#####

http://www.ntg.nl/mailman/private/dev-luatex/

# http://wiki.luatex.org/index.php/Main_Page
# http://wiki.luatex.org/index.php/Typeset_non-TeX_files_by_converting_them_using_Lua_code
# http://wiki.luatex.org/index.php/Writing_Lua_in_TeX
# http://ctan.org/pkg/luacode

# (find-sh "locate luacode")

http://tex.stackexchange.com/users/7826/eduardoochs
http://tex.stackexchange.com/faq#questions
http://en.gravatar.com/emails

http://tex.stackexchange.com/questions/28064/how-to-display-only-certain-lines-of-a-paragraph/28106#28106
http://tex.stackexchange.com/questions/27780/one-letter-word-at-the-end-of-line/28128#28128
http://tex.stackexchange.com/questions/28136/latex-not-hyphenating-properly-text-running-off-page/28178#28178
http://tex.stackexchange.com/questions/28294/can-i-have-the-overfullrule-rule-colored/28299#28299

\luaexec{
  tex.print(math.floor(\the\luatexversion/100).."."..
  \the\luatexversion \% 100)
}}

http://tug.org/pipermail/luatex/2012-August/thread.html#3760
http://wiki.luatex.org/
http://tug.org/TUGboat/tb31-3/tb99isambert.pdf
http://tug.org/TUGboat/tb32-1/tb100isambert.pdf
http://tug.org/~kotucha/luatab.pdf

http://tex.stackexchange.com/questions/70/what-is-a-simple-example-of-something-you-can-do-with-luatex
http://wiki.contextgarden.net/Programming_in_LuaTeX
http://wiki.luatex.org/index.php/TeX_without_TeX
ftp://ftp.dante.de/tex-archive/macros/luatex/generic/lua-visual-debug/doc/
ftp://ftp.dante.de/tex-archive/macros/luatex/generic/lua-visual-debug/doc/lvdebug-doc.pdf

# http://tex.stackexchange.com/questions/108612/how-to-draw-this-pyramid-with-tex
# http://tex.blogoverflow.com/2012/03/textalk-an-interview-with-patrick-gundlach/

# https://mail.google.com/mail/ca/u/0/#search/to%3Apatrick%40gundla.ch/13e0a1a779b546bb
# https://github.com/pgundlach

patrick@gundla.ch
Program and scripts used to generate data diagrams

Hi Patrick,

I am a long-time Lua user but a LuaTeX newbie...
I was browsing the web for LuaTeX examples and I found this:

  http://wiki.luatex.org/index.php/TeX_without_TeX
  http://wiki.luatex.org/index.php/File:Nodes_in_sample_paragraph.png

the data diagram with structs and pointers is just awesome.
How did you generate it? I have lots of diagrams that I would like to
put in that form - and that looks far, far better than anything I've
been able to do with either ascii art or inkscape =)...

  Cheers, thanks in advance,
    Eduardo Ochs
    eduardoochs@gmail.com
    http://angg.twu.net/
    http://angg.twu.net/dednat4.html  <- being ported to LuaTeX very slowly








http://www.guitex.org/home/images/ArsTeXnica/AT011/AT11-scarso.pdf



-- 2013apr23, texlua vs luatex:
local function writemsg (...)
  if token == nil then
    io.write(string.format(...)..'\n')
  else
    texio.write_nl(string.format(...)..'\n')
  end
end
-- The token table isn't accessible from texlua.


http://tex.stackexchange.com/questions/20444/what-are-immediate-write18-and-how-does-one-use-them
https://tex.stackexchange.com/questions/191328/how-to-pass-a-latex-argument-verbatim-to-lua





# Local Variables:
# coding:               raw-text-unix
# modes:                (fundamental-mode emacs-lisp-mode lua-mode)
# ee-delimiter-hash:    "\n#*\n"
# ee-delimiter-percent: "\n%*\n"
# ee-anchor-format:     "«%s»"
# End: