Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm very new to LaTeX and have been using a template from my brother's resume to do up my own, and I have everything exactly how I want it except for the fact that I can't get the text on a line above a list to go all the way to the right.

I have a suspicion that the custom list my brother defines at the beginning of the document has something to do with it but I haven't been able to figure it out.

Here is the environment set-up he has:

\documentclass[margin,line]{res}


\usepackage[pdftex]{graphicx}
\newcommand{\HRule}{\rule{\linewidth}{0.2mm}}

\oddsidemargin -.5in
\evensidemargin -.5in
\textwidth=6.0in
\itemsep=0in
\parsep=0in

\newenvironment{list1}{
  \begin{list}{\ding{113}}{%
      \setlength{\itemsep}{0in}
      \setlength{\parsep}{0in} \setlength{\parskip}{0in}
      \setlength{\topsep}{0in} \setlength{\partopsep}{0in} 
      \setlength{\leftmargin}{0.30in}}}{\end{list}}

and here is two examples of one where I get what I want and one where I don't:

What I want:

\textbf{A University} \hfill \textbf{Somewhere} \\
\textit{My position there} \hfill \textit{when 2012}

What it looks like:

enter image description here

What is happening that is annoying me:

\textbf{A University} \hfill \textbf{Somewhere} \\
\textit{My position there} \hfill \textit{when 2012}
\begin{list1}
    \item[-] This list messes everything up. 
    \item[-] So unfortunate :(
\end{list1}

And it is causing this:

enter image description here

As you can see when 2012 has suddenly been almost tabbed over from the right somehow.

If I add a newline after when 2012 \\ then it will get rid of the 'tab' but put the list down an entire space so I'm hoping there is some simple fix to this.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

the second line of your first example is followed by a paragraph break, and the \hfill overwhelms the space assigned for the end of the paragraph.

in the second example, the list is begun while you're still in horizontal mode, and there's a space (caused by the normal end-of-line character) between the italic string and the list.

add a blank line before the list and (almost) all should be well. the vertical space depends on what's assigned for that situation in the document class you're using, but i don't have access to that so i didn't test it. so you may have to adjust that explicitly, but that's easier than most other methods for dealing with the lack of a flush right line.

as pointed out by Werner in another answer (since deleted), there are quite a few spurious spaces in the definition of list1, at the end of every line between \begin{list} and \end{list}; adding a % at the ends of those lines will make this definition better behaved, especially in "edge" circumstances.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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