2
votes
0answers
26 views

LuaLaTeX error - file ended while scanning use of \luacode@grab@lines (?) [closed]

Even the reduced-to-the-absolute-minimum-file: \documentclass{scrreprt} \usepackage{luacode} \begin{document} \begin{luacode*} tex.sprint(1) \end{luacode*} \end{document} yields the error: ! ...
3
votes
2answers
85 views

Accessing MySQL or SQLite from Lua(La)TeX

I thought it would be possible to access MySQL or SQLite from Lua(La)TeX, but couldn't google up anything on the topic. Please give me pointers to: Snippets / Examples / Documentation on that, if ...
0
votes
0answers
100 views

Execute lua file out of a pdf, lua doesn´t execute “io.open” command

I would like to run program out of the compiled pdf via link. \documentclass[12pt]{article} \usepackage[colorlinks, linkcolor = black, citecolor = black, filecolor = black, urlcolor = ...
12
votes
1answer
187 views

How can I dump Lua code to a format file?

From this format: %% testformat.ini \input plain \directlua {tex.enableprimitives('', tex.extraprimitives())} \directlua { testFunction = function () tex.print("This was print by Lua's ...
6
votes
2answers
263 views

More than one width of a glyph in LaTeX or LuaLatex

I don't know where I can ask about it. I have font with 2 or 3 versions of letter 'a'. How I can put this information to LuaLaTeX, LaTeX etc.? When the paragraph are breaking/making LaTeX made ...
7
votes
1answer
174 views

Strange interaction between fontspec, lua and pgfplots

While trying to combine some Lua code with plots written in pgfplots something went completely wrong. I have no idea what causes the problem, as the error message is a bit opaque to me. Here is the ...
24
votes
1answer
393 views

Bad interaction between fontspec and some lua code that performs string-related search and replace operations

Update 2013/05/28: The selnolig package is now on the CTAN. Comments and critiques always welcome! If you wish to contact me about any aspects of the package, please use the email address that's given ...
12
votes
2answers
3k views

How to properly install and use a new font with LuaLaTeX?

I have problems trying to get new fonts to work when compiling with LuaLaTeX. I'm working on Mac and use TexShop (with the MacTeX package). It goes like this: I downloaded for example the Cardo ...
14
votes
4answers
637 views

How to read a file with luatex

I tried to read a file with lua and set the content as normal text in my document, but I didn't worked it out. Here my code: \documentclass{scrartcl} \usepackage{luatextra} \usepackage{filecontents} ...
8
votes
1answer
684 views

Speeding up latex/lua/tikz

I have a rather large LaTeX document in that it generates a lot of LaTeX code using lua (small .tex file on disk but large amount of generated LaTeX code). It is very slow to compile and takes about 1 ...
10
votes
3answers
1k views

Matrix multiplication (and other operations) macro using lua module

I am hoping to be able to create a macro to multiply matrices using a lua module. The module is here: https://raw.github.com/davidm/lua-matrix/master/lua/matrix.lua As suggested to me in a previous ...
4
votes
2answers
284 views

Why does \luaexec work but the luacode environment doesn't?

The following code can be compiled by lualatex (Version beta-0.70.1-2011061410 (rev 4277)) correctly. But if I use \begin{luacode} ... \end{luacode} environment to replace the \luaexec{...} command, ...
1
vote
0answers
346 views

Debugging Lua in LuaLatex with LDT [closed]

LDT is an IDE for lua based on eclipse. It is quite nice and the best free lua debugger I've seen(I've just stumbled upon it the last 2 days or so). It took me a bit to get setup properly but because ...
11
votes
3answers
315 views

In which order is Lua Code in LuaTeX being processed

Can someone help me understand the order in which LuaTeX documents are being processed? From what I've understood, the order is the following: the code is being read, top to bottom when the ...
6
votes
3answers
428 views

How to do a 'printline' in LuaTeX

I have just started exploring the world of LuaTeX and wanted to write a piece of code, that prints a name to a new line in the document. \directlua{ for i=1,3,1 do tex.print("FOO") end } which ...
5
votes
0answers
307 views

Lua techniques and libraries for LuaTeX [closed]

With LuaTeX, it is possible to use many libraries and functions that can simplify various aspects of Lua programming. As Lua as language is quite new for the majority of TeX users, I think it would be ...
13
votes
1answer
236 views

Lua function to see if a macro is defined or not

I need to determine if a TeX macro is already defined or not via a Lua function. Any ideas? function IsTeXMacroDefined(macroname) if defined(macroname) then return true end return false end
0
votes
2answers
553 views

Print large macro block from Lua to TeX

I have a rather large block of TeX macro code that is no problem to do in TeX but I'd like to create the macro in Lua instead The macro contains various TeX macro characters (\, %, [, ]) How can I ...
3
votes
1answer
174 views

LPeg self-referential pattern

I am trying to create a self-referential pattern in lua/lpeg local group = lpeg.P(sep1 * (1 - sep2)^0 * group^0 * sep2) notice that group refers to itself. This is not possible since group is ...
22
votes
5answers
2k views

Reading data from a relational database into a LaTeX table

I'm using Tex Live 2009 on Debian squeeze. I can upgrade if I really, really have to, but I'd rather not. i was wondering if it would be possible to do the following. Given some data in a ...
7
votes
3answers
734 views

What is the correct way to delineate directories in Lua?

I have been experimenting with some Lua code to list directories and provide them to the TeX engine. I have been using the Lua File System (lfs) module. The first part list the current directory ...
23
votes
7answers
2k views

What are the advantages of Lua over other scripting languages for a TeX implementation?

The question is inspired by Martin Schröder's answer to I am new to TeX. Should I use LaTeX, XeLaTeX, …? as well as my two previous questions on this forum: Automatic document update Generate LaTeX ...
1
vote
0answers
75 views

Sorting tlpdb.tlu output [closed]

I get an output from tlpdb.tlu, which is unsorted. When I now use table.sort the output as a pdf is still unsorted. tlpdb = read_tlpdb( kpse.var_value("SELFAUTOPARENT") ) table.sort(tlpdb) Do I ...
6
votes
1answer
387 views

LuaTeX with unicode-math, how to get the font id of current math font

How can I query informations about the current math font? I tried the following in a document using unicode-math and Cambria Math font \documentclass{article} \usepackage{unicode-math} ...
18
votes
2answers
748 views

LuaJIT and LuaTeX

Is it possible to change the Lua engine in LuaTeX to LuaJIT? Will it be as simple as replacing the Lua5.1 source code in the LuaTeX tarball with the LuaJIT source, or does it require (drastic) ...
4
votes
1answer
87 views

Find node above and under

Using a post_linebreak_filter callback, is it possible to access the nodes positioned above and under a given node?
9
votes
1answer
225 views

Convert color name to pdfliteral code

How can I convert a color name (such as used with the xcolor package) to a pdfliteral code, like q 1 0 0 rg (for red)?
2
votes
1answer
370 views

Using pdfliteral to highlight text

Using pdfliteral, one can color text like the following: w1_prev = node.new("whatsit","pdf_literal") w1_prev.data = "q 1 0 0 rg" w1_prev.mode = 1 w2_prev = ...
6
votes
2answers
103 views

Problems with insert_before and post_linebreak_filter

I'm coding an algorithm to detect and highlight homeoarchies. Here my current almost working (but compiling at least) code: \documentclass{article} \usepackage[french]{babel} \usepackage{kpfonts} ...
2
votes
1answer
95 views

post_linebreak_filter and glyph analysis

When calling a function with a post_linebreak_filter callback, the nodelist only contains nodes of type 0 (hlist), 10 (glue) and 12 (penalty), whereas when using a pre_linebreak_filter callback, type ...
8
votes
1answer
214 views

Testing for TeX boolean in Lua code

How can I test for a TeX boolean in Lua? This kind of code doesn't work: \newif\if@mypkg@someif \begin{luacode} -- some lua code \if@mypkg@someif -- some more lua code \else ...
4
votes
2answers
734 views

How can one get a list of the available functions in Lua(La)TeX

Is there a list or method to determine a list of the lua functions available/installed? Sofar I could only find the lua source files. Maybe I should write something that search through all the ...
3
votes
1answer
634 views

Passing two or more dimensional arrays to lua

I can write: \def\myarray{{Nrs,1,2,3}} then I can call lua: \luadirect{myfunc(\myarray)} and access the values in the array/table. How would one do it for multidimensional ones? I initially ...
3
votes
1answer
138 views

ConTeXt's user namespace seems somewhat empty

With ConTeXt ver: 2010.05.24 13:05 MKIV fmt: 2010.12.18 int: english/english the ConTeXt code \starttext \message{one} \directlua{print(1)} \message{two} \usercode{print(2)} ...
15
votes
1answer
1k views

Installing Lua Modules for use in LuaLaTeX

I've done all of the searching that I can, and I think I've read the right answer, but am too dumb to know that I read it. I can't seem to figure out the magic tricks to get Lua modules, installed by ...
9
votes
2answers
444 views

percent signs in luacode* environment (LuaLaTeX)

Can someone explain what happens here: \documentclass{article} \usepackage{luacode} \begin{document} \begin{luacode*} tex.print("xx\%a","yy\\%b","zz\\\%c") \end{luacode*} \end{document} The ...