CTAN Comprehensive TeX Archive Network

Directory language/japanese/pxpgftate

README.md

pxpgftate Package

p/up: PGF/TikZ in the vertical (tate) direction with dvipdfmx and dvips

日本語の説明は後半にあります。

In the vertical (tate) direction of p and up, the DVI drivers place the characters rotated, but PGF draws its pictures in the unrotated page coordinate system. Without this package, pictures in tate text come out sideways, and shadings, patterns or fadings stop p with

! Incompatible direction list can't be unboxed.

With this package, a picture that begins in the tate direction is rotated like the surrounding text: its x-axis points in the direction of the line (downwards) and its y-axis points to the right. Text in nodes is typeset in the tate direction. The direction is determined at the beginning of each picture, so yoko boxes inside tate text keep working as before.

Supported:

  • paths, nodes, transformations (rotate, transform shape), colors
  • shadings, patterns, fadings, transparency groups
  • remember picture, overlay and the current page node
  • tcolorbox (also enhanced, breakable, drop shadow)

The package is meant for Live 2012 up to the release of PGF that supports the tate direction natively. When the loaded PGF supports it already (it defines \pgfsys@ptex@tate@supported), the package does nothing.

  • Supported formats/engines: p, up (with dvipdfmx or dvips), Live 2012 or later

Files

File Description
pxpgftate.sty The package
pxpgftate.tex, pxpgftate.pdf Documentation
test-pxpgftate.tex Test document (make test)

Requirements

  • p or up ( Live 2012 or later)
  • PGF 2.10 or later
  • the dvipdfmx or dvips driver (with other drivers and other engines the package does nothing)

Installation

Copy pxpgftate.sty to your local tree: $TEXMF/tex/platex/pxpgftate/

Usage

Load the package after tikz (or pgf):

\documentclass[dvipdfmx]{tarticle}
\usepackage{tikz}
\usepackage{pxpgftate}
\begin{document}
縦組みの文中の\tikz\draw[->](0,0)--(1,0);図。
\end{document}

Loading it before PGF works, too; the patches are then applied at \begin{document}. The package has no options.

When PGF supports the tate direction itself

