Title: Theory / Unimportant / CS / Descriptive / LaTeX / Counter
Tags: FromInstruction computer_to_instruction hasNotNewEffectReturnsMeaning
On every note of this deck, unless a note says otherwise:
Page: https://en.wikibooks.org/wiki/LaTeX/Counters

Instruction: \newcounter{foo}
Effect: Create a counter foo
Language: Latex

Instruction: \newcounter{foo}[bar]
Effect: Create a counter foo resetting to 0 when bar is incremented
Language: Latex

Instruction: \counterwithin*{foo}{bar}
Effect: state that foo should be reset when bar is incremented
Language: Latex
Variables: foo,bar counter

Instruction: \counterwithout*{foo}{bar}
Effect: state that foo should not be reset when bar is incremented
Language: Latex
Variables: foo,bar counter

Instruction: \stepcounter{foo}
Effect: increase counter foo
Language: Latex
Variables: foo counter

Instruction: \refstepcounter{foo}
Effect: increase counter foo and allow to create a reference
Language: Latex
Variables: foo counter

Instruction: \addtocounter{foo}{bar}
Effect: Add bar to counter foo
Language: Latex
Variables: foo counter

Instruction: \setcounter{foo}{bar}
Effect: change the value of counter foo to bar
Language: Latex
Variables: foo counter

Instruction: \thefoo
Effect: print the formatted string related to the counter foo
Language: Latex
Variables: foo counter

Instruction: \value{foo}
Language: Latex
Returns: the counter value which can be used by other counters or for calculations
Variables: foo counter

Instruction: \arabic{foo}
Effect: print the formatted counter using arabic numbers.
Language: Latex
Returns: the counter value which can be used by other counters or for calculations
Variables: foo counter

Instruction: \alph{foo}
Effect: print the formatted counter using small letters
Language: Latex
Variables: foo counter

Instruction: \Alph{foo}
Effect: print the formatted counter using capital letters
Language: Latex
Variables: foo counter

Instruction: \Roman{foo}
Effect: print the formatted counter using capital roman number
Language: Latex
Variables: foo counter

Instruction: \roman{foo}
Effect: print the formatted counter using lower roman number
Language: Latex
Variables: foo counter

Instruction: \fnsymbol{foo}
Effect: print the formatted counter using footnote style
Language: Latex
Variables: foo counter