« first day (3156 days earlier)      last day (1771 days later) » 

12:59 AM
Can I prevent expansion of \def at certain point by specifying some kind of command (akin to "return" keyword in a function) instead of using \if and \else?

\def\myTest%
{%
expand this
% do something to prevent further expansion (but not with \if, \else)
don't expand this
}
This would allow avoiding nested \if tokens.
 
@bp2017 \def itself isn't expandable, so I think you mean the contents of \myTest. Could you clarify your question? With an example, perhaps...
 
 
1 hour later…
2:06 AM
@PhelypeOleinik

\def\myTest#1%
{%
\ifnum#1=6
This is number #1.
% QUIT DEF
\fi
This is number 5.
}
\myTest{6}
 
2:38 AM
@bp2017 Try this:
\makeatletter
\def\QStop{\QStop}
\def\RemoveUntilQStop#1\QStop{}
\def\myTest#1%
{%
\ifnum#1=6
This is number #1.
\expandafter\RemoveUntilQStop
\fi
This is number 5.
\@gobble\QStop
}
\myTest{6}
@bp2017 I have to go. Bed time now. Good night!
 
3:07 AM
@PhelypeOleinik, thanks.
 
 
5 hours later…
8:07 AM
user image
3
a quite unique and new badge ^^^
 
 
1 hour later…
9:17 AM
I'm puzzled that a filecontents environment is being processed without my (seemingly) including the filecontents package.
I have one user defined sty file, but it's not in there either.
 
@FaheemMitha the environment is defined in the format (the package is a contributed extension that adds a few features)
 
Never do something important while upgrading glibc. :)
 
@DavidCarlisle Which format? You mean the document type? I'm using scrlttr2.
 
@FaheemMitha the latex format.
 
@DavidCarlisle You mean the base LateX class? I'm not completely sure what a format is.
 
9:29 AM
@FaheemMitha no it is defined in latex itself. before you load any class file, like \newcommand or \begin or any other latex command:
$ latex '\show\filecontents\stop'
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2018-12-01>
> \filecontents=macro:
->\@tempswatrue \filec@ntents .
 
@DavidCarlisle Ok. So a builtin, so to speak? It looks like the star variant might be defined in the package.
 
@FaheemMitha no the filecontents* is also defined by default
 
@DavidCarlisle Oh? The package version allows overwriting with the star version.
Does the default star version do something different?
 
@FaheemMitha not really, been a while since I looked. I think main thing the package does is remove the restriction that filecontents has to be used before \begin{document} the default version undefines itself at the end of the preamble (due to memory requirements at the time)
 
@DavidCarlisle Ah. Well, the documentation is confusing.
First he quotes ltclass.dtx, which says it can't be used in the document.
Then he writes:
> (The comment about filecontents being valid only before \documentclass is,
in fact, untrue. filecontents is allowed anywhere in the document’s preamble.)
Then he writes:
> The filecontents package provides a hacked-up version of the filecontents and
filecontents* environments that lifts the two restrictions stated above, namely
that existing files are never overwritten and that filecontents must be used
before the \documentclass declaration (really, the \begin{document}).
So, the reader is left unsure whether the original version be used in the document or not.
 
9:36 AM
oh presumably it does change the over-writing rules then. The documentation of the original is in texdoc usrguide
@FaheemMitha why read the documentation of some contributed package as documentation of a core function?
 
@DavidCarlisle That's what comes up with texdoc filecontents.
Why not lift the restrictions, though? It's backwards compatible.
 
@FaheemMitha yes but that is documenting the package not the core function, just same as if you go texdoc enumerate you get the package documentation not the documentation of the core environment.
 
@DavidCarlisle Yes, I understand.
 
@FaheemMitha possibly because no one ever asked. Not often you want to write a file mid document. The comment in ltclass.dtx is wrong as you quote though. We should fix that.
 
@DavidCarlisle does Souldern accept ducks in the neighbourhood?
 
9:42 AM
@DavidCarlisle Ok.
 
@PauloCereda not Souldern, but the next village, Fritwell has ducks in its pond.
 
@DavidCarlisle ooh a pond
 
@DavidCarlisle hmm that's a bit suspicious... I don't see an actual pond
 
@PauloCereda possibly the ducks are on the menu instead
 
9:49 AM
@DavidCarlisle oh no
 
10:01 AM
Just found a very cool package by chance: realhats
 
@Skillmon ooh
@Skillmon it's awesome!
 
@PauloCereda right?
 
@Skillmon yes!
 
@PauloCereda fell instantly in love with it!
 
