4:23 AM
pdfTeX error (ext1): \pdfendlink cannot be used in vertical mode.

l.14 ...{\ignorespaces {\@@par }}}{23}{figure.3.1}
%
..
hey I dont know why am getting the error above?

2 hours later…
6:02 AM
6

6:53 AM
@MarcelKrüger So this is a client library artifact? Thank you for the diagnosis. Do you think this is a bug? And if not, what's a suitable workaround?
@MarcelKrüger But the second row is a "real" row. It has other values besides the NULL.
@DavidCarlisle So that wouldn't give unicode codepoints?
@MarcelKrüger Would this be reasonable to post on SO, and/or report as a bug?

@FaheemMitha Artifact? Remember that Lua tables and nil have a special relationship, cf. stackoverflow.com/a/13081723. And your second row has a nil-value, so you should take care of that (yes it's a bug but in your calling code not in some kind of library).

@TeXnician NULL is just how SQLite represents empty values.
Which happens to translate to nil, apparently.
And the whole row isn't empty, just the first value.

7:23 AM
function rows()
local i = 0
print("calling rows")
return function ()
i = i + 1
if i ~= 2 then
return "a", "b"
else
return nil, "b"
end
end
end

for Date, Num in rows() do
print(Date, Num)
end
@FaheemMitha Of course it does. I simplified your code a bit (MWE without SQL or such). Really, it's user error (you must take care of the nil value).

@TeXnician You mean intercept the nil value in code and change it to something else?

@FaheemMitha Whatever you deem sensible. You are the only one who knows the data. However, it is expected behavior to stop iteration once the Date field is nil (the Lua equivalent to NULL). I am not proficient enough to propose alternative fixes, I only know that Lua's behavior you show is expected.

@FaheemMitha The more typical approach to handle this would be to add an additional first return value which is never nil, e.g. a counter. If you don't want an arbitrary value, you can change your query to query the rowid column first. Then it's never nil.

7:52 AM
@FaheemMitha no but it always gives something. unlike decoding a utf-8 file to codepoints which you can only do if you know the file is utf-8

8:35 AM

125

Many LaTeX command names have some 'justification'. For example the commands \cup and \cap have a straightforward meaning. However, I couldn't find a meaning for the commands \quad and \qquad. Is it maybe coming from a concatenation of 'equation' and 'add' ?

thanks

8:56 AM
@huzaifaabedeen you're welcome

@DavidCarlisle Yes, I see.
@MarcelKrüger Hmm.

10 hours later…
6:45 PM
@MarcelKrüger After some digging, I found this expilicitly described in lua.org/manual/5.3/manual.html#3.3.5
Specifically, the part that starts with:
for var_1, ···, var_n in explist do block end
And contains:
if var_1 == nil then break end
There is no justification for this piece of weirdness, but this is Lua, so I guess it's just part of the landscape.

7:05 PM
@FaheemMitha I don't know why you think that this is weird. The iterator has to indicate the end of iteration in some way and returning nil is a pretty obvious way to do this in Lua. Also it is a common rule that when only one value is accepted (e.g. when comparing with nil) but multiple values are provided then the first value is used. What kind of interface would you have expected?

@MarcelKrüger For one thing, giving the first value some special status isn't reasonable.
I was just trying to understand the implementation, and it seems that first value controls the loop. As in, it's passed as a value for the next step. Not sure exactly what's happening there, though.
Perhaps wait this just nil and nothing else is passed?
Specifically, this piece of code:
do
local f, s, var = explist
while true do
local var_1, ···, var_n = f(s, var)
if var_1 == nil then break end
var = var_1
block
end
end
Related discussion here: stackoverflow.com/q/42305188/350713

@FaheemMitha If you want to understand the behavior of Lua internals, reading "Programming in Lua" and/or the Lua manual might be a better help than StackOverflow questions.
@FaheemMitha One reason for passing only one variable might be that it would be impossible to describe the behavior like this using upvalues and a while loop if more values would be passed. Also it would be complicated to implement since the stacksize in every loop iteration would be different.

@MarcelKrüger Actually, that code extract was from a manual. I.e. lua.org/manual/5.3/manual.html#3.3.5
@MarcelKrüger Hmm. Actually most languages don't implement multiple return values. In fact, I can't think of any others that do, though I'm sure they exist.
Python fakes it, but it's really a tuple, I think.
I was also just looking at lua.org/manual/5.3/manual.html#3.3.5
My enthusiasm for learning Lua is limited, but I do like to know what's going on. It's a chronic lifelong disease.
Also, sometimes it's helpful to understand what's going on.

7:20 PM
@FaheemMitha Please read section 7 of Programming in Lua first to understand how this is used, then you can come back to the while loop expression in the manual and it should be clearer what is going on.

Weird. I meant to paste lua.org/pil/7.2.html last time. But ended up pasting the same link twice.
@MarcelKrüger Are you one of those annoying people who learns everything properly and in order? :-)

