@bp2017 Depends on how you define "work". It doesn't detect that the input is wrong because the #1 in \ifx\zTerminator#1 is \relax, so the test is true. The same would happen if you used \def and the user did \ztest{3\def.4}.
@cis You can do such things relatively easily using Lua. I've used a Lua Regex library (not Lua's built-in patterns) to do exactly that.
@cis Here is my code. I kind of hate regular expressions and all their kith and kin, but I thought it might be good for me to learn some of that. Actually, it only took me a couple of days of futzing around.
local rex = require "rex_pcre"
local function basename (filename)
local bn = rex.new("(?=[^/]+$)(.*(?=[.])|.+)")
return bn:match(filename)
end
Of course, you need to set things up so that TeX's Lua will find a path to a third-party library, but there is a package for that.
"The same would happen if you used \def and the user did \ztest{3\def.4}." @PhelypeOleinik, that's weird because if user does \ztest{3\def.4} it doesn't compile (in XeLaTeX at least; although error is not produced).
@FaheemMitha but loading a regex library just to split on a fixed string like / seems over-kill you could do it just as simply in base Lua, or TeX, without the overhead of external Library access.
I think I might suffer from anatidaephobia, the fear that I'm constantly being watched by a duck, because whenever I star a repo on GitHub, @PauloCereda immediately stars it too.
anyone around with an up to date windows tl2019? could you try this?
@VincentYin I thougfht you would have an old version of some package but the file versions are the same for all files except my setup includes ctex-fontset-fandol.def 2019/05/29 v2.4.16 Fandol fonts definition (CTEX) and yours ctex-fontset-windows.def 2019/05/29 v2.4.16 Windows fonts definition (CTEX) ctex-fontset-windowsnew.def 2019/05/29 v2.4.16 Windows fonts definition for so I'm not sure, I'll have a look at that windows file..... — David Carlisle7 mins ago
@bp2017 With "the same" I meant "almost the same" ;-) The general behaviour is still the same: the \def token in the input will terminate the scanning, and the code (\ifx\zTerminator#1) will think that everything went okay. Then the rest of the input will be typeset (.4) and the \zTerminator (last token in \zTest) will do its thing. If it is \relax, then nothing happens (that's what \relax does). If it is \def, then it starts a definition (and what happens then will depend...).
I am trying to develop part of my code, under the condition that if some variable inputs of the functions are equal to zero, tikz do not draw some parts of the drawings. Here is a MWE (although the MWE does not work since I could not handle the condition here):
\documentclass[border = 2mm]{stand...
I was not sure how to write in multiple lines, and the procedure of if then flowchart was a little vague for me... I do not know much about tex programming. Looked at TeXbook, seems there are many ifs like \ifnum, etc. In FORTRAN or python we only have one if!
@JosephWright I think in TeX most of what a text comparison or conditional is needed, are declared as separated ifs... in FORTRAN for instance, we have a function and any requested functionality is returned by functions after if...
@JosephWright did we (team) write anywhere about recommendations for having user doc separate or merged with the source listings, or was that just internal discussion (thinking about my texdoc thread on texlive list)
Actually I want to ask some things: @DavidCarlisle Is it intentional that in tabu-issues-for-future-maintainer/tabu (https://github.com/tabu-issues-for-future-maintainer/tabu) the release ZIP of v.2.10 contains `tabu.sty` v.2.9?
@DavidCarlisle Yes I read this. But from my side I can tell you that updating a file needed version 2.10. Could ther be some option? Either 2.9 or 2.10 abilities as default and the other as package option? And yes I see the rubber duck. big grin Hello, eehm, quaack!
@Speravir if you really want tabu it's best to revert array/longtable/tabu all to the 2018 versions (that's what we helped the doxygen maintainers to do)
@Speravir if a competent person volunteers they are welcome to fork the repository (or have write access to that one) but I simply don't have the bandwidth to make any checkins to that code
@DavidCarlisle I do not really remember why I opted for tabu then (I would have to take a deeper look into code that I partly do not understand anymore), but somewhere you wrote yourself about useful parts. Perhaps these could be implemented elsewhere.
@Speravir tabu has some good ideas, but some terrible user interface design, and a very large code base of somewhat variable quality that is essentially undocumented in its internals and more or less impossible to make compatible with the new color-safe code in the array package without being re-written. If someone is really motivated they could re-write it to be compatible, but just stating that it doesn't work any more won't actually change anything,