3

I was working on my resume and for some reason there is an error message that says "You can't use \moveleft in horizontal mode." I've been working on this for the past 45 minutes and I haven't really touched any of the formatting. I don't understand why I am getting this message.

Here is my code:

 \documentclass[centered,11pt,]{res} 

 \begin{document}


  % Establish mywidth as width of entire resume (since res.cls co-opts textwidth!):
 \newlength\mywidth
 \setlength\mywidth\textwidth
 \addtolength\mywidth{\sectionwidth}

 % Center the name over the entire width of resume:
 \moveleft0.5\hoffset\centerline{\Large \bf TIM H. JOO}

 % Contact info centered over entire width of resume:
 \raggedright \hspace*{-\sectionwidth}123 Sesame Street \hfill (123) 456-7890\\
 \raggedright \hspace*{-\sectionwidth}St. Paul, MN 12345 \hfill younrame@isp.com
 % Draw a horizontal line the whole width of resume:
 \vspace{-3 mm}
 \moveleft\hoffset\vbox{\hrule width \mywidth}
  \vspace{-8 mm}

 \begin{resume}
  blah blah blah

Using \leavehmode does not seem to work.

user64742
  • 343
  • 1
    Always have a blank line before \vspace. You exit horizontal mode by issuing \par (a blank line does it). – egreg Sep 16 '14 at 13:19
  • 2
    \vspace isn't (unfortunately) \vskip. The \vspace is implemented via \vadjust primitive and this is a source of many many user confusions:). I don't understand why this implemetation was used. IMHO it is one of many examples of bad design of LaTeX. – wipet Sep 16 '14 at 15:50
  • You probably want to use \raisebox anyway. – John Kormylo Sep 16 '14 at 17:35

1 Answers1

3

This is how I would approach this:

\documentclass[centered,11pt,]{res} 
% Establish mywidth as width of entire resume (since res.cls co-opts textwidth!):

\newlength\mywidth
\setlength\mywidth\textwidth
\addtolength\mywidth{\sectionwidth}

\begin{document}

% Center the name over the entire width of resume:
\hspace*{-\hoffset}%%
\hspace*{\fill}%%
\makebox[0pt]{\textbf{\Large TIM H. JOO}}%%
\hspace*{\fill}%%

%  % Contact info centered over entire width of resume:
\hspace*{-\sectionwidth}123 Sesame Street  \hfill (123) 456-7890\newline
%% comment out the end of the line to avoid spurious whitespace from creeping in.
\hspace*{-\sectionwidth}St. Paul, MN 12345 \hfill younrame@isp.com%%
%% to adjust the vertical space without creating a new paragraph, call
%% \vspace before `\newline`.
\vspace{-3mm}%%
\newline
% Draw a horizontal line the whole width of resume:
\hspace*{-\hoffset}\rule{\resumewidth}{0.4pt}

\begin{resume}


  blah blah blah

\end{resume}

\end{document}

\makebox centers its content by default. Setting its width to 0pt allows for easy centering over the width of the paper (as I understood what you wanted). The \hspace*{\fill} bracking this box centers the content on the space remaining on the line after the first \hspace*{-\hoffset}.

If you load the package tabularx you can more easily set up your address as you want:

\hspace{-\hoffset}%%
\begin{tabularx}{\resumewidth}{@{}Xr@{}}
  123 Sesame Street & (123) 456-7890 \\
  St.~Paul, MN 12345 & younrame@isp.com \\\hline
\end{tabularx}

The @{} before and after the column specifications removes the white space which tabular environments (and their kin) add between columns. This way you get the material flush left and flush right as you seem to want.

Incidentally, using \textbf{...} is preferable to \bf.

A.Ellett
  • 50,533