« first day (4016 days earlier)      last day (900 days later) » 

8:20 AM
@Sebastiano Good morning, I hope all is ok. nullschool earth (no idea why it's called so) is such a nice web. You can have several overlays, also rain: earth.nullschool.net/#current/wind/surface/level/… ;-)
 
9:10 AM
@PabloGonzálezL The Fedora 35 Final RC1.2 compose [1] is GO and will be shipped live on Tuesday, 2 November 2021.
 
 
1 hour later…
10:16 AM
It would be nice if texlua had Lua's -e flag. E.g.
faheem@orwell:~/test-latex$ lua -e 'print(_VERSION)'
Lua 5.2
faheem@orwell:~/test-latex$ texlua -e 'print(_VERSION)'
Script file print(_VERSION) not found
Maybe I've said this already. I forget.
 
@FaheemMitha texlua is the same executable as luatex and so most naturally has the same commandline options
 
10:49 AM
@FaheemMitha vv
$ luatex  '\directlua{print(_VERSION)}\end'
This is LuaTeX, Version 1.13.2 (TeX Live 2021)
 restricted system commands enabled.
Lua 5.3
 
@DavidCarlisle OK. Thank you.
 
@DavidCarlisle hmmmm
@DavidCarlisle T-2M
 
@PauloCereda sorry, bad example
$ luatex  '\directlua{print("lunch")}\end'
This is LuaTeX, Version 1.13.2 (TeX Live 2021)
 restricted system commands enabled.
lunch
 
paulo in ~ at ravenna
➜ luatex '\directlua{print("lunch")}\end'
oh no
 
@PauloCereda ?
 
11:00 AM
@DavidCarlisle <3
 
11:11 AM
@Rmano Good morning to you dearest. The current situation is bad but not serious. There is flooding and high winds. There is now a very strong flood coming. I thank you very much for your interest. I had never seen so much rain and wind in my life. I feel like I am in a tropical zone. I hope it doesn't do any damage.
 
12:03 PM
I'm trying to understand
15
A: LuaTeX C API as Lua C API

topskipI am by far a person that can give you an authorative answer. As I have written in a comment to David, there is no way to use TeX as a (shared) library. But you can use LuaTeX to load modules and execute LuaTeX's functions. Say you want to call texio.write_nl("Hello world!"). You have to write a...

I don't understand why it's necessary to have
lua_remove(L, -2);
Of course I only have a very sketchy idea of what is happening here, but why remove this before the function call has happened?
I tried it without, and it seems to work.
I'm also not clear why it works without. Doesn't the function need to be pushed on the stack before it is called?
 
@FaheemMitha to remove field from stack?
 
@PauloCereda It's -2, so it's removing texio.
The field as well, of course. But again, why does it need to do that?
I also don't understand how lua_call knows which function to call. Or is it the case that only one function can be on the stack at a time?
 
12:53 PM
@FaheemMitha Look at lua.org/manual/5.3/manual.html#lua_call, there is a very descriptive example.
 
@TeXnician If you are referring to a = f("how", t.x, 14), then yes, I've read that.
Suppose I push two functions and their corresponding arguments?
 
@FaheemMitha I especially refer to the following example where each line is commented, including the stack operations.
 
And then call lua_call?
@TeXnician Yes, the breakdown of that function call, correct?
Starting with:
lua_getglobal(L, "f");                  /* function to be called */
 
@FaheemMitha No, the equivalent of the Lua snippet a = f("how", t.x, 14) if performed from the C API instead of Lua.
@FaheemMitha Yes, that one.
 
@TeXnician Right, the function call.
 
1:01 PM
lua_getglobal(L, "texio"); /* table to index */
lua_getfield(L, -1, "write_nl"); /* function to be called */
lua_remove(L, -2); /* remove table texio from stack */
lua_pushstring(L, "Hello, world!"); /* push first argument to stack */
lua_call(L, 1, 0); */ call function with 1 argument and without result */

This is the breakdown of the function you did not understand. So how does `lua_call` know which function to call? Because given the stack pointer it calculates where to go for a function with 1 argument and without result and then performs the call.
 
@FaheemMitha It doesn't need to do that, but since texio is no longer needed it's good programming technique to remove it instead of leaving it on the stack.
 
@MarcelKrüger I guess I don't understand how this stack works.
 
@TeXnician lua_call calls the function which it finds on the top of the stack after removing the arguments.
 
Once it has been pushed, does that mean it been "read" by the Lua interpreter?
It doesn't need to remain in the stack?
 
@MarcelKrüger That's what I meant with calculating for the function and 1 argument. But your wording is definitely more concise :)
@FaheemMitha No. Pushing simply stores something on the stack.
 
1:04 PM
@MarcelKrüger So if I push two functions + arguments, it would go with the one at the top of the stack? I.e. the "newer" one?
@TeXnician In that case, define "no longer needed". :-)
Why isn't that function not needed? Before it's actually called?
 
