I am currently trying to simplify the process of creating commented ordered and unordered lists in LaTeX. I have a method that achieves the desired visual result, but the syntax seems overly complex. I'm wondering if there's a cleaner or more straightforward approach.
Here's my current implementation:
\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{tabularx}
\usepackage{booktabs}
\begin{document}
\section{Example A}
\hspace{\parindent} \noindent\begin{tabularx}{\textwidth}{@{}l@{\hspace{0.5cm}}lX}
\textbullet & First Statement & \# First Comment \\ \addlinespace
\textbullet & Second Statement & \# Second Comment \\ \addlinespace
\textbullet & Third Statement & \# Third Comment \\ \addlinespace
\end{tabularx} \hspace{-\parindent}
This is some commentary on the list.
\section{Example B}
\hspace{\parindent} \noindent\begin{tabularx}{\textwidth}{@{}l@{\hspace{0.5cm}}lX}
1. & First Statement & \# First Comment \\ \addlinespace
2. & Second Statement & \# Second Comment \\ \addlinespace
3. & Third Statement & \# Third Comment \\ \addlinespace
\end{tabularx} \hspace{-\parindent}
This is some commentary on the list.
\end{document}
I attempted to simplify this by creating new commands for the beginning and end of the list, but encountered issues with closing the list:
\newcommand{\beginCommentList}{
\hspace{\parindent} \noindent\begin{tabularx}{\textwidth}{@{}l@{\hspace{0.5cm}}lX}}
\newcommand{\closeCommentList}{
\end{tabularx} \hspace{-\parindent}}
Ideally, I'd like to find a solution that allows for a simpler syntax, such as:
\documentclass{article}
\usepackage[margin=0.5in]{geometry}
\usepackage{tabularx}
\usepackage{booktabs}
% Define CommentItemize
% Define CommentEnumerate
\begin{document}
\section{Example A}
\begin{CommentItemize}
First Statement & First Comment
Second Statement & Second Comment
Third Statement & Third Comment
\end{CommentItemize}
This is some commentary on the list.
\section{Example B}
\begin{CommentEnumerate}
First Statement & First Comment
Second Statement & Second Comment
Third Statement & Third Comment
\end{CommentEnumerate}
This is some commentary on the list.
\end{document}
Any suggestions or feedback on how to achieve this would be greatly appreciated. Thank you in advance for your help!
\hspace{\parindent} \noindent
is this intended? the\noindent
does nothing here so this forces an indent of 2 \parindent + 1 word space.\tabularx
and\endtabularx
not\begin{tabularx}
(and\newenvironment
)