i asked a question a few weeks ago for some Lua Code, that splits my table cell into two cells, if i type a new line. Here is the code:

function doline(line)
local splitpoint = string.find(line, "=")
local title = line:sub(1, splitpoint-1)
local description = string.gsub(line:sub(splitpoint + 1), "\\par", "\n")
for token in string.gmatch(description, "[^\n]+") do
  tex.print("&\\multicolumn{4}{p{11cm}}{" .. token .. "}\\\\[2pt]")

My problem now is, that there is an empty line, if there is an itemize inside the cell. it looks weird because there are empty lines, that shouldn't be there. The idea was to react to a string like a \newcell or %---newcell but i'm not so good with Lua so i'm looking for some help. Hope, you have any idea.

  • This is the question i aked before: tex.stackexchange.com/questions/482739/… – Narhog May 22 at 8:31
  • This doesn't look very efficient and like an XY problem. What are you actually trying to do? – Henri Menke May 22 at 8:40
  • The Problem is, if there is an massive amount of text in table cell, latex doesn't make a page break and your text disappears at the bottom of your page. The Table is created by a macro, so the idea was to write a code, which writes the Text into a new cell so there is a page break and the text doesn't disappear. but instead of typing a new line in the code i want to do it with a command now, if it is possible – Narhog May 22 at 8:46
  • If you are willing to switch to ConTeXt for that document you can use the tabulate environment which can break cells across pages. – Henri Menke May 22 at 8:49
  • 1
    surely if you want to allow page breaking over a table cell you want to break at lines in the output not based on newlines on the source? – David Carlisle May 22 at 13:07

I solved my problem now by my own with a workaround.

  • 3
    In the current state this answer is not an answer, so it is likely to be deleted. Please make it become an answer by explaining what you have done to solve the problem, and of course, providing an example code which solves the issue. – user156344 May 24 at 8:18
  • Please consider telling us what that workaround was. Few things are more frustrating for people with a similar problem than finding a question on some forum, only little response and then a "I found a workaround" without a mention of the actual workaround: xkcd.com/979 – moewe May 24 at 15:19
  • Its hard to explain, because i use the Lua-Code in Combination with a macro in LaTeX. The Problem was, there was a big gap between two diffrent itemize elements. First I thought i could fix it by changing the Lua code but eliminated the gap with a negativ \vspace and the option [nosep] from the package enumitem. – Narhog May 27 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.