« first day (771 days earlier)      last day (4177 days later) » 

2:01 PM
@percusse This expresses implication but not subsumption.
 
@StephanLehmke OK the last one |ab| = |a| |b|, consequently |-b| = |b|?
I think it is an implication though.
 
@tohecz $\lvert ab\rvert=\lvert a\rvert\lvert b\rvert$, in particular $\lvert-b\rvert|=\lvert b\rvert|$. However this is mathematically incorrect: $\lvert-b\rvert|=\lvert b\rvert|$ by definition.
 
@percusse Again implication only. I think the original expressions by @tohecz are best, I only don't like the sound of "particularly" (and you need to be completely sober saying it).
 
@tohecz I'd use "in particular"
 
@StephanLehmke I think I'm trying to express what egreg has commented. This is not a derivation of |-b| = |b| it's another validation, since abs(.) is well defined.
this also shows that my proposition is also not good :)
 
2:07 PM
@percusse You can't derive an already known fact from something that depends on the very definition: |ab|=|a| |b| depends on the fact that |a| = |-a|.
 
@egreg not if they are operator norms ;)
 
@egreg Which is why initially I've misread.
 
but thanks everybody, "in particular" seems to fit in well ;)
 
@tohecz Yes, that's different. But any norm satisfies ||av|| = |a| ||v|| (a scalar, v vector), again by definition.
 
@egreg I would not say "by definition", rather "by verifying that the map you claim is a norm satisfies the axioms of norm".
 
2:11 PM
@tohecz It wouldn't be a norm, would it?
 
@egreg it wouldn't. It depends on what you emphasize at what place. I don't write axioms of norm anywhere and I don't prove that the map I call "norm" is a norm since it is obvious. I just need to some stress that - has "the same" properties as + (in this case, continuity).
 
This has the same problem of having if and only if in the definitions. If you define it then it's iff anyway, if you derive it you derive a definition which is circular.
 
@Mohan Minor point: the link you put in your torn paper question is not to JLDiaz's website but to TeXample (which is run by Steffan Kottwitz, or some variant thereof).
 
@tohecz This way of doing things reminds me of the "proof" of the infinitude of primes via the divergence of the harmonic series and Euler's infinite products. :) If it's obvious that it's a norm, there's no need to stress that ||a||=||-a||.
 
More stacked subscripts
0
Q: ConTeXt equivalent of AMSmath's \substack

Charles StewartThe Plain TeX $$ \sum_{i \in S \atop j \in T} i $$ seems to be usually typeset mathematically in LaTeX using the \substack macro from the AMS maths macros (accessed using \usepackage{amsmath}) \[ \sum_{\substack{i \in S\\ j \in T}} i \] which gives slightly different results, most important...

This time in Context
 
2:18 PM
@egreg but there's a need to say "and the algebra (B,-,o) is a ring"
 
Context is nice for laying out text and graphical design things, but I haven't really got the hand of its maths stuff yet.
 
@tohecz If it's an algebra, it's a ring by definition. :)
 
@egreg I think he means universal algebra.
 
@tohecz Please, add some context.
 
TeX.SE where vocabulary questions turn into category theory problems.
4
:)
 
2:22 PM
@egreg Working more in Mathematical Logic and related areas, I've also come to denote by algebra any set together with operations on it.
 
@StephanLehmke I believe it's vector spaces; where "algebra" has a very well defined meaning.
 
Did someone say RING?!
 
@egreg algebra is a set with finitely or infinitely many operations. I construct a counterexample to some statement about topological semirings so I want to be really clear in what I define and how.
 
@tohecz Now that's clearer. :) Use "in particular". :)
 
kan
@David How about a simpler version of my problem? Pass 2.10 to the Exercise environment and get it to print "Exercise 2.10"? Any pointers?
 
2:27 PM
@egreg what a conclusion of a lengthy discussion full of confusion :D
 
@PauloCereda When I first started my PhD, my supervisor asked me how I've designed my controller for a particular robot. I've started the sentence by well I've obtained a group of matrices from an experimental setup... and he was already disapproving with his head murmuring matrices are not groups. I should have seen it coming :D
 
@tohecz ... and incidentally my first proposal ...
 
@percusse ooh! :)
 
And I was a working mechanical engineer.... Now I need to state field of characteristic not being equal to 2 in any conversation with him. So that was a long way you can imagine. :)
 
@percusse I have a forum for people like that ...
 
2:31 PM
@kan sorry I didn't understand the original problem. If you go \def\Exercise#1{Exercise #1} Then \begin{Exercise}{2.10} will print Excercise 2.10 but somehow I don't think that is what you mean?
 
