1

Writing a book of probability in arabic, and using the titleps package for the headpage, I obtain some non-beautiful result when there is in the headings some "long-down" letters like the arabic letter ع , for example, where the rule touch some letters. So I want to push down the rule of heading with 1pt or 2, to obtain a best heading. How I can I do this? I give an example to watch you the effect.. enter image description here

I use titleps and this is my page style..

\newpagestyle{Mybookstyle}{
  \setheadrule{.1pt}% Header rule
  \sethead
  [\thepage\hspace*{14pt}\thetitle]% even left
    []% even centre
    [\sectiontitle \hspace*{5pt} .\thesection]% even right
{الباب          
    \arabic{chapter}. 
    \chaptertitle}% odd left
    {}% odd centre
    {\thepage}% odd right
} 
10
  • Could you provide a MWE? are you using fancyhdr?
    – Ryan
    Dec 3, 2014 at 6:56
  • If you could use fancyhdr instead of titleps this may help. tex.stackexchange.com/q/85178/24974
    – erik
    Dec 3, 2014 at 6:58
  • I have edit this comment in the body message.you can find my comments for heading. Dec 3, 2014 at 7:03
  • You might want to check out fancyhdr, it's pretty powerful for more complex headers and in my experience it's easier to work with.
    – Ryan
    Dec 3, 2014 at 7:07
  • How do you control page size features? With the package geometry, there is the option headheight=<length>, which might do the trick (e.g., \usepackage[headheight=14pt, <other options>]{geometry}). Some classes, such as memoir or the KOMA classes have their own built-in facilities for such things.
    – jon
    Dec 3, 2014 at 7:07

1 Answer 1

3

Add this in the definition of Mybookstyle:

\renewcommand{\makeheadrule}{\rule[-0.4\baselineskip]{\linewidth}{0.1pt}}%

You can remove \setheadrule{.1pt} since this is incorporated in the above command. The default optional argument to \rule is 0.3\baselineskip, and you can change it to whatever you want.

You can define as many page styles as you please and use them in the document (of course at appropriate places). Here is an explicit example: \documentclass[a4paper,12pt,twoside,openany]{book}% \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{erewhon} \usepackage{xcolor} \usepackage[pagestyles, clearempty]{titlesec}

 \newpagestyle{Mybookstyle}{%
\renewcommand{\makeheadrule}{\rule[-0.8\baselineskip]{\linewidth}{0.1pt}}%
 \sethead
 [\thepage]% even left
 []% even centre
 [\sectiontitle\enspace\thesection]% even right
 { \arabic{chapter}.\enspace\chaptertitle}% odd left
 {}% odd centre
 {\thepage}% odd right
 }%
 \newpagestyle{Otherbookstyle}{%
\renewcommand{\makeheadrule}{\rule[-0.8\baselineskip]{\linewidth}{0.1pt}}
 \sethead
 [\thepage]% even left
 []% even centre
 [\color{red}\sectiontitle\enspace\thesection]% even right
 { \arabic{chapter}.\enspace\chaptertitle}% odd left
 {}% odd centre
 {\thepage}% odd right
 }%
\pagestyle{Mybookstyle}

\begin{document}

\chapter{Les lois discrètes}
\newpage
\section{Définition et propriété}
\newpage
\section{Propriété et Définition}
\newpage\pagestyle{Otherbookstyle}
\section{Exercises}

\end{document} 

enter image description here

enter image description here

8
  • would you give me the entire command. I tried to write \AtBeginDocument{\renewcommand{\makeheadrule}{\rule[-0.4\baselineskip]{\linewidth}{0.1pt}}}% in the beginning of the document and it has absolutely no effect.. Dec 3, 2014 at 10:59
  • It should be in the definition of your page style. See my updated answer.
    – Bernard
    Dec 3, 2014 at 11:09
  • with this command I have "AtBeginDocument" in the first page.. are you sure that it isn't \Atbegindocument ? Dec 3, 2014 at 11:24
  • I'm sure. Please see an exaggerated example in my updated answer. I couldn't use the whole of your page style because I haven't installed arabxetex.
    – Bernard
    Dec 3, 2014 at 13:16
  • 1
    @Faouzi Bellalouna: This was due to the use of \AtBeginDocument. Actually, it was unnecessary, so I removed it and you can see in my updated answer an example of a page style change mid-document. For the ‘other thing’, I'm not sure I understand whether you speak of the section* formatting or of the section* headers.
    – Bernard
    Dec 3, 2014 at 22:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .