« first day (3176 days earlier)      last day (1758 days later) » 

7:03 PM
Hmm, pgfkeys isn't letting me pass a coordinate pair as the value of an argument.
Specifically (7,0).
 
@FaheemMitha Example?
 
@FaheemMitha you need to hide the comma with braces.
 
@UlrikeFischer Oh, right, the comma is the problem.
@UlrikeFischer (7{,}0), or something else?
 
@JosephWright I have a problem with the lualatex and the dev-format. As soon as I install something in latex-dev in a local texmf-tree, lualatex finds these files first. But kpsewhich --progname lualatex article.cls finds the one in texmf-dist.
 
@FaheemMitha no, pass it in as {(7,0)}. The outermost {} will be stripped, but if you pass in {,} the comma will be hidden for future parsing, too.
 
7:08 PM
@UlrikeFischer Er that's strange
 
@Skillmon Ok, I'll try that.
@Skillmon Ok, that works, thanks.
 
@FaheemMitha you're welcome.
 
Actually, I now have two places where I would like to either place a line of code or nothing.
I could use a boolean argument, and place the code if the arg says true, but I'm hoping there is a slicker method.
I think @texdr.aft earlier possibly made a suggesion.
 
@FaheemMitha take a look at etoolbox and see if one of the provided toggles could be of use for you. Simple and efficient.
 
@JosephWright does it work for you?
 
7:12 PM
@FaheemMitha Alternatively, if you wanted to do it yourself, you could look into how optional arguments are implemented
 
@texdr.aft In pgfkeys?
They're all optional arguments.
Well, nearly all of them. If I want to include some code but don't want it expanded before passing it in, is .code correct?
 
@FaheemMitha take a look at xparse, it is very powerful regarding optional arguments (didn't read the entire conversation, so I have no idea what you're trying to do)
 
@FaheemMitha I'm not sure. I totally forgot that that's what you're focusing on. Sorry.
 
@UlrikeFischer I'll have to check
 
@Skillmon Using pgfkeys to pass key-value arguments to a macro.
 