@percusse The last question in my first year Algebra exam was showing an inseparable polynomial over a field of characteristic 2.
 
@percusse Mathematicians are just hard to talk to for normal people. One careless use of "onto" and they'll stop listening, pondering instead whether you're just presenting a deep insight or are just plain stupid.
 
kan
@DavidCarlisle You are right about thinking that way... the apparent complication arises from the fact that Exercise is a modified theorem environment, so, I should be passing arguments like: \begin{exer}{2.10} which sounds fishy... but something I have seen implemented certainly.
 
@AndrewStacey And it's frightening over there (assuming MO) :) Why don't you take @egreg for a trip there, he can surely survive and most probably make it better.
 
kan
Oh, wait.
 
2:35 PM
@StephanLehmke Yes, I didn't understand it for a long time. I didn't even know about the difference having for all at the beginning and at the end of the proposition.
 
@kan sorry I have no idea what the problem is, you'd need to ask a question with a working exampe.
@StephanLehmke Mathematicians are normal people
 
which was apparently crucial.
 
@DavidCarlisle Just a bit different, sometimes. :)
 
@egreg Perhaps it's just that some are more equal than others....
 
I think it's OK if the etiquette is stated more clearly somewhere. This is very typical of student fraternities where you screw up something and you don't even know. There are unwritten rules.
 
kan
2:36 PM
@DavidCarlisle OK. Will do if absolutely needed.
 
@kan \newtheorem*{exeraux}{Exercise \protect\exernumber}} and then \newenvironment{exer}[1]{\def\exernumber{#1}\exeraux}{\endexeraux}}
 
@DavidCarlisle Not from the perspective of all other people ;-)
 
@kan Assuming amsthm. Or \theoremstyle{nonumberplain} if using ntheorem (and no *)
 
kan
@egreg I am using amsthm of course. :)
@egreg Now, can you please tell me how did you come up with that?
 
@kan Been there, done that. :)
 
kan
2:41 PM
@egreg I mean, can you please tell me where do I begin to learn these things from?
I am stupid.
 
@kan Just read everything @egreg ever writes on this site.
For 12 years.
 
kan
@StephanLehmke OK. I'll begin with the first answer today.
 
@kan It's not so difficult. \newtheorem{x}{X} just defines some commands that use X as the theorem name. But it's not necessarily a string, it can be any token list. If it contains a macro like \exernumber, the current meaning of \exernumber is used. So I use a "wrapper environment" that absorbs an argument with which it gives a meaning to \exernumber. Et voilà. :)
 
@kan no, just unexperienced, as all us are are or were. you begin by understanding the tricks, and once you understand a trick, you can try to reuse it or modify it. And then, as time flows, you get to know more and more of them, et voila!
 
@kan Actually \protect is not necessary if you use amsthm, but it is with ntheorem.
 
2:47 PM
@percusse Not MO, the nForum - for folks interested in higher category theory (and maths in general)
 
@kan You could learn Italian and read my book. ;-)
 
@AndrewStacey Oh I didn't know that. I'll mention it but I doubt he's gonna chip in.
@AndrewStacey Also should we reopen this question for your canonical answer? tex.stackexchange.com/questions/86363/…
I can feel some disapproval about our solution.
 
@percusse Already done
Writing something now
 
@JosephWright Please see my last comment. Would you agree ?
 
@percusse Will be linking to that: give me 5 mins!
 
2:52 PM
@JosephWright No problem. Thanks.
 
Some sort of answer given :-)
 
@JosephWright: I have great news. :P
 
Aarrgh. Why can't I \ref a later defined \label? Even if I'm running pdflatex several times!
 
@HenningKlevjer What are you \refing to?
 
a few algorithmicxs a section and a figure
common is they're \label-ed after \ref
(sorry, algorithm}
 
3:00 PM
@JosephWright Wasn't it really just a duplicate of all the "How do I install a package" questions?
 
@HenningKlevjer OK then how doesn't it work? Appearing question marks or undefined references? Are you putting your labels inside or outside etc. Can you replicate the issue with a simple example with one figure or algorithm?
 
@HenningKlevjer probably because the \label wasn't executed. (Does it show up in the aux file?
 
@percusse [??]'s instead of number. labels are just before \end in all env.'s
@DavidCarlisle No trace in the .aux..
One case:
\end{algorithmic}
\caption{This procedure calculates the \texttt{response} value}
\label{algo:attack:dig1}
\end{algorithm}
 
@HenningKlevjer did you run LaTeX twice?
 
@tohecz Yes. But pdflatex.
 
3:05 PM
@HenningKlevjer well if it's not in the aux file \ref won't find it. But there could be any number of reasons for it not being there. \includeonly for example
 
