[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX
From: |
Juan Manuel Macías |
Subject: |
Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX? |
Date: |
Sat, 09 Jul 2022 11:10:29 +0000 |
Hi Thomas,
Thomas S. Dye writes:
> Yes, what I called Babel you call org-babel. I don't know if the Lua
> handler of source blocks in Org might be useful for someone interested
> to write Lua extensions to LaTeX.
I'm writing a package for LuaLaTeX in Org[1] using lua code blocks, and
everything works fine. But if you mean to evaluate these blocks from
Org, it wouldn't really make sense because LuaTeX uses its own Lua
interpreter and that's where the code should be evaluated. For example,
in LuaTeX you should use tex.print or tex.sprint to print a result in
LaTeX, instead of 'print'.
A simple example to create a counter using Lua:
\newcommand{\mydefcounter}[2]{{\directlua{#1 = #2}}}
\newcommand{\mycounter}[2]{\directlua{%
function count ()
#1 = #1 + #2
tex.print (#1)
end
count()
}}
\mydefcounter{foo}{0}
\mycounter{foo}{1}
\mycounter{foo}{1}
\mycounter{foo}{1}
You might want to take a look at the chickenize package, which includes
loads of examples and is very instructive.
https://www.ctan.org/pkg/chickenize
[1] btw, I thought I was the only one to write a LaTeX package in Org,
instead of the 'official' LaTeX docstrip suite (doing it in Org is
infinitely more comfortable!), but I've seen that the wallcalendar
package has also taken the unorthodox route, with all source code and
documentation in Org :-):
https://github.com/profound-labs/wallcalendar/blob/master/Makefile
Best regards,
Juan Manuel
- LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Juan Manuel Macías, 2022/07/08
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Uwe Brauer, 2022/07/08
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Greg Minshall, 2022/07/08
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Thomas S. Dye, 2022/07/08
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Bruce D'Arcus, 2022/07/08
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Thomas S. Dye, 2022/07/08
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Max Nikulin, 2022/07/08
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Tim Cross, 2022/07/08
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Ihor Radchenko, 2022/07/08
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Tim Cross, 2022/07/09
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Dominik Schrempf, 2022/07/09
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Max Nikulin, 2022/07/09
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Juan Manuel Macías, 2022/07/09
- Re: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?, Tim Cross, 2022/07/09
- M-x org-create-worg-article command? (was: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?), Ihor Radchenko, 2022/07/10
- Re: M-x org-create-worg-article command? (was: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?), Tim Cross, 2022/07/10
- Re: M-x org-create-worg-article command? (was: LaTeX export: when is it more useful to use LuaTeX instead of pdfTeX?), Ihor Radchenko, 2022/07/10