Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditional statements syntax #1262

Closed
matteofg opened this issue Feb 3, 2024 · 5 comments
Closed

Conditional statements syntax #1262

matteofg opened this issue Feb 3, 2024 · 5 comments

Comments

@matteofg
Copy link

matteofg commented Feb 3, 2024

LaTeX provides many conditional statements, but not all of them provide for setting a single true or false branch. Is it possible to generalize the syntax, so that I can write, for example
\IfFileAtLeastF{<file>}{<date>}{<false>}
instead of
\IfFileAtLeastTF{<file>}{<date>}{}{<false>}
?

@josephwright josephwright added this to Pool (unscheduled issues) in upcoming LaTeX2e releases via automation Apr 9, 2024
FrankMittelbach added a commit that referenced this issue Apr 10, 2024
@FrankMittelbach FrankMittelbach moved this from Pool (unscheduled issues) to Done in dev in upcoming LaTeX2e releases Apr 10, 2024
FrankMittelbach added a commit that referenced this issue Apr 10, 2024
* fix for #1222 and #1262

* retry

* mumble (that loaded multicol and thus failed)

* change rollback; ltnews and changes
@FrankMittelbach FrankMittelbach added the fixed in dev Fixed in development branch, not in stable release label Apr 10, 2024
@FrankMittelbach
Copy link
Member

commands added

@muzimuzhi
Copy link
Contributor

\IfExplAtLeastTF defined in ltexpl.dtx also needs T and F variants.

Then how about remaining \If...TF commands? Currently LaTeX2e kernel provides

  • \IfDocumentMetadataTF
  • \IfExplAtLeastTF
  • \IfHookEmptyTF
  • \IfHookExistsTF
  • \IfLabelExistTF
  • \IfMarksEqualTF
  • \IfPropertyExistTF
  • \IfPropertyRecordedTF
  • \IfPDFManagementActiveTF

BTW among all \If...Exist(s)TF commands, \IfHookExistsTF is the only one which uses third-person singular form Exists. Need a renaming (and keep old name for backwards compatibility)?

@car222222
Copy link
Contributor

\IfExplAtLeastTF is also the only one whose meaning is unnecessarily obscure:
what is Expl? and why does it have a date?

@muzimuzhi
Copy link
Contributor

muzimuzhi commented Apr 12, 2024

@car222222 It tests the date of l3kernel bundled into the LaTeX2e format, see #1004.

\IfExpl3AtLeastTF would be better, but unfortunately digits don't have catcode 'letter' by default.

@car222222
Copy link
Contributor

@muzimuzhi : Thanks for the reference!

But I would never have worked that out from the name. Explthree or Expliii would be better, but even then it needs a very careful explanation of exactly what it means: what is it whose date is actually consulted (this turns out to be very obscure: and knowing that it is the date below does little to enlighten this).

I am unsure if it would be useful to explain that it refers to this, also very obscure, date: \ExplLoaderFileDate (but that at least has the word "File" in it!).

@FrankMittelbach FrankMittelbach removed the fixed in dev Fixed in development branch, not in stable release label Jun 3, 2024
@FrankMittelbach FrankMittelbach moved this from Done in dev to Done in upcoming LaTeX2e releases Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

6 participants