@HenningKlevjer that doesn't matter, pdflatex is fine.
 
@DavidCarlisle Aha! I'm using include on several .tex'es
Is there a way to run latex on each included file first, maybe?
to build the .aux'es correctly at first
 
@HenningKlevjer bingo:-) crystal ball is working well today:-) Just comment out \includeonly and run everything every now and then to get in sync
@HenningKlevjer You need to do that anyway to be sure that everything is numbered correctly
 
@DavidCarlisle How would I do that, structure each .tex as a document?
 
@HenningKlevjer No just run pdflatex on your master document as now, but without an \includeonly line
 
3:11 PM
I have a master-tex-file and one for each chapter beginning with \chapter, so I can't possibly run pdflatex on each
@DavidCarlisle But then, how will it catch the included files?
The refs and labels are in different .tex-es
 
@HenningKlevjer It does all the includes if you don't use includeonly
 
oh, ok.
 
@HenningKlevjer That's OK: It will all work fine unless you stop it working:-)
\includeonly speeds up processing during drafting by just re-using aux file from previous run of the skipped files, but that means that it uses stale information, if you add a new \label or new numbered section, or basically anything to a chapter then references to that chapter and all following numbers might be wrong until you next process that chapter. The idea is that that doesn't matter at draft stage if you just want to quickly proof chapter 100 without processing chapters 1-99
 
@DavidCarlisle I'll have to backup this discussion and work on it later. Thank you both for helping!
(all three, actually)
 
3:27 PM
@AndrewStacey I guess so, but perhaps the fact that it's not part of the TikZ 'core' is important
 
3:49 PM
@PauloCereda Wishful thinking
 
@percusse OMG
 
@PauloCereda There goes another 1.5 hours of runtime.... :)
 
@percusse Yay! While it's compiling, TeX time! :)
 
@PauloCereda I'll try to attack the bounty then :)
I'm always intrigued by the stability of error reporting mechanism of Windoze. It's working quite stably maybe they should extend it to the rest of Windoze.
 
@percusse ah 2012b :-)
 
3:56 PM
@DavidCarlisle I have some close friends from Mathworks and they were discussing the items that are appearing on Abandon Matlab blog. Then this came up :)
 
@JosephWright I edited your answer rather than add another answer.
 
@AndrewStacey Fine
@PauloCereda I've heard back from Ulrike: hopefully we can agree a date soon
 
4:12 PM
@JosephWright Cool! :) Thanks.
 
5:11 PM
@AndrewStacey What's going on with the sledge?
 
@JosephWright I think it's some christmas decoration from SE, they've added a twist to the normal falling gravatars.
 
@egreg expandable/unexpandable what's the difference? (thanks:-)
 
5:40 PM
Hi all! Reading up on LaTeX3. Just curious about the D argument specifier. Specifically: why is it an argument specifier? You cannot 'not use' one argument. It seems to me like it should have come to the left of the :.
When I'm reading about LaTeX3, I can't help but question some of the design decisions. I'd love to discuss that sometime. (Though I don't really have a lot of time lately.)
Though I guess I'm a bit late, seeing as how the interface is now fixed.
 
@mhelvens yes, and as well, considering the way how TeX works, I think it's not a bad interface
 
@tohecz I'm not saying it's bad. There are just several things I would have done differently.
I'll wait for LaTeX4.
 
@mhelvens (I don't want to sound offensive) How many TeX packages have you written?
 
:-)
@tohecz Officially, one. Several on the way. But I do have a background in programming language design.
 
and possibly: How many pages have you typeset?
 
5:49 PM
Oh, many.
 
Believe me that some of the LaTeX3 guys have that background as well.
 
@tohecz Me! Me! Me! Ask me! :P
 
Sure. I'm not flat-out saying they did things wrong. I just want to discuss.
 
@mhelvens "many" is thousands or dozens of thousands? :D
 
@tohecz Closer to thousands. But I don't know why that should be the deciding qualification when it comes to designing a language. ;-)
Just to be clear, I don't mean to be offensive either. Just want to discuss.
 
5:52 PM
Yeah, I believe that "language" site of the thing is a lot given by (e-)TeX itself.
What would you do differently?
 
@tohecz The D specifier is a minor example. More importantly: I'd have separated type information (what the callee needs) from expansion handling (what the caller needs). Then I'd generate argument handlers on the fly rather than requiring them to be explicitly declared.
 
@mhelvens the first is related to the :nnn at the end of a macro name, right?
 
@tohecz Yes. The argument specifiers.
At the end of a function name, in fact.
 
