@egreg there are things not implemented in L3 that are needed for some things, like changing the font to the verbatim font... Is it bad to put a \verbatim@font in the code?
@Skillmon At present, we've not really got anything in the release code for fonts: I guess we are talking a thin wrapper, so \char_wd:n or perhaps \font_char_wd:n, etc. Raise on LaTeX-L?
@Skillmon I'm looking for an example where the result is not the same as boxing up: I guess it's just an expandabliity thing
@FaheemMitha You can always create additional functions: probably best to use a 'safe' name, like skfont or something: font as a module name is team-reserved (oddly!)
@egreg from a L2 package I wrote of the same name (without the @).
@egreg ducksay (which is in itself not a serious package) uses it though most of its code is L3.
@FaheemMitha as there currently is no information on how the font interfaces in L3 would be (to my knowledge at least), I don't see a point in adding it oneself in a correct way.
@JosephWright in view of interfaces and details you would perhaps enjoy the discussion about multiscript support in biblatex. After getting stale in 2016 it was reopened a few days ago. Designing expl3 interfaces is a piece of cake compared to this ;-) github.com/plk/biblatex/issues/416
@Skillmon As a matter of course, we've stuck to the the long functions: it's unlikely, but one could imagine some weird expression inside the argument ...
@JosephWright the weirdest I can think of is \__hexdump_char_wd:n { \tl_count:n { \par\par\par } }, and that's really nonsense to sensibly expand to a character code.
Hey guys, I got this algorithm: https://pastebin.com/9y07yFBJ But there is a lot of unecessary white space before and after. Any idea of trying to remove this? There is a lot of space before the \section and the algorithm and the text afterawards
I am using \usepackage[ruled,vlined]{algorithm2e} as well. Might be good to declare
I've added what Mico said to my main file but it doesn't seem to work. https://tex.stackexchange.com/questions/26057/squeezing-space-around-algorithm-construct
@sockevalley The code you show above is really not enough to reproduce the problem. I think it would be best (and you'd probably have better answers) if you posted a question on the main site.
@sockevalley Although, from the picture it looks like you have a really bad page break and LaTeX stretched the space after the section title a tad too much. May be related to the [H] option (I'm only guessing, though).
@sockevalley [H] is a request to get a bad page break rather than move the float, so bad page breaks with large white space are expected if you use [H]
@sockevalley what do you mean by "out of questions" ? You have only ever asked 2 questions on tex.stackexchange tex.stackexchange.com/users/128906/sockevalley (admittedly that is two more than me)
@sockevalley SE doesn't have question limits. There are people on these sites that have asked hundreds of questions. Though asking a lot of questions isn't actually encouraged, especially if you are not answering any questions.
@FaheemMitha the feature of macro arguments that you can drop the brace if it is a single token is not shared by most primitives, so for example you can do \mbox X but \hbox X is a syntax error, you need \hbox{X}
@UlrikeFischer anyway it all seems very improbable that the German newsgroup would need a filename as short as 5%.tex shouldn't it be filerepresentingafractionoffivehundrethsofsomequantitythatisleftimplicithere.tex ?
4
@PhelypeOleinik except that @ isn't a letter on the commandline
@FaheemMitha I'm in a meeting now. After my lunch (about 3 hours) I can give you a detailed explanation if you want, but in short it's what egreg said in the comment. The parser is looking for a - sign, but it doesn't find it because it is "hidden" in a macro. Later on it expands that macro and then tries to use that in an integer comparison.
@FaheemMitha \expanded{\foo} is exactly the same as \foo and fails for the same reason, the keyval parser doesn't expand the value so \expanded is not expanded.
@PhelypeOleinik yes although of course this is a very special case, normally you have much more common and clearer phrases like "\noexpand is expanded`
Only in this chatroom would you find a joke about the complexities of Windows' move command squashed in between a discussion about \expanded and \noexpand…
(Apart from the fact that I'm sure nobody else talks about \expanded and \noexpand)
@DavidCarlisle You wouldn't guess what miktex does with lualatex 5\csname @percentchar\endcsname.tex
This is LuaTeX, Version 1.10.0 (MiKTeX 2.9.7140 NEXT)
restricted system commands enabled.
! I can't find file `5/csname'.
<*> 5/csname
@percentchar\endcsname.tex
(Press Enter to retry, or Control-Z to exit)
@bp2017 well clearly you need to apply \expandafter to \the not #1 (you should use expl3 juggling arguments to make that work is the start of the whole project
@bp2017 just define \zinternal as above and then define \z by \def\z#1#2{\zinternal{#2}{#1}}
@FaheemMitha Actually egreg's answer covers all there is to it. The parser never sees the - because it's hidden in a macro (this happens just two or three expansions before the part of the log you show in your question). Then the trim space code is a bit reckless and expands \foo and strips the layer of braces. The code then checks that the argument is a valid integer, but the verification overlooks the fact that 1- is more than one token, and this goes to the \ifnum test and explodes :-)
@FaheemMitha He just makes sure the argument is expanded before going to the internals of pdfpages. The layer of braces is still there, but some piece of code probably takes care of that (intentionally or otherwise).
@FaheemMitha Reliable is relative. For instance (my opinion may be biased but) l3fp's parser is very thorough, it stops you from doing a lot of wrong things with nice error messages. Yet \fp_eval:n{1+\csname} will break badly :-)
@FaheemMitha Both the expansion and brace stripping. If the code is supposed to trim spaces, it probably shouldn't do anything else other than that. If it does, odd things like this may happen
@FaheemMitha Well, \edef is... brutal. If you put anything that doesn't work by pure expansion (first example that comes to mind: \@ifnextchar) inside an \edef it will break. But then the argument is supposed to contain numbers only. Reliability relies on the user being sensible :-)
@FaheemMitha It is. Everything, from the name of the functions, how they treat the argument, how many times it is expanded, how many braces are stripped is controlled. If it's not, then it's probably a bug. It's really neat :-)
@FaheemMitha LaTeX2e is really good at what it does, and it does very different things than expl3. For now most of LaTeX3 is the expl3 code, which is the programming layer. Things to "pass tokens around in funny ways", manipulate data and so on. For instance, LaTeX3 still has very little typesetting support. It would probably be hard to use without 2e for now. Work is underway to change that
@PhelypeOleinik It might be good at what it does, but it's not exactly easy to understand. Though I'm not sure how much of an improvement LaTeX 3 will be.
Anyway, to go back to the topic at hand, do you reckon \protected@edef would be an improvement?
@FaheemMitha I never said it was :-) But the expl3 kernel code is not much more friendly either, it's the interface that is. It's a bit easier to read because of the arg specs and more clear function names. But if you take a look at some of its internals the code will be rather hard to understand too. That's probably because both are TeX
@FaheemMitha Might be, depending on the input. If I recall correctly, if babel activates a character (say, -), then \protected@edef{-} will not break, while \edef{-} will.
@FaheemMitha but it would be much easier to say if it is a known issue if you would give a complete example that one can simply try instead of a more or less vage descriptions and snippets.
@FaheemMitha Hadrly. The difference between \edef and \protected@edef is that the former just expands everything (except \protected macros), while the latter redefines LaTeX's \protect to be (roughly) \noexpand, so something that is not supposed to expand in an \edef is preserved. Everything else is the same
@FaheemMitha well no, not if it means that at the end you are spreading your description over 10 chat messages without any concrete code. LaTeX is large, tikz is large, pgfkeys is large. There a lots of ways to use and to use it wrong.
@FaheemMitha No, \noexpand works the same. Suppose you have \edef{\protect\foo}. \protect is normally \relax, so \edef{\protect\foo} will be \relax\expansion_of_foo. If \foo doesn't work by expansion then it breaks. Inside \protected@edef, \protect becomes \noexpand, so \protected@edef{\protect\foo} is just \foo. The definition of \protected@edef is around line 1000 of latex.ltx.
@PauloCereda A couple years ago I was working with my former advisor on a technical report. We were simulating waste disposal in the sea, and there were a lot of simulated scenarios. The final report turned out to be some 2000 pages. I was responsible to make the graphics. The computer working by itself took 2 or 3 days to generate all the images from the results. It was a nice break for coffee :-)
@FaheemMitha \relax by itself does nothing, but if TeX is doing something (scanning an integer, for instance), it tells TeX to stop what it's doing. Perhaps that's the reason for the name.
@FaheemMitha no not at all, \relax has no special code for suppressing expansion or scanning for integers, it is simply a non expandable command that does nothing.
Does the O{} argument (no spaces between braces) for \NewDocumentCommand pass an empty string by default? Though I don't think TeX actually has strings, so presumably some equivalent.
@FaheemMitha \caption[]{foo} puts an empty caption in the list of figures, \caption{foo} is the same as \caption[foo]{foo} and puts a caption with text foo in the list of figures.
Does git and/or github or sourcetree constantly change files in the background? All my git repos are in Dropbox folders, and now Dropbox is constantly syncing git related files (heads, remotes, etc.) I've never noticed this behaviour before.
@FaheemMitha TeX is a macro expansion language, what would it be, Null/None etc are friends of C null pointer and tex has nothing remotely like a C pointer
@FaheemMitha no anyone using the optional parameter system defined by xparse is using the same marker, and if you are using a completely different optional parameter system how would sharing one internal command for one specific aspect help at all?
@FaheemMitha everyone in python is using the same function call parser.
@FaheemMitha but using the same notation is exactly what tex is designed not to do. It has essentially no built in syntax, it is a macro definition language that lets you define syntax.
@FaheemMitha built in to tex there is no standard syntax, not even { .. } for grouping it would be very odd to have a standard command for "no value" without any shared definition of calling conventions or syntax or anything other than that one thing.
Hmm. It seems that Dropbox has trouble with symbolic links and this can cause this. And I have symbolic links in my texmf folder. But it's strange I've never seen this until recently.