From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,NICE_REPLY_A,T_SCC_BODY_TEXT_LINE, URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25628 invoked from network); 19 May 2023 10:16:28 -0000 Received: from zapf.ntg.nl (5.39.185.232) by inbox.vuxu.org with ESMTPUTF8; 19 May 2023 10:16:28 -0000 Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7D7471C3465; Fri, 19 May 2023 12:16:02 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.ntg.nl Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04iTPCCt7QcU; Fri, 19 May 2023 12:16:00 +0200 (CEST) Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id F281AA7F; Fri, 19 May 2023 12:15:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 08459A7F for ; Fri, 19 May 2023 12:15:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.ntg.nl Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sU49m-Pp4q6S for ; Fri, 19 May 2023 12:15:57 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.53; helo=mail-ed1-f53.google.com; envelope-from=wolfgang.schuster.lists@gmail.com; receiver= Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 2A8912F7 for ; Fri, 19 May 2023 12:15:57 +0200 (CEST) Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-51190fd46c3so450066a12.1 for ; Fri, 19 May 2023 03:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684491356; x=1687083356; h=content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from:from:to:cc:subject:date :message-id:reply-to; bh=4tJ6ufozEjz8jvUdmFjp31EFwKJaOM6acfcFpUwkFH0=; b=nakp1uY5+H4LrFTUY+aT1hD5SQBCZoQ+nV6olY+1pnmdURRlV/nzxzluZtb1lbRTbS qIU5mQB906DG3S3yGG49cQ6e43TW/lc/mkhP4/bcoTa3cL1T01L9Kte221NPew/KL72F BN1vKfG5JpEWr/F2SJEqpi6S73Pk8ctcklON6UUkx1/dAIrL4Y8T/EG2zqt1v1TjMXsh LUh3Kx4eNFnBS3VioXkHzgDv+vv+XNwfzikkr78bQ8K0FQEo36UYwYgEsYIEpRjCVsT5 sN9otYqRH0iq/lA3yXZObsZCtb1Hb8UTNM5YP4BpG4G2XLupJllAhwgCBZUz99eqFVEf NjRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684491356; x=1687083356; h=content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:subject:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=4tJ6ufozEjz8jvUdmFjp31EFwKJaOM6acfcFpUwkFH0=; b=PhtLn6Y4kJ7EVM4MsRspWQIktNlkiX0QPGGzu/GA6jmpdoeInknqBCRxFsTtwW0BBJ bryL0dDJoUrb4XkqHzP8pqFNJGypICFW1XGxaFnlaQ3aX/v73TqrwtAv1WvP4cYzHcz5 hIsLtbUQELvwDtRF0+KNPgjZgbT1t2z7I5v3XRokV5VKgmEfBBBy/LT5kJG/j5Pj/P9V RCQAuPf9D7fo00zXRVbiUECZ2LeXaBJg1UsG286XvwWiJd/UEF9n88PZJKcvnU79yt5+ 7eZ7p44BDyGmAK1VdjMHSaTyTYV9kZ9iqA+OVwbt3SW45X6y5xgbnpEnvQADjI4A/93e aLsQ== X-Gm-Message-State: AC+VfDw2EYlV3eMS9AtT6UkohmnoEfYvOLCI5F31VFXu6roBISV898Fg eKlXLfT+HdDDKUdXbRX6M8s= X-Google-Smtp-Source: ACHHUZ7857wBG+btM/6DWlsIfAwpqRrp13JV3VNBIDjl/nB2OU/IQFPzizVKhsV5Q0XfE+ARzU4eIA== X-Received: by 2002:a17:906:ecf2:b0:96a:2dd7:2efc with SMTP id qt18-20020a170906ecf200b0096a2dd72efcmr852546ejb.41.1684491356320; Fri, 19 May 2023 03:15:56 -0700 (PDT) Received: from ?IPv6:2a02:810d:a8bf:fe08::5a8c? ([2a02:810d:a8bf:fe08::5a8c]) by smtp.gmail.com with ESMTPSA id gf3-20020a170906e20300b0096a16e49b0fsm2117254ejb.51.2023.05.19.03.15.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2023 03:15:55 -0700 (PDT) To: mailing list for ConTeXt users , Gerben Wierda via ntg-context References: Message-ID: <155acd72-8541-ce73-7681-b38adebf925d@gmail.com> Date: Fri, 19 May 2023 12:15:40 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 PostboxApp/7.0.60 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Subject: Re: [NTG-context] Probably simple: using a variable for \switchtobodyfont size X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.38 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Wolfgang Schuster via ntg-context Reply-To: mailing list for ConTeXt users Cc: Wolfgang Schuster Content-Type: multipart/mixed; boundary="===============2116486133687948044==" Errors-To: ntg-context-bounces@ntg.nl Sender: "ntg-context" This is a multi-part message in MIME format. --===============2116486133687948044== Content-Type: multipart/alternative; boundary="------------66BDE619C6424ABE404A5CD6" Content-Language: en-US This is a multi-part message in MIME format. --------------66BDE619C6424ABE404A5CD6 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Gerben Wierda via ntg-context schrieb am 19.05.2023 um 11:43: > I want to use a variable for a font size so I can set it based on > language (as some translated texts have widely different sizes) > > This fails: > > %=========================== > \newdimen\relationsFontSize > \relationsFontSize=8pt > \starttext > \switchtobodyfont[\relationsFontSize] > Hello, world! > \stoptext > %=========================== > > How can I use a variable to steer \switchtobodyfont size? You need \the\, i.e. \switchtobodyfont[\the\relationsFontSize] but I would use the measure command, e.g. \definemeasure[relationsFontSize][8pt] \starttext \switchtobodyfont[\measure{relationsFontSize}] Hello, world! \stoptext Wolfgang --------------66BDE619C6424ABE404A5CD6 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 7bit Gerben Wierda via ntg-context schrieb am 19.05.2023 um 11:43:
I want to use a variable for a font size so I can set it based on language (as some translated texts have widely different sizes)

This fails:

%===========================
\newdimen\relationsFontSize
\relationsFontSize=8pt
\starttext
\switchtobodyfont[\relationsFontSize]
Hello, world!
\stoptext
%===========================

How can I use a variable to steer \switchtobodyfont size?

You need \the\<register>, i.e.

\switchtobodyfont[\the\relationsFontSize]

but I would use the measure command, e.g.

\definemeasure[relationsFontSize][8pt]
\starttext
\switchtobodyfont[\measure{relationsFontSize}]
Hello, world!
\stoptext

Wolfgang

--------------66BDE619C6424ABE404A5CD6-- --===============2116486133687948044== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________ --===============2116486133687948044==--