Questions tagged [lua]
Lua is a powerful, fast, lightweight, embeddable scripting language.
418 questions
2 votes
0 answers
41 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 > ...
1 vote
1 answer
62 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
0 answers
94 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
92 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
29 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
97 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 ...
8 votes
3 answers
280 views
A logistical way to recursively subdivide triangles (into 6 sub-triangles), such that all detail is captured and no triangles are wasted
I have a surface composed of triangles. I want to recursively subdivide these triangles into 6 sub-triangles, which are then themselves further subdivided into 6 more and so on. I want for this ...
5 votes
1 answer
86 views
tessellate set of non-coincident points on a plane into a minimal set of triangles
Suppose I have a set of non-coincident points on a grid. My goal is to take this set of points, and tessellate them into a minimal set of triangles, by connecting a minimal amount of points with line ...
3 votes
1 answer
156 views
How can I convert simple and complex LaTeX math to plain Unicode text?
While some university repository systems (such as DiVA) support HTML markup, many other critical administrative systems—such as those for grading, assigning ISBNs, and official university records—...
3 votes
1 answer
117 views
How can I insert math expressions which aren't simple strings into my lua-tikz setup?
I am building a package, part of which should be able to simply append mathematics to a picture. Unfortunately, it currently only works for simple strings. How could I insert the following math ...
7 votes
3 answers
207 views
Replace decimal point with comma in luadraw (or globally in lua)
In the luadraw documentation numericFormat={0,0}. Cette option précise le type d’affiche numérique (non encore implémenté). numericFormat={0,0}. This option specifies the type of numeric display (not ...
3 votes
2 answers
166 views
Converting lua tables to token lists and back
Using the calc package we can write something like \documentclass[11pt]{article} \usepackage{tensor,calc} \newlength{\eqwidth} \newlength{\eqheight} \setlength{\eqwidth}{ \widthof{ $\tensor{A}{^{34}^{...
2 votes
2 answers
184 views
lualatex printing \begin{environment}
I have written a function in lua loaded using \directlua{dofile("product.lua")} and \newcommand\product[1]{\directlua{TeXProduct(#1)}}. This is fine for printing simple strings but as soon ...
2 votes
1 answer
158 views
Better \left and \right constructs like nath, but in LuaTeX
I would like to have \left \right constructs that behave similar to ones from the nath package, and I tried to implement such a behavior in LuaTeX. Example: Subscripts should not influece the size of ...
5 votes
1 answer
143 views
Triangulating Non-Convex Closed Planar Curves with Sparsity Control
I’m developing software to tessellate closed planar curves with triangles. The curves may be non-convex, but they are simple (no self-intersections). My goal is to produce a triangulation that fully ...