well, this is IMHO close-to-the-best decision in LaTeX3, because as a caller, you need to know, whether your callee is going to fully expand the contents, or pass them as-is etc.
 
@mhelvens lots of people wonder why the :mmm bit is part of the command name rather than some kind of dynamic function modifier, but it's really hard to make the latter work, so many places really need the function names to be a single token to get anything like reasonable behaviour/speed
 
5:56 PM
@mhelvens Well :D is more of a marker, but it's in some ways the same a :w - it does not mean 'one argument' as much as 'you have to know what you are doing'!
 
@tohecz My point exactly. :-) Expansion control SHOULD be in control of the caller. Whether the thing that is eventually passed, however, is a token or a tokenlist or... whatever, should be in control of the callee.
 
@mhelvens but it's impossible. Consider \ref command, it must fully expand immediately
 
@tohecz Neh. Just a design choice.
 
@mhelvens But TeX is a macro expansion language, which imposes certain requirements
 
@mhelvens and i somehow agree, but the choice was made by DEK
 
5:59 PM
@mhelvens Certainly the team have looked before at doing variants on-the-fly, and this did not work in a practical sense (or at least could not be done by the team members at the time)
 
@JosephWright I realize that. I'd just like to understand how that lead to the current design of LaTeX3. It may very well be that I'm flat wrong. :-) But I want to understand.
@JosephWright Please note that I (stupidly) mention two separate issues in one chat-message there.
@JosephWright One about on-the-fly expansion. The other about separation of concerns.
 
@mhelvens As @DavidCarlisle says, having things as one token can be important, as is the fact that TeX will complain before we can 'intercept' undefined csnames
@mhelvens I have no formal programming background, so simple examples are handy :-)
 
@JosephWright Yes, 'one token' can be a valid argument type imposed by the callee. In that case, 'non-expanding tokenlist' would be an invalid expansion strategy on the caller side.
@JosephWright Well, it seems to me that the function itself (the callee) should have control over what kind of information it receives. The caller should have control over how to generate that information (the expansions strategy). Those two 'concerns' are now mixed up in what you call argument specifiers. This means you can not get proper encapsulation.
 
@mhelvens No, that misunderstands arg specs
 
@JosephWright You're right. I should give examples. But chat isn't really the right medium. And I don't really have a lot of time.
 
6:04 PM
@mhelvens Or at least, that sounds to me as if it does
 
@JosephWright Maybe you're right. Can't say for sure.
 
@mhelvens Feel free to send some to LaTeX-L or me by e-mail
 
@mhelvens well that's basically the idea in L3 the "function" has control over the basic functionality (and basically should use n arguments) which is called via a thin wrapper which uses :mox whatever which controls the expansion that happens before the base function is called.
 
@mhelvens The idea of the arg spec is that a function \foo:nnn is a 'base' function, and may do any defined expansion with the arguments 'internally'
 
@JosephWright Maybe I will.
 
6:06 PM
@mhelvens Where the function is used, something like \foo:nno means 'first expand the last argument once, then do \foo:nnn'. Thus it's still down to the base function to do 'stuff'
A good example of that is \int_set:Nn where the n-type argument has to be something that will turn into a numexpr on expansion
(Hopefully I have the time zone conversion correct)
 
@DavidCarlisle Just a tiny, negligible difference. :)
 
@JosephWright Thank you very much! :)
 
@JosephWright Yes, I understand. Ok, example: You offer both N and n as argument specifiers (or: caller decision). But whether the function can handle a single token or a braced set of tokens (or a function, or a csname, or...) should be up to the callee. How to generate it should be up to the caller. Both are now encoded in argument specifiers.
 
@mhelvens I suspected you might raise this
 
@JosephWright @DavidCarlisle @tohecz It was not my purpose to start a full-blown discussion right now. :-) I don't yet know enough about LaTeX3 to say anything with certainty. My apologies. If I every raise an issue like this again, I'll do it with examples and more well-reasoned arguments.
 
6:11 PM
@mhelvens Don't worry: happy to talk
@mhelvens The reason for having these is that they are both sensible at the 'base function' level. There are many cases where you want different behaviour at the \foo:n and \foo:N level (see for example handling of comma lists, where the n functions strip spaces, but stored lists are already processed and so N does no stripping)
 
@JosephWright: 13 UTC?
 
@PauloCereda Hopefully :-)
 
@JosephWright Thanks. :)
 
@mhelvens I hope I wasn't rude, and if I were, accept my apologies
 
@tohecz It was a legitimate question. No worries. :-)
 
6:15 PM
21
A: TeXtalk interviews

Paulo CeredaOur next interviewee: Ulrike Fischer Interview scheduled to Thursday, December 13th, around 13:00 UTC. Everybody is invited! Lost with the UTC time? Click here to see the event time in your local timezone. :)