7:15 PM
@FaheemMitha so something like (I'm not really familiar with pgfkeys but just want to be clear) \macro[do={code}]{whatever} does {code}, but \macro{whatever} does not do {code}?
 
@texdr.aft Well, the second option should be nothing. It's probably not that hard, but it's getting late here, and I'm fuzzy.
Will probably knock off soon.
 
@FaheemMitha in that case any optional argument implementation suffices, but xparse's cares for balanced square brackets, which is a nice bonus.
 
@Skillmon xparse doesn't handle name-value arguments, does it?
 
@FaheemMitha \NewDocumentCommand\foo{O{}}{\pgfkeys{#1}<do stuff>}, xparse only for the grabbing of the optional argument, any key=value interface can do the additional parsing of #1, pgfkeys being one of them.
 
@Skillmon Sure. Right now I was using \newcommand in the interest of simplicity. You're saying \NewDocumentCommand would be a bit better re error handling?
 
7:23 PM
@FaheemMitha i think \NewDocumentCommand is necessary with xparse
 
@FaheemMitha \foo[bar=[baz]] would be parsed as [baz with \necommand with a trailing ] that would be inserted after \foo did its job. with xparse the result would be [baz].
 
@JosephWright I think kpse is not correctly initialized, when I do \directlua{kpse.set_program_name("lualatex")} it behaves again.
 
@UlrikeFischer Oops
@UlrikeFischer Do we need that in the .ini file?
 
@Skillmon That seems a weird way to do things. Are you recommending \NewDocumentCommand?
@texdr.aft If I was using xparse, then yes. :-)
 
@JosephWright looks so, and \directlua{kpse.set_program_name("lualatex-dev")} for the dev. Currently it obviously uses progname=luatex.
 
7:29 PM
@FaheemMitha the point was, that \newcommand doesn't care for a nested pair of brackets and only reads the optional argument to the first closing bracket, but with \NewDocumentCommand the brackets would be read balanced, for example: \foo[abc[def]]{ghi} with \newcommand\foo[2][]{...} would grab abc[def as argument #1 and ] as argument #2, after that there would be a {ghi} that wasn't read at all. With xparse the arguments would be read as abc[def] as #1 and ghi as #2.
@FaheemMitha with \newcommand you have to input the above as \foo[{abc[def]}]{ghi} for everything to be read correctly.
 
@Skillmon Ok, I'll try \NewDocumentCommand.
But the earlier problem I was having was with commas.
 
@FaheemMitha but the best part of \NewDocumentCommand is that you can easily define multiple optional arguments and similar.
 
hello eerybody
 
@Skillmon That's one handy feature.
 
@FaheemMitha for key=value syntax, you always have to input arguments containing a comma with a {} around the value. You always have to input things containing a comma as key={value,with,comma}, correct parsing would be a big overhead, no package that I know of takes care of, as the first step of all the key=value implementations is splitting the argument at the commas.
 
yo'
7:46 PM
@Skillmon there's no real way how to deal with it in any other way.
 
@yo' well, you could define a key of which you know its value contains a comma and handle it that way. So there is a real way to do it, but it is not reasonable to introduce the additional complexion necessary for the parsing.
 
just wanted to share this thing I made with Ti_k_Z:
https://i.imgur.com/6uJmzbw.png (Sorry, Imgur doesn't host vectors).

I asked a question about automating it here: https://tex.stackexchange.com/q/499447/165801 , but ended up doing it manually.
 
@tjt263 that's really cool. Eventually I need to learn Tikz...
 
yo'
@Skillmon the parsing is not the issue, this is still solvable with REGEX (no xkcd this time please), but it's unpredictable. You could also e.g. say that your key cannot contain = and that it has to have a value; then you can parse ([^,=]+)=([^=]+)[,$]
 
i tell myself the same thing ha
feels like I'm stumbling in the dark at the moment
 
7:53 PM
@tjt263 well, at least you got a great result
 
thanks. it just took a long time. i would love to be able to whip it up real quick, you know? which i think could be possible
the syntax is a bit difficult to get used to
marmot seems to have almost mastered his skill
 
of course if you practice enough you can get to the same level
 
that syntax though. it's so.. unorganised. sometimes
 
@yo' no need to use a (very poorly performing) regular expression (sorry Bruno, I love your l3regex but one shouldn't use it too excessively), in l3keys one could e.g. implement a tl_set_comma_separated:NN that grabs the current value and the next entry in the sequence (with a bit of an overhead to test for a ={some,comma})
 
@tjt263 I think the process is (1) think of what you want to achieve (in this case what you want to draw), (2) do it any way you can, then (3) generalize it. that last step is
 
7:59 PM
i kind of want to go through and reactor it with a consistent style and catalogue it all neatly
 
that may be quite a rabbit hole!
 
@tjt263 l3draw:-)
 
whats that!
l3draw
 
@tjt263 the new picture mode.
 
@DavidCarlisle ooh ducks
 
8:00 PM
@tjt263 nobody except for David will use it
 
@tjt263 if you want a completely "logical" graphics programming language, there's always metafont
 
@tjt263 start of a clean expl3 re-implementation of a pgf-like thing (nothing like tikz yet)
@texdr.aft or latex picture mode
 
true
 
@Skillmon not even Joseph?
 
maybe metapost? I don't know anything about it though
 
8:01 PM
what's metafont? i was thinking of trying postscript. i tried using things like tikzit and tikzeditor etc but they're a little bare
 
But if you're after 100% well-documented and 100% logical (almost), I'd say metafont is as close as you're going to get
it's not nearly as powerful as tikz although it hasn't really been exploited to its full potential in my opinion
@tjt263 it's Knuth's original font/typeface designing software used to create Computer Modern
 
oh. is knuth stil around
 
@tjt263 meafont or metapost? metafont is the companion to TeX written by Knuth to design the computer modern fonts, metapost is a derived program that generates more general postscript/pdf graphics using basically the same language as metafont
 
it's unique in that (1) it's a programming language and not a GUI-based program like fontforge and (2) it allows you to parameterize everything, which is how all of the variants of computer modern were created
 
@texdr.aft but presumably metapost rather than metafont if you are aiming for general graphics
 
8:03 PM
@DavidCarlisle yes
 
@tjt263 yes (but not here)
 
i dunno whatever someone mentioned earlier
 
