3

My overall goal is to redefine the [ ] , I have done that actually and it works well, but I just noted that my new trivlist, trivilist2, does not behave well regarding the space left between the above text line and \item. According to the books on latex, the speration from the text to the list is \topsep+\parskip. But when I set \topsep to -\parskip, I still have a space left !

\documentclass[twoside,a4paper, 11pt]{article}
\usepackage{amsmath}
\usepackage{lipsum}

%\parskip=0.5\baselineskip %\advance\parskip by 0pt plus 2pt
\parskip=1ex
\parindent=0ex

\newenvironment{trivlist2}
{\begin{list}
{}
{
\setlength{\labelwidth}{0ex}
\setlength{\leftmargin}{0ex}
\setlength{\labelsep}{0ex}
\setlength{\itemindent}{1\parindent}
\setlength{\listparindent}{1\parindent}
\setlength{\itemsep}{0ex}
%\setlength{\topsep}{0.5\parskip plus 0.25\parskip minus 0\parskip}
\setlength{\topsep}{-3\parskip}
\setlength{\parsep}{0ex}
%useless only \topsep counts anyway as there is no \[ ]\ alone in an environment
\setlength{\partopsep}{0ex}
}}
{\end{list}}

\begin{document}
blablablablablablablablablablablablablablablablablabla,
\begin{trivlist2}
\item blablablablablablablablablablablablablablablablablabla
\end{trivlist2}
blablablablablablablablablablablablablablablablablabla
\end{document}

only the space between the list and the bottom text is eaten up... I do not see why. I need \setlength{\topsep}{-3\parskip} for the bottom text to touch the \item.

  • Use \setlength{\topsep}{-\parskip}. But the easier is to use enumitem package: \newlist{trivlist2}{itemize}{1} \setlist[trivlist2,1]{label=,nolistsep,topsep=-\parskip,leftmargin=\parindent}. – user11232 Apr 25 '14 at 8:14
  • Well that's the point, if \setlength{\topsep}{-\parskip} there still exists a space between the surrounding space above the list, bit no space below...It is flagrant with \setlength{\topsep}{-2\parskip} – user50260 Apr 25 '14 at 9:23
  • and actually your command for enumitem presents the same pathology ! – user50260 Apr 25 '14 at 9:41
  • It's not really clear what you want to achieve. What do you mean by “touching the \item”? – egreg Apr 25 '14 at 10:00
  • Yes I just mean that the \topsep must be -3\parskip in order to skim (from below) the last item of the list. – user50260 Apr 29 '14 at 6:15
2

Assuming the desired output is that the content of the list sits on top of the following line of text, the correct amount is -\parskip-\baselineskip:

Sample output

\documentclass[twoside,a4paper, 11pt]{article}
\usepackage{amsmath}
\usepackage{lipsum}

\parskip=1ex
\parindent=0ex

\newenvironment{trivlist2}
{\begin{list}
{}
{
\setlength{\labelwidth}{0ex}
\setlength{\leftmargin}{0ex}
\setlength{\labelsep}{0ex}
\setlength{\itemindent}{1\parindent}
\setlength{\listparindent}{1\parindent}
\setlength{\itemsep}{0ex}
\setlength{\topsep}{\dimexpr-\parskip-\baselineskip}
\setlength{\parsep}{0ex}
\setlength{\partopsep}{0ex}
}}
{\end{list}}

\begin{document}
blablablablablablablablablablablablablablablablablabla,
\begin{trivlist2}
\item Trblablablablablablablablablablablablablablablablablabla
\end{trivlist2}
blablablablablablablablablablablablablablablablablabla
\end{document}

Adding \showoutput to the file writes box information in the .log that helps with finding such things.

Your Answer

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