Skip to content
This repository was archived by the owner on May 14, 2020. It is now read-only.

Shifted frame with showframe package #6

Open
jspitz opened this issue Sep 11, 2019 · 1 comment
Open

Shifted frame with showframe package #6

jspitz opened this issue Sep 11, 2019 · 1 comment

Comments

@jspitz
Copy link

jspitz commented Sep 11, 2019

(Moving from reutenauer/polyglossia#33)

When compiling this example:

% !TeX TS-program = xelatex
\documentclass{book}
\usepackage{xcolor}

\usepackage{polyglossia}
\setdefaultlanguage{arabic}
\newfontfamily\arabicfont[Script=Arabic]{Amiri}

\usepackage{showframe}
\begin{document}
A\newpage B\newpage C
\end{document}

it becomes obvious that showframe does not recognize text area and margins correctly when
\setdefaultlanguage{arabic} is used.

This problem is not restricted to the showframe package but to packages using the information about the page layout in general, of course, for example the thumbs package.
Screen shot of two sided pdf

@u-fischer
Copy link
Contributor

bidi is (depending on the loading order of the various packages) trying to patch eso-pic, which imho the wrong place. It would make more sense to switch back to LTR before the atbegshi picture.

\documentclass[a4paper]{book}%
\usepackage{atbegshi}
\usepackage{etoolbox}
\usepackage{xcolor,graphicx}
%
\makeatletter
\patchcmd\AtBegShi@BeginPicture{\begingroup}{\begingroup\@RTLfalse}{}{\fail}
\makeatother
\usepackage{polyglossia}
\setdefaultlanguage{arabic}
\newfontfamily\arabicfont[Script=Arabic]{Amiri}
%load later to avoid the eso-pic patch:
\usepackage{showframe}
\usepackage{wallpaper}

\begin{document}
\ThisCenterWallPaper{1}{example-image-duck}
A\newpage B\newpage C
\end{document}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants