Lately I've become a big fan of using header rules in my works, but sometimes I feel like I could be more "stylish" if I could make slightly fancier rules. As an example of what I would like to be able to do, perhaps the rule could end in arrowheads at both ends (so something like "<–––––––––--->"), or perhaps I could have a rule with some nice emblem-like kind of thing in the middle (like the {TEX}-thing at the top of this page).

How would I go about making these things happen? I assume some kind of hard-coding of what I want goes in somewhere, but I don't know where to start.

Feel free to link to duplicates if I have missed any while searching myself. (This variant I found myself - Draw horizontal lines like open and close brackets)

• When I see documents with fancy header I always think they do it to hide the fact that the content is crappy. Beside this: tex.stackexchange.com/questions/198947/… – Ulrike Fischer Jan 28 '16 at 11:16
• Using package \usepackage[headsepline]{scrlayer-scrpage} you can do pretty much whatever you want. You can color the rule with \addtokomafont{headsepline}{\color{XXX}} or add whatever you want -- e.g., a tikz drawing. See @UlrikeFischer's link for a full example. I also agree that you should use it sparingly. – Joseph Jan 28 '16 at 12:24
• Of course, I agree that a document should have meaningful content first and foremost. I don't have anything against regular rules, or against using no rules either. I just want to experiment a little and be able to, for those special occasions, be able to use something modest yet elegant for that extra little personal touch. Thank you both for your responses ; ) – A.Sh Jan 28 '16 at 15:25

You can do that with the \makeheadrule command, from titleps, which comes with titlesec.

Here is a attempt, with only basic tools:

\documentclass[ twoside]{article}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage[x11names]{xcolor}
\usepackage[pagestyles]{titlesec}

\renewcommand{\makeheadrule}{\color{LightSteelBlue3}\llap{\raisebox{-2.4ex}{\footnotesize\boldmath$>$}}\kern-0pt \makebox[\linewidth]{\rule[-2ex]{1.005\linewidth}{0.6pt}}\rlap{\raisebox{-2.4ex}{\footnotesize\boldmath$<$}}}
}

\titleformat{\section}[block]{\bfseries\large}{\llap{\makebox[0.5in][l]{\thesection.}}}{0pt}{}

\begin{document}

\section{The First Section}

Some text text text text text text text text text text text text text text text text text text text text text text text text text.
\clearpage

\section{The Next Section}
More text in another section. More text in another section. More text in
another section. More text in another section.
More text in another section. More text in another section. More text in
another section. More text in another section.
\end{document}


• Thank you for your answer. This looks just like what I want. – A.Sh Jan 28 '16 at 15:29