From: Slawek Zak <zaks@prioris.mini.pw.edu.pl>
Cc: ntg-context@ntg.nl
Subject: Re: String -> register conversion
Date: Wed, 06 Feb 2002 16:07:05 +0100 [thread overview]
Message-ID: <87it9ahco6.fsf@pf39.warszawa.sdi.tpnet.pl> (raw)
In-Reply-To: <5.1.0.14.1.20020206094654.04235158@server-1> (Hans Hagen's message of "Wed, 06 Feb 2002 09:52:52 +0100")
On Wed, 06 Feb 2002, Hans Hagen verbalised:
> [bounced mail, use address know to list]
Fixed, thanks.
>>How can I make the following work in Tex? :
>>
>>\def\mac{10}
>>\newcount\cnt
>>\cnt=\mac
>>\the\mac
>>\bye
>>
>> The idea is simple. I want TeX to expand \mac and make an assignment to
>> register \cnt. I tried \expandafter\cnt=\mac, but it doesn't work. Perhaps
>> because of the = after \cnt.
>
> first of all, \the\mac is wrong, since \mac is no register, so that one should
> be \the\cnt
Sure. My fault. I meant \the\cnt of course.
> but then, again you get not what you want, because tex keeps on reading until
> no numbers are found, so you need to stop reading by saying \cnt=\mac\relax
> (or \cnt\mac\space)
Ouch. \relax, I should've thought of it. Thanks.
> if you want a neutral way to get a number, use \number\cnt or \number\mac
> since \number is less strict in what it expects
Yep. That reminds me to put The TeXbook lecture on my to-read list again ;)
> PS. Of course a google search does not work, since mac will always lead you to
> big macs i suppose -)
Apple would come up as the first search result on Google, actually ;)
/S
--
hundred-and-one symptoms of being an internet addict:
234. You started college as a chemistry major, and walk out four years
later as an Internet provider.
* Suavek Zak / PGP: finger://zaks@prioris.mini.pw.edu.pl
prev parent reply other threads:[~2002-02-06 15:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-02-06 8:52 Hans Hagen
2002-02-06 15:07 ` Slawek Zak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87it9ahco6.fsf@pf39.warszawa.sdi.tpnet.pl \
--to=zaks@prioris.mini.pw.edu.pl \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).