LuaTeX and LuaLaTeX stuff (Eduardo Ochs)
Quick index:
1. Dednat6
Almost all of my recent .tex files invoke a "semi-preprocessor"
that I wrote, called Dednat6, to let me typeset
diagrams easily. Its homepage is here: dednat6.html, its files are
here: LATEX/dednat6/, and most tarballs in this page include a
full copy of dednat6 because they were created with flsfiles and they have dednat6 among their dependencies. Note that a
"full copy" of dednat6 includes "bloat" like the modules that I use to
typeset papers like these and the
repl described in the next section.
2. Using LuaRepl on luatex/lualatex
I integrated Rob Hoelz's lua-repl into dednat6 to let me test things in lualatex using a Lua
prompt and eepitch. To test the repl, run:
# rm -rfv /tmp/2018repl-test.tgz
# rm -rfv /tmp/edrx-latex/
cd /tmp/
wget http://angg.twu.net/LATEX/2018repl-test.tgz
mkdir /tmp/edrx-latex/
tar -C /tmp/edrx-latex/ -xvzf /tmp/2018repl-test.tgz
cd /tmp/edrx-latex/
lualatex 2018repl-test.tex
|
Uncomment the first two lines to re-run the code erasing everything
that was created the first time. The file 2018repl-test.tgz was
created with flsfiles and includes a full version of dednat6 (with bloat). If you want to take a look at the file
2018repl-test.tex see here for an
htmlized version and here for the raw
.tex.
...And please do get in touch with me - I'm eduardoochs@gmail.com - to discuss new features that would make this
easier to use!!! I always use this repl from Emacs and eev with
eepitch - see section 6 here - so I
need very few features from the repl myself.
Note that you can get a very minimalistic Lua repl by just running
this from LuaTeX, either from a .tex file or from the TeX prompt:
\directlua{debug.debug()}
|
I used this technique a bit years ago - see the link to
"lua-repl-2012" below - but I was a bit frustrated, I don't remember
exactly why.
Old news:
THe best way to explain the repl would be with a screencast - that
I haven't been able to produce yet because of a glitch in X, so no
screencasts yet! =(
3. Flsfiles: a way to pack multi-file .tex files
Most of my .tex files start with a header like this,
% (defun c () (interactive) (find-LATEXsh "lualatex -record 2017planar-has.tex"))
% (defun d () (interactive) (find-xpdfpage "~/LATEX/2017planar-has.pdf"))
% (defun e () (interactive) (find-LATEX "2017planar-has.tex"))
% (defun u () (interactive) (find-latex-upload-links "2017planar-has"))
|
so that I can get an e-script like this one by typing 'M-x
u ',
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# Upload pdf
cd ~/LATEX/
Scp-np 2017planar-has.pdf $TWUP/LATEX/2017planar-has.pdf
Scp-np 2017planar-has.pdf $TWUS/LATEX/2017planar-has.pdf
# Test the pdf (open the urls in a browser):
# (find-xpdfpage "~/LATEX/2017planar-has.pdf")
# http://angg.twu.net/LATEX/2017planar-has.pdf
# file:///home/edrx/LATEX/2017planar-has.pdf
# Make .tgz and upload it
flsfiles-tgz 2017planar-has.fls 2017planar-has.tgz
Scp-np 2017planar-has.tgz $TWUP/LATEX/2017planar-has.tgz
Scp-np 2017planar-has.tgz $TWUS/LATEX/2017planar-has.tgz
# http://angg.twu.net/LATEX/2017planar-has.tgz
# Make .zip and upload it
flsfiles-zip 2017planar-has.fls 2017planar-has.zip
Scp-np 2017planar-has.zip $TWUP/LATEX/2017planar-has.zip
Scp-np 2017planar-has.zip $TWUS/LATEX/2017planar-has.zip
# http://angg.twu.net/LATEX/2017planar-has.zip
# Test the .tgz.
# The e-script below downloads, unpacks and compiles the .tgz in /tmp/edrx-latex/.
#
rm -rfv /tmp/2017planar-has.tgz
rm -rfv /tmp/edrx-latex/
cd /tmp/
wget http://angg.twu.net/LATEX/2017planar-has.tgz
mkdir /tmp/edrx-latex/
tar -C /tmp/edrx-latex/ -xvzf /tmp/2017planar-has.tgz
cd /tmp/edrx-latex/
lualatex 2017planar-has.tex
# Test the .zip.
# The e-script below downloads, unpacks and compiles the .tgz in /tmp/edrx-latex/.
#
rm -rfv /tmp/2017planar-has.zip
rm -rfv /tmp/edrx-latex/
cd /tmp/
wget http://angg.twu.net/LATEX/2017planar-has.zip
mkdir /tmp/edrx-latex/
unzip -d /tmp/edrx-latex/ /tmp/2017planar-has.zip
cd /tmp/edrx-latex/
lualatex 2017planar-has.tex
|
The really non-trivial parts are the ones that call flsfiles-tgz and flsfiles-zip .
When I type 'M-x c ' emacs runs lualatex -record
2017planar-has.tex , and the '-record ' option makes lualatex
generate a .fls file that lists all files that lualatex has read; the
Lua script flsfiles.lua processes that, and
outputs the files that are in current directory or in its
subdirectories (to exclude the files from the global installation),
without repetitions.
Here are the definitions of flsfiles-tgz and flsfiles-zip :
# From: (find-angg ".zshrc" "flsfiles")
# See: (find-angg "LUA/flsfiles.lua")
function flsfiles () { ~/LUA/flsfiles.lua $1 | grep -v "^/" }
function flsfiles-tgz () { tar -chvzf "$2" $(flsfiles $1) }
function flsfiles-zip () { rm -fv "$2"; zip "$2" $(flsfiles $1) }
|
In lua(la)tex 0.76 the '-record ' option does not list .lua
files, so the above does not work. In lua(la)tex 0.79 and beyond it
works, so I have to install a newer luatex on top of my Debian
system...
|