0

how can I add a horizental line above my page and write above it. like that enter image description here

2
1

Here's an example that is based on here. The manual for the package fancyhdr can be found here.

% Based on https://overleaf.com/learn/latex/Headers_and_footers

\documentclass{book}

\usepackage{blindtext}
\usepackage{fancyhdr} % <-- Important package!

\pagestyle{fancy}
\fancyhf{} % Clear all header and footer fields and then re-define the field, see below.
\fancyhead[LE,RO]{Overleaf}
\fancyhead[RE,LO]{Guides and tutorials}
\fancyfoot[CE,CO]{\leftmark}
\fancyfoot[LE,RO]{\thepage}

% E for even page
% O for odd page
% L for left side
% C for centered
% R for right side

\renewcommand{\headrulewidth}{10pt} % <-- Width of head line
\renewcommand{\footrulewidth}{0.1pt} % <-- Width of foot line

\begin{document}

\blinddocument[2]

\end{document}

enter image description here

2
  • thank you for your answer but I'm using lyx ,so I can't write all this ,I can only insert code tex .
    – Imene Yd
    Jun 13 at 7:24
  • I do not understand your comment, sorry. Most likely because I have never used LyX. Jun 13 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.