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 wanted a really compact list, so I have defined a custom environment to achieve the same.

However, I am unable to get rid of the whitespace at the top of the list beyond a certain width. I tinkered with negative values for topsep and other parameters, however no success.

Why does this happen? Is there a minimum limit on the top whitespace in a list?

Here is an example of my resume:

\documentclass[a4paper]{article}

\usepackage[total={6.8in,9.3in},top=1.1in,left=.7in]{geometry}
\usepackage{fancyhdr}
\usepackage[hidelinks]{hyperref}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage[T1]{fontenc}
\usepackage{tgpagella}
\usepackage{textcomp}
\usepackage{enumitem}

\pagestyle{fancy}
% Remove page numbers
\fancyfoot{}

\newenvironment{noindlist}
 {\begin{list}{\labelitemi}{\leftmargin=1em\itemindent=0em\topsep=0em\partopsep=0em\itemsep=-4pt}}
 {\end{list}}

\setlength{\headheight}{52pt}
\chead{%
  \fontsize{20.74pt}{24pt}\selectfont{}%
  Firstname Secondname\\%
  \fontsize{8pt}{9.6pt}\selectfont{}%
  \oldstylenums{1234}C, Street Name, City, State, \oldstylenums{12345}, United States; \oldstylenums{123 456 7890}; %
  \href{mailto:email@gmail.com}{\nolinkurl{email@gmail.com}}; %
  \href{http://google.com}{WWW}%
}

\begin{document}
\noindent
\renewcommand\multirowsetup{\raggedleft}
\begin{tabularx}{\textwidth}{rX lX}
  \multirow{2}{2.5cm}{RESEARCH\\WORK} & \textbf{Master's Thesis:} Blah Blah Blah \hfill University\\
  &  \textit{Advisor: \href{http://www.google.com}{Prof. Some Name}}\hfill April \oldstylenums{2012 =} Current\\
  & \begin{noindlist}
    \item First line of the thesis description
    \item Second line of the thesis description which is quite long and hence will spill out in an additional line
  \end{noindlist}\\
\end{tabularx}
\end{document}

Here's an example with topsep set to -100em: enter image description here

share|improve this question
add comment

2 Answers 2

up vote 6 down vote accepted

You have to be careful: \topsep is used between the previous text and the list but also after the list and the following text, so this

\documentclass{article}

\newenvironment{noindlist}
 {\begin{list}{\labelitemi}{\leftmargin=1em\itemindent=0em\topsep=-5em\itemsep=-4pt}}
 {\end{list}}

\begin{document}

\noindent Some text before the list
\begin{noindlist}
\item First item.
\item Second item.
\end{noindlist}
Some text after the list

\end{document}

will produce a rather undesired effect:

enter image description here

You can set \topsep and \partopsep to 0em:

\documentclass{article}

\newenvironment{noindlist}
 {\begin{list}{\labelitemi}{\leftmargin=1em\itemindent=0em\topsep=0em\partopsep=0em \itemsep=-4pt}}
 {\end{list}}

\begin{document}

\noindent Some text before the list
\begin{noindlist}
\item First item.
\item Second item.
\end{noindlist}
Some text after the list

\end{document

enter image description here

Another option is to use nolistsep and leftamrgin=* from the enumitem package:

\documentclass{article}
\usepackage{enumitem}

\begin{document}

\noindent Some text before the list
\begin{itemize}[nolistsep,leftmargin=*]
\item First item.
\item Second item.
\end{itemize}
Some text after the list

\end{document}

enter image description here

If this must be applied for all itemize environments, you can say

\setlist[itemize]{nolistsep,leftmargin=*}

in the preamble, or you could define your own list with these settings (refer to the package documentation).

Update: now that the actual code has been provided, the problem can be detected: inside a tabular cell lists insert a vertical space given by \parskip since @minipage is false; to prevent this, one can "make believe" the list that it's inside a minipage (inside a minipage this space won't be added) setting @minipage to true. Here's a possible solution:

\documentclass[a4paper]{article}

\usepackage[total={6.8in,9.3in},top=1.1in,left=.7in]{geometry}
\usepackage{fancyhdr}
\usepackage[hidelinks]{hyperref}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage[T1]{fontenc}
\usepackage{tgpagella}
\usepackage{textcomp}
\usepackage{enumitem}

\pagestyle{fancy}
% Remove page numbers
\fancyfoot{}

\newenvironment{noindlist}
 {\begin{list}{\labelitemi}{\leftmargin=1em\itemindent=0em\topsep=0em\partopsep=0em\itemsep=-4pt\parskip=0pt}}
 {\end{list}}

\setlength{\headheight}{52pt}
\chead{%
  \fontsize{20.74pt}{24pt}\selectfont{}%
  Firstname Secondname\\%
  \fontsize{8pt}{9.6pt}\selectfont{}%
  \oldstylenums{1234}C, Street Name, City, State, \oldstylenums{12345}, United States; \oldstylenums{123 456 7890}; %
  \href{mailto:email@gmail.com}{\nolinkurl{email@gmail.com}}; %
  \href{http://google.com}{WWW}%
}

\makeatletter
\newcommand\novspace{\@minipagetrue}
\makeatother

\begin{document}
\noindent
\renewcommand\multirowsetup{\raggedleft}
\begin{tabularx}{\textwidth}{rX lX}
  \multirow{2}{2.5cm}{RESEARCH\\WORK} & \textbf{Master's Thesis:} Blah Blah Blah \hfill University\\
  &  \textit{Advisor: \href{http://www.google.com}{Prof. Some Name}}\hfill April \oldstylenums{2012 =} Current \\
  & \novspace\begin{noindlist}
    \item First line of the thesis description
    \item Second line of the thesis description which is quite long and hence will spill out in an additional line
  \end{noindlist}\\
\end{tabularx}
\end{document}

enter image description here

Of course, if you are going to use lists several times in your column, the best thing would be to define a new column type:

\makeatletter
\newcommand\novspace{\@minipagetrue}
\makeatother
\newcolumntype{Y}{>{\novspace}X}

and then:

\begin{tabularx}{\textwidth}{rY lX}
...
\end{tabularx}

Also, seeing your first column, perhaps it would be better to define as a p{<length>} column so it will have a fixed width (given by <length>).

share|improve this answer
    
I have edited my question. Can you please have a look again, the first measure that you suggested does not help. –  abhinavkulkarni Mar 27 '13 at 0:40
    
@abhinavkulkarni please see my updated answer. –  Gonzalo Medina Mar 27 '13 at 0:55
add comment

Please always provide a complete document that shows the issue. With the standard settings the negative spacing you show does not leave a large space, in fact it produces negative space and over-prints the surrounding text. So the effect you show is due to code you have not shown, which makes it hard to help.

I would guess you have a non standard \parskip and haven't taken account of that and/or \partopsep

enter image description here

\documentclass{article}

\newenvironment{noindlist}
 {\begin{list}{\labelitemi}{\leftmargin=1em \itemindent=0em \topsep=-5em \itemsep=-4pt}}
 {\end{list}}

\begin{document}


aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa 
\begin{noindlist}
\item 1 1 1 1 1 1
\item 2 2 2 2 2 2
\item 3 3 3 3 3 3
\end{noindlist}
bbbb bbbb bbbb bbbb bbbb bbbb bbbb bbbb 


\vspace{3cm}


cccc cccc cccc cccc cccc cccc cccc cccc 

\begin{noindlist}
\item 1 1 1 1 1 1
\item 2 2 2 2 2 2
\item 3 3 3 3 3 3
\end{noindlist}

dddd dddd dddd dddd dddd dddd dddd dddd 


\end{document}

In the edited question the white space is not glue it is a blank paragraph caused by an interaction between the strut added to p columns (including X) and list handling. Simplest is just to start a normal paragraph with \mbox{} to give the list a base to start from but insert some negative space to compensate.

& 
\mbox{}\par\vskip-2\baselineskip\mbox{}
\begin{noindlist}
share|improve this answer
    
I have provided the full code now. Can you please have a look again? –  abhinavkulkarni Mar 27 '13 at 0:41
    
@abhinavkulkarni oh that's a different case altogether. I'll add some code. –  David Carlisle Mar 27 '13 at 1:03
add comment

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.