7

I'd like to get a list with the label $\mathscr{G}_1$, where G_1 is the first item in the list.

If I use

\newenvironment{enumeratescr}{\begin{enumerate}
                    [labelindent=\parindent, leftmargin=*,
                    label=$\mathscr{G}_1:$, noitemsep]}
                    {\end{enumerate}}

then all the items in the list start with G_1. How do I fix this?

  • Welcome to TeX.SE. Please keep in mind that while code snippets are useful in explanations, it is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. – Peter Grill Apr 1 '12 at 14:24
10
\usepackage{enumitem}
\newenvironment{enumeratescr}
  {\begin{enumerate}[labelindent=\parindent,
                     leftmargin=*,
                     label=$\mathscr{G}_{\arabic*}$:,
                     noitemsep
                    ]}
  {\end{enumerate}}

The current item number can be accessed with \arabic* (or other number representation commands).

The colon should go outside the formula, as it's not part of it. Take the habit of writing \mathcal{X} or \mathbf{A} and not \mathcal X.

(And, please, don't use non standard commands in a code snippet unless you provide also their definition or the packages necessary for them: nobody can know what \mathscr is supposed to do, as it's not a standard command.)

  • Thanks. Sorry, I forgot to change \mscr to \mathscr. That was indeed helpful. – nearim Apr 1 '12 at 13:41
  • 1
    @nearim Also \mathscr is not a standard command. :) – egreg Apr 1 '12 at 13:43
  • How to continue the counter of enumeration whenever this enviornment is called again from the previous. – nichas Dec 13 '18 at 11:30
  • 1
    @nichas The enumitem package offers resume. There is an example in my answer tex.stackexchange.com/a/463711/4427 – egreg Dec 13 '18 at 11:43
8
\documentclass{article}   
\usepackage[mathscr]{eucal}
\usepackage{enumitem}
\newlist{enumeratescr}{enumerate}{10}
\setlist[enumeratescr]{labelindent=\parindent, leftmargin=*,
                    label*=$\mathscr{G}_\arabic*$:, noitemsep}
\begin{document}

\begin{enumeratescr}
  \item foo
  \item bar
\end{enumeratescr}

\end{document}

enter image description here

4

You need to specify the label with the regular enumitem syntax:

\begin{enumerate}[label={$\mathscr{G}_{\arabic*}$:}]
\item Foo
\item Bar
\item FooBar
\end{enumerate}

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.