From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id 6B3E024512 for ; Mon, 20 May 2024 10:02:51 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 9316A484564 for ; Mon, 20 May 2024 10:02:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=freedom.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w9osSowxePP4 for ; Mon, 20 May 2024 10:02:50 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id EE5314843AB for ; Mon, 20 May 2024 10:02:17 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 522AE4842A0 for ; Mon, 20 May 2024 10:02:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Z1i7e4LM1J6 for ; Mon, 20 May 2024 10:02:05 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=185.233.34.146; helo=outbound.soverin.net; envelope-from=j.hagen@freedom.nl; receiver= Received: from outbound.soverin.net (outbound.soverin.net [185.233.34.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 09D47484290 for ; Mon, 20 May 2024 10:02:04 +0200 (CEST) Received: from smtp.freedom.nl (c04cst-smtp-frd01.int.sover.in [10.10.4.107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by outbound.soverin.net (Postfix) with ESMTPS id 4VjVQh3ZH6z6w for ; Mon, 20 May 2024 08:02:04 +0000 (UTC) Received: from smtp.freedom.nl (smtp.freedom.nl [10.10.4.107]) by freedom.nl (Postfix) with ESMTPSA id 4VjVQh1WGNz2G for ; Mon, 20 May 2024 08:02:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freedom.nl; s=default; t=1716192124; bh=BR8vhbRHQJtlkvZE1D30Q6Q3G/3ByXkbwj/+7aKPayU=; h=Date:Subject:To:References:From:In-Reply-To:From; b=QzGiETBz9G5fn/46pbXO+b+moLFgPQifLEdsRSr8boU5ZxjBfppbxFv0/DD3s25nk pXEAMeFn7x/HkcKo9Kl9Wb8esEsyNQy5Gt+YlvEmsJfx68wuBHhevjKCUn0f69UzBM uCfMVZomsBPzpf/GoQHY5Y27qFKyDNytlgoRkrII= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freedom.nl; s=default; t=1716192124; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QEDl7sNAP8GNTH33a468xATmsbGxbHO+romVlIJ9HYk=; b=gNu8eS01yML+vKCpVtost8SGmBGdcq5yp538uQeSKjMC6hjFe15Znd/fFRgv0RVZA4lP5h 6U/xCi3XzcVX4CmQ+BJU5aF/q4sOsZR3SXr5jiVReEfOqb6bkaqrO7F5lfWSwYQ0tVChUY dVLR70kr8n0ehIk7PvI1E99TsIwIL88= ARC-Authentication-Results: i=1; smtp.freedom.nl; auth=pass smtp.mailfrom=j.hagen@freedom.nl ARC-Seal: i=1; s=default; d=freedom.nl; t=1716192124; a=rsa-sha256; cv=none; b=Q9Y+ITyQjQkUqz+MAvlV/h0cpDGwR/fdgp/C3kJpdlXLSEsq0wBCfemxRQvFuf1ZXU8neU rkMPmhYgkSJmvm9DC8+g9KHfYV8pa+5yfHn2yZzZfQH75TlD0R6N0NYDLjJoogrmM/mPP7 vqK8enQ7GznZwQSZBvNw3Q6AB69Aol8= Message-ID: <7c029492-97f6-46c0-82d7-ae080aac0dc7@freedom.nl> Date: Mon, 20 May 2024 10:02:01 +0200 MIME-Version: 1.0 Content-Language: en-US To: ntg-context@ntg.nl References: <573802ae-4aab-4321-afb5-811a16e13c83@xs4all.nl> <171618491505.1996.2365276090642094609@cgl.ntg.nl> X-Soverin-Authenticated: true In-Reply-To: <171618491505.1996.2365276090642094609@cgl.ntg.nl> X-Spampanel-Class: ham Message-ID-Hash: MLPQWGMT3ORSFCX3T36RN6ZZ42CMGQPI X-Message-ID-Hash: MLPQWGMT3ORSFCX3T36RN6ZZ42CMGQPI X-MailFrom: j.hagen@freedom.nl X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: defining hashtag simulator List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Hans Hagen via ntg-context Cc: Hans Hagen Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit On 5/20/2024 8:01 AM, seyal.zavira@gmail.com wrote: > Thanks. > > What if we want the text to be copied when it is clicked? > I found these link on the stack site for this > https://tex.stackexchange.com/questions/174637/copy-to-clipboard-feature-in-pdf-output/545107#545107 > > also i defined this: > \def\Hashtag#1{ > \hbox{\tfa\ctxlua{ > str = "#1" > replacespace = string.gsub(str," ","_") > > context.letterhash() > context(replacespace) > } > } > } > \starttext > \Hashtag{hello} > \stoptext > > i used hbox for making phrase unbreakable. > > How can you put all the code in the one Lua function and not need to put hbox or goto function outside of Lua? \startluacode interfaces.implement { name = "Hashtag", public = true, protected = true, arguments = "string", actions = function(str) context("{\\nohyphens\\letterhash %s}",string.gsub(str," ","_")) -- str = string.gsub(str," ","_") -- context.bgroup() -- context.nohyphens() -- context.letterhash() -- context(str) -- context.egroup() end } \stopluacode -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________