GeneralHow to create a command for a numbered list?

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
CharlieMAC
Posts: 19
Joined: Wed May 04, 2011 5:50 pm

How to create a command for a numbered list?

Post by CharlieMAC »

Hi everyone:

My question is simple. I want to make a command that saves time to me in writing the environment:

Code: Select all

\begin{enumerate}
\item lorem ipsum
\item lorem ipsum
\item lorem ipsum
\item lorem ipsum
\item lorem ipsum
\item lorem ipsum
%...
\item lorem ipsum
\end{enumerate}
So, I want to write the text corresponding to each item in the enumerate environment separated with commas in my command. For example:

Code: Select all

\enum{Lorem ipsum, Lorem Ipsum, blabla, 12354}
And that produces:

Code: Select all

\begin{enumerate}
\item Lorem ipsum
\item lorem Ipsum
\item blabla
\item 12354
\end{enumerate}
Is that possible?
Any suggestions?
Charlie

I hope you understand what I want to do.

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: How to create a command for a numbered list?

Post by Stefan Kottwitz »

Hi Charlie,

welcome to the board!
I'm not aware that there's a ready-to-use solution for it. I guess it requires more time to program something than it's time saving. And there are further environments which may require much to type.

Let's look at the meaning for your LaTeX code. Will it remain understandable, well readable? You change an environment into a command with one argument, thus changing the syntax.

Regarding the typing, I would use an editor which saves time by auto-completion, such as Kile or TeXnicCenter. My experience is, that code is written once, but read often, so my focus is on readbility, not on writing shortcuts.

Stefan
LaTeX.org admin
CharlieMAC
Posts: 19
Joined: Wed May 04, 2011 5:50 pm

Re: How to create a command for a numbered list?

Post by CharlieMAC »

I didn't think I would spend more time programming the command than time the command could save.

I'm currently using Kile for writing my documents. In spite it's very friendly, there're some stuff I don't like. I wish I could add like buttons to the window with shortcuts to different commands. Anyway, I think it is the best LaTeX editor I've used.

Do you know where I can find scripts for Kile?

Thanks for your answer :)

MAC
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

How to create a command for a numbered list?

Post by Stefan Kottwitz »

Hi Charlie,

yes, Kile is a great LaTeX IDE.
Regarding scripts, documentation and more, I would first look at http://kile.sourceforge.net/.

Stefan
LaTeX.org admin
Post Reply