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

Bug with \IfTargetDateBefore and \RequirePackage #828

Open
lvjr opened this issue May 28, 2022 · 5 comments
Open

Bug with \IfTargetDateBefore and \RequirePackage #828

lvjr opened this issue May 28, 2022 · 5 comments

Comments

@lvjr
Copy link

lvjr commented May 28, 2022

Brief outline of the bug

In the code of ltclass, all packages share the same macro \pkgcls@innerdate which is used by \IfTargetDateBefore. This may cause problems if there is a \RequirePackage with different rollback date before \IfTargetDateBefore.

Minimal example showing the bug

\begin{filecontents}[force]{demo.sty}
\DeclareCurrentRelease{}{2022-02-02}
\IfTargetDateBefore{2022-01-01}{\typeout{old}}{\typeout{new}} % => new 
\RequirePackage{pkg}[=2021-12-12]
\IfTargetDateBefore{2022-01-01}{\typeout{old}}{\typeout{new}} % => old
\end{filecontents}

\begin{filecontents}[force]{pkg.sty}
\DeclareCurrentRelease{}{2021-12-12}
\end{filecontents}

\documentclass{article}

\usepackage{demo}[=2022-02-02]

\begin{document}

\end{document}

Log file (required) and possibly PDF file

The first \IfTargetDateBefore types out new but the second \IfTargetDateBefore types out old.

(demo.sty
Rollback for package 'demo' requested -> date 2022-02-02.
         Best approximation is the release introduced on 2022-02-02.

Include code introduced on 2022-01-01
new
(pkg.sty
Rollback for package 'pkg' requested -> date 2021-12-12.
         Best approximation is the release introduced on 2021-12-12.
)
Exclude code introduced on 2022-01-01
old
) 
@FrankMittelbach
Copy link
Member

looks like a bug, yes. Such a \RequirePackage would need to undo the innerdate modification at the end.

@stale
Copy link

stale bot commented Aug 13, 2022

This issue has been automatically marked as stale because it has not had recent activity.

@stale stale bot added the stale label Aug 13, 2022
@FrankMittelbach FrankMittelbach self-assigned this Nov 7, 2023
@github-actions github-actions bot removed the stale label Nov 8, 2023
Copy link

github-actions bot commented Jun 5, 2024

This issue has been automatically marked as stale because it has not had recent activity.

@github-actions github-actions bot added the stale label Jun 5, 2024
@FrankMittelbach
Copy link
Member

I looked at this last night and I'm inclined to document this as a limitation of \IfTargetDateBefore, i.e., that you can't use it if your code is explicitly asking for a dated release of some other package. Otherwise one would maintain the information in a stack which seems overkill to me.

Copy link

github-actions bot commented Aug 6, 2024

This issue has been automatically marked as stale because it has not had recent activity.

@github-actions github-actions bot added the stale label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Pool (unscheduled issues)
Development

No branches or pull requests

2 participants