« first day (3164 days earlier)      last day (1761 days later) » 

1:05 AM
Why the first line of every paragraph is always indented with \everypar{\noindent}?
 
 
5 hours later…
6:06 AM
@bp2017 \noindent is for starting a new paragraph with no indentation. When the \everypar tokens are inserted, a new paragraph has already been started, and the indent inserted. Better to set \parindent to zero.
@bp2017 If this is latex, better not use \everypar anyhow, as it is used by latex. (Notably in lists.)
 
 
2 hours later…
7:56 AM
@bp2017 But if you must do this, {\setbox0\lastbox} after the paragraph has been started but before anything has been added to it, will remove the paragraph indentation (which is an \hbox). It can be used in \everypar.
 
 
1 hour later…
8:57 AM
I just noticed that \newcommand doesn't give an error if the number of arguments specified are not provided.
E.g. \newcommand\foo[2]{#1 #2}
Then \foo{foo} works. \foo{foo}{bar} also works.
 
@FaheemMitha Er, not exactly
 
@JosephWright Well, it doesn't give an error, at any rate.
 
@FaheemMitha TeX will accept a balanced text here, which is zero or more tokens in braces or a single token without them
@FaheemMitha #2 in the first case is whatever the next non-space token is
 
@JosephWright Oh, it just grabs the next thing available? Wonderful.
 
@FaheemMitha Yes: try making the replacement text #2 #1 and you'll see it more clearly
 
8:59 AM
Are those xparse functions any less, um, flexible?
 
@FaheemMitha No, because this is a fundamental feature of TeX
 
@JosephWright Ok.
@JosephWright Suppose there is no next thing? There is not in my example.
No, I take that back. One sec.
 
@FaheemMitha There is some next thing unless you are at the end of the file
 
@JosephWright See, for example:
\begin{document}
\foo{foo}{bar}\\
\foo{foo}
\end{document}
Where \foo is defined as above.
 
@FaheemMitha You do have stuff after \foo{foo}: \end is the next token
@FaheemMitha try a document that is just
\newcommand{\foo}[2]{#1 #2}
\foo{oh no!}
and you get
Runaway argument?
! File ended while scanning use of \foo.
<inserted text>
                \par
<*> test.tex

?
 
9:03 AM
@JosephWright I see.
@JosephWright Is TeX actually trying to typeset \end here, then?
 
@FaheemMitha Not typeset, you are just re-inserting the token into the input stream, and it does whatever it does (in LaTeX, \end is a macro, so gets expanded)
 
@JosephWright That's what I meant.
Apparently expanded into nothing printable.
It would be nice if some error checking could happen here...
 
@FaheemMitha \end just looks up \enddocument here, and that then does all of the tidying up for a document
@FaheemMitha What do you mean?
 
@JosephWright I mean, if \newcommand declares 2 arguments, then if the user clearly didn't intend to pass two args, an error would be thrown.
But it sounds like TeX can't tell the difference.
 
@FaheemMitha You can look ahead for a { token (if you don't want things to be expandable), but it's ... painful. Also, a lot of people would find it a surprise: for example, you used \newcommand\foo not \newcommand{\foo} above ...
 
9:09 AM
@JosephWright That's true, I did. My mistake.
 
@FaheemMitha It's not a mistake, really: Lamport in his book does stick strictly to braces, but they are almost-certainly over-the-top for cases where only a single token is allowed (like \newcommand's first argument)
 
@JosephWright I thought that was standard. All the examples have it.
 
@FaheemMitha Well yes, because it has to be a single token
 
@JosephWright But it still works if you don't have the braces?
 
@FaheemMitha Yes, because TeX grabs a balanced text comprising one token in both cases
 
9:18 AM
@JosephWright Sounds like brackets are "safer".
 
@FaheemMitha Yes, which is why Lamport's book always uses them
 
@FaheemMitha actually not, they allow you to do \newcommand{\foo1}{something} which passes in \foo1 as first argument (which then doesn't work)
 
@DavidCarlisle Because TeX doesn't like the integer?
 
@FaheemMitha yes the argument has to be a single token, using braces rather hides that fact as it lets you pass in an arbitrary token list
 
9:22 AM
@DavidCarlisle What's the advantage, though? Does it give a better error message?
Checking...
It gives the same error in both cases.
 
@FaheemMitha mostly clearer documentation if you document the command takes a single token (expl3 N argument type) as opposed to a braced list (expl3 n)
 
> ERROR: You can't use `macro parameter character #' in horizontal mode.
 
@FaheemMitha then you didn't use the example I used. (but the behaviour in either case is spurious accidental expansion as newcommand does no error checking)
 
@DavidCarlisle What was that example again?
@DavidCarlisle Are the xparse commands any betterm in any respect?
As in, in there any reason to prefer them from the pov of error checking?
 
you get no error from either form here, but the behaviour is perhaps not what you expect
\documentclass{article}

\begin{document}

\newcommand{\fooa1}{something}

\newcommand\foob1{something}



\end{document}
 
9:32 AM
@DavidCarlisle did you see the complain about a mailing list answer here tex.stackexchange.com/q/498032/2388 ;-)?
 
@DavidCarlisle Both definitions typeset "something". The first, with a 1 in front.
 
@FaheemMitha xparse does do more error checking up-front, yes
 
@FaheemMitha the first one defines nothing and typesets 1something the second one defines \foob to be 1 then typesets something
 
Wonderfully confusing if you weren't expecting it.
@DavidCarlisle It doesn't define anything?
 
@UlrikeFischer yes @HenriMenke didn't like my follow question it seems:-)
 
9:34 AM
@DavidCarlisle better now;-)
 
So I have again been looking at fontspec documentation and I have noticed the Renderer property can take Harbuzz and Graphite values. But neither works here on Linux with TexLive 2019. Are those only available on some platforms?
 
@FaheemMitha well it defines some internal tokens to nonsense values, it doesn't define\fooa or \fooa1 or anything else that you might access.
 
@DavidCarlisle Oh. I know TeX doesn't like integers in macro names. But I can never quite remember why. Though I've read explanations.
Perhaps it makes it change modes or something.
 
@FaheemMitha nothing much to do with integers here
 
@DavidCarlisle Oh?
 
9:41 AM
@DavidCarlisle I found the question that triggered the lua question: tex.stackexchange.com/q/498021/2388.
@wilx no it is broken. I already made a bug report: github.com/wspr/fontspec/issues/370. Currently you have to use e.g RawFeature={mode=harf}.
 
@UlrikeFischer Yup, that's the same error I saw. Thanks.
Not that I have any use for that. I was just tinkering with my document. :)
 
10:00 AM
Morning quack!
 
@PauloCereda QUACK
 
@JosephWright ooh a duck
 
@PauloCereda Who are you who are so wise in the ways of science?
 
@JosephWright Arthur Reutenauer, king of the Britons? :)
 
