I am studying Count number of figures, tables and citations in report class. I am writing a custom class that would have this implementation built in. I would like to move the commands \AtEndDocument from the preamble to the .cls file. The problem is that they do not get executed in case of a simple copy. Can you help?

  • 3
    It would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that reproduces the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. – Peter Grill Nov 22 '18 at 21:27
  • 2
    Mhhh, \AtEndDocument should just work in a .cls file. It certainly worked for me in a short example I just wrote. It would be much easier to answer this question if you could show us an example document and an example .cls file of what you tried, what you expected and how it failed for you. – moewe Nov 22 '18 at 21:31
  • @moewe, could it be that I provided \AtEndDocument after \endinput? – Viesturs Nov 22 '18 at 22:14
  • 3
    Well yes, that would definitely be a problem. Everything after \endinput is ignored. – moewe Nov 22 '18 at 22:23
  • 3
    that is why questions should always have example code, the cause of the problem isn't mentioned in the question. tex does not read the text at all on any lines after \endinput – David Carlisle Nov 23 '18 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.