@Skillmon I lol'ed at the "Make LaTeX great again" hat. :)
 
10:22 AM
Hey friends, we have our first grandmaster: @UlrikeFischer! <3
 
@PauloCereda ;-)
 
@UlrikeFischer That Kasparov bloke does not have a badge. :)
 
@UlrikeFischer Oooh are you the first one awarding it?
 
@CarLaTeX yesterday the tag got the 100 question and then the badge was awarded - I will be the only one for quite some time ;-) tex.stackexchange.com/tags/chess/topusers
 
@PauloCereda wouldn't a grand master have a gold badge?
 
10:31 AM
@DavidCarlisle oh
 
11:09 AM
Does anyone have a reference for how to handle references for a form letter situation? I.e. multiple letters generated by a loop in a single document? Essentially one needs to reset the counter at the beginning of every loop, I suppose.
I think I used to know how to do this, but I can't find an example among my correspondence. Though I don't do a lot of form letters.
And searching isn't bringing up anything.
 
11:31 AM
How much is different each time? If used datatool and a csv file for that
 
@daleif There are a couple of references. I actually have a custom reference counter.
But I don't understand references well enough to know how to handle it.
@daleif I'm using datatool and csv too.
 
@DavidCarlisle Good morning. Is it correct the edit? Already someone punished me as soon as I edited my question after your comment.
 
@Sebastiano as I say I don't think font choice is really on topic.
 
@DavidCarlisle I always listen to the best users. Then I'll eliminate my question. Thank you always for everything....done! Delete it.
 
Looks like just using:
\setcounter{mycustomcounter}{0}
works.
 
11:53 AM
Or make the label name in each iteration of the letter depend on a counter that ticks up on each letter.
 
12:28 PM
Hi, does texlive distribute a compiled version of xindy, which depends on shared libraries?
$ lddtree /usr/local/texlive/2019/bin/x86_64-linux/xindy.run
xindy.run => /usr/local/texlive/2019/bin/x86_64-linux/xindy.run (interpreter => /lib64/ld-linux-x86-64.so.2)
libm.so.6 => /lib64/libm.so.6
ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
libcrypt.so.1 => /lib64/libcrypt.so.1
libncurses.so.5 => not found
libtinfo.so.5 => not found
libdl.so.2 => /lib64/libdl.so.2
libc.so.6 => /lib64/libc.so.6
I wonder that it depends on ncurses 5
also there was no update since 2014 on github.com/jschrod/xindy.ctan
is xindy dead? Did I miss to switch to a new alternative of xindy?
 
@JonasStein well it is still working, but there has been no development and I doubt that something will happen (it would need a major rewrite in many places to get utf8 really right). I would check bib2gls as an alternative (but it works quite differently and needs some changes in documents).
@JonasStein you could also look at xindex.
 
ok thank you
 
12:47 PM
@UlrikeFischer Oooh I see!
 
1:02 PM
@JosephWright I think I sorted out the pageattr business ;-) It now works for all four backends, with a rather minimal impact on the aux file, and one can now rotate float pages with pdflatex too ...
 
@UlrikeFischer Great! I've seen the mails but not read the checkins just yet
@UlrikeFischer Heading to Germany for work shortly: will have all tomorrow free ... hope to look at it
 
@JosephWright better don't try to read them -- they are quite a mess. I restarted I think three or four times because always one backend was wrong.
 
@UlrikeFischer I'll look at the results then
 
@JosephWright I reordered the dtx: the "good" stuff is on top. And where the === are starts the part that still needs reworking ...
 
@daleif I was thinking of that. Is that standard practice?
The counters are now correct, but it's still complaining about multiply defined labels.
Are labels inside a letter environment globally visible? So if there are multiple letter environments inside a document, do they clash with each other?
I guess TeX doesn't really have a concept of scoping?
 
1:10 PM
@JosephWright where are you going?
 
@UlrikeFischer Cool
@UlrikeFischer Frankfurt for Neu-Isenburg on Monday
 
@JosephWright nice. It will be hot there too ...
 
Is there an instruction, on how to compile arara?
I looked at github.com/cereda/arara, because a user requested arara as new gentoo package. But could not find any make files or instructions.
 
1:27 PM
@daleif I'm not sure how to add a counter to the labels, seeing as the labels correspond to entries in a csv file.
I might have no option but to grit my teeth and write a MWE.
 
@UlrikeFischer I know: I was in Karlsruhe Tuesday to Thursday
 
