LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Sender:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Thu, 1 Sep 2011 16:44:17 +0100
Reply-To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Message-ID:
Subject:
MIME-Version:
1.0
Content-Transfer-Encoding:
7bit
In-Reply-To:
Content-Type:
text/plain; charset=ISO-8859-1
From:
Joseph Wright <[log in to unmask]>
Parts/Attachments:
text/plain (34 lines)
On 01/09/2011 13:53, Ulrike Fischer wrote:
> Well my command (it is more a variable so \tl_set would perhaps be
> more correct) must exist and that's why I'm using \providecommand:
> To make sure *that* is exists. I'm not relying on a "might exist"
> command but try to ensure that it is a "does exist" command.
> 
> The problem is that it must exist in various encoding definitions
> files for fontenc, in the sty (chessfss) and that its "value" can be
> set/changed by the user -- which means that I have no control over
> the location where the default value should be set. I have to set it
> in various places in such a way that it doesn't overwrite user
> settings.

That's broadly what I mean by 'LaTeX2e issues': having a value which is
used directly at a user level, and in various files, is not good.

You don't say if the value might alter again after you've
\providecommand'd it. If not, then I'd be tempted to go with something like

  \tl_new:N \l_<internal-thing>_tl
  \cs_if_exist:NTF \<thing>
    { \tl_set_eq:NN \l_<internal-thing>_tl \<thing> }
    { \tl_set:Nn \l_<internal-thing>_tl { <default> } }

On the other hand, if this variable in question has to be user-setable
at any point, then you can't use an internal value and have to stick to
a manual '\providecommand' approach.

(I'm assuming that the variable in question is one that is already
required by LaTeX2e constructs, and so 'simply do things differently' is
not an option.)
-- 
Joseph Wright

ATOM RSS1 RSS2