Text FormattingDefining a command with counter

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
artemff
Posts: 113
Joined: Sat Oct 17, 2009 11:15 pm

Defining a command with counter

Post by artemff »

gmedina
I do not undestand you here. What do you mean?

Code: Select all

\printent{4}
prints "4".

Code: Select all

\printent{9}
prints "9".

Code: Select all

\printent{20}
prints "20".

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

artemff
Posts: 113
Joined: Sat Oct 17, 2009 11:15 pm

Re: My commands don't work.

Post by artemff »

Sorry, now all work...
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Defining a command with counter

Post by gmedina »

As I said in a previous response, I made a mistake in the new definition of the \printent command. Now the mistake has been corrected; use the corrected code:

Code: Select all

\newcommand{\printent}[1]%
  {\vskip#1\baselineskip}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply