GeneralRedefine 'enumerate' to draw horizontal Lines between Items

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
jpuri0705
Posts: 1
Joined: Mon Jul 11, 2011 11:53 am

Redefine 'enumerate' to draw horizontal Lines between Items

Post by jpuri0705 »

Hello.

I'm trying to find a way to redefine the \item command (or redefine the package) within the enumerate environment (or some another listing environment) so that as each item ends a line is drawn directly after (as in the code below). Does anyone have any ideas?

thanks in advance,
J. Puri

Code: Select all

\documentclass{article}

\begin{document}
\begin{enumerate}
\item An Item 
\begin{center}
  \line(1,0){300}
\end{center}

\item Another item
\begin{center}
  \line(1,0){300}
\end{center}

\end{enumerate}
\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

Redefine 'enumerate' to draw horizontal Lines between Items

Post by 5gon12eder »

Well, the obvious approach would be something along these lines:

Code: Select all

\documentclass{article}
\usepackage[T1]{fontenc}

\newcommand{\litem}[1]{\item #1\begin{center}\rule{0.8\textwidth}{0.4pt}\end{center}}

\begin{document}
  \begin{enumerate}
    \litem{first point}
    \litem{second point}
  \end{enumerate}
  
  Works for any kind of list:
  \begin{itemize}
    \litem{a point}
    \litem{another point}
  \end{itemize}
\end{document}
Sorry if that was too trivial.

Best
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
Post Reply