Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Don't discount flying pigs before you have good air defense." -- jvh@clinet.FI


computers / comp.text.tex / Class writing: Variables won't show in savebox

SubjectAuthor
* Class writing: Variables won't show in saveboxjohnl...@gmail.com
`- Re: Class writing: Variables won't show in saveboxJulius Dittmar

1
Class writing: Variables won't show in savebox

<c8f72255-a915-4d08-8a10-dd5f47fa73dcn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5252&group=comp.text.tex#5252

  copy link   Newsgroups: comp.text.tex
X-Received: by 2002:a05:622a:205:b0:343:282:3d0e with SMTP id b5-20020a05622a020500b0034302823d0emr17671192qtx.436.1662846311435;
Sat, 10 Sep 2022 14:45:11 -0700 (PDT)
X-Received: by 2002:a81:4e4c:0:b0:345:5870:1707 with SMTP id
c73-20020a814e4c000000b0034558701707mr16968527ywb.111.1662846311135; Sat, 10
Sep 2022 14:45:11 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.text.tex
Date: Sat, 10 Sep 2022 14:45:10 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=75.85.186.159; posting-account=wmA6DwoAAADS2NSWjb1cOGch380zMLxf
NNTP-Posting-Host: 75.85.186.159
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c8f72255-a915-4d08-8a10-dd5f47fa73dcn@googlegroups.com>
Subject: Class writing: Variables won't show in savebox
From: johnlervin@gmail.com (johnl...@gmail.com)
Injection-Date: Sat, 10 Sep 2022 21:45:11 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1566
 by: johnl...@gmail.com - Sat, 10 Sep 2022 21:45 UTC

Reposting from a week ago to see if there is an answer?

Hi There:
Trying to use variable with saveboxes and getting unexpected result. Why won't the variable show when I use the savebox?

thanks!
John

Class File (excerpt):
\let\@foo\relax
\def\foo#1{\def\@foo{#1}}
\newcommand{\showfoo}{\@foo}
\newsavebox{\testbox}
\sbox{\testbox} { Testbox goes \showfoo}

Tex File (excerpt):
\begin{document}
\foo{foo}
Test box test: \usebox{\testbox}

Show foo test: \showfoo
\end{document}

Output:
Test box test: Testbox goes
Show foo test: foo

Re: Class writing: Variables won't show in savebox

<tfk425$3rp$1@news-cypress.fernuni-hagen.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5253&group=comp.text.tex#5253

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!news.samoylyk.net!newsfeed.pionier.net.pl!news-1.dfn.de!news.dfn.de!news-cypress.fernuni-hagen.de!news.fernuni-hagen.de!.POSTED.xdsl-89-0-225-167.nc.de!not-for-mail
From: Julius.Dittmar@gmx.de (Julius Dittmar)
Newsgroups: comp.text.tex
Subject: Re: Class writing: Variables won't show in savebox
Date: Sun, 11 Sep 2022 09:51:32 +0200
Organization: FernUni Hagen
Message-ID: <tfk425$3rp$1@news-cypress.fernuni-hagen.de>
References: <c8f72255-a915-4d08-8a10-dd5f47fa73dcn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 11 Sep 2022 07:51:33 +0000 (UTC)
Injection-Info: news-cypress.fernuni-hagen.de; posting-host="xdsl-89-0-225-167.nc.de:89.0.225.167";
logging-data="3961"; mail-complaints-to="newsadmin@fernuni-hagen.de"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Content-Language: en-US
In-Reply-To: <c8f72255-a915-4d08-8a10-dd5f47fa73dcn@googlegroups.com>
 by: Julius Dittmar - Sun, 11 Sep 2022 07:51 UTC

Am 10.09.22 um 23:45 schrieb johnl...@gmail.com:
> Reposting from a week ago to see if there is an answer?
>
> Hi There:
> Trying to use variable with saveboxes and getting unexpected result. Why won't the variable show when I use the savebox?

The box is rendered when you define it, which is in the preamble in your
example. After that, when the box as rendered is used as is. There's no
box-creating macro code left which could be interpreted with current values.

At the moment when the box is created, \@foo is \relax, so there's
nothing \showfoo would show.

HTH,
Julius

PS: If you create a full minimal example it's easier for others to play
with your code and find the problem. Something like:

\documentclass{article}
\makeatletter
> \let\@foo\relax
> \def\foo#1{\def\@foo{#1}}
> \newcommand{\showfoo}{\@foo}
> \newsavebox{\testbox}
> \sbox{\testbox} { Testbox goes \showfoo}
>
% Tex File (excerpt):
> \begin{document}
> \foo{foo}
> Test box test: \usebox{\testbox}
>
> Show foo test: \showfoo
> \end{document}
>
> Output:
> Test box test: Testbox goes
> Show foo test: foo

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor