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

Deactivate \keywords after \maketitle #2464

Closed

Conversation

dginev
Copy link
Collaborator

@dginev dginev commented Dec 30, 2024

Fixes #2263 .

That issue could also be closed as wontfix, as it is not really a "healthy" use of LaTeX syntax, since using \keywords after \maketitle is asking for trouble.

But since trouble is often a part of life, and we have some idiosyncratic code that caused the behavior, I took a pass ironing it out a little further.

Namely, after \maketitle executes in a document, we try to deactivate a number of frontmatter macros. This PR adds \keywords to that list of macros, but also redoes the deactivation as a subroutine, so that deactivated macros can also consume their arguments. The guard in question seems to have been around since 2007, so I am conservatively sticking with it here.

@dginev dginev requested a review from brucemiller December 30, 2024 19:35
@brucemiller
Copy link
Owner

hmm, well, it's the wrong fix, isn't it? In the cited issue, the pdf actually has keywords appearing twice (whether or not that's healthy). But the underlying issue seems to be that article.cls resets \and (to \relax), but llncs.cls does not.

@dginev
Copy link
Collaborator Author

dginev commented Jan 22, 2025

Update: my PR appears to have accidentally unlocked \maketitle, which would have brought some pain in arXiv. I have just returned the lock, looking forward to more discussion.

@dginev
Copy link
Collaborator Author

dginev commented Jan 23, 2025

the pdf actually has keywords appearing twice

On a third(!) look, I was fooled by missing a new page getting shipped. Indeed, the keywords appear twice in the PDF for this example.

I still think my PR attempt is a good patch for the current approach of latexml, or do we really want to enable \keywords to deposit metadata before and after \maketitle in llncs.cls?

By "current approach" I am mostly refering to the comment above the maketitle binding:

# But, it does make the various frontmatter macros into no-ops.

Which I still think is a good strategy for now.

@brucemiller
Copy link
Owner

brucemiller commented Jan 23, 2025 via email

@dginev
Copy link
Collaborator Author

dginev commented Jan 23, 2025

In any case, I think the whole duplicate \keywords is a red herring

Yes, but we've patched this school of herrings before, so might as well be consistent... We can keep the llncs-sepcific issue open until some better solution comes to mind, but I think the PR itself may avoid an edge case in the mid-term.

@brucemiller
Copy link
Owner

brucemiller commented Jan 23, 2025 via email

@dginev
Copy link
Collaborator Author

dginev commented Jan 23, 2025

I am trying to disable all frontmatter-depositing macros after \maketitle has been encountered, as is the current intent of the \maketitle binding in LaTeX.pool.

The edge case this avoids is depositing duplicate metadata unintentionally.

The difference to latex this (continues to) cause is that in some .cls files the frontmatter macros after \maketitle indeed do deposit ink to the page, where latexml will silently ignore them. I think we can stay consistent with that behavior (namely, include \keywords to the neutralization code) until a larger redesign takes place.

Edit: This has a healthy development approach to it as well, as redefining \maketitle in any specific .cls.ltxml binding can be made to avoid this default neutralization behavior.

@brucemiller
Copy link
Owner

brucemiller commented Jan 23, 2025 via email

@dginev dginev closed this Jan 23, 2025
@dginev
Copy link
Collaborator Author

dginev commented Jan 23, 2025

emulate LaTeX's \maketitle.

I think you mean article.cls here, which is where the \maketitle binding code appears to be copied from.

Ok, if there is a moratorium on improving that, I will let that be as it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

llncs: \and ignored after \maketitle
2 participants