9

I am making a checklist to print, where users can check their answers on a printed paper. For this I am using itemize and \renewcommand{\labelitemi}{\Box}, \renewcommand{\labelitemii}{\Box} etc..., which works fine.

What I now want is to make items, sub-items and sub-sub-items different sized, so that the higher the hierarchy, the bigger font. Since I have a lot of things to check, I don't want to specify each line in the latex document, but was hoping to use a \renewcommand{\itemi}{something} or something like that.

Is this possible in any way?

11

Define your own itemize environment which uses the normal one but changes the font size first. The relsize package gives you the handy \smaller and \larger macros.

This would make every level one font size step smaller.

\usepackage{relsize}

\newenvironment{xitemize}{%
    \smaller
    \itemize
}{%
    \enditemize
}

This would make the first level smaller then the text. If this is not wanted change \smaller to \ifnum\csname @itemdepth\endcsname=0\else\smaller\fi.

If you want to keep the itemize name in your documents, use:

\let\olditemize\itemize
\let\endolditemize\enditemize
\renewenvironment{itemize}{%
    \smaller
    \olditemize
}{%
    \endolditemize
}

You could define your own set of e.g. \fontitemi, \fontitemii, ... macros:

\makeatletter
\newenvironment{xitemize}{%
    \@nameuse{fontitem\romannumeral\the\@itemdepth}
    \itemize
}{%
    \enditemize
}
\makeatother
\newcommand{\fontitem}{\Huge}
\newcommand{\fontitemi}{\Large}
\newcommand{\fontitemii}{\large}
\newcommand{\fontitemiii}{\normalsize}
\newcommand{\fontitemiv}{\small}
3
  • I think there is a typo in the above code: \renewenvironment uses \endolditemize instead of \oldenditemize. – Gabriel Oct 23 '16 at 13:35
  • Needs one more command: \newcommand{\fontitem}{\Huge}. – user21820 Oct 24 '16 at 7:21
  • @Gabriel: Thanks. I misspelled that one. Fixed now. – Martin Scharrer Oct 25 '16 at 12:16

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.