if you want a tikz alternative right now, metafont is probably not a good start :)
well, not the best start
 
actually just started using fontself
 
now, if you implemented a meta- layer on top of tikz... that's another thing
 
8:04 PM
butit's guy only
gui
 
@texdr.aft metapost is built in to luatex and is basically what context uses for graphics as far as I can tell
 
@texdr.aft that might be a more pragmatic approach
 
metafont is possibly one of the most unique pieces of software I know of; it's so specific yet so generalized
 
@texdr.aft and pretty much ignored by every font designer since:-)
 
anyone like postscript?
 
8:06 PM
@tjt263 yes (or I did like it 25 years ago:-)
 
@DavidCarlisle it's a shame really... someone announced something similar for truetype a while ago I think, but didn't seem to have any awareness of mf
@tjt263 just use pure postscript!
 
i think most font designers are non-technically oriented creative artists. they look at code and shut down haha
 
I remember reading a comment somewhere that said something to the effect of "it was realized that describing fonts mathematically was only really suited for people who are Donald Knuth..."
it's more like math than a conventional programming language
if i recall correctly, 3x is parsed as 3 * x and not, well, a syntax error
 
hahahahaha that sounds about right
 
and it solves equations to define your outlines
 
8:09 PM
isn't he like.. a math legend
 
so you set up inequalities and it just deals with it
 
@texdr.aft yes but also it's the wrong math for current font technology as it really wants to stroke paths so getting the outlines from metafont is harder than it might be (which is why it took so long to get the first type1 versions of the cm fonts)
 
I'd say so :)
@DavidCarlisle yeah... I think metafont is more wanting in terms of an """"update"""" than TeX
 
@DavidCarlisle :)
 
and sadly it's a bit harder to implement opentype support for metafont than pdf support for tex
 
