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

\thmtlo@newentry unnecessarily called twice for every theorem #48

Open
mbertucci47 opened this issue Oct 17, 2023 · 0 comments
Open

\thmtlo@newentry unnecessarily called twice for every theorem #48

mbertucci47 opened this issue Oct 17, 2023 · 0 comments

Comments

@mbertucci47
Copy link
Collaborator

In thm-listof.sty, the command \thmtlo@newentry which defines l@<theorem> is called multiple times for every theorem. Once in \thmt@mklistcmd which is added to every theorem definition:

\newcommand\thmt@mklistcmd{%
  \thmtlo@newentry
  ...
}

then

\g@addto@macro\thmt@newtheorem@predefinition{%
  \thmt@mklistcmd
  \thmt@recordenvname
}

And again for every call of \listoftheorems:

\newcommand\listoftheorems[1][]{%
...
  \@for\thmt@envname:=\thmt@allenvs\do{%
    % CHECK: is \cs{l@\thmt@envname} repeatedly defined?
    \thmtlo@newentry
  }%
...
}

And indeed, removing either the first \thmtlo@newentry above or the \@for block seems to have no effect. I guess removing the \@for block is more efficient since it leads to fewer total definitions.

Note the % CHECK: comment is in the file, not added by me.

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

No branches or pull requests

1 participant