diff options
-rw-r--r-- | Master/texmf-dist/tex/xelatex/xetex-def/xetex.def | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xetex-def/xetex.def b/Master/texmf-dist/tex/xelatex/xetex-def/xetex.def index c061f94a8af..e224b46868e 100644 --- a/Master/texmf-dist/tex/xelatex/xetex-def/xetex.def +++ b/Master/texmf-dist/tex/xelatex/xetex-def/xetex.def @@ -15,10 +15,13 @@ %% Please report bugs and patches through the tracker there. %% Official releases are made through CTAN: %% http://www.ctan.org/pkg/xetex-def -%% http://www.ctan.org/pkg/xetex-def %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Version History +%% 2015/09/11 [AK, NA, TY] [v4.06] Support pagebox=artbox, etc. in xelatex, +%% like in pdflatex. It requires new xetex and xdvipdfmx, which +%% will be available in TeX Live 2016. Interested users may build +%% new binaries by using new sources in the TeX Live repository. %% %% 2015/03/26 [SH] [v4.04] JPEG 2000 (.jp2, .jpf) support, written for %% dvipdfmx. @@ -97,7 +100,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % emacs-page \ProvidesFile{xetex.def} - [2015/03/25 v4.04 LaTeX color/graphics driver for XeTeX (TeX Live/RRM/JK)] + [2015/09/11 v4.06 LaTeX color/graphics driver for XeTeX (TeX Live/RRM/JK)] %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % make sure we can use " with correct catcode @@ -273,18 +276,52 @@ % % PDF is a special case which has extra features \def\G@pdf@ext{.pdf} +% +% import from pdftex.def to support pagebox=artbox etc. in XeLaTeX +% +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname RequirePackage\endcsname\relax + \input infwarerr.sty\relax + \input ltxcmds.sty\relax +\else + \RequirePackage{infwarerr}[2007/09/09]% + \RequirePackage{ltxcmds}[2010/12/07]% +\fi +\def\GPT@error{\@PackageError{xetex.def}}% +\def\GPT@warn{\@PackageWarning{xetex.def}}% +% % \Gin@XeTeX@page: page number of pdf image or \@empty otherwise. % This code adapted from pdftex.def \let\Gin@XeTeX@page\@empty +\let\GPT@pagebox\ltx@empty \begingroup - \toks@{\define@key{Gin}{page}{\def\Gin@XeTeX@page{#1}}}% + \toks@{\define@key{Gin}{page}{\def\Gin@XeTeX@page{#1}} +\define@key{Gin}{pagebox}{% + \expandafter\let\expandafter\GPT@pagebox% + \csname GPT@pagebox@#1\endcsname + \ifx\GPT@pagebox\relax + \let\GPT@pagebox\ltx@empty + \GPT@warn{% + Unknown value `#1' for `pagebox'.\MessageBreak + Supported values:\MessageBreak + mediabox, cropbox, bleedbox, trimbox, artbox% + }% + \fi% +}% +}% \@ifundefined{define@key}{% \edef\x{\endgroup\noexpand\AtBeginDocument{% \noexpand\@ifundefined{define@key}{}{\the\toks@}}% }\x }{\expandafter\endgroup\the\toks@} +\def\GPT@pagebox@cropbox{crop}% +\def\GPT@pagebox@mediabox{media}% +\def\GPT@pagebox@artbox{art}% +\def\GPT@pagebox@trimbox{trim}% +\def\GPT@pagebox@bleedbox{bleed}% +% % rotating graphics is supported, but % rotation of arbitrary material is not supported yet % @@ -304,19 +341,22 @@ % \def\XeTeX@include@QTm#1{% \def\picpage{}% + \def\picpagebox{}% \edef\type@ext{% \noexpand\lowercase{% \noexpand\def\noexpand\type@ext{\Gin@ext}% }% }\type@ext \ifx\type@ext\G@pdf@ext + \ifx\GPT@pagebox\ltx@empty\else + \edef\picpagebox{ \GPT@pagebox}\fi \ifx\Gin@XeTeX@page\@empty\else \edef\picpage{ page\Gin@XeTeX@page}\fi \def\picfilecommand{\pdffile@cmd}% \else \def\picfilecommand{\picfile@cmd}% \fi - \edef\picfileargs{ \XeTeXquote#1\XeTeXquote\space\picpage}% + \edef\picfileargs{ \XeTeXquote#1\XeTeXquote\space\picpage\picpagebox}% \Gin@log{% <use \picfileargs>% }% @@ -437,11 +477,13 @@ \ifx\type@ext\G@pdf@ext \ifx\Gin@XeTeX@page\@empty \def\picpage{}% \else \edef\picpage{ page\Gin@XeTeX@page}\fi + \ifx\GPT@pagebox\ltx@empty \def\picpagebox{}% + \else \edef\picpagebox{ \GPT@pagebox}\fi \fi \setbox0=\hbox{% \ifx\type@ext\G@pdf@ext \edef\piccommand{\noexpand\pdffile@cmd - \XeTeXquote#1#2\XeTeXquote\space\picpage}% + \XeTeXquote#1#2\XeTeXquote\space\picpage\picpagebox}% \else \edef\piccommand{\noexpand\picfile@cmd \XeTeXquote#1#2\XeTeXquote\space}% |