Re: [NTG-context] stretching smallcaps with a style command
Just to let anyone know who's interested, I more or less solved this problem with the (more or less undocumented) command \definealternativestyle [StretchedSmallCaps] [\StretchedSmallCaps] [\StretchedSmallCaps]. It allows me to set \setupsynonyms [abbreviation] [textstyle=StretchedSmallCaps, criterium=all], which essentially works. Is this generally applicable enough to put on the wiki somewhere?
I now have another abbreviations question. What is the easiest way to allow digits (and, ideally, the forward slash) in abbreviation names (i.e. be able to type \PS/2 and not get the error "\PS is undefined")? This occurs quite commonly, particularly with numbers. I can define the abbreviation fine, and I can use the \infull version of it fine, but I can't use the command version at all. Another example: \ATX12V. I've been working around it by defining both synonyms and a logo like \PSTwo which typesets like I want \PS/2 to typeset, but what is a more elegent way of doing this that doesn't involve definining two different commands? I don't know how to change catcodes, despite numerous failed attempts to do just that with commands like \unprotect \catcode`2=\@@letter \protect.
Thanks,
Bob
----- Original Message ----
From: Bob Reynolds
Bob Reynolds wrote:
I can define the abbreviation fine, and I can use the \infull version of it fine, but I can't use the command version at all. Another example: \ATX12V. I've been working around it by defining both synonyms and a logo like \PSTwo which typesets like I want \PS/2 to typeset, but what is a more elegent way of doing this that doesn't involve definining two different commands? I don't know how to change catcodes, despite numerous failed attempts to do just that with commands like \unprotect \catcode`2=\@@letter \protect.
Changing the catcode of digits is a bad idea because you are likely to run into problems elsewhere (like in section headings etc.). The cleanest solution is to use a small dedicated macro to call the abbreviated version with: \logo [PS/2] [Play School Halved] \unexpanded\def\abbr#1{\getvalue{#1}} \starttext \abbr{PS/2} \stoptext That takes a bit more typing, but is much safer and will work regardless of the current catcode values. Best wishes, Taco
participants (2)
-
Bob Reynolds
-
Taco Hoekwater