Am 26.10.2010 um 00:49 schrieb Philipp Gesang:

> On 2010-10-25 <17:00:39>, Aditya Mahajan wrote:
>> On Mon, 25 Oct 2010, Steffen Wolfrum wrote:
>> 
>>> 
>>> Am 25.10.2010 um 19:30 schrieb Aditya Mahajan:
>>> 
>>>> On Mon, 25 Oct 2010, Steffen Wolfrum wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> the "%" is a frequently used character in URL.
>>>>> But \hyphenatedurl{} can deal with it ...
>>>>> 
>>>>> Does someone has a fix?
>>>>> 
>>>>> 
>>>>> \starttext
>>>>> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text.
>>>>> \stoptext
>>>> 
>>>> An extreme solution:
>>>> 
>>>> \startcatcodetable \txtcatcodes
>>>>  \catcode`\^^I = 10
>>>>  \catcode`\^^M =  5
>>>>  \catcode`\^^L =  5
>>>>  \catcode`\    = 10
>>>>  \catcode`\^^Z =  9
>>>>  \catcode`\\   =  0
>>>>  \catcode`\{   =  1
>>>>  \catcode`\}   =  2
>>>> %   \catcode`\%   = 14
>>>> \stopcatcodetable
>>>> \starttext
>>>> \asciimode
>>>> text\footnote{test \hyphenatedurl{www.test%it.com} test.} text.
>>>> \stoptext
>>> 
>>> 
>>> 
>>> As I don't have any experience with "\asciimode" "I am not sure if I can 
>>> map this entirely on a complex book project...
>> 
>> In addition to usual asciimode, I changed the definition so that %
>> does not have its usual meaning. So, % is no longer a comment; it
>> just typesets percentage sign. You can get a comment using
>> 
>> \starthiding ... \stophiding.
>> 
>>> Any known side-effects?
>> 
>> * You need to use \math{...} to go into math mode. $ will just give
>> a dollar.
>> 
>> * You need \startformula ... \stopformula to go into display math.
>> $$...$$ will just print dollars.
>> 
>> * _ in text mode will produce an underscore instead of an error. _
>> in math mode will work fine. The same for ^.
>> 
>> * You need
>> 
>> \starttex(something) (I don't remember on the top of my head)
>> \def\whatever#1{...}
>> \stoptex(something)
>> 
>> to change the definition of a macro.
>> 
>> I have never really tested it on a large document. Maybe you can
>> just add this and see if everything compiles.
> 
> Hi Aditya, Steffen and others,
> 
> I was toying around with catcode tables too. Shouldn’t it suffice
> to simply change % to ‘other’? This way you can keep the dollar
> style math.
> 
> Philipp
> 
> ···8<····························································
> 
> \setupinteraction[state=start]
> 
> \unprotect
> \newcatcodetable \urlcatcodes % ordinary \ctxcatcodes except for minor changes
> \startcatcodetable \urlcatcodes
>    \catcode`\^^I = 10
>    \catcode`\^^M =  5
>    \catcode`\^^L =  5
>    \catcode`\    = 10
>    \catcode`\^^Z =  9
>    \catcode`\\   =  0
>    \catcode`\{   =  1
>    \catcode`\}   =  2
>    \catcode`\$   =  3
>    \catcode`\&   =  4
>    \catcode`\#   =  6
>    \catcode`\^   =  7
>    \catcode`\_   =  8
>    \catcode`\~   = 13
>    \catcode`\|   = 13
>    \catcode`\%   = \@@other
>    \catcode`\*   = \@@comment % comment this out if you don’t need line 
> comments
> \stopcatcodetable
> 
> \protect
> 
> \starttext
> 
> \bgroup
>  TEST
>  \setcatcodetable \urlcatcodes
>  \hyphenatedurl{www.test%it.com}
>  * this should be treated as comment
>  \footnote{
>    \hyphenatedurl{www.test%it.com}
>  }
>  Math mode: $(x)(y)\,(Fx\,.\,x=y\,.\supset\,Fy)$
>  TEST
> \egroup
> 
> \stoptext
> 
> ···8<····························································



Hi Hans and other catcode wizards,

isn't there a way to make this kind of catcode trickery only be available 
*inside* \hyphenatedurl{} environment?

Steffen
___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to