I am using LaTeX inside a graphical editor (IPE) for presentations and would like to speed up creating itemize environments, as I use them very frequently. I have different text fields for each item and they all get compiled individually by the editor, so I basically need to re-create the itemize environment for every text field. This is what I currently use:
\newcommand{\e}[1]{\begin{itemize}\item #1\end{itemize}}
\newcommand{\ee}[1]{\begin{itemize}\begin{itemize}\item #1\end{itemize}\end{itemize}}
\newcommand{\eee}[1]{\begin{itemize}\begin{itemize}\begin{itemize}\item #1\end{itemize}\end{itemize}\end{itemize}}
\newcommand{\w}[2][1.]{\begin{enumerate}\item[#1] #2\end{enumerate}}
\newcommand{\ww}[2][(a)]{\begin{enumerate}\begin{enumerate}\item[#1] #2\end{enumerate}\end{enumerate}}
\newcommand{\www}[2][i.]{\begin{enumerate}\begin{enumerate}\begin{enumerate}\item[#1] #2\end{enumerate}\end{enumerate}\end{enumerate}}
This way I can simply use \e{some text} and \ee{more text} for individual levels of itemize (and enumerate).
Now the question: I'd rather like to use \e some text and \ee more text as this is much simpler to handle. Especially when editing stuff I often have to de-select the braces in order to not overwrite them. But LaTeX only takes a single token as argument when you omit the braces, so I get an annoying line break after the first character.
I could think of multiple solutions:
- Is it possible to tell LaTeX to use the entire remainder of the line as #1 argument?
- Is it possible to replicate the behavior of itemize (the symbol of \item, the font size of the three layers, the indentation especially after a line break) without the environment?
- Is it possible to prevent the line break after
\end{itemize}and just continue typing on your\item? This should however still result in correct indentation after a natural line break occurs.
Thank you in advance!
Edit:
Willie Wong provided me with this link that did the trick for itemize. Thank you!
\newcommandit is possible to use\defwith the end of line as one of the delimiters of input. Doing so is however slightly tricky, and probably for other reasons not a great idea. – Willie Wong Feb 27 '20 at 20:39