momeni / sharif-thesis

The XeLaTeX template for writing thesis according to the style of Sharif University of Technology (SUT)
GNU General Public License v3.0
34 stars 14 forks source link

Migrate from using scrpage2 to scrlayer-scrpage package #5

Closed momeni closed 7 years ago

momeni commented 8 years ago

The scrbook now includes the scrlayer module. We should either directly use the scrlayer or use the scrlayer-scrpage package as a semi-compatible interface with the scrpage2. Just swapping the usepackage commands will shift header/footer contents out of the page.

momeni commented 8 years ago

This issue requires the scrlayer-scrpage package to be patched to become bidi-aware.

ghost commented 7 years ago

Have you heard anything back from koma-script developer? if not, I can look into it. Please include a non-working minimal example.

momeni commented 7 years ago

Very Thanks. I contacted Mr. Kohm about mid September and received this response:

The usual way is, that the bidi packages supports other packages not other packages supports the bidi package.

To change the behaviour of scrlayer-scrpage, I first have to understand the bidi package. Sorry, currently there's no time for this. But I will see, what I can do, when I find some time.

Here is a minimal non-working example:

\documentclass[fontsize=12pt,paper=A4,chapterprefix=true]{scrbook}
%\usepackage{scrpage2} % working % see headers of pages 2 and 3
\usepackage{scrlayer-scrpage} % non-working % headers are shifted out of the page

\newpagestyle{samplepagestyle}
{% header definition
    (0pt,0pt)
    {\leftmark\hfill}% even pages
    {\hfill\rightmark}% odd pages
    {\leftmark\hfill\rightmark}% one-sided layout pages
    (\textwidth,0.45pt)
}{% footer definition
    {\hfill\pagemark\hfill}% even pages
    {\hfill\pagemark\hfill}% odd pages
    {\hfill\pagemark\hfill}% one-sided layout pages
    (0pt,0pt)
}
\usepackage{xepersian}
\settextfont{XB Niloofar}

\title{SampleTitle}
\usepackage{lipsum}

\begin{document}
\pagestyle{samplepagestyle}\mainmatter
\renewcommand{\chaptermark}[1]{\markboth{Chapter~\thechapter:~#1}{}}
\renewcommand{\sectionmark}[1]{\markright{Section~\thesection:~#1}}
\chapter{Introduction}
\section{FirstSection}
Text Text Text

\lipsum[1-12]
\end{document}

If I comment line 3 of the above example and uncomment line 2, headers/footers will be shown in their expected locations.

ghost commented 7 years ago

Thanks. I have documented this here.

ghost commented 7 years ago

Could you please see the updated tex-xet/bidi#4. I have added a comment with the necessary fix that works with your example but I need more user feedback so that I can add it to the bidi package. Thanks