Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

In a notebook, when writing \[RightVector] over a variable I always end up bolding it to make it more visible. But it'd be easier if it could be set up to bold that character by default.

I haven't ventured into setting key bindings yet (just starting out), but I'm wondering if it's possible to set the combination EscvecEsc to turn on bolding, insert the appropriate symbol, then turn off bolding. If there's an even easier way, that'd be even better.

share|improve this question
add comment

1 Answer 1

up vote 8 down vote accepted

Yes, you can use InputAliases to style the replacements as you wish. I explained how to make auto replacements in this answer, but that was for a more specialized purpose.

As a simple example, you can do something like:

SetOptions[SelectedNotebook[], InputAliases -> 
    {"foo" -> MakeBoxes@Row[{
        Style[foo, FontColor -> Red, FontWeight -> Bold, 
            FontSlant -> Italic, FontFamily -> "Verdana"],
            \[VeryThinSpace]
        }]
    }
]

Now if you type EscfooEsc, it will show up as a bold, italic red foo.

share|improve this answer
1  
I would also throw in a Block around foo if there's a chance of it also being a variable in the current context –  rm -rf Oct 11 '12 at 19:05
    
Thanks for the answer! I'm having a bit of a problem using \[RightVector] as the text being styled though. It looks like it's the same problem with any operators as well. Do you know of any ways around that? –  Mirov Oct 11 '12 at 21:21
    
@user745434 I don't know the answer off the top of my head... I can try figuring it out later, when I have some time :) –  rm -rf Oct 11 '12 at 21:33
    
Thanks. I'll tinker with it as well. –  Mirov Oct 11 '12 at 21:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.