1:39 PM
@JosephWright how could one write this engine independant (assuming utf8 input file): \str_set_convert:Nnnn \l_tmpa_str { Grüße }{utf8 } {utf8/string}. If I got it right, then pdftex needs "utf8" and luatex an empty argument.
 
1:56 PM
@JonasStein @PauloCereda ^
 
@UlrikeFischer I think you have to use two lines or expand to pass the utf8 part as an argument: the native situations are not the same
 
@JosephWright we don't have fold (accumulator) operations on sequences in core expl3? I was looking for a one line solution to the partial sum question earlier today...
 
@DavidCarlisle No, don't think so at present
 
@JosephWright yes. Would it make sense to have another input option (or to change the utf8 option) so that it is {utf8} for pdflatex and {} for lualatex?
 
@JosephWright I went the easy way and used and assignment to hold the accumulated sum, to do it expandably you'd want to iterate a two argument function over the sequence (probably)
 
2:02 PM
@UlrikeFischer -- It's about time.
 
@UlrikeFischer I guess: what would we call it?
 
@JosephWright does the existing utf8 one do anything sensible for luatex, if not you could call it utf8
 
@JosephWright ^^^that's what I wanted to say too.
 
2:21 PM
@DavidCarlisle Something like unicode or std or ...?
 
@JonasStein Hi, got your GH issue. :) The instructions are in the user manual, from page 136 onwards. I will try to come up with a INSTALL doc.
 
great. We have a request for arara here bugs.gentoo.org/688454
 
Can LuaTeX manipulate things like counters and references? Not that I'm planning to.
 
we do not want to distribute binaries. The people who want to prepare a package are interested in required compiler, libs and how to test
 
@JosephWright imho the best would be if utf8 in luatex would do the same as the empty argument (so mean "native"). currently it does nothing sensible (gives errors).
 
2:35 PM
@UlrikeFischer That's a possible: also applies to XeTeX I guess
@UlrikeFischer One for the team list? Bruno might have a reason
 
@FaheemMitha it can manipulate counters not sure what you mean by manipulate references, do you mean like \ref or like \begin{bibligraphy} either way they are macro level constructs so not anything the engine really knows anything about.
 
@DavidCarlisle Following the cricket?
 
@JosephWright no actually, but don't tell @PauloCereda
 
@JosephWright I guess the reason is that "utf8" would be used for two different things, but as it doesn't do anything sensible for luatex I don't think that it really matters.
 
@UlrikeFischer it's sort of a bad name as in the luatex/xetex case neither the input nor the output of the conversion is UTF-8 encoded, but on the grounds of causing least user confusion, it might be the best name to use
 
2:51 PM
@DavidCarlisle what do you mean by that input is not utf8? That the code actually sees only character code?
 
@DavidCarlisle The Lua engine can get access to the value of a macro, though, right?
 
@UlrikeFischer yes the original file encoding is long gone by that point, and whether the character is 1 2 or 5 bytes in utf-8 encoded stream is irrelevant, it is a single token in and a single token out
@FaheemMitha yes (relatively recent versions can)
@UlrikeFischer to put it another way if you used luainputenc (or equivalent callbacks) and the input stream was latin1 or utf-16 or whatever, by the time the token list is tokenized the expl3 function sees the same list of tokens
 
@DavidCarlisle yes, that's what I meant with "two different things". Perhaps to avoid confusion one should really say "dflt" or "std" as @JosephWright suggested.
 
3:34 PM
@DavidCarlisle ooh
 
@UlrikeFischer who do we know with a badge...
3
@UlrikeFischer texdoc xskak not very informative, I see you want to stay lonely with your chess badge:-)
 
@DavidCarlisle chess is similar to cricket?
 
@PauloCereda yes but on a smaller playing field
 
@DavidCarlisle ;-). I really should try to sort the sources of the documentation so that I can upload them to ctan to satisfy texlive. I have to switch to miktex too to read my own docu ;-).
 
@DavidCarlisle ooh
 
3:46 PM
 
@DavidCarlisle I don't know what you mean: ftp.math.purdue.edu/mirrors/ctan.org/macros/latex/contrib/xskak/…. It says I’m quite sure that they are bugs and errors in the package., so it is a good manual.
 
@DavidCarlisle \Huge\chess
 
@marmot that's ctan, try texdoc xksak in texlive....
 
@PauloCereda No \chessboard[3d,sun position=afternoon].
 
@marmot ooh
 
3:48 PM
@DavidCarlisle Yes, texdoc xksak tells me I should look at the pdf version since it uses local fonts.
 
@marmot It tells you Karl doesn't like @UlrikeFischer's document
 
