5

I loaded lineno to number the lines on my resume for critique by a professor. Doing so changed the spacing after the headers. I would like to number the lines and retain the original formatting, if possible.

\documentclass{article}
\usepackage{fullpage}
\pagestyle{empty}
\raggedright

% Uncommenting lineno changes spacing below \header
%\usepackage{lineno}

\newcommand{\area}[2]{\vspace*{-9pt} \begin{verse}\textbf{#1}   #2 \end{verse}  }
\newcommand{\lineunder}{\vspace*{-8pt} \\ \hspace*{-18pt} \hrulefill \\}
\newcommand{\header}[1]{{\hspace*{-15pt}\vspace*{6pt} \textsc{#1}} \vspace*{-6pt} \lineunder}

\newcommand{\schoolwithcourses}[4]{
\textbf{#1} #2 $\bullet$ #3 $\bullet$ #4\\
Selected Coursework:\\
\vspace*{5pt}
}

\begin{document}

\header{Education}

\schoolwithcourses{Bachelor of Science}{$\bullet$ Georgia Gwinnett College}{May 2013 $\bullet$ Magna cum Laude}
{GPA: 3.874/4.000}
\area{Biology}{Microbiology $\cdot$ Immunology $\cdot$ Human Anatomy $\cdot$ Human Physiology $\cdot$ Biomechanics $\cdot$ Organic~Chemistry $\cdot$ Biotechnology $\cdot$ Biochemistry $\cdot$ Cell Biology }
\end{document}
  • 2
    The solution is to load lineno before \raggedright. – karlkoeller Sep 7 '13 at 16:41
  • How would I ever know that? – John Johnson Sep 7 '13 at 17:06
  • 1
    To respond to your question about how you would know that, in this case I think the following rule of thumb could be followed: load all packages before using any commands that are related to actually typesetting text such as \raggedright (which usually would go after \begin{document}.) This won't solve package loading order problems, but will prevent this sort of problem from arising. See also What's the right order when loading packages?. – Alan Munn Sep 8 '13 at 3:32
8

The general answer is:

NEVER use any command related to typesetting text (\raggedright in your case) in the preamble.


The specific answer in your case is:

lineno.sty redefines the meaning of \\ (which you're using in your \newcommands) and issuing \raggedright before that redefinition causes the conflict.

These are the lines in lineno.sty which cause the conflict:

\DeclareRobustCommand\\{%
  \ifLineNumbers
    \expandafter \@LN@cr
  \else
    \expandafter \@normalcr
  \fi
}

LineNumbers is false in your case, so \\ gets defined as \@normalcr, which is the "fragile" version of \\.

|improve this answer|||||

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.