Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [lua]

Lua is a powerful, fast, lightweight, embeddable scripting language.

0
votes
1answer
37 views

Preparing a latex installer to ship the reporting system

I have prepared a simple report making system that uses Latex to prepare all the reports. It is a simple system that prepares a 15 page report by reading a CSV file. I want to ship the system. I don'...
4
votes
3answers
85 views

Transforming a statement into a mathematical expression

Is there a way, where I could automatically transform a string (using a command) like: (1/SF) * (MDD\_a) * (1/LDD\_b) * (MBS\_b) * (1/SSA\_ab) into a mathematical expression like: $(\frac{1}{SF}) * ...
0
votes
0answers
70 views

Getting cross references for the total pages correct the first time

In order to have a footer at each page that displays the current page number with the total number of pages (Eg.,4 of 12), I used lastpage package and placed the statement: \rfoot{\thepage\ of \...
0
votes
1answer
19 views

Getting error undefined controlled sequence when trying to make a function of module

In the following code, the function named json_parser is meant to parse the JSON. I had initially kept this function as a separate module named json.lua and required it using: local json = require("...
0
votes
1answer
43 views

Getting Missing number, treated as zero error when trying to fit table in the document

While trying to dynamically render a table, it gets out of the document generated and looks as follows: To avoid this, I followed the steps mentioned in: SO Post - 1, which uses tabularx SO Post - 2,...
3
votes
0answers
91 views

Reducing the document preparation time with lualatex [closed]

I am trying to render a document that is around 2300 pages from a JSON file using lualatex. It takes around 32 seconds to create a document. The document is a series of tables and paragraphs. I think ...
0
votes
1answer
33 views

Saving all the latex to a file and then render reading from the file

I am rendering Latex that spawns ~2600 pages. The document is rendered from a JSON using Lua. It takes around 32 seconds to prepare the document of ~2600 pages. To verify, if there is a difference in ...
1
vote
0answers
20 views

How can you change the appearance of a line (edge) with a tikz graph drawing algorithm written in Lua?

In my graph drawing algorithm (written in Lua for LuaLaTeX), I'd like to change a solid line to a dashed line. I use a Digraph with some vertices and arcs between them. On page 499 of the Tikz & ...
1
vote
1answer
89 views

LuaLaTeX: How to correctly resolve absolute path with \directlua on Windows

I need to resolve absolute path to fonts: \setmainjfont[ Path = \currfileabsdir, UprightFont = fonts/HGS_Mincho/HGRMB.ttc, BoldFont = fonts/HGS_Mincho/HGRME.ttc ]{HGS ...
2
votes
1answer
83 views

Using ODT styles in a reference template to format make4ht

Following my recent question Customizing ODT output from mk4ht oolatex and a improved process alternative described here: Use ODT Template for make4ht (which makes use of direct formatting by using ...
7
votes
0answers
220 views

Convert all all-caps words to small caps #2

A question very similar to mine was asked before, but I assume that there are others with the same issue and that there are other solutions. I know several academic publishers that don't like ...
0
votes
0answers
50 views

Can't execute jar from directory with umlaut

Okay so this is quite an exotic question and I am unsure whether it really fits on this page. But as it involves LaTeX I'll post it here. I have written a Java program that I am calling from inside ...
0
votes
0answers
73 views

Custom Lua feature for CID-keyed font

fonts.handlers.otf.addfeature in luaotfload can be used to create custom features for fonts. The unicode values of glyphs can be used for CID fonts in the same way as for GID fonts, but some fonts ...
1
vote
1answer
90 views

LuaLaTeX set a path in lua

I have defined a command \newcommand{\mypath}{/Documents/Myfile/additionalresources/} that contains the path to some external files that I need in my main file. I need to use the \mypath command to ...
2
votes
1answer
332 views

Collect numbers a,b and c from equation $ax^2+bx+c=0$ with lpeg (luatex)

This is my first attempt to create macro with luatex. the macro \solveq to solve quadratic equation ax^2+bx+c=0 here my code \documentclass[12pt]{article} \usepackage{amssymb} \usepackage{luacode} ...
4
votes
2answers
103 views

Insert LaTeX code at line break

Is there a way to insert arbitrary (La)TeX-code at the line break of a typeset line? I am aware that this isn't really possible with (La)TeX as such. But looking at all the interesting chickenize-...
2
votes
0answers
111 views

Lua Table or XML as Bibliography File in LuaLaTeX

According to the ConTeXt Wiki in ConTeXt you can use the bibtex format for bibliographies but are not limited to that filetype. Since lua and XML are a little more universal but i can‘t (yet) switch ...
2
votes
0answers
119 views

Set global non-ligature kerning with selnolig

Similar to this question I want to use selnolig but I don't like the fact that in words containing fl without ligature these two letters are too close together. Like in Mico's answer I want to use ...
1
vote
1answer
70 views

TeXShop console (not log) contains entire LuaLaTeX file

I tried the example of "von" in the post Is direct utf8 input of combining diacritics in math mode possible with lualatex? regarding the use of a Lua script to allow TeX commands for combining ...
6
votes
1answer
135 views

Implement a job queue in LuaLaTeX

I have a project depending on LuaLaTeX where the main document first generates one or more intermediate .tex files and then invokes lualatex in a loop to generate the final PDF results. This can ...
4
votes
1answer
59 views

Setting page attributes of every page in a generated ConTeXt file

I'm trying to inject page metadata into a PDF generated with ConTeXt so that the pages have their tabbing order set to use the document structure (for accessibility checks). Currently, I can inject ...
3
votes
2answers
84 views

Included lilypond files being processed by lualatex can't contain % symbol comments

My MWE below shows two files working together to create a document containing music using the lyluatex package. Unfortunately, I've observed that if I add any comments to the contents anywhere in the ...
0
votes
1answer
51 views

How to integrate xkeyval keys with Lua code

I am currently maintaining a template that uses directlua to compute a value based on a number of parameters defined as command keys with keyval. As it stands, it compiles correctly. However, when I ...
7
votes
4answers
316 views

How can I retrieve \thepage (or detect a page change) from Lua in LuaTeX?

I am writing (contributing to) a LuaLaTeX package where a Lua function is used to generate images that are inserted in the LaTeX document. One piece of information we need is the current page number ...
2
votes
1answer
390 views

LuaTeX error: LuaTeXbase-loader.sty

I am trying to edit my old CV with modernCV in Linux. Some missing styles and classes are not installed automatically -- so I now must try to do this manually. Since the popular package source ctan....
5
votes
1answer
129 views

Strange ConTeXt fail to load pgf.gd.control

I'm playing with PGF's (algorithmic) graph drawing, which relies on Lua internally. I have no problems with LaTeX, but ConTeXt fails to load the package. For the simple document: \usemodule[tikz] \...
3
votes
1answer
72 views

How can I retrieve the current roman, sans, and mono fonts in LuaTeX

I am working on a LuaLaTeX package, and at one point I have to pass the full names of the three basic font families (roman, sans, mono) to another tool. I have found and checked that I can correctly ...
0
votes
1answer
68 views

Calling Lua on the output of a \@for loop to add “and” to the end of a comma-separated list

I'm trying to make a package-free command that applies a command across a comma-separated list, and then adds the word ``and'' to the output as is grammatically appropriate. I've already gotten some ...
12
votes
0answers
248 views

metafun: Why is the arrow tip not filled? [closed]

Trying out another example I saw that with the metafun format (luatex version) the arrow tips are no longer filled. The following document (to be compile with lualatex) shows the problem: \...
3
votes
1answer
887 views

Do I have to install Lua in order to compile with LuaTex? Which is the best way to do it?

I've already installed TeXLive and TexMaker. Now I'm thinking of turning to LuaTeX. What are the steps I have to follow in order to start compiling with LuaTeX? Do I have to install Lua first? If so, ...
12
votes
2answers
533 views

Problem using length operator in Lua

This is my MWE: \documentclass{article} \newcommand{\printdata}{% \directlua{ data = {"a", "b", "c"} for i = 1, #data do tex.print(data[i]) end } } \begin{document} \...
0
votes
1answer
91 views

Generate a list of QR-code with lua

I want to generate a list of digit sequences, where a part of a sequence is a counter and another one is generated depending on this counter. My MnotWE \documentclass{book} \usepackage{luacode} \...
1
vote
0answers
63 views

Can't use SQL to format date in LuaLaTeX with LuaSQL & passing parameters to compiler

I am working on a LuaLaTeX example where date has to be transferred from my database using Lua and then compiled using LuaLaTeX. I am using LuaSQL to do all this and this is the minimal working ...
0
votes
2answers
117 views

How shall I launch from lualatex a lua program contained in a lua variable?

I store contents in lua variables and use them in a lualatex document. I know how to do insert that content in the TeX flow, in a macro but I don't know how to launch a lua program contained in a lua ...
1
vote
1answer
185 views

Human-readable context-free manuscript metadata [closed]

tl;dr • Would lua be a good option to process metadata stored in an external text file and output TeX fragments for use in a front matter? A minimal lua example to solve the following sub-problem ...
8
votes
2answers
3k views

My first luaLaTeX example

I am totaly inexperienced in LuaLaTeX and I don't know why but it was somehow very difficult to find working LuaLaTeX example so I can start playing around. I finaly found the example in a document ...
2
votes
1answer
121 views

lstlisting environment inside luacode

I'd like to feed a lstlisting environment (from the listings package) with contents back to TeX from Lua, but the end of lstlisting is apparently not found. The same happens if lstlisting is replaced ...
3
votes
1answer
622 views

Error: Only one # is allowed per tab

Whenever I try processing the following code it gives the error Only one # is allowed per tab. ... .25ex\everycr {}\tabskip \z@skip \halign {##. Can someone let me know what is wrong with it? \...
3
votes
1answer
358 views

XML parsing and data retrieving in ConTeXt

ConTeXt provides a way of managing XML files. The reason I approached this functionality is due to the need of being able to publish xml data in PDF to obtain catalogs or other technical ...
4
votes
3answers
240 views

Selecting a Specific Array Element in LuaTeX?

I need to create a command that goes \MyCommand{x,y} or \MyCommand{x,y,z} (both ways should be possible), where x, y, and z are three numbers. It should give the output \begin{matrix}x\\y\end{matrix} ...
4
votes
2answers
560 views

Does lua scripting entirely replace the TeX macro-definition commands & allies?

Does lua scripting in LuaTeX entirely eliminate the need to use the TeX macro-definition commands \def, \gdef, \edef and \xdef? What about \exapndafter, \noexpand, \protected, \long and \relax?
5
votes
1answer
93 views

Automatically highlighting nominalizations (a.k.a. zombie nouns) as a writing aid

To improve my writing, I want to reduce the number of nominalizations (a.k.a. zombie nouns) that I use. For that purpose I would like to have all nominalizations automatically highlighted in the ...
10
votes
1answer
181 views

Call a (luatex-)combo font through NFSS

After some struggles I found a way to call a combo-font (which combines glyphs from two fonts) so that I can get various font sizes. Has anyone an idea how one could inject this code (or other code ...
9
votes
2answers
547 views

LuaTeX C API as Lua C API

I'm writing a Lua Module for LuaLaTeX. Does a LuaTeX C API exist? For example, how can I use the C version of tex.print into my C code? Thanks in advance
14
votes
2answers
349 views

Fill a lua table with lowercase/uppercase pairs.

I would like to add the Letters=Uppercase option to a font which hasn't the needed open type feature built in. This is (with lualatex) possible like this: \documentclass{article} \directlua { ...
5
votes
1answer
205 views

How to redefine caption in KOMA-Script to captionbeside?

While experimenting with KOMA-Script's features I have found captionbeside. That's a really great option for me as I want my captions to be formatted this way. The only problem is that in a long ...
26
votes
3answers
4k views

Why should I be interested in Lua?

I have been using LuaLaTex since I got acquainted with TeX, because it can easily work with system fonts, which I really need. Font packages in TeX are not friends of the Russian language, though ...
5
votes
1answer
165 views

How to print a verbatim block at its end automatically in LuaLaTeX?

This is a follow-up question to this answer by Mico. I try to adjust his Lua code to my needs and line numbering already works. Actually there is one real usability issue and that's my question: How ...
4
votes
2answers
241 views

Order list of names with Lua

I want to define a command using \directlua that looks something like: \sort{c, b, a} and outputs a, b, c to the document.
1
vote
0answers
202 views

Create external file (like a Makefile) whit real tabs using LaTeX and Lua code

I'm trying to generate a external Makefile (and others) file using latex and the filecontents or fancyvrb package. As the \t (tabs) characters in input file are converted to space in output file (see ...