GeneralPackageWarning: a dumb's question

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
NinV
Posts: 69
Joined: Sun Oct 05, 2008 12:57 pm

PackageWarning: a dumb's question

Post by NinV »

Hi,

please forgive me for this question :oops:

How can I insert the value of a counter in a warning message using \PackageWarning?

I tried this:

Code: Select all

 \newcount\totkete
 \totkete=0

 ... omissis ...

 \ifnum\totkete<64
  \PackageWarning{mypack}
  {The quantity isn't enough: \totkete}
 \else
  \ifnum\totkete>64
   \PackageWarning{mypack}
   {The quantity is too high: \totkete}
  \fi
\fi
But it doesn't work.

Please help me.

Thanks,
Nino
Window + MiKTeX 2.7
Ubuntu + TexLive + Kile
Xandros (eeePC) + TeTex + TexMaker

Recommended reading 2024:

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

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

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm

PackageWarning: a dumb's question

Post by josephwright »

You can't use a count (or any other register) directly, except in very particular circumstances. Convert it into its value using \the.

Code: Select all

\ifnum\totkete<64\relax
  \PackageWarning{mypack}
  {The quantity isn't enough: \the\totkete}
\else
  \ifnum\totkete>64\relax
   \PackageWarning{mypack}
   {The quantity is too high: \the\totkete}
  \fi
\fi
Joseph Wright
NinV
Posts: 69
Joined: Sun Oct 05, 2008 12:57 pm

Re: PackageWarning: a dumb's question

Post by NinV »

I forgot that!

Thank you very much.
Window + MiKTeX 2.7
Ubuntu + TexLive + Kile
Xandros (eeePC) + TeTex + TexMaker
Post Reply