ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Willi Egger via ntg-context <ntg-context@ntg.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Willi Egger <context@boede.nl>
Subject: Re: How to use a variable in a macro agrument
Date: Sat, 18 Dec 2021 11:55:03 +0100	[thread overview]
Message-ID: <28D60989-690F-43EC-928A-6228A40DDE35@boede.nl> (raw)
In-Reply-To: <20211218015236.13330@sachi>

May be \useexternalfigure is your friend instead of your \define[]\logofile{}, which allows you to give a symbolic name of the logo-file. This symbolic name you can use then in the setlayer construct.

Willi

> On 18 Dec 2021, at 10:52, skyhorse--- via ntg-context <ntg-context@ntg.nl> wrote:
> 
> 
> 
> I have a need to use a logo graphics file several times in a document.
> I somethings need to update to a newer graphics file.
> I only want to make one change to the original variable value definition.
> 
> I've tried using \define.. but it's not working for me.
> Here is my MWE:
> 
> %%%%%%%%
> 
> \define[]\logofile{an_image_file.png}	% Here defining the variable with the filename to use.
> 
> \definelayer[stillimage]
> \setlayer[stillimage]{\externalfigure[\logofile]}  % Here trying to use the \logofile macro.
> \setupbackgrounds[page][background=stillimage]
> 
> \starttext
>   \input knuth
> \stoptext
> 
> 
> 
> 
> What's the accepted way to do this or are macro arguments not allowable?
> 
> 
> Thanks
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2021-12-18 10:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-18  9:52 skyhorse--- via ntg-context
2021-12-18 10:55 ` Willi Egger via ntg-context [this message]
2021-12-18 11:42 ` Wolfgang Schuster via ntg-context

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=28D60989-690F-43EC-928A-6228A40DDE35@boede.nl \
    --to=ntg-context@ntg.nl \
    --cc=context@boede.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).