I'm current using enumitem to make a list.
1.) Each item consists of multiple paragraphs. I want each item to stay on one page. Is this possible? (I think it might have something to do with penalties but I can't get it to work.)
2.) How can I add a horizontal line to separate the items?
Thanks!
Text Formatting ⇒ Two questions with the enumitem package
Two questions with the enumitem package
Last edited by kitsune on Thu Apr 08, 2010 5:40 am, edited 1 time in total.
Two questions with the enumitem package
If you want to make pagebreak between items so every item is on a separate page (if not, remove \newpage when defining \litem), and add a horizontal line before/after every one of them, you may test this code and customize it further for your needs (e.g., if you want horizontal line after items, put \hrule after \newpage):
Code: Select all
\documentclass{book}
\usepackage{enumitem}
\usepackage{lipsum}% for generating dummy text
\newcommand\litem[1]{\newpage\hrule\item{#1}}% customizing item entries
\begin{document}
\lipsum[1-2]% dummy text, 2 paragraphs
\begin{itemize}
\litem Test
\lipsum[1-3]% dummy text, 3 paragraphs
\litem Test
\lipsum[1-3]% dummy text, 3 paragraphs
\litem Test
\lipsum[1-3]% dummy text, 3 paragraphs
\end{itemize}
\end{document}
Re: Two questions with the enumitem package
Thank you! The horizontal line part works!
For the page break problem, I do not want one item to be split onto two pages. (Each item is small enough to fit on one page.) Having multiple items on one page is fine. Is there a way to do that?
For the page break problem, I do not want one item to be split onto two pages. (Each item is small enough to fit on one page.) Having multiple items on one page is fine. Is there a way to do that?
-
- Posts: 90
- Joined: Fri Nov 06, 2009 7:29 am
Two questions with the enumitem package
how is this for you (just a modification of meho_r's code):
Code: Select all
\documentclass{book}
\usepackage{enumitem}
\usepackage{lipsum}% for generating dummy text
\newlength{\minipagewidth}
\newenvironment{litem}{\vspace{3pt}\hrule\item \begin{minipage}[t]{\minipagewidth}}{\end{minipage}}% customizing item entries
\begin{document}
\setlength{\minipagewidth}{4.42in}
\lipsum[1-2]% dummy text, 2 paragraphs
\begin{itemize}
\begin{litem} Test
\lipsum[1-2]% dummy text, 3 paragraphs
\end{litem}
\begin{litem} Test
\lipsum[1]% dummy text, 3 paragraphs
\end{litem}
\begin{litem} Test
\lipsum[1]% dummy text, 3 paragraphs
\end{litem}
\end{itemize}
\lipsum[1-2]
\end{document}
Re: Two questions with the enumitem package
Thanks! I got it to work with your solution! 
