[NTG-context] Re: defining hashtag simulator
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? ___ 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 ___
[NTG-context] Re: How to disable hyphenation at the end of a line?
Hi, since it has to do with paragraph building and not with certain breaks it is controlled by a demerits rather than a penalty, and there is, as far as I know, no value that explicitly prohibits a hyphen at the last line specifically (you can set the hyphenpenalty to 1 to avoid hyphenations everywhere). In the total demerits calculation penalties are more or less squared, so setting \finalhyphendemerits to a ridiculously high value might do, for most paragraphs. /Mikael On Mon, May 20, 2024 at 3:33 AM Joel via ntg-context wrote: > > I'm using mostly default ConTeXt settings, but an editor has warned I should > avoid using hyphenation at the end of lines--at least for my particular > audience. > > I've found manual text that says how to disable specific words from being > hyphenated. > > Is there a whole-document switch to disable it? > > --Joel > ___ > 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 > ___ ___ 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 ___
[NTG-context] How to disable hyphenation at the end of a line?
I'm using mostly default ConTeXt settings, but an editor has warned I should avoid using hyphenation at the end of lines--at least for my particular audience. I've found manual text that says how to disable specific words from being hyphenated. Is there a whole-document switch to disable it? --Joel ___ 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 ___
[NTG-context] Re: luatex doesn't see installed 3rd party module
Correction for misspelling : `context --latex` —> `context --luatex` > On May 20, 2024, at 02:29, and...@borisov.dev wrote: > > Hello! > > I’ve installed a 3rd party module by copying its TDS folder structure and > invoking `context --generate` as described in > https://wiki.contextgarden.net/Modules#ConTeXt_LMTX > > When I compile my project with `context` (using LuaMetaTeX), it's found and > works just fine; however, when I try to compile with LuaTeX by invoking > `context --latex`, it can’t find the module. > > Do I need to do something special to make it visible for LuaTeX? I can’t find > the answer in the wiki. > > Any help would be appreciated 🙏🏻 > > Best, > Andrei. ___ 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 ___
[NTG-context] Re: luatex doesn't see installed 3rd party module
Correction for misspelling : `context --latex` —> `context --luatex` ___ 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 ___
[NTG-context] luatex doesn't see installed 3rd party module
Hello! I’ve installed a 3rd party module by copying its TDS folder structure and invoking `context --generate` as described in https://wiki.contextgarden.net/Modules#ConTeXt_LMTX When I compile my project with `context` (using LuaMetaTeX), it's found and works just fine; however, when I try to compile with LuaTeX by invoking `context --luatex`, it can’t find the module. Do I need to do something special to make it visible for LuaTeX? I can’t find the answer in the wiki. I use standalone ConTeXt distribution. Any help would be appreciated 🙏🏻 Best, Andrei. ___ 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 ___
[NTG-context] luatex doesn't see installed 3rd party module
Hello! I’ve installed a 3rd party module by copying its TDS folder structure and invoking `context --generate` as described in https://wiki.contextgarden.net/Modules#ConTeXt_LMTX When I compile my project with `context` (using LuaMetaTeX), it's found and works just fine; however, when I try to compile with LuaTeX by invoking `context --latex`, it can’t find the module. Do I need to do something special to make it visible for LuaTeX? I can’t find the answer in the wiki. Any help would be appreciated 🙏🏻 Best, Andrei.___ 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 ___
[NTG-context] Re: build_parshape and \getshapetext - need for a deeper understanding
On 5/19/2024 2:29 PM, garu...@azules.eu wrote: I still get some difficulties with build_parshape, \getshapetex and sectionning. I though I find a solution by removing \blank with \setuphead [subsection] [before=, after=, style=, command=\MySubSectionCommand, alternative=text ] But actually it's not enough : when I add text before the first section, new issues appear. I tried to build a MVE by refactoring and tidying as much as I could. It build 3 comparative pages (i) basic issue, (ii) solution, (iii) remaining issue. Your guidance are most welcome :-) you have to fight several issues: - parshapes being reset at the end paragraph (handled here by luametatex context) - parshapes operate on lines, not dimension (i might add an aletnative one day) - you use a bit old mechanism (checkout the luametafun-paragraphs chapter) Now, is there a solution? It really depends on the circumstances, so here is one. \setupbodyfont[11pt] \definemeasure [mywidth] [7cm] \definemeasure [mywidtha] [5cm] \definemeasure [myheight] [{\the\dimexpr\baselineskip*37+\lineskip\relax}] \definemeasure [myheighta] [{\the\dimexpr\baselineskip*18+\lineskip*1\relax}] \definemeasure [myheightb] [{\the\dimexpr\baselineskip*25-\lineskip*1\relax}] \startuseMPgraphic{shape:1} path p ; numeric mywidth ; mywidth := \measure{mywidth}; numeric mywidtha ; mywidtha := \measure{mywidtha}; numeric myheight ; myheight := \measure{myheight}; numeric myheighta ; myheighta := \measure{myheighta}; numeric myheightb ; myheightb := \measure{myheightb}; p := (0,0)-- (mywidth,0) -- (mywidth,myheighta) -- (mywidtha,myheighta) -- (mywidtha,myheightb) -- (mywidth,myheightb) -- (mywidth,myheight) -- (0cm,myheight) -- cycle; build_parshape(p,0,0,0,\baselinedistance,\strutheight,\strutdepth,\topskip) ; path SavedShape ; SavedShape := p ; \stopuseMPgraphic \startuseMPgraphic{shape:2} SavedShape := SavedShape shifted (0,-ypart urcorner OverlayBox) ; SavedShape := SavedShape shifted (0,positiony("test")) ; fill SavedShape withcolor red; setbounds currentpicture to OverlayBox; \stopuseMPgraphic \showframe \defineoverlay[myoverlay][\useMPgraphic{shape:2}] \setupbackgrounds[text][text][background=myoverlay] \startsection[title={test}] \startshapedparagraph[mp=shape:1]% \setupalign[verytolerant,stretch]% \hpos{test}{!}\samplefile{tufte} \samplefile{tufte} \stopshapedparagraph \stopsection The "test" position is hard coded but should be namespaced, the ! can be a \strut instead. So, more thinking from the end of the text flow. Hans - 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 ___
[NTG-context] Re: Wiki - test/proposal to further clarify documentation
> So is the plan to go through each of the main headings in the left side-bar > and make the same type of change? Yes. Maybe new ones will have to be added ___ 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 ___
[NTG-context] build_parshape and \getshapetext - need for a deeper understanding
I still get some difficulties with build_parshape, \getshapetex and sectionning. I though I find a solution by removing \blank with \setuphead [subsection] [before=, after=, style=, command=\MySubSectionCommand, alternative=text ] But actually it's not enough : when I add text before the first section, new issues appear. I tried to build a MVE by refactoring and tidying as much as I could. It build 3 comparative pages (i) basic issue, (ii) solution, (iii) remaining issue. Your guidance are most welcome :-) \setupbodyfont[11pt] %-- \usecolors[svg] \definemeasure [mywidth] [7cm] \definemeasure [mywidtha] [5cm] \definemeasure [myheight] [{\the\dimexpr\baselineskip*37+\lineskip\relax}] \definemeasure [myheighta][{\the\dimexpr\baselineskip*18+\lineskip*1\relax}] \definemeasure [myheightb][{\the\dimexpr\baselineskip*25-\lineskip*1\relax}] \startuseMPgraphic{mymetafunpath} path p ; numeric mywidth ; mywidth := \measure{mywidth}; numeric mywidtha ; mywidtha := \measure{mywidtha}; numeric myheight ; myheight := \measure{myheight}; numeric myheighta ; myheighta := \measure{myheighta}; numeric myheightb ; myheightb := \measure{myheightb}; p := (0,0)-- (mywidth,0) -- (mywidth,myheighta) -- (mywidtha,myheighta) -- (mywidtha,myheightb) -- (mywidth,myheightb) -- (mywidth,myheight) -- (0cm,myheight) -- cycle; build_parshape(p,0,0,0,\baselinedistance,\strutheight,\strutdepth,\topskip) ; fill p withcolor \MPcolor{tan}; \stopuseMPgraphic \defineoverlay[myoverlay][\useMPgraphic{mymetafunpath}] %-- \define[2]\MySubSectionCommand{\leftaligned{#2}} %-- \define[2]\MyPageBuilder{% \page \setupbackgrounds[page][background=testA] \definelayer[testA] [x=0mm, y=0mm,width=\paperwidth, height=\paperheight] ~ \startshapetext[mymetafunpath, mymetafunpath] % <=== WITHOUT \startsubsection #2 %\startsubsection[title={Title for section #1}] \MySubSectionCommand{1}{Title for section #1} \input knuth \endgraf \input ward %\stopsubsection \stopshapetext \setlayer [testA] [hoffset={\the\dimexpr\backspace\relax}, voffset={\the\dimexpr\topspace+\headerheight+\headerdistance\relax},] {\framed[background=myoverlay,frame=off]{\strut\getshapetext}} \startshapetext[mymetafunpath, mymetafunpath] % <= WITH \startsubsection #2 \startsubsection[title={Title for section #1}] %\MySubSectionCommand{1}{Title for section #1} \input knuth \endgraf \input ward \stopsubsection \stopshapetext \setlayer [testA] [hoffset={\the\dimexpr\backspace+\measure{mywidth}+5mm\relax}, voffset={\the\dimexpr\topspace+\headerheight+\headerdistance\relax},] {\framed[background=myoverlay,frame=off]{\strut\getshapetext}} } %== %\showboxes \starttext \MyPageBuilder{A}{} \setuphead [subsection] [ before=, after=, style=, command=\MySubSectionCommand, alternative=text, ] \MyPageBuilder{B}{} \MyPageBuilder{C}{\strut Hi from here. \endgraf} \stoptext ___ 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 ___
[NTG-context] Re: MyWay from dl.contextgarden.net
Thanks Wolfgang, links are up-to-date https://wiki.contextgarden.net/This_Way_-_My_Way#MyWay ___ 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 ___
[NTG-context] Re: defining hashtag simulator
On 5/19/2024 5:40 AM, seyal.zav...@gmail.com wrote: Hi all, I want to define a command that simulate hashtag behavior in social networks, In other words, this command should put the hashtag sign at the beginning of it, replace spaces with dashes and also it should be a clickable link and unbreakable world. I mean like this, for example: \myhashtag{hello world} It should be displayed as #hello_world in the final PDF and when clicked it will search for #hello_world throughout the pdf How is this possible? One of the disppointments of pdf (some things indeed got worse over time) ... "Table 215 — Named actions" lists several named actions (PDF 1.2) that interactive PDF processors shall support; further names may be added in the future. Table 215 — Named ac Only a few were ever formal ok. Acrobat supports some more (at least did) but even on the \goto{test}[action(search)] one could not set a string. Adding a decent subset of commands is way easier than whatever came later to the standard. It's especially ironic in the perspective of accessibility. However, if one could agree on a subset (as the standard is open) and open source viewers would support it ... but getting all on board is probably not possible). Hans - 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 ___