I want to create an automatic itemize environment where the item's color font is alternating.

Suposing the following list:

   \item A
   \item B
   \item C
   \item D
   \item E

I want a code to A, C, and E have color #1 and B and D, color #2.

Yes, I know I can create an alternative \item command (\coloreditem or something such that), but I am asking for an automated way. So, if I insert on the fly a new item between other two items of that list, I do not need to (manually) change the color scheme of every item after the new one.


2 Answers 2


Like this?





enter image description here

  • Good choice of colors :)
    – Marijn
    Commented Mar 16, 2018 at 15:50
  • @Marijn you too :)
    – Skillmon
    Commented Mar 16, 2018 at 15:51
  • 2
    I did not know the duckuments package. Funnier than lipsum ;) Commented Mar 16, 2018 at 16:24
  • @FabianoFagundes no wonder you didn't know, I pushed it to CTAN only a few days ago :)
    – Skillmon
    Commented Mar 16, 2018 at 16:25
  • This is ducking clever!
    – FeRD
    Commented Mar 17, 2018 at 8:26

You can add a custom macro before each \item with the xpatch package. In the example below the \choosecolor macro is defined which alternates the color using a toggle.



\item first item
\item second item
\item third item
Text after itemize


enter image description here

  • So, in your example, how I am sure that every new itemize list starts with tcolor=true? I think the tcolor toggle does not reset automatically after each itemize list. EDIT: Nevermind, I just tested and works very fine, reseting the toggle. Thanks :) Commented Mar 16, 2018 at 16:37
  • In my nature I always thank from the heart those who help with the heart Sebastiano.
    – Sebastiano
    Commented Sep 7, 2019 at 16:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .