I remember seeing a possible solution here, but can't find it. Is there any way to simplify bold and italics so that instead of \textbf{bold text} and \textit{italics text} I use simple marks like (such as in Word) bold text

*bold text* 

and italics


for the whole document?

  • 3
    Do you use mathematics? If not, the _ should not be a problem, I'll post an answer below. If yes, it is a serious problem related to \catcodes. However, the star * is a problem since you cannot make it \active and work in commands like \section* both at once.
    – yo'
    Commented Feb 26, 2013 at 12:24
  • 1
    (La)TeX is for humans (you, me, others here) to read and understand. Like the markup here. But people would get mightily confused if instead of (familiar) \textbf{junk} they start encountering **junk** in your text.
    – vonbrand
    Commented Feb 26, 2013 at 19:54
  • Perhaps you saw this answer? Commented Feb 28, 2013 at 9:17
  • @vonbrand, I agree. I just wanted to know if something like that might work. Now I see it doesn't work properly. But "familiarity" is relative, and so is understanding. If I showed someone who isn't familiar with Latex the macro \textbf, it wouldn't make much sense either, until he figures it out. But I suggest you tone down your implied sarcasm in "\textbf{junk}".
    – user9424
    Commented Feb 28, 2013 at 13:55
  • 1
    @vonbrand, that's ok. And yes, I agree something like \texbf is more logical. Maybe I need to use too much \textit for transliterations...
    – user9424
    Commented Feb 28, 2013 at 19:41

1 Answer 1


For the underscore, the following works:





Hello \textit{World!} How are you?

Hello _World!_ How are _you?

I'm fine._ And you?

_I'm fine, too.

Glad to hear that._


However, it is a bit crazy and unstable. If you want to use it only for short texts (not spanning multiple paragraphs), the following would be better. (It doesn't work in the above example, since there we span multiple pagraphs. In real, it will throw an error if you put odd number of _ in one paragraph.)


You can use the same ideas for the star. The problem is, that \section*{Text} will suddenly stop working. Variant 1:


Variant 2:


If you don't use math at all, just use ^ instead of * and it should be ok.

How does it work: The primitive macro \catcode makes _ \active so that we can define it as any other command.

In Variant 1, we define it to (1) start a group (2) start italic text (3) add italic correction to the end of the italic text (4) make the one next _ end the group we started. By the end of the group, the re-definition of _ is forgotten so another _ will again start an italic text.

The Variant 2 is even simpler: When _ is found, a second _ is looked for, end everything inbetween is put into \textit.

The \protected directive makes sure that _ is written as _ in the auxiliary files, which is necessary for it to behave correctly.

  • 1
    You should use \protected\def_ in order to avoid quirks in moving arguments. And probably an \ifmmode switch in the definition.
    – egreg
    Commented Feb 26, 2013 at 13:15
  • @egreg thanks pal, I oversaw this. And I can make it work in maths as the subscript symbol, but I doubt it is a good idea to make _ do two completely different things in one document.
    – yo'
    Commented Feb 26, 2013 at 13:55
  • not only \section* but any star-variant command...
    – user4686
    Commented Feb 26, 2013 at 14:03
  • @user700902 I leave that to the intuition of the users ;) And you just earned one nice duck for finding it out, you can claim it in the chat ;)
    – yo'
    Commented Feb 26, 2013 at 14:05

You must log in to answer this question.