TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I read how to change \emph and changed it to \DeclareTextFontCommand{\emph}{\bfseries}.

Now I want to create another command like \secondstyleformat which I can configure aswell. Such a format could be bold and italic. After writing the document I could change it easily to for example italic and blue. How can I do that?

share|improve this question
A number in a LaTeX command does not work, so \emph2 is a syntax error. Try \BetterEmph or something similar – Christian Hupfer Jul 3 '14 at 10:03
You could teach \emph to look for the next token and, if it finds a 2 then use \itshape and, otherwise, \bfseries… But, why wouldn't you use a semantic command? What are you going to emphasize with this “\emph2”. – Manuel Jul 3 '14 at 10:06
@Manuel: I would not redefine the standard command \emph anyway. Better use logical markup, say for some text, which should be formated in special way, at first \textit{foo} and later on the decision to make in blue color and bold, it is better do use a command \newcommand{\makeitboldandcoloured}[1]{\textbf{\textcolor{blue}{#1}}}, in the preamble, so you can 1st easily detect and replace such markup to change the name or change the color etc, if needed. This requires a little categorization how certain text is to be formatted – Christian Hupfer Jul 3 '14 at 10:29
@ChristianHupfer I'm not recommending to redefine it: since he already did, I'm just asking to clarify what's his real problem… But you seem to have solved the “un-question” :P – Manuel Jul 3 '14 at 10:32
@user50224 You can use the same system you said at first: \DeclareTextFontCommand\makeitboldandcoloured{\bfseries\color{blue}}. – Manuel Jul 3 '14 at 10:36
up vote 4 down vote accepted

There's nothing stopping you from doing

share|improve this answer

Your Answer


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.