[NTG-context] Re: Buffer and \input content as input for \processtokens, etc.
On 12/6/2023 8:26 PM, Jairo A. del Rio wrote: Hi, list! My question is just like that: how do I pass buffers or \input content to \processtokens. What I have done so far: \tolerant\protected\def\foo#={\ifparameter#1\or\oof{#1}\fi} \protected\def\oof#1{<#1>} \startbuffer[ofo] % Output: Ths not a anymore! Th{i{s {is} not a {question} anymore! \stopbuffer \starttext \processtokens\foo\foo\relax\space{Th{i}s {is} not a {question} anymore!} % Neither \inlinebuffer nor \rawbuffer work in the example above \stoptext I didn't try to decipher this (you probably need expansion someplace), I've also tried a variant of the mechanism described in OPmac trick described here <https://petr.olsak.net/opmac-tricks-e.html#etoks> to process content token by token, but it only works with \normalinput. Any suggestions or guidance? Thank you in advance. \starttext % \doloopovermatch % {(.-)(\letterpercent b\letterleftbrace\letterrightbrace)(.-)} % {Th{i}s {is} not a {que{s}tion} anymore!} % {#1<#2>#3} \startluacode interfaces.implement { name = "WeirdCommand", -- arguments = "string", arguments = "detokened", public= true, actions = function(s) s = string.gsub(s,".",{ ["{"] = "<", ["}"] = ">",}) context(s) end } \stopluacode \WeirdCommand {Th{i}s {is} not a {que{s}tion} anymore!} \stoptext 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] braces removed in url
Dear list, I have the following sample: \setupinteraction[state=start] \starttext \startTEXpage[offset=1em] \def\MyURL#1{\goto{\hyphenatedurl{#1}}[url(#1)]} \MyURL{a={b}}\\ \MyURL{a=\letterleftbrace b\letterrightbrace}\\ \asciimode\MyURL{a={b}}\\ \stopTEXpage \stoptext For all three options, destination is a=#b. Both with MkIV and MkXL. What am I missing to get the destination a={b}? Many thanks for your help, Pablo -- http://www.ousia.tk ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Escaping reserved/problematic characters
Benct Philip Jonsson schrieb am 11.03.2021 um 18:37: In a program I'm writing I have a function for escaping characters which are reserved or problematic in LaTeX. I would like to have a corresponding function for ConTeXt, so I'm wondering which ones are different/superfluous/missing from a ConTeXt perspective in the following list (sorry about the formatting!): '{': "\\{" \letterleftbrace '}': "\\}" \letterrightbrace '_': "\\_" No escape needed. '%': "\\%" \letterpercent '#': "\\#" \letterhash '$': "\\$" \letterdollar '&': "\\&" No escape needed. '`': "\\textasciigrave{}" \textgrave '^': "\\textasciicircum{}" \letterhat '~': "\\textasciitilde{}" \lettertilde '\\': "\\textbackslash{}" \letterbackslash '|': "\\textbar{}" \letterbar '<': "\\textless{}" '>': "\\textgreater{}" '[': '{[}' ']': '{]}' No escape needed. Note that I'm not looking for accented letters, Unicode quotes and dashes etc. I'm assuming that people in the year 2021 are using an UTF-8-aware engine (and my corresponding HTML escape function similarly caters only to & < > " '). Another option is to use \utfchar, e.g. \utfchar{0x60} Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] (My) problem with percent sign in URLs -- about Wiki
Is there not some way to "protect" a literal string to be taken verbatim where no character be active, for it is messy to have to "clean-up" data such as a url. Alan On Tue, 15 Aug 2017 19:07:54 +0200 Wolfgang Schuster <schuster.wolfg...@gmail.com> wrote: > > Are there some other predefined "\letterxxx" commands? > \letteropenbrace > \letterclosebrace > \letterampersand > \letterless > \lettermore > \letterhash > \letterdoublequote > \lettersinglequote > \letterdollar > \letterpercent > \letterhat > \letterunderscore > \letterbar > \lettertilde > \letterbackslash > \letterslash > \letterquestionmark > \letterat > \lettercolon > \letterescape > \letterbgroup > \letteregroup > \letterleftbrace > \letterrightbrace > \letterexclamationmark ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] (My) problem with percent sign in URLs -- about Wiki
Tomas Hala <mailto:tomas.h...@mendelu.cz> 15. August 2017 um 18:52 Hi, I updated the page about URLs. Reading the text, I found the following sentence which -- in my opinion -- does not correspond with the current behaviour: "You can use \url[aurl] as well, which behaves like \from[#1]." I tried it but the \url[aurl] is not printed out in green colour as well as other similar links and, moreover, it seems not to be clickable. Could somebody confirm or disprove it? # \mypersonalurl{http://bits.blogs.nytimes.com/2010/03/05/a-former-book-designer-says-good-riddance-to-print/?hpw\letterpercent20hpw} # # Please update the garden (another command is \letterhash), when the # reply solved your problem. Are there some other predefined "\letterxxx" commands? \letteropenbrace \letterclosebrace \letterampersand \letterless \lettermore \letterhash \letterdoublequote \lettersinglequote \letterdollar \letterpercent \letterhat \letterunderscore \letterbar \lettertilde \letterbackslash \letterslash \letterquestionmark \letterat \lettercolon \letterescape \letterbgroup \letteregroup \letterleftbrace \letterrightbrace \letterexclamationmark Is (and how) possible to change the name of page from Url to URL? I moved the page. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] List of special characters
Am 15.08.2011 um 16:31 schrieb Cecil Westerhof: While writing the documentation about using ConTeXt I need some 'special' characters. A few I have found, for example \%, \backslash, \texttilde, \percent. But until now I did not find how to represent [ and ]. How would I use those characters in my document? Also: is there somewhere a 'complete' list? I found several, but they where all for LaTeX and are not completely the same. For example LaTeX uses \textbackslash which does not work in ConTeXt which uses \backslash. \starttext [ ] @ _ ^ % normal characters \startlines \textbackslash\ or \letterbackslash \textbraceleft\ or \letterleftbrace\ or \{ \textbraceright\ or \letterrightbrace\ or \} \percent\ or \letterpercent\ or \% \textdollar\ or \letterdollar\ or \$ \letterampersand\ or \ \letterhash\ or \# \stoplines \asciimode % $ # %% this is a comment \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] List of special characters
2011/8/15 Wolfgang Schuster schuster.wolfg...@googlemail.com While writing the documentation about using ConTeXt I need some 'special' characters. A few I have found, for example \%, \backslash, \texttilde, \percent. But until now I did not find how to represent [ and ]. How would I use those characters in my document? Also: is there somewhere a 'complete' list? I found several, but they where all for LaTeX and are not completely the same. For example LaTeX uses \textbackslash which does not work in ConTeXt which uses \backslash. \starttext [ ] @ _ ^ % normal characters \startlines \textbackslash\ or \letterbackslash \textbraceleft\ or \letterleftbrace\ or \{ \textbraceright\ or \letterrightbrace\ or \} \percent\ or \letterpercent\ or \% \textdollar\ or \letterdollar\ or \$ \letterampersand\ or \ \letterhash\ or \# \stoplines \asciimode % $ # %% this is a comment \stoptext I found it also. I new that there was something like it (I had it seen passing on the mailing list), but could not find it at first. Do I understand correctly that '%% this is a comment' should not be in the PDF? Because it is when I compile the document. Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ -- Cecil Westerhof ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Producing quotesingle glyph
Am 20.03.2011 um 11:04 schrieb Mojca Miklavec: On Sun, Mar 20, 2011 at 08:34, Pontus Lurcock wrote: On Sun 20 Mar 2011, Wolfgang Schuster wrote: Another option is to disable only a single feature: \definefontfeature[notrep][trep=no] \def\realquotesingle{{\addfs{notrep}'}} Thanks, that's more elegant. I've updated the wiki page to include it. Just a question for Hans or Taco: would it be possible to create a command sequence that would avoid doing the auto-replacement even when trep is on? Say, \textapostrophe, \asciiapostrophe, \textquote, \asciiquote or some similar name. { : \letteropenbrace, \letterbgroup, \letterleftbrace, \textbraceleft } : \letterclosebrace, \letteregroup, \letterrightbrace, \textbraceright : \letterampersand : \letterless : \lettermore # : \letterhash : \letterdoublequote, \quotedbl ' : \lettersinglequote, \quotesingle $ : \letterdollar, \textdollar % : \letterpercent, \percent ^ : \letterhat _ : \letterunderscore, \textunderscore | : \letterbar, \textbar ~ : \lettertilde, \textasciitilde \ : \letterbackslash, \letterescape, \textbackslash / : \letterslash, \textslash ? : \letterquestionmark ! : \letterexclamationmark @ : \letterat, \textat : : \lettercolon ` : \textgrave Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Braces in TexLive MKIV
Am 16.02.2011 um 22:04 schrieb Tom: When I recently upgraded to TexLive MKII, I learned that \lq, etc. no longer worked in that version but that \lbrace still did. Today, I tried MKIV and find that \lbrace does not work in MKIV. So, I tried \braceleft because \quoteleft worked in TexLive 2010 MKII. Neither \lbrace nor \braceleft work in MKIV. What is now the proper representation for this character? Choose one! \starttext \{ $\{$ $\lbrace$ \letterleftbrace\ \textbraceleft \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Braces in TexLive MKIV
Thanks, Wolfgang. My document now compiles without errors and produces a PDF. It is my understanding that one of the ways MKIV differs greatly from MKII is in the handling of fonts. Which documentation should I look at first to learn about fonts in MKIV (not that I understand them in MKII yet)? Tom Benjey 717-258-9733 voice 717-243-0074 fax blog: www.TomBenjey.com -Original Message- From: ntg-context-boun...@ntg.nl [mailto:ntg-context-boun...@ntg.nl] On Behalf Of Wolfgang Schuster Sent: Wednesday, February 16, 2011 5:24 PM To: mailing list for ConTeXt users Subject: Re: [NTG-context] Braces in TexLive MKIV Am 16.02.2011 um 22:04 schrieb Tom: When I recently upgraded to TexLive MKII, I learned that \lq, etc. no longer worked in that version but that \lbrace still did. Today, I tried MKIV and find that \lbrace does not work in MKIV. So, I tried \braceleft because \quoteleft worked in TexLive 2010 MKII. Neither \lbrace nor \braceleft work in MKIV. What is now the proper representation for this character? Choose one! \starttext \{ $\{$ $\lbrace$ \letterleftbrace\ \textbraceleft \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] type problems
Hallo Wolfgang, it is amazing to see, that you are always able to draw a new white rabbit out of your context-hat! is \mono the youngest incarnation of \type, \retype ...? \starttext \mono{\%}\mono{\letterpercent} \mono{\{}\mono{\letterleftbrace} % \mono{\{} works only with MkIV \mono{\#}\mono{\letterhash} \startlines \mono{bla}blub \stoplines \stoptext What about \mono{Dies|Das}? Is'nt it frustrating? Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] type problems
Am 06.08.2009 um 11:28 schrieb Wolfgang Werners-Lucchini: Hallo, I have always problems with verbatim text. Sometimes I found a solution, sometimes a workaround. Are there solutions to - print text with a verbatim '%' sign - print text with a verbatim '{' \starttext \mono{\%}\mono{\letterpercent} \mono{\{}\mono{\letterleftbrace} % \mono{\{} works only with MkIV \mono{\#}\mono{\letterhash} \startlines \mono{bla}blub \stoplines \stoptext why is in the following example '#' -- '##'? why is there a newline between 'bla' and 'blub'? Has to do with the way how \retype works, a solution for the # problem was posted not so long ago on comp.text.tex (or on a tex mailing list). Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] some minor problems (mkiv)
On Fri, May 16, 2008 at 1:12 PM, Peter Rolf [EMAIL PROTECTED] wrote: hi, i'm still trying to make my code run with mkiv. here are two minor problems. the first one is easy to deal with, but the second one currently breaks my testbed. % engine=luatex \setupcolors[state=start] \starttext \startMPcode label(no color,origin) withcolor red; % always black \stopMPcode \string{\{} \string{ \char`{ \letterleftbrace \char123 \char7B \stoptext greetings, peter Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] some minor problems (mkiv)
Wolfgang Schuster schrieb: On Fri, May 16, 2008 at 1:12 PM, Peter Rolf [EMAIL PROTECTED] wrote: hi, i'm still trying to make my code run with mkiv. here are two minor problems. the first one is easy to deal with, but the second one currently breaks my testbed. % engine=luatex \setupcolors[state=start] \starttext \startMPcode label(no color,origin) withcolor red; % always black \stopMPcode \string{\{} \string{ \char`{ \letterleftbrace \char123 \char7B thanks wolfgang! but sadly it's not the only argument of \string (my example was bad). best wishes, peter \stoptext greetings, peter Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___