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 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
2  
A number in a LaTeX command does not work, so \emph2 is a syntax error. Try \BetterEmph or something similar –  Christian Hupfer Jul 3 at 10:03
2  
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 at 10:06
1  
@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 at 10:29
2  
@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 at 10:32
2  
@user50224 You can use the same system you said at first: \DeclareTextFontCommand\makeitboldandcoloured{\bfseries\color{blue}}. –  Manuel Jul 3 at 10:36

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.