@tjt263 here's some of knuth's metafont code:
```
vardef serif(suffix $,$$,@)  % serif at |z$| for stroke from |z$$|
  (expr darkness,jut) suffix modifier =
 pickup crisp.nib; numeric bracket_height; pair downward;
 bracket_height=if dark.modifier: 1.5 fi\\ bracket;
 if y$<y$$: y@2=min(y$+bracket_height,y$$);
  top y@1-slab=bot y@0+eps=tiny.bot y$; downward=z$-z$$;
  if y@1>y@2: y@2:=y@1; fi
 else: y@2=max(y$-bracket_height,y$$);
  bot y@1+slab=top y@0-eps=tiny.top y$; downward=z$$-z$;
  if y@1<y@2: y@2:=y@1; fi fi
 y@3=y@2; z@3=whatever[z$,z$$];
 
@texdr.aft if you had total control you could push the metafont logic into the font renderer and so have the font store metafont paths rather than bezier outlines, perhaps (not sure how much compute power metafont would really take for that to be a reality....)
 
well that ruined the indentation but it isn't that much more readable with it...
there we go
 
i think i want Beziér curves
actually i think that syntax would be readable if i understood it. it seems logical. kinda like raw math
 
@DavidCarlisle does metafont internally work with bezier curves (it does if i remember correctly) or its own thnig
@tjt263 well, it was designed by Knuth :)
@tjt263 if you get the METAFONTBook, you can see just how logical it is
 
8:17 PM
lets get hi in here
him
 
he may be busy
if you want to take a look at the book and language, you can READ THE TEX SOURCE of the book; find 'mfbook.tex' at i think knuth/dist/mf/mfbook.tex or something similar
 
what does he do these days
 
"write a book"
 
@texdr.aft a long time since I looked but as far as I recall it does but for stroking the path (with a pen of a given shape) so interpolating the outline of the stroked path (and accounting for intersections) isn't trivial at all.
 
@DavidCarlisle I do know that the way it strokes the path was somewhat of a breakthrough in graphics programming (at least solving a hard problem) at the time
wasn't some version of computer modern created by "tracing the raster output of metafont" or something similarly ridiculous?
 
8:22 PM
@texdr.aft yes but what I mean is that even now it's not trivial to get the outlines (I think most conversions have not used the mathematical path descriptions at all, just rendered a high resolution bitmap in metafont then interpolated the outlines to get the paths
 
well that answers my question
 
@texdr.aft as I was just writing, doing anything else is hard
 
metafont is weird because it combines such a high-level concept (drawing with pens, something that fontforge doesn't even implement as i remember) with the idea of defining paths with equations
but it makes perfect sense when you consider its history
 
@texdr.aft if you stroke along a cubic curve with an elliptical pen, then the mathematics to get the outline is "interesting" metafont doesn't help with that at all as it doesn't need the outline for the font formats it was targeting
 
yo'
@barbarabeeton @PauloCereda Summer camp awaits! I'm just getting all my stuff together and moving it to the car. Tomorrow I start my 18 days in the middle of Nowhere. (Just remember that in Czechia, there's LTE even in Nowhere.)
 
8:28 PM
@yo' not if you leave your phone at home
 
something like a "SyncMF" could be very cool
 
@marmot Thank you very much always for your answer of Physics theme
0
Q: Compact expression of Maxwell's equations: missed minus sign

SebastianoWith much courtesy I ask a simple explanation to be able to obtain a minus sign missing from the compact form of Maxwell's equations: $$\boxed{\square \overleftrightarrow F=\mu_0 \boldsymbol{\mathcal{J}}} \tag{1}$$ where the current density quadrivector is given by the relation $\boldsymbol{\mat...

 
yo'
@DavidCarlisle unable.
 
@yo' -- Stay dry. Don't fall out of a canoe. And have fun!
 
@tjt263 here's a good example of a simple math statement in metafont:
 
8:30 PM
did anyone see that video
 
@yo' how did Baden-Powell manage without a mobile phone?
 
(x1+20)/(x2-20)+sqrt(a**2-2/3sqrt b)
 
it's about drawing vectors using fourier series
 
i haven't watched it all the way but it is interesting
 
@marmot people are really weird. The same person voted against this morning's question just because he doesn't like the x_4=ict notation. And he added another random downvote.
 
yo'
8:31 PM
@barbarabeeton easier said than done: google.com/…
 
Good evening everybody into chat.
 
yo'
@DavidCarlisle he relied on goodwill of people. This is a-changing.
@barbarabeeton and I won't be on the canoe. The other 31 people will :-)
 
@tjt263 note that in metafont x1 is not a distinct variable from x; it's a subscript.
 
i don't know what that means
i'm relatively new to math; since i started studying computer science
 
in c-like languages, x1 x2 x3 etc. are all different identifiers, but in metafont it's like x[1] x[2] x[3]
$x_1, x_2, x_3$
 
8:35 PM
@yo' -- well, teach them how not to fall out.
 
by identifier are you referring to variable names
 
@barbarabeeton where's the fun in that?
@tjt263 yes
 
x[1] looks like it refers to an element of a list or set or a subset of a set, etc
 
@Sebastiano I can confirm that some users are off.
 
so x is the data structure (list, set, array, etc) and 1 is the index of the element
 
8:38 PM
@Skillmon Thanks! (But I fail to be able to use overleaf for free, also because I do not want to share my email address.)
 
is that right
 
@tjt263 yes
 
yeah, i like that
 
@texdr.aft -- Consider metapost. Even DEK uses it, I am told.
 
@marmot Look please these photos:
 
8:38 PM
is it related to postscript
 
it also allows you to define macros that are binary operators: "x macro y"
 
@barbarabeeton David E Karlisle? ;-)
 
@marmot LOL for previous comment: David E Karlisle? ;-)
 
@barbarabeeton of course. I just like metafont; i'm not interested in actual practical drawing
 
@JosephWright I think the correct syntax is kpse.set_program_name("luatex","lualatex") and it must be done after luaotfload is loaded, as lualibs calls kpse.set_program_name("luatex").
 
8:40 PM
@tjt263 also ' means prime; x' is a "different version" of x if i recall correctly
 
@Sebastiano Yes, the physics site is really off. On TeX at least there is a rather simple way to find out who is right and who not, either your code produces the correct result or it doesn't. On physics .... I came across a user who called viXra articles serious research...
 
@texdr.aft in that sense it's usually "complement of x"
 
@marmot -- Nope. Donald E. Knuth. (But you knew that.)
 
but people say "x prime" because it uses the prime symbol (') i think
 
8:41 PM
@marmot I felt compelled to vote for some of yours :-)
 
@barbarabeeton I think so... ;-)
 
@tjt263 yeah in metafont x' is read as "x prime". it also has double prime i believe
 
@texdr.aft i'm actually writing a thing about it
 
@barbarabeeton Is "second burrow on the right" an acceptable address? We do not have postal codes.
 
@tjt263 i'm looking through the metafontbook, and it's so much weirder than i remember
@tjt263 about "prime"?
 
8:43 PM
@marmot use a throw-away-address. From my personal experience with the team, they won't use your data with any malicious intend, the two founders are reasonable and obliging persons (by the way, I'm no longer part of their support:).
 
maybe knuth is a rainman kinda guy
 
I don't judge people. But really some are not normal. I do everything to write a clear question but I don't know how to write it anymore. Ask for help and they will criticize you as well. But the sensitivity, the spirit of union, of participation, where are they?
 
@tjt263 metafont allows any numeric value as an index/subscript: x1.5 is valid and different from x1 and x2. but amazingly, it's equivalent to x[3/2]
obviously that makes sense, but it's sort of unexpected in a programming language
x[3-2k]
 
@texdr.aft no i don't think i ever use the word "prime" because it doesn't refer to prime as a mathematical concept (i.e. factorials and prime numbers etc); about bitwise complementation of boolean values, etc. where A' = NOT(A). such that if A=1, A'=0
 
@tjt263 i see
you can subtract and add coordinate pairs too: (2,3)-(1,2)=(1,1)
 
8:47 PM
yeah that does seem strange
 
i believe you can also do 2(x,y) which is naturally (2x,2y)
 
the last part is not uncommon i don't think
i think python allows that
with tuples
 
python loves its tuples
 
its quite useful
i enjoy the shorthand
 
yeah it's great
 
8:50 PM
it's natural too i think. i love when a language is intuitive like that
 
@marmot -- I'll check and let you know. Are you implying that I can infer something interesting?
 
@DavidCarlisle it almost seems that metafont's draw z1, z2, z3, z4, ..., zn allows for n-order bezier curves, but i'm not sure
 
hey @marmot i sent you a picture
 
@barbarabeeton Interesting ... depends on how you define it. (But I learned some things when trying to type up things that I thought to understand, as usual.)
 
@texdr.aft looks kinda like cartesian coordinates
 
8:53 PM
@marmot -- Well, "interesting" is what my mother used to say when she wasn't sure she approved, but didn't want to be impolite.
 
@tjt263 essentially, but note z1 etc. are coordinate pairs
 
@marmot ^^^
 
@tjt263 Where did you send it? (BTW, could you perhaps tell the OP of the other answer that \node[blullet] (B\the\numexpr\XX) at (\XX,\yDist) {}; doesn't work in his answer, not only because \node[blullet] should be \node[blullet] but because blullet is not defined in his code... If write this comment there might be irritations.)
 
@tjt263 one of the really cool things is that you can define delimiters, if you want to use something like ({[]}) instead of just nested parentheses
 
@UlrikeFischer You sent a case of these to me? When will they arrive? THANKS!
 
8:55 PM
so why do you guys all like latex? is it for typesetting equations, or for drawing vector graphics or what?
@texdr.aft like awk? the language. how you can set field delimeters
 
@tjt263 Nobody likes LaTeX here, this is only about ducks. ;-)
 
I'm in high school and have no use for it; i just really really like it as a concept and for its story
 
@marmot in the same chat room as yesterday
 
@tjt263 i don't really know anything about awk so I can't say
 
@barbarabeeton Well, if I tell my mom her food tastes "interesting" she is not necessarily amused.
 
8:57 PM
@marmot The Bär and the Marmot won't let go of it ;-(
 
@UlrikeFischer Oh no!!
 
@texdr.aft that is.. so bizarre. kind of impressive though. you must be half my age. do you write code? you know, i bt if you used latex to do your homework and blow everyone away, you'll probably graduate early and land at MIT or stanford or somewhere like that haha
 
yo'
@barbarabeeton again, not my job; my friend is a certified instructor :)
 

« first day (3176 days earlier)      last day (1758 days later) »