2

I want to use $\bullet$ for the item label. In most LaTeX classes I would use

\usepackage{enumitem}
\setitemize{label=$\bullet$}

However this won't work in beamerarticle since enumitem doesn't play nice with everything beamer-related (see for instance Trouble combining enumitem and beamer)

Here is an example that pdflatex will fail to compile (in TeXLive 2014).

\documentclass{article}
\usepackage{enumitem}
\usepackage{beamerarticle}
\setitemize{label=$\bullet$}
\begin{document}

\begin{description}
\item[first item] blabla
\item[second item] blabla
\end{description}

\end{document}

Note that I don't want to redefine the default description environment in article, only replace the "-" label used in the itemize environment with a $\bullet$.

I also tried

\renewcommand{\labelitemi}{$\bullet$}

but it needs to be put it in every document. There is a conflict with the french option of babel. See for instance:

with test.cls containing

\NeedsTeXFormat{LaTeX2e} 
\ProvidesClass{test}
\LoadClass{article}

\RequirePackage[french]{babel}
\renewcommand{\labelitemi}{$\bullet$}
\endinput

the following uses the regular "-" for item labels whereas it uses bullets if babel is not loaded with the french option.

\documentclass{test}
\title{Essai}
\begin{document}

\begin{itemize}
\item blabla
\item blabla
\end{itemize}

\end{document}

Any ideas?

  • It is \labelitemi and not \labelitem... and why do you say that it doesn't work if placed in a .cls file? – karlkoeller Mar 6 '15 at 6:47
  • I investigated further and noticed that the problem arises from a conflict with \RequirePackage[french]{babel} – wilk Mar 6 '15 at 13:39
  • @wilk You're right and an answer has been provided below. – Gonzalo Medina Mar 6 '15 at 14:05
4

With the french module for babel, you need to do the change \AtBeginDocument:

\AtBeginDocument{\renewcommand{\labelitemi}{$\bullet$}}

A complete example:

\documentclass{article}
\title{Essai}

\RequirePackage[french]{babel}
\AtBeginDocument{\renewcommand{\labelitemi}{$\bullet$}}


\begin{document}

\begin{itemize}
\item blabla
\item blabla
\end{itemize}

\end{document}

enter image description here

Your test.cls then will be

\NeedsTeXFormat{LaTeX2e} 
\ProvidesClass{test}
\LoadClass{article}

\RequirePackage[french]{babel}
\AtBeginDocument{\renewcommand{\labelitemi}{$\bullet$}}
\endinput
  • Thanks, I'm confused as to why you cannot do the \renewcommand after loading babel in the preamble, and instead you have to do it in the document itself. – wilk Mar 6 '15 at 17:35
  • @wilk You don't have to do it in the document. As I showed you can do it in the class file, but you need to do instruct TeX to postpone the \renewcommand after \begin{document} (not exactly after, but that's not relevant here); otherwise, it won't have any effect since the french module also redefines the labels \AtBeginDocument. – Gonzalo Medina Mar 6 '15 at 17:41
  • The way I see it using AtBeginDocument is roughly equivalent to putting the command after \begin{document}. And I was surprised that loading babel compels you to put this change to \labelitemi after \begin{document} (even through \AtBeginDocument) when you can otherwise put it before \begin{document}. It doesn't really matter in the end since I have a working solution, thanks to you. – wilk Mar 7 '15 at 0:09
  • @wilk I see. You can post, if you want, your solution as an answer (it could be helpful for other users). – Gonzalo Medina Mar 7 '15 at 0:16
  • The working solution is in fact your suggestion of using \AtBeginDocument – wilk Mar 7 '15 at 6:45

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.