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-...
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 -----------------------------------------------------------------