@DavidCarlisle No. Anyway, this is all on the deprecated version of chess, nowadays one uses ducks, koalas, mice and marmots and so on instead of the peasants, towers, runners and queens.
 
@marmot that wouldn't matter for xskak/chessboard, it is (rather) easy to exchange the figurines, only the rules have to stay. Which should the marmots replace?
 
@UlrikeFischer pawn
 
@DavidCarlisle or let it jumping around like a knight?
 
4:08 PM
@UlrikeFischer The marmot is, of course, the queen, and the (recently added) squirrel the king. Ducks can be peasants. ;-)
 
4:24 PM
Minor question. I have this code; I'm not sure where I got it from.
\newcounter{tabenum}\setcounter{tabenum}{0}
But isn't a new counter automatically set to 0?
 
@FaheemMitha yes
 
@DavidCarlisle So that second bit is unnecessary, then.
 
@marmot /sob
 
@PauloCereda On the bright side, it means a lot of ducks.
 
@FaheemMitha yes but sometimes it makes things more explicit or as a placeholder in case you need to start from 42 rather than 0 or ....
 
4:38 PM
@DavidCarlisle Hmm.
 
4:51 PM
@marmot And we can eat them when captured.
 
@HaraldHanche-Olsen Oh no! The next game will need a full set of <s>peasants</s>ducks.
 
@DavidCarlisle Following the cricket?
@DavidCarlisle I'm managing to, and I'm at the airport
@DavidCarlisle, @UlrikeFischer Also trying to write LaTeX3 of course
@DavidCarlisle I've noticed a suspiciously-large number of good expl3 answers from you lately: have you lent @egreg your login details ;)
 
@JosephWright who is playing?
 
@PhelypeOleinik Also lots of good answers using expl3: really appreciated
@UlrikeFischer India vs Afghanistan: it's tight, Afghanistan are playing well
I think India will just survive a big surprise
Flight delayed ... more time for expl3 :)
 
@JosephWright oh no
 
5:01 PM
@PauloCereda It's only a short flight: I'm in Frankfurt (again), having being in Karlsruhe on Thursday. If we'd known about both trips before the bookings were made ...
 
@JosephWright oh
 
@PauloCereda Hmm .. could have had today in Baden-Baden or Strasbourg ... would have been fun
 
@JosephWright ooh Baden twice.
 
@PauloCereda That's basically how it got it's name: used to just be Baden ...
 
@JosephWright :)
 
5:09 PM
@UlrikeFischer Reading your pdfresources stuff
@DavidCarlisle, @UlrikeFischer (@egreg) I'm hoping for feedback on the support work for the Highly Secret Plan ...
 
@JosephWright did I miss something?
 
@UlrikeFischer The debug branch
 
@JosephWright ah. I'm using it currently, it didn't explode yet ...
 
@UlrikeFischer It's more about the interface
@UlrikeFischer So am I: it's nice being able to log-functions without getting all of expl3 itself
 
@JosephWright as in, more than 0 :-)
 
5:15 PM
@DavidCarlisle that's mean
 
@PauloCereda you can't be mean about yourself
3
 
@DavidCarlisle oh
 
@DavidCarlisle Yup
@DavidCarlisle Getting ready for Big Bang 2?
 
@JosephWright is that when everything implodes and the universe ends?
 
@DavidCarlisle Sounds about right ...
 
5:29 PM
@JosephWright so we should give more answers in expl3? But I like the time I spent implementing all those features myself :(
 
@JosephWright we are now going to the theater ... so all comments have to wait ;-)
 
@UlrikeFischer have fun!
 
@UlrikeFischer Have a lot of fun
 
@JosephWright you had to surpass me, haven't you?
 
@Skillmon It's a long standing quote
 
5:37 PM
@UlrikeFischer Wait, with "theater" you are not referring to this chat?
3
 
@JosephWright Oh, thanks! Glad you liked :-)
 
TO QUACK OR NOT TO QUACK, THAT IS THE QUESTION
4
 
@PauloCereda /QUACK
 
@JosephWright ooh
 
@PauloCereda not an issue if wrapped in a pancake with soy sauce
 
5:42 PM
@PauloCereda It's not a hard decision, let's be honest
 
@DavidCarlisle you are mean
@JosephWright not at all :)
 
Jun 5 at 13:22, by Harald Hanche-Olsen
@DavidCarlisle Ah, makes sense. You are not mean.
 
@DavidCarlisle oh
 
 
6 hours later…
11:57 PM
Hello! Quick question:
 

« first day (3156 days earlier)      last day (1771 days later) »