Support for the tate direction has also been proposed for PGF itself (pgf-tikz/pgf#1487). Once a release of PGF includes it, PGF handles pictures in tate text by itself, and this package does nothing: it leaves PGF alone and only writes the following to the log:

Package pxpgftate Info: PGF supports the tate direction itself.
(pxpgftate)             Nothing is done on input line ....

So you can keep \usepackage{pxpgftate} in your documents: they work both with older Live (where the package does the work) and with newer Live (where PGF does it), and look the same. You may remove the line once you use only a PGF with the native support.

What it changes

The package wraps the driver macros of PGF instead of copying them, so the same code works with the different PGF versions of Live 2012–2026:

  • \pgfsys@beginpicture, \pgfsys@endpicture: rotate the picture in the tate direction (dvipdfmx; dvips rotates PostScript specials by itself).
  • \pgfsys@hbox, \pgfsys@hboxsynced, \pgfsys@transparencygroupfrombox: undo the rotation around the current point for boxes and XObjects (dvipdfmx). This uses pdf:bcontent rather than pdf:btrans, which is misplaced inside pdf:bcontent and in XObjects with dvipdfmx before Live 2021. With PGF 2.10 ( Live 2012), the box macros of PGF 3.0 are used in tate pictures.
  • \pgfsys@getposition, current page: rotate page positions into the coordinate system of a tate picture.
  • \pgfutil@insertatbegincurrentpagefrombox, \pgfdeclarefading, \tikzfadingfrompicture, \tikzfading: always use the yoko direction, since this material is unboxed at shipout in the yoko direction.
  • With before 2020-10-01 and everyshi.sty v3: the shipout hooks are run in the yoko direction, as the pxeveryshi package does. This affects all users of everyshi.sty in tate documents (nothing is done when pxeveryshi is loaded).

Limitations

  • Only the tate direction is handled; the \dtou direction is not.
  • Fadings are always defined in the yoko direction, also when they are declared in tate text.
  • remember picture, overlay and current page need the position tracking of PGF, which PGF enables for p only from Live 2018 on. This is the same in yoko documents.
  • With dvips, fadings need a PGF that supports them with dvips (not the one of Live 2016 or earlier), and Japanese fonts need the usual font map setup for dvips and Ghostscript. Both are independent of this package.

Testing

  • make test typesets test-pxpgftate.tex with the installed Live (p/up × dvipdfmx/dvips) and checks that there are no errors and that pxpgftate patched the driver.
  • make test-matrix (run-matrix.sh, only in the repository) does the same with Live 2012–2026 installed in /opt/texlive/<year> and renders the first page of each result into test-out/ for a visual check.

History

This package grew out of patches for PGF in the tate direction that the author has been developing since 2015 for book production with p and dvipdfmx. In 2024 they were put together as pgfsys-dvipdfmx-ptextate.sty and two patched copies of pgfutil-latex.def. The package was then rewritten to patch PGF without replacing its files.

  • v1.0 (2026-11-04): first release

Repository

License

This package may be distributed and/or modified under the Project Public License, version 1.3c or later, and/or under the GNU General Public License, version 2 or later, like PGF itself. See LICENSE.

Copyright (c) 2015-2026 Munehiro Yamamoto


日本語

p/upの縦組み(tate)中で、dvipdfmx/dvipsドライバを使ってPGF/TikZを使えるようにするパッケージです。

p/upの縦組みでは、DVIドライバは文字を回転して配置しますが、PGFは回転していないページ座標系で図を描きます。そのため、このパッケージなしでは縦組み中の図が横倒しになり、シェーディング・パターン・フェードを使うと Incompatible direction list can't be unboxed エラーで止まります。

このパッケージを読み込むと、縦組み中で始まった図は周囲の文字と同じように回転します(x軸は行送りの方向=下向き、y軸は右向き)。ノード内の文字は縦組みで組まれます。組方向は図ごとに判定するので、縦組み中のyoko箱の図も従来どおり動きます。

対応しているもの:

  • パス、ノード、座標変換(rotate、transform shape)、色
  • シェーディング、パターン、フェード、透明グループ
  • remember picture、overlay、current page ノード
  • tcolorbox(enhanced、breakable、drop shadow を含む)

対象は Live 2012から、PGF本体が縦組みに対応する版の手前までです。読み込んだPGFが縦組みに対応済み(\pgfsys@ptex@tate@supported が定義されている)なら、このパッケージは何もしません。

使い方

tikz(または pgf)の後で読み込みます。

\documentclass[dvipdfmx]{tarticle}
\usepackage{tikz}
\usepackage{pxpgftate}

PGFより前に読み込んでも構いません。その場合は \begin{document} の時点でパッチを当てます。オプションはありません。

PGF本体が縦組みに対応したら

縦組み対応は、PGF本体にも提案しています(pgf-tikz/pgf#1487)。これを取り込んだPGFが出ると、縦組み中の図はPGFだけで正しく描かれ、このパッケージは何もしなくなります。PGFには手を加えず、ログに次の情報を書くだけです。

Package pxpgftate Info: PGF supports the tate direction itself.
(pxpgftate)             Nothing is done on input line ....

そのため、文書の \usepackage{pxpgftate} は残したままで構いません。古い Liveではこのパッケージが、新しい LiveではPGF本体が縦組みを扱い、どちらでも同じ結果になります。PGF本体の対応版だけを使うようになったら、この行は消しても構いません。

仕組み

PGFのドライバのマクロをコピーせずにラップしているので、 Live 2012〜2026の各版のPGFで同じコードが動きます。PGFのファイルを差し替えることはしません。箱やXObjectの逆回転には pdf:btrans ではなく pdf:bcontent を使います( Live 2020以前のdvipdfmxでは、pdf:bcontent の中やXObjectの中で pdf:btrans の位置がずれるため)。PGF 2.10( Live 2012)では、縦組みの図の中に限ってPGF 3.0の箱のマクロを使います。 2020-10-01より前でeveryshi.sty v3を使う場合は、pxeveryshiと同様にshipoutフックを横組み方向で実行します(縦組み文書中のeveryshi利用者すべてに影響します。pxeveryshiが読み込まれていれば何もしません)。

制限

  • 扱うのはtate方向だけで、\dtou 方向には対応していません。
  • remember picture、overlay、current page にはPGFの位置追跡が必要です。PGFがpで位置追跡を有効にするのは Live 2018以降です(横組み文書でも同じです)。
  • フェードは、縦組み中で宣言しても常に横組み方向で定義します。
  • dvips でのフェードには、dvipsでフェードに対応したPGF( Live 2017以降)が必要です。和文を出すには、dvipsとGhostscriptの通常の和文フォント設定も必要です(どちらもこのパッケージとは無関係です)。

テスト

  • make test:インストール済みの Liveで test-pxpgftate.tex を p/up × dvipdfmx/dvips で組み、エラーがないこととドライバへのパッチを確認します。
  • make test-matrix(run-matrix.sh、リポジトリのみ):/opt/texlive/<年> の Live 2012〜2026で同じことを行い、各結果の1ページ目を test-out/ に画像化します。

ライセンス

Copyright (c) 2015-2026 Munehiro Yamamoto

PGFと同じく、 Project Public License 1.3c以降、またはGNU General Public License 2以降のもとで配布・改変できます。

Download the contents of this package in one zip archive (202.8k).

PxPGFtate – Support for PGF/ in the vertical (tate) direction of (u)p

In the vertical (tate) direction of p and up, the DVI drivers place the characters rotated, but PGF draws its pictures in the unrotated page coordinate system. Pictures in tate text therefore come out sideways, and shadings, patterns or fadings stop p with Incompatible direction list can't be unboxed.

This package makes a picture that begins in the tate direction behave like the surrounding text: its x-axis points in the direction of the line and its y-axis to the right, and node text is typeset in the tate direction. Paths, nodes, transformations, shadings, patterns, fadings, transparency groups, remember picture, the current page node and tcolorbox are supported. The package patches the driver macros of PGF (2.10 or later) instead of replacing PGF's files, and does nothing when the loaded PGF supports the tate direction itself.

Supported formats/engines: p, up (with dvipdfmx or dvips), Live 2012 or later.

PackagePxPGFtate
Bug tracker
Repository
Version1.0 2026-11-04
LicensesThe Project Public License 1.3c
GNU General Public License, version 2 or newer
Copyright2015–2026 Munehiro Yamamoto
MaintainerMunehiro Yamamoto
Contained inTeX Live as pxpgftate
TopicsPGF
Japanese
...
Guest Book Sitemap Contact Contact Author