Skip to content

Instantly share code, notes, and snippets.

@doraTeX
Created March 22, 2016 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doraTeX/91fd44952dbaa72de148 to your computer and use it in GitHub Desktop.
Save doraTeX/91fd44952dbaa72de148 to your computer and use it in GitHub Desktop.
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