[prev in list] [next in list] [prev in thread] [next in thread]
List: lyx-users
Subject: Re: Automagically reduce the spacing between "++" in the word "C++"
From: rgheck <rgheck () bobjweil ! com>
Date: 2008-10-22 21:44:58
Message-ID: 48FF9EDA.5050509 () bobjweil ! com
[Download RAW message or body]
Andre Poenitz wrote:
> On Wed, Oct 22, 2008 at 09:22:35PM +0200, Andre Poenitz wrote:
>
>>> I think that I remember to have read about so-called catcodes (or
>>> whatever?) in TeX, which apparently make it possible to declare certain
>>> characters as "active" so that further processing is possible whenever
>>> the TeX scanner reads such character. I wonder if it is possible this way
>>> to declare in the preamble that
>>> "C" followed by "+", followed by "+"
>>> is "active" and should be inherently substituted with something like
>>> "\mbox{C+\hspace{-.5ex}+}}"
>>>
>> Quick shot: [...]
>>
>
> Somewhat improved version:
>
> \def\plus{+}
> \catcode`\+=\active
>
> \def\smallplusplus#1{\raisebox{0.6ex}{\tiny\plus\kern-.3ex\plus}}
> \def+{\futurelet\nextchar\pluss}
> \def\pluss{%
> \ifx\nextchar+%
> \let\next\smallplusplus%
> \else%
> \let\next\plus%
> \fi%
> \next}
>
> And no, I can't explain it.
>
>
If you could, I'd be really worried about you. ;-)
rh
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic