The commands \makeatletter and \makeatother should not be used in .tex sources.

If you want to use @ for namespacing latex commands, you should ideally put those commands into a separate style file.