@FaheemMitha Yes, it offsets from the top of the stack (stacks are structures where your only way to retrieve data is from the top so you would have to jump through hoops to actually implement everything else and it wouldn't be particularly stack-like).
 
@TeXnician OK.
 
@FaheemMitha Ever heard of stack overflows? Well, if you leave stuff on the stack and do not clean up you might fill the available space and at some point … you guess it. No longer needed is everything that has been consumed, e.g. a function and its arguments after lua_call (which actually pops the stack accordingly).
 
@TeXnician My question is why the "function" or "function value", if you prefer, it popped before the function call for that "function" is actually made.
 
@FaheemMitha It's not.
 
1:08 PM
That is not what I would expect.
 
@FaheemMitha Where is the function popped before the call? The only thing that's popped is the irrelevant table storing a pointer.
 
@MarcelKrüger Isn't that what lua_remove(L, -2); does?
 
@FaheemMitha No, lua_remove only removes the element at index -2. (The second entry from the top) That's texio.
 
@TeXnician That removes texio, correct?
 
@FaheemMitha Yes, as I said, that's irrelevant as soon as write_nl has been fetched.
 
1:09 PM
@TeXnician It is? Doesn't write_nl depend on texio being present?
 
@FaheemMitha No.
 
@TeXnician Oh. OK.
That wasn't obvious to me.
 
Imagine that the Lua interpreter needed to get texio to look where to find write_nl. But as soon as it figured out where it would find write_nl (the address of the function the table is pointing to) it doesn't need texio anymore. Lua tables are basically many pointers.
 
@TeXnician I see. So once it's done the lookup, it doesn't need the lookup table any more?
 
@FaheemMitha Right, it only needs the address of write_nl (because that has to be called later on).
 
1:12 PM
@TeXnician So when it pushes write_nl, then it has obtained the function? But I thought that in a stack, when the earlier ones were popped, the later ones were also popped? So if texio is popped, isn't write_nl forced to be popped too?
 
@FaheemMitha No, in Lua certain operations can change elements of the stack directly, even if they are not on the top. If a function is documented to remove one element, then it only removes this one element.
 
@MarcelKrüger That seems like cheating. So it's a stack, except when it isn't?
 
@FaheemMitha Well, iirc remove is actually doing the following: pop everything into a temporary second stack until the index to remove is found, then pop the second stack and push everything back to the regular stack. So indeed it is popped but also pushed again. (This is theory and nearly surely not how the implementation will do it.)
So you can express all of this in stack operations but it would be expensive to implement it that way ;)
 
@TeXnician Hmm. OK. But if it's being expressed in terms of stacks, I think it's excusable to get confused.
 
/Postscript intensifies
 
1:17 PM
@FaheemMitha I would say, especially then it is not. Because it just depends which abstract data type your stack is trying to implement. And at some of them it is just a bad choice but stacks are a very simple model for the mind ;)
 
Also, we are on Stack Exchange. :)
 
@PauloCereda You are so modern. Grownups use Forth
 
@DavidCarlisle oh
 
@DavidCarlisle Well, and the banking sector uses Cobol because Forth has been to modern :D
 
/duck eat stack empty
 
1:22 PM
@DavidCarlisle OH NO
 
@MarcelKrüger @TeXnician So if a Lua C function says it removes or pops a value from the stack, one should assume that only that one has been removed or popped? Not the ones after it?
 
@FaheemMitha I'm not really into the Lua C API but it would be the usual expectation: functions only pop what they consume.
 
@TeXnician OK.
 
@FaheemMitha If it removes a value, you should assume that it only removes that value. It will normally not call it pops since pop specifically refers to removing the top element.
 
@MarcelKrüger OK.
 
1:26 PM
E.g. lua_pop(L, 2) would remove both elements on the top. (what you thought lua_remove(L, -2) did)
@FaheemMitha But generally: Read the official documentation. E.g. for lua_remove it explicitly says what happens with higher elements on the stack, so it's pretty clear that they aren't removed.
 
@MarcelKrüger OK.
@MarcelKrüger Yes, I understand. Thank you.
 
1:48 PM
Is there an easy way to resume an enumeration in beamer across frames (like enumitem's resume key)?
 
2:27 PM
@AlanMunn ... by not making separate frames and use overlays instead?
\documentclass{beamer}

\begin{document}

\begin{frame}
\frametitle{title}
\begin{enumerate}
\item<1> test
\item<2> test
\end{enumerate}
\end{frame}

\end{document}
 
@samcarter No, that won't really work, I'm afraid. The numbered elements are more like equations (but aren't).
 
@AlanMunn Can you make a mwe?
 
@samcarter And since I only create slides with markdown I need a mimimalist solution. No time to make a MWE right now.
 
well you can always set the start number manually: `\begin{enumerate}
\setcounter{enumi}{1}`, but no idea if it works in your workflow
 
Keep fingers crossed for clear nights, unusual low auroras might be visible swpc.noaa.gov/news/g3-strong-geomagnetic-storm-watch-october-30
 
 
1 hour later…
3:41 PM
@samcarter How much low? I think Milan is way too low
 
@AlanMunn Maybe like this tex.stackexchange.com/a/55001/52406?
 
@CarLaTeX I didn't find a prediction for Europe, but if Pennsylvania is high enough, it might also work for Milan
 
@PauloCereda ohh! The hedgehog is too cute :)
 
@samcarter :)
 
 
1 hour later…
5:33 PM
@samcarter -- Darn, it's supposed to rain here, with patchy fog. At least it won't be like the storm we had a few days ago. Power outages all over the place, and some of our neighbors didn't get turned back on until today. (We were spared, thankfully.)
 
@barbarabeeton ooh more secret mail :)
 
6:29 PM
@barbarabeeton ... doesn't look much better here: thick clouds and foggy near waterways :(
 
6:55 PM
@samcarter Ooohhh
 
@mickep @samcarter @UlrikeFischer Thanks for all your suggestions. Since I produce Beamer slides with markdown (because the markup:content ratio is much too high otherwise) I've been trying to stick to things that can be done that way, but it doesn't really look like it's possible, so I'll just embed raw LaTeX into the markdown, in which case I can use a regular linguistic example package.
 

« first day (4016 days earlier)      last day (900 days later) »