@JosephWright: One for the bulletin. :)
 
@mhelvens I guess you'd prefer we had just 'pure' expansion in the spec, with the 'different handling' in the name. There is of course an argument for that (see for example \str_if_eq_x:nn), but the n/N base stuff works quite well in concert with how we actually want to process arguments.
@PauloCereda Already done
 
@JosephWright Wow!
 
@tohecz That's not true. DocScape for instance has a much different "language level". It's just a question how much overhead you are willing to accept.
 
@mhelvens There was quite a lot of internal discussion to reach the current situation
@StephanLehmke True: some people really don't like the amount of stuff LaTeX3 requires
 
@JosephWright Indeed, that would have been my suggestion. And indeed, it would have been more verbose at times. What you're doing is overloading on parameter types. But I'm not sure that could be done properly in TeX anyway (i.e. determine whether a given actual parameter is a single token, or a list, etc. and dispatching different implementations based on that).
 
6:18 PM
anyways, I gotta go in couple minutes
 
We can use our new interview lioness! Yay!
 
@JosephWright The main question is: Will people use this to define math symbols or graphic objects other stuff which is evaluated a real lot during document generation. In that case it'll get really critical.
 
@JosephWright Anyway, we academics are way too much into mathematical purity. So much so we usually don't get anything done. ;-)
 
@mhelvens The problem is not only detecting what is given (can be done, but time cost could be too high), but also if you are passed \foo, is it a single token list or a macro used to store a passed list.
 
Hullo peeps.
 
6:20 PM
@JosephWright Well, you could 'check what is given', then expand, then 'check what is left' and use both to determine the dispatched implementation.
In theory, anyway.
 
@StephanLehmke True, but even then there are other issues. Simply saying that a primitives-only approach is faster is not necessarily true as each loop, etc. is then done by hand and it's easier to mess up.
 
Why do I get this error:
Thank you for your help...
 
@mhelvens I see what you are after, but I'm really not sure the effort is worth it, nor am I sure that hiding whether a macro expects a variable or an arbitrary list is really that helpful
 
@JosephWright That's the tradeoff between speed of development and speed of execution. But indeed it is well-known that while high-level languages (like prolog) execute slower on a benchmark level, it is much easier to express complex algorithmic optimizations or caching techniques in them so the system as a whole may be more efficient.
 
@mhelvens What would be handy is an example where you think such a change would offer a benefit in terms of code readability, performance or similar.
@StephanLehmke In the TeX world we have a lot of people writing code without training. So there are quite a lot of cases with poor loops :-)
Try reading some of pgf
Right, have to get off to get home
 
6:26 PM
@JosephWright My argument would be code readability. It would probably be costly in terms of performance. :-)
@JosephWright Thanks for the discussion. Cya!
@JosephWright Actually, my argument would be encapsulation and reusability. With readability a close second.
 
A question, if I may: How would you draw a border around some content without enclosing it in a TeX scope? It may contain \defs that have to survive past the border.
A very strange question, I agree, mixing visual formatting with definition scope. :-)
 
@mhelvens gdef is not an option?
 
@JLDiaz Nope. The content to enclose doesn't come from me and may contain anything.
(Well, anything that would be valid TeX on its own.)
 
Is "because you're using Windows" a correct answer to this question? :)
0
Q: Why do I get the following error

GigiliI get this error trying to execute my code: I don't know what has changed that caused this error but going through preference, I don't seem to know what should be done there and what's wrong.

 
6:41 PM
@egreg Possibly. :)
 
6:59 PM
@mhelvens put the border on aftewards, either in teh output routine
 
@DavidCarlisle Sounds reasonable. But I don't know how. :-) Can you give me a URL or a search term?
 
@DavidCarlisle, would it work to put the content in a box and then \usebox inside the frame?
 
@mhelvens oops sorry connection dropped and lost my edit. in the output routine or uisng \pdfsavepos to get the coordinates or using tikz or pstricks coordinates
@JLDiaz no that's a tex group
 
Ah, using \tikzmark is a good idea
 
@DavidCarlisle \pdfsavepos sounds pdf-only. tikz feels a bit overkill, (though I guess I could get it to work). Could you point me toward an explanation of the output routine solution?
 
7:04 PM
@mhelvens :don't be fooled by names:-)
@mhelvens no I have to get food:-)
 
@DavidCarlisle Hehe. Bon apetit.
I guess I'll go for the tikz solution. I've done something similar in the past.
 
