1

I want to rename enumerate to something like enum or even ol for short typing. But nothing helps me.

The correct formatting is

enter image description here

If I use \newcommand{\ol}{\enumerate}, I get wrong formatting like

enter image description here

If I use \let\ol\enumerate I get even more wrong formatting like

enter image description here

I think something may go wrong because I use \setlist[enumerate]{leftmargin=*} from enumitem, but when I move renaming before or after setting margin, nothing changes.

PS: I even want to rename \begin to \b, and I get even more strange errors. Where can I read something about it?

  • 9
    for enumerate \newenvironment{enum}{\begin{enumerate}}{\end{enumerate}} but I would not do that, for renaming \begin and \end don't do it, you will break many latex constructs. Any reasonable editor should be able to add \begin{enumerate}\end{enumerate} with a 2 or 3 key shortcut so there is no typing advantage to renaming and many disadvantages as people and syntax highlighters will find it harder to understand your document. – David Carlisle Dec 24 '17 at 10:38
  • 1
    Welcome to TeX SX! I think this is more of an editor problem; use shortcuts so that the editor displays \begin{enumerate}, \end{enumerate} and the cursor in-between. – Bernard Dec 24 '17 at 11:05
  • Of course I can use (and use) shortcuts. The problem is that all that cumbersome constructions make it difficult to read the LaTeX code. – wiki-fan Dec 24 '17 at 11:55
  • Mmm, \let\ol\enumerate should actually work without affecting the formatting. But you should also do \let\endol\endenumerate, otherwise the environment end might cause problems. Without an compilable MWE it's hard to track it down. – Martin Scharrer Dec 24 '17 at 11:56
  • @wiki-fan: Then you might be interested in LyX instead. – Werner Dec 24 '17 at 16:22
4

If you want to rename the enumerate environment to ol you need to rename its end-macro as well:

\let\ol\enumerate 
\let\endol\endenumerate

Or, in a more LaTeX style:

\newenvironment{enum}{\enumerate}{\endenumerate} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.