Skip to content

Instantly share code, notes, and snippets.

@doraTeX
Last active May 15, 2019 05:20
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/a1f7523dd6c8bc21c1a7c51ace9b2bc1 to your computer and use it in GitHub Desktop.
Save doraTeX/a1f7523dd6c8bc21c1a7c51ace9b2bc1 to your computer and use it in GitHub Desktop.
jsarticle + mag + gentombow + pdfbox + pxpgfmark の両立実験
% (u)pLaTeX + dvipdfmx
\documentclass[8pt,b6paper,dvipdfmx,autodetect-engine,tombo]{jsarticle}
\usepackage[pdfbox]{gentombow}
\usepackage{tikz}
\usepackage{pxpgfmark}
\def\test{%
\begin{tikzpicture}[remember picture, overlay]
\coordinate (NE) at (current page.north east);
\coordinate (NW) at (current page.north west);
\coordinate (SE) at (current page.south east);
\coordinate (SW) at (current page.south west);
\coordinate (C) at (current page.center);
\draw[blue,line width=8pt] (SW) rectangle (NE);
\draw[red,line width=4pt]
(NE) circle (1)
(NW) circle (1)
(SE) circle (1)
(SW) circle (1)
(C) circle (1);
\draw
(current page.south) -- (current page.north)
(current page.west) -- (current page.east);
\end{tikzpicture}}
\makeatletter
\def\pgf@sys@pdf@mark@pos@pgfpageorigin{%
\pgf@x=\dimexpr (\stockwidth-\paperwidth)/2 - 1truein + 1in\relax
\pgf@y=\dimexpr \jsc@magscale\stockheight - (\stockheight + \paperheight)/2 + 1truein - 1in\relax
\ignorespaces
}
\makeatother
\begin{document}
\test
\end{document}
@kbhonda
Copy link

kbhonda commented Nov 25, 2018

本田です.
勤務先のルール上,\stockwidth/\stockheightが+2inという値だと
製版で怒られるので細工しているのですが,
そのままだと当然gentombowを使うと問題が起こる上に
jsのmagで何が起こるか未知だったので
その細工にどう手を入れるべきか煮詰まってました.

既存のコードの修正を小さくしたかったので見た目が違いますが,
おかげさまで
おそらく同値な式だと思われる以下に到達できました.
ありがとうございました.

  \def\pgf@sys@pdf@mark@pos@pgfpageorigin{%
    \pgf@x=\dimexpr \hoffset + 1in
    \pgf@y=\dimexpr  \jsc@magscale\stockheight - \paperheight - 1in  - \voffset
    \ignorespaces
  }

@doraTeX
Copy link
Author

doraTeX commented May 15, 2019

@kbhonda さん,

すみません,ここのコメントに今更気づきました。シンプルな式に同値変形していただきありがとうございます。
が,TeX Live 2019 で \pdfsavepos の仕様が変わった影響で,従来のコードがうまく動かなくなってしまいました。
新仕様に対応する試みを私のレポジトリで現在試行中です。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment