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.

The picture shown below is the desired simple head-rule, but the rule width should be much thinner like 1pt.

enter image description here

Real one: enter image description here

So how to use Tikz or other packages to draw this kind of line as a headrule?

Or alternatively, suppose I have the vector pciture in pdf form, e.g head-rule.pdf, how can I include it for use of head-rule?

share|improve this question
    
Do you insist on TikZ? There is psvectorian: melusine.eu.org/syracuse/pstricks/vectorian –  tohecz Feb 8 '13 at 12:50
4  
there is also pgfornament tex.stackexchange.com/a/46401/3235 but Alain Mathes mentions a license problem in the comments. –  percusse Feb 8 '13 at 12:57
    
related? –  Marc van Dongen Feb 8 '13 at 20:19
    
@MarcvanDongen, it's too stylish :) –  KOF Feb 8 '13 at 20:22
add comment

1 Answer

up vote 16 down vote accepted

Here is the aforementioned rule using tikz with the center dot set to 1 pt. In the updated version, I filled them in and extended them to slightly more than \textwidth. You can tweak the number I divided \textwidth by in order to shorten or lengthen it. Note that it looks better with both the \fill and the \draw commands together. Without the latter, the edges are not crisp enough. [Sorry for the delay in updating. I was digging out from a snowstorm.]

\begin{tikzpicture}
\fill (0,0) circle (1pt);
\draw (0.2,0) .. controls (0.2,0.075) and (1,0) .. (\textwidth/2,0);
\fill (0.2,0) .. controls (0.2,0.075) and (1,0) .. (\textwidth/2,0);
\draw (0.2,0) .. controls (0.2,-0.075) and (1,0) .. (\textwidth/2,0);
\fill (0.2,0) .. controls (0.2,-0.075) and (1,0) .. (\textwidth/2,0);
\draw (-0.2,0) .. controls (-0.2,0.075) and (-1,0) .. (-\textwidth/2,0);
\fill (-0.2,0) .. controls (-0.2,0.075) and (-1,0) .. (-\textwidth/2,0);
\draw (-0.2,0) .. controls (-0.2,-0.075) and (-1,0) .. (-\textwidth/2,0);
\fill (-0.2,0) .. controls (-0.2,-0.075) and (-1,0) .. (-\textwidth/2,0);
\end{tikzpicture}

To use this with fancyhdr just put the above code inside \chead{} in your preamble.

Here's the output:

enter image description here

share|improve this answer
    
It's very close to the desired one. Can you make it as long as the \textwidth, and fill in with black color? –  KOF Feb 9 '13 at 6:54
    
Just updated. Sorry for the delay in replying. Had to dig out from a snowstorm. –  Ian Durham Feb 9 '13 at 22:10
    
that is Great. Could you please show a MWE for use of this line for headrule? –  KOF Feb 10 '13 at 0:04
    
Do you specifically want an MWE that utilizes fancyhdr or are you trying to avoid fancyhdr? If you're using it, you can just stick the above code inside \chead{}. –  Ian Durham Feb 10 '13 at 2:36
    
It worked, perfect. –  KOF Feb 10 '13 at 10:47
add comment

Your Answer

 
discard

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.