7:18 PM
@mhelvens I was thinking about N/n on my cycle ride home. There are actually very few cases where there are two functions with the same name but a variation in this only (some for clists come to mind). So as much as anything the difference here is about keeping us 'honest', as TeX does mind about single tokens quite a bit.
 
@JosephWright The 'honesty' you describe is what we call type-correctness. Don't give a string to a function that expects an int. Or in this case: don't give a tokenlist to a function that expects a single token. My earlier point was that this should be dictated by the function-definition, not by the one who calls the function.
@JosephWright That being said, I would still allow the caller to give a token list to a function that expects a single token, as long as exhaustive expansion is specified and the caller is sure that it will expand to a single token.
@JosephWright Additionally, I would employ some kind of runtime-typechecking to make sure that the right thing is actually passed, so you can supply the programmer with useful error-messages.
@JosephWright And of course allow the programmer to disable runtime-typechecking when performance is a factor.
 
0
Q: What makes a good community advert?

Joseph WrightThe Community Promotion Ads - 2013 question has recently appeared on meta. In a comment there, tohecz points out that the stats for the 2012 ads show that older ads get far fewer clicks than newer ones. This raises the question of how many ads to reuse, and more generally what makes a good ad. Th...

@mhelvens Braces
 
@JosephWright Braces don't turn a token-list into a single token, though. :-)
 
@mhelvens We do have some runtime checks, mainly to deal with the fact that TeX registers have to be defined but macros do not
@mhelvens Other way around. In for example \cs_set:Npn, we are providing a wrapper around \def. That has to have a single token first argument, so braces from an x-type expansion are a disaster.
At one point, we had a whole family of 'one token, no braces' specs. They got dropped in a big refactor.
 
@JosephWright Ah, x-type still leaves braces? I wasn't aware.
@JosephWright Hm. I guess I would have left those in. Seem useful.
 
7:27 PM
@mhelvens No, not really :-)
@mhelvens Braces are the 'usual' case
 
@JosephWright Exactly in the case I described before: The function needs a single token. The caller can supply a braced token list of which he's sure could expand into a single token.
 
@mhelvens No, they took a single token argument
 
@JosephWright But you still have N, right?
 
@mhelvens Yes
@mhelvens Very rarely needed in practice, honest
 
@JosephWright That's a "no manipulation, single token" argument. I'm simply suggesting a "exhaustive expansion, results in single token" argument.
@JosephWright Hm. I see it all over the place, when a cs needs to be passed.
 
7:32 PM
@mhelvens Yes, but that's a clearly defined use, and to me separate from what we used to have in C, X, O
@mhelvens The problem we had before was too many different cases
 
@JosephWright I suppose you would eventually run out of letters in the alphabet. That's why I would also have made the argument specifiers a bit more flexible and delimited somehow, so you're more future-proof.
@JosephWright Exactly! That's why mixing everything up into a single letter may not have been the best design choice.
 
@mhelvens We did talk about creating more, but the result of the refactor was to cut them down.
For example, we had d (double expansion), but it was used about half a dozen times in total in places where replacement was tricky. So it made sense long-term to cut down to a sensible minimum.
 
@JosephWright What I would probably have tried was a scheme where you separate different 'dimensions' of argument modifiers. So: \name:(xt)(xl)(nt)(nl). That's a function taking a token, list, another token and another list. The first two are expanded, the last two are not expanded.
 
@mhelvens So a base function would always read \name:(nt)(nl)(nt)(nl)?
(all n)
It's pretty rare you x-type expand knowing you want a single token
 
@JosephWright Everything else left the same, yes indeed. But as I said before, I'd do other things differently too. So when defining a function, you only have to give the second modifier (per argument). When calling it, you only give the first.
 
7:38 PM
@mhelvens OK, how ;-)
 
@JosephWright I understand. But note that this is just an example.
@JosephWright You're asking me how I would implement it in TeXe? I'm not experienced enough to give you a detailed answer there. Still, I'm convinced it would be possible. And elegant.
 
When I started on expl3, the decision was very much how to tidy up the arg spec, so some of the basics are better asked to @FrankMittelbach or @DavidCarlisle, by the way
@mhelvens Yes
@mhelvens In particular, remember you have to define names before you can use them :-)
 
@JosephWright In my implementation, the argument specifier would not be part of the name. I would make the : char active.
 
Another point to bear in mind is the 'finish stuff' problem. When we did the refactor on arg specs (and in other places), we do have to make a decision at some point. It took 15 years to get a decision on arg specs that was stable!
 
@JosephWright That means you can no longer 'overload' on argument specifiers. But you can compensate for that in different ways. Changing the name itself is one. But you could also have 'real' overloading, by checking the argument type.
 
7:42 PM
@mhelvens Feel free to create a demo :-)
 
