latex3 / latex2e

The LaTeX2e kernel
https://www.latex-project.org/
LaTeX Project Public License v1.3c
1.94k stars 267 forks source link

Missing variants of `\property_if_recorded:eeTF` #1532

Open gusbrs opened 2 weeks ago

gusbrs commented 2 weeks ago

Brief outline of the bug

ltproperties-doc documents all conditional variants of \property_if_recorded:eeTF to exist, but in reality, only the TF is defined.

Minimal example showing the bug

\RequirePackage{latexbug}
\documentclass{article}

\begin{document}

\section{Section}
\RecordProperties{sec:section}{label,page}

\ExplSyntaxOn
% ok
\property_if_recorded:eeTF{sec:section}{label}{Yes}{No}

% fails
\property_if_recorded:eeT{sec:section}{label}{Yes}
\ExplSyntaxOff

\end{document}

Log file (required) and possibly PDF file

document.log

muzimuzhi commented 2 weeks ago

\property_if_recorded:eTF has a similar issue.

214ce87af (expand label/property name consistently in LaTeX2e commands, 2023-09-13) added e variants of \property_if_recorded:nTF and \property_if_recorded:nnTF for only the TF forms, although the base functions have all four forms (p, T, F, TF) defined.

Probably a documentation issue.

u-fischer commented 2 weeks ago

I must say, I have no idea how to properly document that in the l3doc syntax. The easy way out would be to provide all variants (here and in two other conditionals), another to mention the ee-variant only in the text. @josephwright , @FrankMittelbach what do you think?

josephwright commented 2 weeks ago

@u-fischer Yes, by far the easiest it to provide all variants

gusbrs commented 2 weeks ago

This is a little weird, providing the variants for this reason alone...

To be clear, I'm not requesting or suggesting for them to be defined.

Anyway, what I can say from "the user side" is that I almost got bitten by this. I had used the non-existing \property_if_recorded:eeT in a very "corner place" of a package (somewhere reached only if the place is a measuring pass where the user has set a label option there), and which was not covered by regression tests, and almost shipped the package with it. So promising something exists when it doesn't, is also not ideal.

josephwright commented 2 weeks ago

This is a little weird, providing the variants for this reason alone...

Sure, but they are low cost and predictability is good.