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'm writing a document which uses titlesec, and I'd like to set the title rule to a different color.

How can I do that?

This is what I currently have, which produces section titles with black rules:


Note: I want to change the color of the rule that appears below a section title.

share|improve this question
Welcome to TeX.SX! It's difficult to say without an example of the code you're using and an indication of what rule you want to color. – egreg May 17 '12 at 16:12
Thanks! I've added a snippet of the code I'm using. – alemartini May 17 '12 at 16:17
up vote 8 down vote accepted

In a very simple manner:


\section{Hello again}

I add the resulting image of my code:

enter image description here


As @lockstep noticed, to avoid that \color inserts break points (reference answer) should be better to use:

share|improve this answer
Claudio, thanks a lot for your answer! – alemartini May 17 '12 at 16:32

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.