2

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.

4
\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.

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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