# Decorative lines above and left of text

I would like to recreate this decoration, which is being placed at the top of every page:

So a thin line above the text, and a thicker line left of the text. I've been trying to do this using the mdframed package, but I am not able to use a different width for the two lines. My question is: is the mdframed package the right way to go, or should I use something different?

If it's the right way to go, here's my code; how to differentiate between the width of the lines?

\newmdenv[rightline=false,bottomline=false,linewidth=2]{frameit}
...
\begin{frameit}
Forum
\end{frameit}


I see no information about this in the manual: http://ftp.sun.ac.za/ftp/CTAN/macros/latex/contrib/mdframed/mdframed.pdf

• And the text where does it come from? Is it always the same? Does it correspond to section titles? – Gonzalo Medina Apr 1 '13 at 7:01
• @GonzaloMedina Text is always the same, it's on every page. It's a header you could say, indicating what kind of document it is. – please delete me Apr 1 '13 at 7:11
• I see. Please see my answer below. – Gonzalo Medina Apr 1 '13 at 7:13

## 1 Answer

To create headers/footers You could use either the titleps or the fancyhdr package; a little example using fancyhdr:

\documentclass{article}
\usepackage[a5paper]{geometry}% just for the example
\usepackage{fancyhdr}
\usepackage{lipsum}

\fancyhf{}
\setlength\headheight{13.7pt}
\renewcommand\headrulewidth{0pt}
\fancyhead[C]{\renewcommand\headrulewidth{.4pt}\headrule}
\fancyhead[L]{\rule[-2pt]{3pt}{10pt}\hspace*{0.5em}\sffamily\footnotesize\bfseries FORUM}
\fancyfoot[C]{\thepage}
\pagestyle{fancy}

\begin{document}

\lipsum[1-12]

\end{document}


Here's another possibility using this time the tikzpagenodes and background packages:

\documentclass{article}
\usepackage[a5paper]{geometry}% just for the example
\usepackage{background}
\usepackage{tikzpagenodes}
\usepackage{lipsum}

\backgroundsetup{
scale=1,
angle=0,
opacity=1,
color =black,
contents={\begin{tikzpicture}[remember picture,overlay]
\draw ([yshift=18pt]current page text area.north west) --
([yshift=18pt]current page text area.north east);
\draw[line width=3pt] ([yshift=18pt,xshift=0.5\pgflinewidth]current page text area.north west) --
++(0pt,-10pt);
\node[anchor=west] at ([yshift=11pt,xshift=5pt]current page text area.north west) {\sffamily\bfseries\footnotesize FORUM};
\end{tikzpicture}}
}
\begin{document}

\lipsum[1-12]

\end{document}


Of course, the mdframed package can also be used here, but it seems somehow an overkill:

\documentclass{article}
\usepackage[a5paper]{geometry}% just for the example
\usepackage[framemethod=tikz]{mdframed}
\usepackage{fancyhdr}
\usepackage{lipsum}

\fancyhf{}
\setlength\headheight{29.2pt}
\renewcommand\headrulewidth{0pt}
\fancyhead[C]{\begin{mdframed}[
skipabove=0pt,
skipbelow=0pt,
topline=true,
leftline=true,
rightline=false,
bottomline=false,
innerbottommargin=0pt,
singleextra= {\draw[line width=3pt] (P-|O) -- (O);}]
\sffamily\footnotesize\bfseries FORUM
\end{mdframed}}
\fancyfoot[C]{\thepage}
\pagestyle{fancy}

\begin{document}

\lipsum[1-12]

\end{document}


The different width for the framing lines was achieved with the help of the singleextra command.

• So when does mdframed package fit in ? – texenthusiast Apr 1 '13 at 7:17
• @texenthusiast no need to use mdframed here; of course it could be used, but seems an overkill. – Gonzalo Medina Apr 1 '13 at 7:23
• @GonzaloMedina Thanks, all clear. I'll study the details of the fancyhead commands that created the decoration. – please delete me Apr 1 '13 at 7:24
• @user I added two more options to my answer; the third one using mdframed and showing how to get different width for the lines; this option, however (and possibly also the second one), might be an overkill. – Gonzalo Medina Apr 1 '13 at 7:50
• @GonzaloMedina I am learning from examples here. infinite patience is seen most of the times here. – texenthusiast Apr 1 '13 at 7:54