Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
TikZ の current page と jsclasses との相性問題の解決
\NeedsTeXFormat{pLaTeX2e}
\ProvidesPackage{fixpageforjs}[2016/3/22, v0.01]
\RequirePackage{pgf}
\ifpapersize %% for [papersize] option of jsclasses
\def\pgf@sys@pdf@mark@pos@pgfpageorigin{%
\pgf@x=\dimexpr 1in \iftombow\else - 1truein\fi\relax
\pgf@y=\dimexpr \paperheight*\the\mag/1000 - \paperheight + \iftombow 1in \else 1truein - 1in\fi\relax
\ignorespaces
}
\else %% for geometry.sty
\def\pgf@sys@pdf@mark@pos@pgfpageorigin{%
\pgf@x=\dimexpr 1in - 1truein\relax
\pgf@y=\dimexpr \paperheight - \paperheight/\the\mag*1000 - 1in + 1truein\relax
\ignorespaces
}
\expandafter\def\csname pgf@sh@np@current page\endcsname{%
\def\southwest{\pgfpointorigin}%
\def\northeast{\pgfpoint{\pgfsys@thepagewidth/\the\mag*1000}{\pgfsys@thepageheight/\the\mag*1000}}%
}
\fi
\endinput
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment