treyhunner / resume

LaTeX resume format
MIT License
268 stars 132 forks source link

Use \AtBeginDocument instead of redefining \document #9

Closed jasperhabicht closed 1 year ago

jasperhabicht commented 1 year ago

Redefining the \document macro is not a good idea, because this can easily mess up the code when other packages are used. It is far more reliable to use \AtBeginDocument to insert code directly after \begin{document}. I therefore suggest that lines 68 to 76 in the .cls file are replaced as follows:

- \let\ori@document=\document
- \renewcommand{\document}{
-   \ori@document                     % Begin document
+ \AtBeginDocument{
    \printname                        % Print the name specified with \name
    \@ifundefined{@addressone}{}{     % Print the first address if specified
      \printaddress{\@addressone}}
    \@ifundefined{@addresstwo}{}{     % Print the second address if specified
      \printaddress{\@addresstwo}} 
  }
passos commented 1 year ago

I noticed that there is a warning regard to document command when use it like \begin{document}. The message is Overfull \hbox (30.0pt too wide) in paragraph at lines 11--11 []. Do you have any idea how to fix it?

Version: Latexmk, John Collins, 17 Mar. 2022. Version 4.77, version: 4.77

jasperhabicht commented 1 year ago

@passos This is true, but it has nothing to do with this issue. If you keep the original code, the same warning appears. Maybe open a new issue?

treyhunner commented 1 year ago

Added in #10