@PauloCereda :)
 
10:08 AM
@JosephWright now I want to watch the movie again. :)
 
@JosephWright I'm guessing Monty Python.
 
@FaheemMitha Got it in one
 
That was a guess, I didn't actually search.
 
@FaheemMitha It has everything to do with category codes (catcodes for short) So yes, it does have something to do with integers, just not in the way you were thinking. Letters and digits have different catcodes.
 
@HaraldHanche-Olsen Hmm. I hadn't registered that. But Ok.
 
10:19 AM
@HaraldHanche-Olsen feline schemes. :)
 
I thought all of ASCII was one code. And spaces were another. And then special characters had their own.
> 11. Letters: the alphabet.
 
@PauloCereda I am currently living with my sister’s cats, so I know a bit about their schemes.
 
@HaraldHanche-Olsen ooh
 
I've not noticed numbers having their own catcodes.
 
@FaheemMitha No, they are catcode-12 ('other')
 
10:23 AM
@JosephWright Oh, I see.
 
@FaheemMitha It doesn’t seem that giving digits their own catcode would have been very useful.
 
@HaraldHanche-Olsen Depends what one was going to do with them, I suppose.
I guess TeX probably wasn't going to add them together.
I don't see why they couldn't lumped in with the letters, though.
From a typography point of view, are they really different?
 
@FaheemMitha Well catcodes are more about TeX than typography
 
@JosephWright I thought TeX was about typography.
 