@JosephWright That sounds like a fun project. Really. But I have PhD thesis to write, which has priority. :-)
 
@JosephWright May I ask which part of the pgf you meant in your comment? I'm reading it and indeed there are some instances I am not really sure if that's the best practice on certain things.
 
@JosephWright Note that with my new scheme, you could use (as the 'expansion part' of an argument) 2, 3, 4, x, whatever to denote specific expansion strategies.
 
@mhelvens The thing for me is that the scheme we have does work, and I find it reasonably clear. I'm happy for people to make better suggestions, but we could argue for ever about lots of things (for example, the choice of : and _ continues to cause some comment)
 
@JosephWright Oh, I don't propose for a minute that you change the language specs at this point. It's way too late in the game for that.
 
7:46 PM
One issue which springs to mind using an active : is that there are cases where it's very handy that functions are a single token. If you 'free' the arg spec, life becomes more complex
 
@JosephWright Also, just to be clear, LaTeX 3 seems like a tremendous improvement over LaTeX2e for programming. I'm not denying that. :-)
 
@percusse The one that comes to mind may no longer apply. When I wrote l3keys, I took the original idea from pgfkeys. That was a mission, as while the interface is good the code was not.
 
@JosephWright Yes, that's a valid point. But I imagine an argument type called 'two tokens', which would probably solve that problem.
 
Ah yes, I see we all get sleds if we leave the room!
@mhelvens The other usual worry is expandability, as look-ahead is much more tricky there
There's also performance, of course
@mhelvens I do hope you are on LaTeX-L :-)
 
@JosephWright Oh I just asked out of curiosity I can't surely judge it as good as you might do..
 
7:50 PM
@JosephWright Remember we discussed this some weeks ago. We could do it without looking ahead. You could just pre-define all argument specifiers up to a certain length ahead of time. Probably a better solution would be to use currying. Are you familiar with that concept (see: functional programming; lambda calculus).
 
@percusse I know more about beamer, which Till Tantau also wrote. It is certainly rather awkward to maintain.
 
@JosephWright Go for the hat trick: next time you mention the animation, use 'sleigh'. (cf. chat.stackexchange.com/transcript/41?m=7210945#7210945) :)
 
@AlanMunn Oops
 
@JosephWright Ah yes but that's not using pgfkeys and it might be indeed quite terrible to maintain :)
I guess beamer code is much older than PGF.
 
@percusse It is, I suspect
@percusse I've not read a lot of pgf, so it might just have been that part of the keys code that I looked at. I certainly know it's changed.
 
7:53 PM
@JosephWright Currying would probably be a great solution, both for performance and flexibility of the language. But this does imply that any function 'name' would have a variable number of 'parts' (each argument specifier would need its own token), so even the 'two token' idea I gave before would not save us there.
 
@JosephWright No, just linguistic curiosity. I think 'sled' vs. 'sledge' is N. American vs. British usage; but the image in the animation for me I would call a 'sleigh', since 'sled(ge)' is more of a small thing than something with a seat.
 
@AlanMunn Maybe. I'd expect a horse with a sleigh
 
@JosephWright Indeed Christian put much effort recently in the CVS version. So I guess things are changing and more mature probably.
 
@JosephWright Me too. It's just implied in the animation. :)
 
@JosephWright Sorry for all my babbling. :-) Currying would be nice, but it would be exceedingly difficult to do that while maintaining the current LaTeX3 interface (if not impossible). You would probably want a scheme such as \name:x:y:z. Still, it could work. I'm telling you, I'll create a demo sometime.
@JosephWright I just subscribed to LATEX-L. Pf, as if I needed yet another way to procrastinate. :-p
 
8:00 PM
@mhelvens How about csname expansion. The current set up makes this easy, but if the name is in two parts then you need to allow for a split: tricky.
 
@JosephWright You mean for sending the function a macro? Or another function? Or a variable? (which one, just to be clear)
 
@mhelvens Sending the partial name of a function to another function, for example for constructing the name on-the-fly
 
@JosephWright Passing functions around is actually easier with my scheme. You just pass the name, not the argument specifiers. If you want to call it again 'on the inside' you give the argument specifiers you want right there. Since argument specifiers (in my scheme) are up to the caller.
@JosephWright However, if you are intent on sending the 'whole package', you can always wrap it in another macro and send that.
@JosephWright That reminds me of another useful type of argument you could support: anonymous functions: as in, brace delimited token-lists that can contain #1, #2, etc. On the inside of the function it would be delivered as a cs.
That one you could still add, by the way, in the current LaTeX3 scheme.
@JosephWright Anyway, I gotta go. It's been a nice discussion, but we'll have to continue it another time. Cheers!
 
