I know I can change a counter style as this:


(The above command will make chapter numbers be written in upper case roman numerals)

However, according to Wikibooks and an answer to this question, I can only choose among arabic, roman, greek and footnote symbols:

  • \arabic 1, 2, 3 ...
  • \alph a, b, c ...
  • \Alph A, B, C ...
  • \roman i, ii, iii ...
  • \Roman I, II, III ...
  • \fnsymbol Aimed at footnotes; prints a sequence of symbols.

Is there a way I can define my own symbol sequence for a counter?


You can easily adapt the definition of \alph which is defined like this in latex.ltx:

\def\alph#1{\expandafter\@alph\csname c@#1\endcsname}
  \ifcase#1\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or
   k\or l\or m\or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or
    y\or z\else\@ctrerr\fi}

So here is a MWE for a custom sequence.

\def\mysequence#1{\expandafter\@mysequence\csname c@#1\endcsname}
  \ifcase#1\or AAA\or BBB\or CCC\else\@ctrerr\fi}
%\section{Section} % --> LaTeX Error: Counter too large

Be aware, that this implementation stops working if the counter value is too high (in my example 4). So make sure you define enough symbols.

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.