@FaheemMitha A control sequence is named by a backslash followed by one or more characters with catcode 11, or a single character with a different catcode. Giving digits catcode 11 would change the meaning of \count0. I guess it boils down to Knuth’s preference.
@FaheemMitha Yes but it’s also the mahinery to make typography happen.
 
10:35 AM
@HaraldHanche-Olsen So, if you use integers to number stuff, then they have to be handled differently?
 
@FaheemMitha Well yes, you'd need to say \count 0 not \count0 or similar
 
Like those toks things?
 
@FaheemMitha Also have numbers, yes
 
@FaheemMitha Those too. And \box and \dimen and …
 
I don't think I've even seen a register in the wild. They mostly seem to stay hidden.
 
10:38 AM
@FaheemMitha Latex hides them. In the plain tex world, thet are all over the place. And in any latex class file.
 
@HaraldHanche-Olsen I guess LaTeX hides a lot of stuff. By design.
A bit of a shock to the system if you need to do some actual programming.
 
@FaheemMitha Absolutely!
 
 
4 hours later…
2:27 PM
Is this really still on topic? tex.stackexchange.com/questions/498057/…
 
@Skillmon No
 
@JosephWright thanks.
Is stuff put into the TEXMFLOCAL considerably faster loaded than TEXMFHOME, does anyone have some experience with this?
 
@Skillmon TEXMFLOCAL uses ls-R files, whereas TEXMFHOME must be searched explicitly. Thus file finding is faster for the former.
@Skillmon I guess that with an SSD there is not so big a difference, provided TEXMFHOME is not large and deep.
 
@egreg reasonable assumption
 
2:44 PM
Does anyone have a reference to a primer for Lua callbacks? What they are used for, how they can be used etc.?
Simple examples strongly preferred.
 
@FaheemMitha chickenize code is pretty good (seriously!)
 
@JosephWright I love how chickenize is always brought up when one asks for Lua examples.
 
@Skillmon 'Cause it's good Lua code, even if the outputs are ... special
 
@JosephWright David mentioned that one once before. But it's not exactly a primer.
 
@JosephWright I love the guttenbergenize option (I'm studying at the same university where he plagiarized his doctor's thesis).
@FaheemMitha texdoc luatex starting from page 165 the Lua callbacks are described.
 
2:57 PM
@Skillmon I see it. But it's a bit overwhelming. Mostly a list. Are there any callbacks invoked when calling a macro?
 
@FaheemMitha No
 
@JosephWright Ok.
 
3:10 PM
@FaheemMitha well, depends, if the macro contains a \directlua...
 
@Skillmon Hmm.
 
@FaheemMitha but without parsing the input there is no way of telling whether the user called any macro that is not handled by Lua (but you can hook into the file reading)
@DavidCarlisle \newcommand\foo{\directlua{bar}} is a macro, isn't it?
 
@Skillmon sorry misread
 
@DavidCarlisle no problem :)
 
@Skillmon Hook into the file reading?
 
3:15 PM
@FaheemMitha if I'm not mistaken you can alter the tokens TeX sees with Lua callbacks, before TeX tokenizes them (I'm not very familiar with how LuaTeX works)
 
@Skillmon Probably. Oh, you mean as TeX reads the file?
 
@FaheemMitha all the callbacks are listed and categorised in the luatex manual. not sure what else you are looking for
 
@FaheemMitha yes.
 
@DavidCarlisle I guess he looks for something which is a bit more explanatory on how to use them, what they do, containing small examples.
 
3:17 PM
@Skillmon chickenize:-)
 
@DavidCarlisle was already proposed:
31 mins ago, by Joseph Wright
@FaheemMitha chickenize code is pretty good (seriously!)
 
It's possible I don't need callbacks for now.
 
@FaheemMitha If you told us what you're trying to achieve, it would be easier to help you :)
 
@Skillmon Nothing in particular really. Though I did, at one point, write macros inside a Lua string, inside a Lua loop. That did feel a little clumsy.
I was planning to post it as an answer here.
 
@Skillmon yes I know
 
3:24 PM
36 mins ago, by Skillmon
@JosephWright I love how chickenize is always brought up when one asks for Lua examples.
 