8:26 PM
@mhelvens Have fun :-)
@mhelvens I really would be interested in a demo!
I have other stuff to worry about, TeX-wise, for example RTL galleys, the OR, ...
 
@AlanMunn Rosebud?
@JosephWright Or reindeer.
 
@egreg :-)
 
@JosephWright Someday. Good night!
 
@mhelvens 'Bye
 
8:41 PM
@JosephWright: re community adverts: I have a few ideas about them, should I "answer" the thread or perhaps brainstorm stuff via comments?
 
@egreg Exactly.
 
@PauloCereda Whatever you like
 
@AlanMunn: Trivia: how do you say "brainstorm" in Minas Gerais? :P
@JosephWright I'll go with comments then. :)
 
@AlanMunn I'm wondering if anybody else caught the reference. :)
 
@PauloCereda There's no such word? :)
 
8:46 PM
@egreg Of course
 
@AlanMunn Of course there is! :) You'll be surprised. :)
 
@PauloCereda Ok, I'll bite.
 
@AlanMunn "Toró de parpite". ("parpite" being a provincial way of saying "palpite"). :)
 
@PauloCereda But not everyone in MG says 'r' for 'l'...
 
@AlanMunn Depende dos mineiro, uai. :) Granted, it's a common expression in the whole country. :) If I turn my caipira mode on, the replacement algorithm is executed. :)
 
9:29 PM
@JosephWright In light of this question
3
Q: What is the difference between \newenvironment and \newenvironment*?

Charles StaatsI vaguely seem to recall reading that \newenvironment* gives better spacing than \newenvironment, but I don't recall any details and I can't seem to find a reference by searching. What is the difference between these two, and when should one be used rather than the other? [Note: I'll be happy f...

would you like to modify your answer to this old one to cover also \newenvironment?
73
Q: What's the difference between \newcommand and \newcommand*?

Andrew StaceyI just spotted someone use \newcommand* in an answer and realised that I'd never quite sorted out in my head what the star (asterisk) was there for. (This one is practically impossible to search for on the internet so this is a good place to record the answer!)

 
@egreg What would you suggest adding?
 
@JosephWright Maybe just that \newenvironment{foo}[1]{...}{...} allows a \long argument and \newenvironment* doesn't.
 
@egreg Done
 
@egreg I don't think it's the best thing to close this. Rather put an answer with a link to the \newcommand question.
 
@JosephWright Re Alan's comment, what do you think?
I can write a CW answer to the newer one.
 
9:40 PM
I suspect that \newcommand and \newenvironment are quite different conceptually in people's minds and so having an environment question point to a macro question won't seem so natural.
Also, although the meaning of * in the two cases is the same, having one answer might lead to a more general interpretation of what * means, which of course isn't true across packages.
 
@AlanMunn I guess you're right.
 
@AlanMunn Seems reasonable
 
And there is the discussion that @Vivi and I had last night, too.
 
@AlanMunn Yes, I'd seen she's appeared here (@Vivi has been on the site from basically day one, I think)
 
I've added a link to this chat in the comments so that we don't get piling on close votes.
 
9:45 PM
@AlanMunn OK
 
@AlanMunn @JosephWright CW answer done
 
@JosephWright Worked really well. Already up to 4. :( Don't people read?
 
@AlanMunn If it gets closed, I'll reopen (which handily clears the votes!)
I hope my changes to the \newcommand question help :-)
 
@JosephWright Maybe you can add "see the sister question ..."
 
@egreg OK
 
9:52 PM
@JosephWright So as to make a vicious circle. :)
 
One thing that came up in the discussion with Vivi last night was that I've noticed that a lot of the fast close votes are coming from users who are 'medium rep'. That's not necessarily a problem but we now have lots more users with close voting privileges who don't necessarily have the institutional memory of the meta discussions that talked about these issues. I wonder if there's a way to remedy that?
 
@AlanMunn Not really, I suspect. The overall network model is much more skewed toward 'close fast, reopen after edits' than we favour. Getting the tools altered is more-or-less impossible.
@AlanMunn It is important to leave appropriate comments, of course
 
@JosephWright Yes, I'm sure that's the case. I'm just wondering if there's a way we can improve education for users at that stage.
 
@AlanMunn Comments are the best plan, but once people have voted they don't see them. As we can't tell who votes until after the questions are closed, it's a bit tricky
 
For the question at hand, someone could provide the fifth and final closing vote, so that @JosephWright could immediately reopen it (and hereby clear all closing votes).
 
9:59 PM
@lockstep This did occur to me
 

« first day (771 days earlier)      last day (4177 days later) »