Created
February 9, 2012 18:06
-
-
Save schocco/1781655 to your computer and use it in GitHub Desktop.
Simple loop for printing stars
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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