Skip to content

Instantly share code, notes, and snippets.

@schocco
Created February 9, 2012 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schocco/1781655 to your computer and use it in GitHub Desktop.
Save schocco/1781655 to your computer and use it in GitHub Desktop.
Simple loop for printing stars
% required packages
\usepackage{ifthen}
\usepackage{bbding} % for star symbols
% command for star printing
% \level{3} would print 3 stars
\newcounter{levelcounter} %init counter
\newcommand{\level}[1]{%
\ifthenelse{ \value{levelcounter}<#1 }%
{%
\FiveStarOpen %
\addtocounter{levelcounter}{1} %
\level{#1} % next iteration
}%
{% reset counter and exit
\setcounter{levelcounter}{0} %%
}%
}%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment