Text FormattingChanging Enumerate style in environment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
rill2503456
Posts: 2
Joined: Wed Oct 05, 2011 7:07 am

Changing Enumerate style in environment

Post by rill2503456 »

I'm wondering if it's possible/easy to change the style of enumeration in the middle of the environment. Right now trying to do something like:

Code: Select all

\begin{enumerate}
\theenumi}{3.\arabic{enumi}
\item
\theenumi}{5.\arabic{enumi}
\item
With the hope of producing something to the effect of
3.1
5.2
I realize that I could of course just do \item[5.2], or start a new enumerate environment but those both seem extremely inelegant...
Last edited by rill2503456 on Sat Oct 08, 2011 7:02 am, edited 1 time in total.

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: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Changing Enumerate style in environment

Post by Stefan Kottwitz »

Hi,

you could do it this way:

Code: Select all

\documentclass{article}
\begin{document}
\begin{enumerate}
\renewcommand*{\theenumi}{3.\arabic{enumi}}
\item One
\renewcommand*{\theenumi}{5.\arabic{enumi}}
\item Two
\end{enumerate}
\end{document}
And please post more complete code examples in a question, like this one.

Stefan
LaTeX.org admin
rill2503456
Posts: 2
Joined: Wed Oct 05, 2011 7:07 am

Re: Changing Enumerate style in environment

Post by rill2503456 »

Sorry about that, I will make sure to do that next time. Anyways, the code worked perfectly, thanks! I'm curious though - what's the difference between renewcommand and renewcommand*? I don't think I've ever seen the latter
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Changing Enumerate style in environment

Post by Stefan Kottwitz »

Here's an explanation: What's the difference between \newcommand and \newcommand*

Btw. it would be great if you would mark the question as solved now. This helps us to see the still open questions. Just edit your first post in this thread (the question) and choose the checkmark symbol as topic icon.

Stefan
LaTeX.org admin
Post Reply