On 5/20/2024 8:01 AM, seyal.zav...@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
___________________________________________________________________________________

Reply via email to