I have to do a small document, in which I intend to use Tufte-handout
rather than article
or Scrartcl
classes and compile it with XeLaTeX
with a typography I intend to use.
However I have a difficulty with the format, I have to use the enumerate
environment nested in three levels with the following characteristics:
- The item marker appears in color (red), for this I think I can load
the
xcolor
package before\documentclass
to\PassOptionToPackage
or something like that. But I don't know how to define it automatically for each item. The method of numbering the list, I need to appear as:
1
1.1
1.1.1
and not:
1.
(a)
i.
as default.
Finally I think this is the most difficult (or I don't know how to achieve it) and it's the format of each level of nesting:
- 1st level item: in roman letter (default value)
- 2nd level item: in small caps (and sometimes in small italic caps). The font I chose can achieve it without problems.
- 3rd level item: in italics but without using
\emph{}
I've already used and I don't think it's the best choice.
Any idea how to do this? I can do it manually but as it is a fairly long list because it would prefer to automate in the preamble.
Update
Well, after the suggestion of use enumitem I triead with good results. The suggestion is in the code below as a MWE, it is:
\PassOptionsToPackage{usenames,dvipsnames,table}{xcolor}
\documentclass[]{tufte-handout}
%\usepackage[spanish]{babel}
\usepackage{enumitem}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\usepackage{xunicode}
\usepackage{xltxtra}
\setmainfont{Warnock Pro}
\renewcommand{\theenumii}{\arabic{enumii}}
\renewcommand{\labelenumii}{\theenumii.}
\renewcommand{\theenumii}{\arabic{enumii}}
\renewcommand{\labelenumii}{\theenumi . \theenumii.}
\renewcommand{\theenumiii}{\arabic{enumiii}}
\renewcommand{\labelenumiii}{
\theenumi . \theenumii . \theenumiii.}
\begin{document}
\begin{enumerate}
\item[\textcolor{red}{1}] This is a first level item
\begin{enumerate}
\item \textsc{This is a second level item}
\begin{enumerate}
\item \textit{This is a third level item}
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{document}
It works, now I need to add color to the label of the first level, and automate the format of the content as I described before.
enumitem
comes to help here. But do you really want the same thing once with a period (1.1) and a level higher up with out a period (1)?enumitem
at all, by the way. You might as well not load it if you do it that way.