# Vertical space before list environment within a macro

UPDATE

My problem comes down to the following: vertical space is added before the \items of a list within a macro. The layout I want to use is based on the classicthesis-styled CV (currvita) template by Alessandro Plasmati and the defined commands (\MarginText and \Description) should produce a margin text that is aligned vertically with the first line of the \Description text.

However, when using lists, vertical space is added before the list. How can I suppress this? I already tried \setlength{topskip}{0pt} and also the space controls added by the enumitem package.

Why do lists behave like this?

MWE:

\documentclass[a4paper]{scrartcl}
\reversemarginpar
\newcommand{\MarginText}[1]{\marginpar{\raggedleft#1}}
\newcommand{\Description}[1]{#1}

\begin{document}
\Description{\MarginText{Papers}
\begin{itemize}
\item a bibitem
\item another one
\end{itemize}
}

\end{document}


Old Version

When I use \bibentry in the classicthesis-styled CV, the entries are listed after a line break, however I want the \bibentry next to the category (e.g. papers, conferences, posters etc.). Also, the bibliography gets listed below (which I don't want)—how can I change this? See an example in the uploaded screenshot and the MWE below.

MWE

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[a4paper]{scrartcl}
\usepackage[nochapters]{classicthesis}
\usepackage[LabelsAligned]{currvita}

%***********************
% FONTS
%***********************
\usepackage{fontspec,xunicode}
\setsansfont[Mapping=tex-text,Scale=MatchLowercase]{Futura}

%***********************
% LAYOUT
%***********************
\reversemarginpar % Move the margin to the left of the page
\newcommand{\MarginText}[1]{\marginpar{\raggedleft\itshape\small#1}\marginparsep0pt} % New command defining the margin text style

\usepackage{hyperref}

\newlength{\datebox}\settowidth{\datebox}{Long  2011} % Set the width of the date box in each block

\newcommand{\NewEntry}[3]{\noindent\hangindent=2em\hangafter=0 \parbox{\datebox}{\small \sffamily \textit{#1}}\hspace{1em} #2 #3 % Define a command for each new block - change spacing and font sizes here: #1 is the left margin, #2 is the italic date field and #3 is the position/employer/location field
\vspace{0.5em}} % Add some white space after each new entry

\newcommand{\Description}[1]{\hangindent=2em\hangafter=0\noindent\raggedright\footnotesize{#1}\par\normalsize\vspace{1em}} % Define a command for descriptions of each entry - change spacing and font sizes here

% bib stuff
\usepackage[round]{natbib}
\usepackage{bibentry}
\nobibliography*

%----------------------------------------------------------------------------------------

\begin{document}

\thispagestyle{empty} % Stop the page count at the bottom of the first page

%----------------------------------------------------------------------------------------
%   NAME AND CONTACT INFORMATION SECTION
%----------------------------------------------------------------------------------------

\noindent\spacedlowsmallcaps{Personal Information}\vspace{0.5em} % Personal information heading

\NewEntry{*}{\textit{Born in the USA,}}{19 July 2013} % Birthplace and date

\NewEntry{phone}{(H) +33 (0) 3455 9222\ \ $\cdotp$\ \ (M) +33 (0) 455 1116661} % Phone number(s)

\vspace{1em} % Extra white space between the personal information section and goal

\noindent\spacedlowsmallcaps{Goal}\vspace{1em} % Goal heading, could be used for a quotation or short profile instead

\vspace{2em} % Goal text

%----------------------------------------------------------------------------------------
%   EDUCATION
%----------------------------------------------------------------------------------------

\spacedlowsmallcaps{Education}\vspace{1em}

\NewEntry{2009--2013}{University XYZ}

\Description{\MarginText{Ph.\,D.} Info, info, info\ \ $\cdotp$\ \ School: School of Physics \newline Thesis: \textit{"Title title"} Description: ... \\ Advisors: Dr.\,XC \textsc{Hellloo}}

%----------------------------------------------------------------------------------------
%   PUBLICATIONS
%----------------------------------------------------------------------------------------

\spacedlowsmallcaps{Publications}\vspace{1em}

\Description{\MarginText{Papers}
\begin{itemize}
\item \bibentry{Bohr:1923tl}
\item \bibentry{Bohr:1923tl}
\end{itemize}
}

\Description{\MarginText{Posters}
Text text text
\begin{itemize}
\item \bibentry{Bohr:1923tl}
\item \bibentry{Bohr:1923tl}
\end{itemize}
}

\Description{\MarginText{Conferences}
\bibentry{Bohr:1923tl}
}

%------------------------------------------------

\end{cv}

%\nocite{*}
\bibliographystyle{plainnat}
\bibliography{lib-x}

\end{document}


lib-x.bib

@article{Bohr:1923tl,
author = {Bohr, N},
title = {{The structure of the atom}},
journal = {Nature},
year = {1923},
volume = {112},
pages = {29--44}
}

• You could use the marginnote package, use it to define \newcommand{\MarginText}[1]{\marginnote{\raggedleft#1}}, and call it as part of the first item: \begin{itemize}\item\MarginText{Papers}a bibitem ... – cgnieder Aug 1 '13 at 14:00

Here is a version for your updated problem. I use enumitem to easily kill the top spacing on the list, and before the list I ensure that we back up vertically (this code is now placed in the list options). Note the \leavevmode added to the \MarginText command, for consistency of spacing:

\documentclass[a4paper]{scrartcl}

\reversemarginpar

\newcommand{\MarginText}[1]{\leavevmode\marginpar{\raggedleft#1}\ignorespaces}
\newcommand{\Description}[1]{#1}

\usepackage{enumitem}

\begin{document}

\Description{\MarginText{Papers}
\begin{itemize}[topsep=0pt,partopsep=0pt,before=\vspace*{\dimexpr-\baselineskip-\parskip},after=\vspace*{\baselineskip}]
\item a bibitem
\item another one
\end{itemize}
}

\Description{\MarginText{Other}
Some text

And some more}

\end{document}


In your example you would probably want to define a new list type and use it when necessary:

\documentclass[a4paper]{scrartcl}
\usepackage[nochapters]{classicthesis}
\usepackage[LabelsAligned]{currvita}

%***********************
% FONTS
%***********************
\usepackage{fontspec,xunicode}
%\setsansfont[Mapping=tex-text,Scale=MatchLowercase]{Futura}

%***********************
% LAYOUT
%***********************
\reversemarginpar % Move the margin to the left of the page
\newcommand{\MarginText}[1]{\leavevmode\marginpar{\raggedleft\itshape\small#1}\ignorespaces} % New command defining the margin text style

\usepackage{enumitem}
\newlist{thislineitemize}{itemize}{1}
\setlist[thislineitemize]{label=\textbullet,topsep=0pt,partopsep=0pt,before=\vspace*{\dimexpr-\baselineskip-\parskip},after=\vspace*{\baselineskip}}

\usepackage{hyperref}

\newlength{\datebox}\settowidth{\datebox}{Long  2011} % Set the width of the date box in each block

\newcommand{\NewEntry}[3]{\noindent\hangindent=2em\hangafter=0 \parbox{\datebox}{\small \sffamily \textit{#1}}\hspace{1em} #2 #3 % Define a command for each new block - change spacing and font sizes here: #1 is the left margin, #2 is the italic date field and #3 is the position/employer/location field
\vspace{0.5em}} % Add some white space after each new entry

\newcommand{\Description}[1]{\bgroup\hangindent=2em\hangafter=0\noindent
\raggedright\footnotesize#1\par\egroup\vspace{1em}} % Define a command for descriptions of each entry - change spacing and font sizes here

% bib stuff
\usepackage[round]{natbib}
\usepackage{bibentry}
\nobibliography*

\begin{document}

\thispagestyle{empty} % Stop the page count at the bottom of the first page

\noindent\spacedlowsmallcaps{Personal Information}\vspace{0.5em} % Personal information heading

\NewEntry{*}{\textit{Born in the USA,}}{19 July 2013} % Birthplace and date

\NewEntry{phone}{(H) +33 (0) 3455 9222\ \ $\cdotp$\ \ (M) +33 (0) 455 1116661} % Phone number(s)

\vspace{1em} % Extra white space between the personal information section and goal

\noindent\spacedlowsmallcaps{Goal}\vspace{1em} % Goal heading, could be used for a quotation or short profile instead

\vspace{2em} % Goal text

%----------------------------------------------------------------------------------------
%   EDUCATION
%----------------------------------------------------------------------------------------

\spacedlowsmallcaps{Education}\vspace{1em}

\NewEntry{2009--2013}{University XYZ}

\Description{\MarginText{Ph.\,D.} Info, info, info\ \ $\cdotp$\ \ School: School of Physics \newline Thesis: \textit{Title title''} Description: \dots \\ Advisors: Dr.\,XC \textsc{Hellloo}}

%----------------------------------------------------------------------------------------
%   PUBLICATIONS
%----------------------------------------------------------------------------------------

\spacedlowsmallcaps{Publications}\vspace{1em}

\Description{\MarginText{Papers}
\begin{thislineitemize}
\item \bibentry{Bohr:1923tl}
\item \bibentry{Bohr:1923tl}
\end{thislineitemize}
}

\Description{\MarginText{Posters}
Text text text
\begin{itemize}
\item \bibentry{Bohr:1923tl}
\item \bibentry{Bohr:1923tl}
\end{itemize}
}

\Description{\MarginText{Conferences}
\bibentry{Bohr:1923tl}
}

%------------------------------------------------

\end{cv}

%\nocite{*}
\bibliographystyle{plainnat}
\bibliography{lib-x}

\end{document}


As to the general "Why", list environments as standard start on a newline. This is usually desirable as you don't have worry about whether the call falls inside a paragraph or not. But in some situations it is not what one wants.

• This doesn't work because I use the same commands with normal text environment (i.e. without lists) and then the second paragraph of the text overlaps with the first paragraph, e.g. \Description{\MarginText{Papers} Just Text without any lists. \And the second paragraph.} – Paglia Orba Aug 4 '13 at 9:03
• You can move the backspacing code around. I have rewritten the answer with it now placed in the list. – Andrew Swann Aug 4 '13 at 16:08
• ok, thanks! actually, I just could have defined two commands instead of one. your first version for lists and the old version for normal text... – Paglia Orba Aug 5 '13 at 12:28

To have no references list at the end, instead of \bibliography{lib-x} put \nobibliography{lib-x}. Source: http://gking.harvard.edu/files/bibentry2.pdf

The reason you have the line break in the "Conferences" section is because you put a line break in there, i.e. you wrote

\Description{\MarginText{Conferences}

\bibentry{Bohr:1923tl}
}


but you can remove the line break by

\Description{\MarginText{Conferences}
\bibentry{Bohr:1923tl}
}


In my test, this messed with the position of the \MarginText, but I don't know why. I think the reason there's a line break in the "Papers" section has to do with the itemize, but that could be wrong.

• Thank you for the \nobibliogrpahy{} solution, darthbith! – Paglia Orba Jul 30 '13 at 13:30
• It seems that when using the macro \newcommand, empty lines are not allowed which is strange, because technically it should do so. see [tex.stackexchange.com/questions/1050/… – Paglia Orba Jul 31 '13 at 12:00
• I don't understand what you mean... your problem is that you have extra empty lines, not that there aren't empty lines where you expect them, right? – darthbith Jul 31 '13 at 12:50
• yeah, i got lost, i guess. sorry for the confusion – Paglia Orba Jul 31 '13 at 13:10