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

I am writing my thesis and I'm looking for a way of displaying the project name with the same style all over the place. More specifically, when I'm writing 'MyProjectName' it should always be printed with bold font (just an example).

How can I defined the style for a single word/phrase. Is OK if I need to create a new command for it or something, I just want to avoid copy/pasting the style definition all over the place.

share|improve this question

1 Answer 1

up vote 4 down vote accepted
\newcommand{\NAME}{\mbox{\normalfont\bfseries MyProjectName}}

The \mbox is there in order to avoid that the name is split across lines; inside the box you can set whatever font you like, just remember to choose \normalfont first that sets the setting to the standard one.

share|improve this answer
2  
You might want to add \xspace (xspace package) at the end of the macro. –  Martin Scharrer May 20 '11 at 9:33
    
@Martin: Bela Lugosi used to say "I never drink … wine"; I say "I never use \xspace". :) –  egreg May 20 '11 at 9:35
    
But Victor might drink wine and/or want the functionality of \xpace :-) –  Martin Scharrer May 20 '11 at 9:37
    
That works great! Wrt to \xspace I haven't decided yet :) –  Victor Hurdugaci May 20 '11 at 9:46

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.