4:01 PM
ooh chickens
 
 
1 hour later…
5:09 PM
@PauloCereda not as tasty as ducks.
 
@Skillmon oh no
 
cis
It is 39.4 deg Celsius today.....
..............................................

Haw-Haw!
I hacked pgfmath into a CAS; with GNUPLOT:
\newcommand\Function[3][fixed,precision=6]{%%%%%%%%%
\sbox{\mycalc}{%%
\begin{tikzpicture}[]
\begin{axis}[]
\addplot[blue,domain = {#3:#3+0.1}] plot gnuplot[id=mycalc]{#2};
%\addplot[blue,domain = {pi:2*pi}] plot gnuplot[id=mycalc]{5};
\end{axis}
\end{tikzpicture}
}%%%
%\usebox{\mycalc}
%
\pgfplotstableread[header=false]{\jobname.mycalc.table}\tempdata%
%\pgfplotstabletypeset[string type]{\tempdata}
%
\pgfplotstablegetelem{0}{1}\of\tempdata
\pgfmathsetmacro\y{\pgfplotsretval}
\pgfmathprintnumber[#1]{\y}%
0
A: pgfmath / gnuplot: How to use gnuplot for complicated calculations?

cisSomething like that: Short: % arara: pdflatex: {shell: yes} \documentclass[margin=5mm, varwidth]{standalone} \usepackage{pgfplots, pgfplotstable} \pgfplotsset{compat=1.16} \newsavebox{\mycalc} % See to: http://gnuplot.sourceforge.net/docs_4.2/node53.html \begin{document} \newcommand\Funct...

 
5:26 PM
I found a facebook page about LaTeX-memes.
 
user image
4
I especially like this one.
 
Heh. So meta.
 
5:44 PM
@AlanMunn LOL
@AlanMunn ^^ Two of my favourite French singers singing Edith Piaf. :)
 
@PauloCereda <3
 
@AlanMunn <3
 
@PauloCereda My Spotify is mainly French these days.
 
@AlanMunn That's good. :)
I need to move on to Spotify...
 
@PauloCereda Huh?
 
5:50 PM
@JosephWright I don't use it. :)
 
@PauloCereda Ah
@PauloCereda I got a free account very early on ...
 
@JosephWright really?
 
@PauloCereda Yes, I don't remember exactly when
In other news, anyone want to buy a Mac Mini ...
 
@JosephWright Interesting.
@JosephWright I cannot afford one yet, but I want to get it in the future. :)
 
@PauloCereda It's an old one ..
 
5:52 PM
@JosephWright oh I got it now
@JosephWright getting room for a new one, perhaps? :)
 
@JosephWright Like all streaming platforms, it's pretty crap for classical music. Not so much because of what's there, but because of the lack of useful (and visible) metadata.
 
@JosephWright -- No, but maybe someday a Mini Cooper, since they don't make Saabs any more.
 
@AlanMunn It would be amazing to jog while listening to the 1812 overture. :)
 
@PauloCereda Tchaikovsky does Boom Boom Pow.
 
@AlanMunn LOL
 
5:56 PM
@AlanMunn Sure, I wouldn't even consider it for classical, but then I have Radio 3 to listen to
 
Friend:What instrument do you play?
Me: Heavy Field Artillery
@AlanMunn ^^
 
Meanwhile, where's @DavidCarlisle when there is an exciting cricket match
 
Pachelbel: I'm writing a canon in D.
Tchaikosvsky: I'm putting D canon in my song.
@AlanMunn ^^
Why am I having so much fun with this? :D
Random person: canons aren't instruments
Tchaikovsky: hold my vodka
 
@HaraldHanche-Olsen, thanks.
 
6:18 PM
@JosephWright there are no exciting cricket matches?!
 
@PauloCereda -- Not sure about that, but it used to be very effective when timed to coincide with when a roommate asked to be waked up.
 
6:36 PM
@JosephWright my husband's comment: "Daddles is trying for the Indian Citizenship." <<@DavidCarlisle
 
@PauloCereda LOL
@PauloCereda Put another round in my canon.
 
 
5 hours later…

« first day (3164 days earlier)      last day (1761 days later) »