diff options
author | Norbert Preining <norbert@preining.info> | 2020-02-26 03:01:01 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-02-26 03:01:01 +0000 |
commit | 2dfd6df5d1db270dc874c6c319d51eed43defb91 (patch) | |
tree | 771360801233f1bd518937e92f71184debc2c95e /language/japanese/plautopatch/pxtextpos.sty | |
parent | e55e56ce482cc9d01a0b83f22dac4851eb4c0357 (diff) |
CTAN sync 202002260301
Diffstat (limited to 'language/japanese/plautopatch/pxtextpos.sty')
-rw-r--r-- | language/japanese/plautopatch/pxtextpos.sty | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/language/japanese/plautopatch/pxtextpos.sty b/language/japanese/plautopatch/pxtextpos.sty new file mode 100644 index 0000000000..439005987e --- /dev/null +++ b/language/japanese/plautopatch/pxtextpos.sty @@ -0,0 +1,85 @@ +% +% pxtextpos.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the plautopatch bundle. +% https://github.com/aminophen/plautopatch +% +% This package is expected to be compatible with +% * textpos.sty +% 2005/10/13 v1.6a -- 2019/04/15 v1.9.1 +% + +%% package declaration +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pxtextpos} + [2019/11/17 v0.2a Patch to textpos for (u)pLaTeX] + +%% preparations +\def\pxtxtpos@pkgname{pxtextpos} +\def\pxtxtpos@warn{\PackageWarningNoLine\pxtxtpos@pkgname} + +%% load it +\RequirePackageWithOptions{textpos} + +%% check if \iftombow ... \fi is available +\ifx\tombowtrue\@undefined + \pxtxtpos@warn{Tombow feature unavailable, aborting} + \expandafter\endinput +\fi + +%% known definition +\def\pxtxtpos@textblockorigin#1#2{% + \ifTP@abspos + \TP@ox=-1in \addtolength\TP@ox{#1} + \TP@oy=-1in \addtolength\TP@oy{#2} + \ifTP@chatter\typeout{TextBlockOrigin set to #1 x #2}\fi + \else + \PackageError{textpos} + {The \protect\textblockorigin\space command\MessageBreak + may only be used if the package was given\MessageBreak + the`absolute' option when it was invoked} + {If you want to use the \protect\textblockorigin\space command, then + \MessageBreak + invoke the package with the syntax\MessageBreak + \protect\usepackage[absolute]{textpos}} + \fi +} +\@onlypreamble\pxtxtpos@textblockorigin + +%% redefine it +\ifx\textblockorigin\pxtxtpos@textblockorigin\else + \pxtxtpos@warn{% + Command \noexpand\textblockorigin is beyond my knowledge.\MessageBreak + I will apply the patch anyway, but it may break:\MessageBreak + Please report to the author of `\pxtxtpos@pkgname.sty'} +\fi +\def\textblockorigin#1#2{% + \ifTP@abspos + \TP@ox=-1in \addtolength\TP@ox{#1} + \TP@oy=-1in \addtolength\TP@oy{#2} + %%% addition + \iftombow + \addtolength\TP@ox{1in}\addtolength\TP@oy{1in} + \fi + %%% + \ifTP@chatter\typeout{TextBlockOrigin set to #1 x #2}\fi + \else + \PackageError{textpos} + {The \protect\textblockorigin\space command\MessageBreak + may only be used if the package was given\MessageBreak + the`absolute' option when it was invoked} + {If you want to use the \protect\textblockorigin\space command, then + \MessageBreak + invoke the package with the syntax\MessageBreak + \protect\usepackage[absolute]{textpos}} + \fi +} + +%% reset +\ifTP@abspos + \textblockorigin{0pt}{0pt}% +\fi + +\endinput +%% EOF |