mlhetland / pseudo.sty

Straightforward pseudocode.
MIT License
13 stars 2 forks source link

These two lines do not compile for me #30

Closed Vilin97 closed 9 months ago

Vilin97 commented 9 months ago

Lines 49 and 50 in the pseudo.sty file. Commenting them out solves the problem and does not seem to introduce any new issues, at least for me.

\cs_generate_variant:Nn \tl_set:Nn                { Ne     }
\exp_args_generate:n                              { NNVNNV }
mlhetland commented 9 months ago

Thanks for reporting this!

About the first line

It seems the variant \tl_set:Ne has been added to expl3, now. I don't quite understand why this should lead to an error, because the documentation says (`interface3.pdf, 2023-12-08, p. 33):

[E]ntries which correspond to existing functions are silently ingored.

I guess this might not be the case, then? However, I guess this line is just a holdover, anyway, as \tl_set:Ne isn't in fact used anywhere in my code, anymore, to removing it is perfectly fine. I'll do that as a bug fix.

About the second line

This I don't immediately understand. I'm not sure what the issue would be with the line. And the fact that your code works without it is probably down to you not using the unknown key (implicitly). That is, I guess you're not using either keys of the kind foo<2> or adding extra space, like \\[1cm]. Perhaps you could try the latter, and see if you get an error? Specifically, it should error when trying to execute \exp_args:NNNVNNV (which, without the second of your two lines, shouldn't exist).

mlhetland commented 9 months ago

Also, if you have the specific error messages you get, both after only commenting out the first line and after only commenting out the second, as well as any version info on your TeX installation, that would be useful. (Because it all seems to work for me, with the most recent MacTeX/TeXLive.)

Vilin97 commented 9 months ago

Can you give me an example that you think should not work? I don't understand where to add \\[1cm]

tex --version
TeX 3.14159265 (TeX Live 2017/Debian)

pdflatex --version
pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian)
mlhetland commented 9 months ago

It’s just a matter of replacing one of the terminators \\ in your pseudocode with, e.g., \\[1cm]. But it’s not so important; I’m pretty sure it won’t work.

it seems the explanation here is simply that \exp_args_generate:n was introduced in 2018, and your distribution is fro 2017 :-)

I’ll have a look at replacing it, but updating your LaTeX distribution (or the expl3 package, in particular) should also solve the problem. And running with the \exp_args_generate:n line commented out should also work fine, as long as you don’t use the (somewhat marginal) features mentioned (using <…> overlays or distances as part of key specifications).

mlhetland commented 9 months ago

(Note that the \\<…> syntax should still work; just not \\[some-key<…>].)

mlhetland commented 9 months ago

Okay, I've rewritten the code to avoid using \exp_args_generate:n. Could you check if the most recent version fixes your problem?

Vilin97 commented 9 months ago

Actually, I upgraded to the latest TeX distribution! Everything works now.

mlhetland commented 9 months ago

OK, then!-)