@FaheemMitha No, but I read up about the things I missed before claiming that it's unjustified weirdness.

@MarcelKrüger Still seems weird to me. But I don't think Lua and I are destined to be friends.
But anyway, I'll try to read Ch 7. If I can stay awake. Wish me luck.

@FaheemMitha The great part about LuaLaTeX is that you can profit from having Lua available even if you don't want to write Lua yourself since you can use packages which hide it behind a TeX interface.

7:42 PM
@MarcelKrüger That's true. You can.
Though I write Lua too. It's unavoidable.
@MarcelKrüger Do you develop LuaTeX too?

1 hour later…
9:06 PM
@FaheemMitha No (some small patches every now and then, but no serious involvement). You can list the members of the LuaTeX team with luatex -credits.

9:51 PM
Hello my friends in th U.S. and the Anglo-Saxon language areas:

Question: Is it said "pastime" for
things that you do when you are bored?

10:04 PM
@cis not really, it more means "hobby"

11:03 PM
Mmmh, there is the German word "Zeitvertreib":
A hobby is usually something that you aim at and do on purpose. A "Zeitvertreib" (translated 'pastime') is more like something you do to make the time pass; or to make the time go faster.

tex.stackexchange.com/questions/434288/how-to-automatically-create-a-short-caption-for-the-list-of-figures
I am trying to make a list of figures without using any package and am referring t other first answer
I have a class file .cls
and a main tex file
I am confused where t oinsert
\newcommand\slcaption[1]{\caption[\getfirst#1\relax.]{#1}}
\def\getfirst#1.#2\relax{#1}
\begin{document}
\listoffigures
....................
I tried to tweak thew cls file by inserting the above in
\fi
\iffigurespage
\listoffigures
\newpage
am geting error
...................
also with using below \begin{document} in the main tex file..also gives error
\newcommand\slcaption[1]{\caption[\getfirst#1\relax.]{#1}}
\def\getfirst#1.#2\relax{#1}
\protect

\begin{document}
\listoffigures
any help@barbarabeeton ?

@CarLaTeX -- How nice of you to find this! I checked to see if it was in the list of "Often referenced questions", and it wasn't, so I added it. When you come across something this authoritative, please do consider adding it there; make it easier to find useful duplicates.

11:28 PM
@cis (@barbarabeeton may have a comment on this even though she's American so can't reallly speak English). English does have the phrase "something to pass the time" with the meaning that you are looking for, but "a pastime" doesn't really have that connotation. It's a rather old fashioned term (I'm not sure I'd use it normally) but it means a hobby or game that you do for fun.

11:39 PM
@DavidCarlisle and @cis -- I agree on this, that "pastime" is more like a hobby, but not necessarily a serious one. For example, doing jigsaw puzzles is an enjoyable pastime, whereas editing TUGboat is quite a serious hobby. (I'm fond of the word "lollygagging" to describe what I do to pass time more-or-less aimlessly. David, what's your term for that?)
@BAYMAX -- I'm afraid I'd just bite the bullet and add an [optional] short form for captions that needed them. Even if there are a lot of captions, it would most likely take me longer to develop code to correctly parse a long caption than it would to create really good short captions, since with my writing style, I couldn't guarantee that what's before the first period would be short enough.

bite the bullet?
@BAYMAX -- "Bite the bullet" is an old U.S. expression (don't know about UK) meaning "admit this is the most expedient way to do something, so let's get on with it." Regarding short form for a caption, every version I know of defines it thus: \caption[<optional short text>]{<mandatory full text>}.