Questions tagged [lua]
Lua is a powerful, fast, lightweight, embeddable scripting language.
427 questions
3
votes
0
answers
60
views
What is the correct way to doc-string a Lua function?
What is the correct way to doc-string a Lua function?
I just picked this up from reading the code of others:
--- the dot product
--- @param u table<table<number>> a vector
--- @param v ...
1
vote
0
answers
61
views
lua file in the local folder is not enabled after texhash
I am trying to add the pre-release version of lua-widow-control to my local TeX directory. In the local folder, I created a new folder lua-widow-control and placed the files lua-widow-control.sty, lua-...
8
votes
2
answers
176
views
Don't get decimal output with luacas
First of all "Merry Christmas" to everyone.
I'm trying to get decimal output with luacas and don't get it.
\documentclass[paper=a4,fontsize=12pt]{scrartcl}
\usepackage{luacas}
\begin{...
6
votes
1
answer
122
views
Running Lua function on biblatex output
I want to automatically transliterate titles and author names I'm citing if they're written in another script. For example, given an author named مَحْمُود, I would like to be able to cite them inline ...
2
votes
0
answers
72
views
ConTeXt: Correctly classifying arguments with CLD
I have the following MWE:
\startluacode
local function startenv(keyword, keyval)
if keyword[1]:find("=", 1, true) then
local cadena = utilities.parsers.array_to_string(keyword, &...
2
votes
2
answers
199
views
The method of marching cubes (for implicit surfaces) is very slow, and does not reach the level of accuracy of existing pictures. How to improve?
I was inspired by some of the illustrations in https://math.stackexchange.com/a/46222.
I wanted to try graphing implicit surfaces myself, and came across the method of marching cubes. See https://...
2
votes
1
answer
102
views
I would like to discretize the "tiles" into rectangular prismatic groups, sort each group, then sort the groups by each other or be shown a better way
I have built a comparator which can determine the occlusive relationship between two 0--2-dimensioal affine tiles (using their simplicial representations).
In English, if I have two tiles (a tile is a ...
10
votes
3
answers
610
views
Is there a way in TikZ or Lua to make a short function which converts letters to their corresponding alphabetical position (and vice versa)?
Is there a way in TikZ or Lua to make a short function which converts letters to their corresponding alphabetical position (and vice versa)?
The only way I can think of it so string check each letter, ...
2
votes
1
answer
72
views
Option for Stacktrace output of `texlua`
If I make mistakes in a Lua script and I call it from a .tex file via
\directlua{
dofile("myscript.lua")
}
then I get a full stacktrace in the output of lualatex-compiler:
myscript.lua:...
2
votes
0
answers
60
views
Check for and report excessively large dimensions in \tkzGetNodes
This is a refinement I would like to add to the following macro:
\def\tkzGetNodes{\directlua{%
local n,sd,ft,xft, xsd
for K,V in pairs(z) do
n = string.len(K)
if n > ...
2
votes
1
answer
100
views
Difficulties in using string.find with directlua
The main macro in tkz-elements is \tkzGetNodes. This macro retrieves the elements from the z table in order to create nodes. The elements in the table provide the node name and its coordinates. The ...
6
votes
1
answer
148
views
There is a problem for triangles which are capable of partitioning eachother, which also coincide at one vertex. I am having trouble debugging it
NOTE: I revised my formulation of the problem, and posted it on SO where it might have a better chance of reaching the right people. It
can be found here, https://stackoverflow.com/q/79829288/29000697....
2
votes
0
answers
102
views
Run lua code in pdflatex
I'm a bit tired of writing LaTeX code:
syntax is impossible (I still can't remember how to do a simple float multiplication without packages! and LaTeX3 is soo verbose that it does not really help…) ...
1
vote
1
answer
33
views
Expand LuaMetaFun parameter before adding it to a string, so it can be understood by Lua's load() function
I have a LuaMetaFun setup where I use the load() function to turn strings into Lua code. I am defining a macro on the MetaFun end, and would like to load some of the parameters to Lua every time it is ...
1
vote
1
answer
104
views
passing metapost parameters to Lua as strings
My apologies in advance for what is probably a trivial issue.
I have been trying to debug this MWE for a while now, and despite my best efforts (and an old MWE that still works to go off of), I was ...