LaTeX-Package-Repositories / geometry

Updating Hideo Umeki's geometry package for LaTeX page dimensions
40 stars 5 forks source link

The `showframe` option does not correctly draw frames for the marginpar when using the `reversemarginpar` option #17

Open merijn opened 1 year ago

merijn commented 1 year ago

When using the reversemarginpar option, the frames for the marginpar are shown in the original position, rather than the reversed position. This seems to be a simple oversight caused by the frame code (https://github.com/LaTeX-Package-Repositories/geometry/blob/main/geometry.dtx#L3418-L3460) not checking the reversemarginpar option.

merijn commented 1 year ago

Quick workaround that patches the margin frames with a conditional on reversemarginpar until this can be fixed inside geometry:

\makeatletter
\newcommand*{\leftmarginframe}{}
\newcommand*{\rightmarginframe}{}
\let\rightmarginframe\Gm@vrules@mpi{}
\let\leftmarginframe\Gm@vrules@mpii{}
\renewcommand*{\Gm@vrules@mpi}{%
\if@reversemargin{}
    \leftmarginframe{}
\else
    \rightmarginframe{}
\fi}
\renewcommand*{\Gm@vrules@mpii}{%
\if@reversemargin{}
    \rightmarginframe{}
\else
    \leftmarginframe{}
\fi}
\makeatother