From b86e9967616bbf2d46b5b4f278e262bd3b824f7b Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 24 Mar 2020 20:52:52 +0000 Subject: graphics-def (24mar20) git-svn-id: svn://tug.org/texlive/trunk@54522 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/graphics-def/dvisvgm.def | 123 +++++++++++++++++---- .../texmf-dist/tex/latex/graphics-def/luatex.def | 13 ++- .../texmf-dist/tex/latex/graphics-def/pdftex.def | 13 ++- 3 files changed, 115 insertions(+), 34 deletions(-) (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/graphics-def/dvisvgm.def b/Master/texmf-dist/tex/latex/graphics-def/dvisvgm.def index e94ec8dc09d..46a3c3859c7 100644 --- a/Master/texmf-dist/tex/latex/graphics-def/dvisvgm.def +++ b/Master/texmf-dist/tex/latex/graphics-def/dvisvgm.def @@ -1,5 +1,5 @@ % Copyright 2015 by Till Tantau -% Copyright 2016 by Till Tantau and LaTeX3 Project +% Copyright 2016 2018 by Till Tantau and LaTeX3 Project % %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3c @@ -15,9 +15,9 @@ %% %% https://github.com/latex3/graphics-def/issues % -\ProvidesFile{dvisvgm.def}[2017/06/20 v1.0b dvisvgm graphics driver for latex] -\def\GPT@space{ } +\ProvidesFile{dvisvgm.def}[2020/03/22 v1.2 dvisvgm graphics driver for latex] % The following is copied from dvips.def: +\def\GPT@space{ } \def\c@lor@arg#1{% \dimen@#1\p@ \ifdim\dimen@<\z@\dimen@\maxdimen\fi @@ -72,11 +72,85 @@ \def\reset@color{\special{color pop}} \def\set@page@color{\special{bgcolor \current@color}} \def\define@color@named#1#2{\expandafter\let\csname col@#1\endcsname\@nnil} -\def\Grot@start{\special{dvisvgm:raw }} -\def\Grot@end{\special{dvisvgm:raw }} -\def\Gscale@start{\special{dvisvgm:raw }} -\def\Gscale@end{\special{dvisvgm:raw }} -\def\Gin@extensions{.png,.jpg,.jpeg,.svg} +\def\Grot@start{% + \special{ps: gsave currentpoint currentpoint translate \Grot@angle\GPT@space neg rotate neg exch neg exch translate}% + \special{dvisvgm:bbox \strip@pt\wd\z@ pt \strip@pt\ht\z@ pt \strip@pt\dp\z@ pt transform}% + \special{ps: grestore}% + \special{dvisvgm:raw }% + \special{dvisvgm:bbox lock}% +} +\def\Grot@end{\special{dvisvgm:bbox unlock}\special{dvisvgm:raw }} +\def\Gscale@start{% + \special{ps: gsave currentpoint currentpoint translate \Gscale@x\GPT@space \Gscale@y\GPT@space scale neg exch neg exch translate}% + \special{dvisvgm:bbox \strip@pt\wd\z@ pt \strip@pt\ht\z@ pt \strip@pt\dp\z@ pt transform}% + \special{ps: grestore}% + \special{dvisvgm:raw }% + \special{dvisvgm:bbox lock}% +} +\let\Gscale@end\Grot@end +\def\Gin@extensions{.svg,.eps,.png,.jpg,.jpeg} +\def\Ginclude@pdf#1{\Ginclude@psorpdf{#1}{pdffile}} +\def\Ginclude@eps#1{\let\Gin@page\@empty\Ginclude@psorpdf{#1}{PSfile}} +\def\Ginclude@psorpdf#1#2{% + \message{<#1>}% + \bgroup + \def\@tempa{!}% + \dimen@\Gin@req@width + \dimen@ii.1bp% + \divide\dimen@\dimen@ii + \@tempdima\Gin@req@height + \divide\@tempdima\dimen@ii + \special{#2="#1"\GPT@space + \ifx\Gin@page\@empty\else page=\Gin@page\GPT@space\fi + llx=\Gin@llx\GPT@space + lly=\Gin@lly\GPT@space + urx=\Gin@urx\GPT@space + ury=\Gin@ury\GPT@space + \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\GPT@space\fi + \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\GPT@space\fi + \ifGin@clip clip\fi + }% + \egroup} +\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}} +\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}} +\@namedef{Gin@rule@.mps}#1{{eps}{.mps}{#1}} +\@namedef{Gin@rule@.pdf}#1{{pdf}{.xbb}{#1}} +% BoundingBox determination (from dvipdfmx.def) +\def\Gread@pdf#1{% + \Gread@generic{#1}\Gread@extractbb@aux% +}% +\def\Gread@extractbb@aux#1{% + \ifeof\@inputcheck% + \immediate\openin\@inputcheck=% + "|extractbb % + \ifx\Gin@page\@empty\else -p \Gin@page\GPT@space\fi + \ifx\Gin@pagebox\@empty\else -B \Gin@pagebox\GPT@space\fi + -O \Gin@base\Gin@ext"% + \fi% + \Gread@true% + \let\@tempb\Gread@false% + \ifeof\@inputcheck% + \@latex@error% + {Cannot run pipe command. Try --shell-escape\MessageBreak% + (--enable-pipes in MikTeX) option}% + {Alternatively, execute\MessageBreak\space\space + extractbb + \ifx\Gin@page\@empty\else -p \Gin@page\GPT@space\fi + \ifx\Gin@pagebox\@empty\else -B \Gin@pagebox\GPT@space\fi + \Gin@base\Gin@ext\MessageBreak in a terminal.}% + \else% + \loop% + \read\@inputcheck to\@tempa% + \ifeof\@inputcheck% + \Gread@false% + \else% + \expandafter\Gread@find@bb\@tempa:.\\% + \fi% + \ifGread@% + \repeat% + \immediate\closein\@inputcheck% + \fi% +} \def\Ginclude@bitmap#1{% \dimen@\Gin@urx pt% \advance\dimen@ by-\Gin@llx pt% @@ -87,17 +161,17 @@ \dimen@\Gin@svg@real@height@bp pt% \advance\dimen@ by-\Gin@ury pt% \edef\Gin@svg@view@base{\strip@pt\dimen@}% -% \kern-\Gin@llx bp% - \raise\Gin@req@height\hbox{% + \Gin@req@width0.99626\Gin@req@width% + \Gin@req@height0.99626\Gin@req@height% + \raise\strip@pt\Gin@req@height bp\hbox{% \special{dvisvgm: raw - }% -% \special{dvisvgm: img \strip@pt\Gin@req@width\GPT@space \strip@pt\Gin@req@height\GPT@space #1} }% } @@ -139,32 +213,33 @@ \fi \edef\Gin@setter{\def\noexpand\Gin@urx{\Gin@urx}\def\noexpand\Gin@ury{\Gin@ury}}% \expandafter\endgroup\Gin@setter% - \def\Gin@llx{0}% + \def\Gin@llx{0}% \def\Gin@lly{0}% \edef\Gin@svg@real@width@bp{\Gin@urx}% - \edef\Gin@svg@real@height@bp{\Gin@ury}% + \edef\Gin@svg@real@height@bp{\Gin@ury}% } \def\Gin@partext{\par} \def\Gread@svg@height#1height={\@ifnextchar\relax{}{\@ifnextchar'\Gread@svg@height@apo\Gread@svg@height@double}} -\def\Gread@svg@height@apo'#1'#2\relax{\afterassignment\Gin@gobble@till@relax\dimen@#1pt\relax\dimen@0.99626\dimen@\edef\Gin@ury{\strip@pt\dimen@}} -\def\Gread@svg@height@double"#1"#2\relax{\afterassignment\Gin@gobble@till@relax\dimen@#1pt\relax\dimen@0.99626\dimen@\edef\Gin@ury{\strip@pt\dimen@}} +\def\Gread@svg@height@apo'#1'#2\relax{\afterassignment\Gin@gobble@till@relax\dimen@#1pt\relax\edef\Gin@ury{\strip@pt\dimen@}} +\def\Gread@svg@height@double"#1"#2\relax{\afterassignment\Gin@gobble@till@relax\dimen@#1pt\relax\edef\Gin@ury{\strip@pt\dimen@}} \def\Gread@svg@width#1width={\@ifnextchar\relax{}{\@ifnextchar'\Gread@svg@width@apo\Gread@svg@width@double}} -\def\Gread@svg@width@apo'#1'#2\relax{\afterassignment\Gin@gobble@till@relax\dimen@#1pt\relax\dimen@0.99626\dimen@\edef\Gin@urx{\strip@pt\dimen@}} -\def\Gread@svg@width@double"#1"#2\relax{\afterassignment\Gin@gobble@till@relax\dimen@#1pt\relax\dimen@0.99626\dimen@\edef\Gin@urx{\strip@pt\dimen@}} +\def\Gread@svg@width@apo'#1'#2\relax{\afterassignment\Gin@gobble@till@relax\dimen@#1pt\relax\edef\Gin@urx{\strip@pt\dimen@}} +\def\Gread@svg@width@double"#1"#2\relax{\afterassignment\Gin@gobble@till@relax\dimen@#1pt\relax\edef\Gin@urx{\strip@pt\dimen@}} \def\Gin@gobble@till@relax#1\relax{} +\edef\Gin@hash@tag{\string#} \@namedef{Gin@rule@.jpg}#1{{bitmap}{.xbb}{#1}} \@namedef{Gin@rule@.jpeg}#1{{bitmap}{.xbb}{#1}} \@namedef{Gin@rule@.png}#1{{bitmap}{.xbb}{#1}} -% Replace +% Replace \def\Gread@bitmap#1{% - \Gread@eps{#1}% - \dimen@\Gin@urx bp% - \advance\dimen@ by-\Gin@llx bp% + \Gread@generic{#1}\Gread@extractbb@aux% + \dimen@\Gin@urx pt% + \advance\dimen@ by-\Gin@llx pt% \edef\Gin@svg@real@width@bp{\strip@pt\dimen@}% - \dimen@\Gin@ury bp% - \advance\dimen@ by-\Gin@lly bp% + \dimen@\Gin@ury pt% + \advance\dimen@ by-\Gin@lly pt% \edef\Gin@svg@real@height@bp{\strip@pt\dimen@}% } diff --git a/Master/texmf-dist/tex/latex/graphics-def/luatex.def b/Master/texmf-dist/tex/latex/graphics-def/luatex.def index c8287ee95f9..84ed1109be6 100644 --- a/Master/texmf-dist/tex/latex/graphics-def/luatex.def +++ b/Master/texmf-dist/tex/latex/graphics-def/luatex.def @@ -128,14 +128,17 @@ \AtBeginDocument{% \def\KV@Gin@bbllx{% \PackageError{luatex.def}{% - Options `bblly', `bblly', `bburx' and `bbury'\MessageBreak - are not supported by luatex driver:\MessageBreak + Options `bblly', `bblly', `bburx', `bbury',\MessageBreak + `natheight' and `natwidth' are not\MessageBreak + supported by luatex driver:\MessageBreak use `viewport' instead% }\@ehc }% \let\KV@Gin@bblly\KV@Gin@bbllx \let\KV@Gin@bburx\KV@Gin@bbllx \let\KV@Gin@bbury\KV@Gin@bbllx + \let\KV@Gin@natwidth\KV@Gin@bbllx + \let\KV@Gin@natheight\KV@Gin@bbllx \def\KV@Gin@bb{% \PackageInfo{luatex.def}% {Option `bb' equivalent to `viewport' for luatex driver}% @@ -575,18 +578,18 @@ % b) and shell escape is enabled (possibly restricted), % c) and \DoNotLoadEpstopdf either does not exist or is not \relax, % d) and neither pst-pdf nor pdftricks is loaded (by \begin{document}). -% +% % In other words, by default .eps files will be automatically % converted to .pdf files when outputting pdf. This can be wrong! % If the .pdf is the source, rather than the .eps, you should put % \newcommand{\DoNotLoadEpstopdf}{} % before even the \documentclass line of your document. -% +% % More information about the epstopdf run will be in the .log file; % see http://ctan.org/pkg/epstopdf-pkg for more info about the % epstopdf package itself. In turn, it calls the epstopdf script % (http://ctan.org/pkg/epstopdf). -% +% % For the first discussion and background on this, see the thread on latex-l: % http://thread.gmane.org/gmane.comp.tex.latex.latex3/1465 % diff --git a/Master/texmf-dist/tex/latex/graphics-def/pdftex.def b/Master/texmf-dist/tex/latex/graphics-def/pdftex.def index 3d064430f07..0c9d2da5489 100644 --- a/Master/texmf-dist/tex/latex/graphics-def/pdftex.def +++ b/Master/texmf-dist/tex/latex/graphics-def/pdftex.def @@ -142,14 +142,17 @@ E \else \AtBeginDocument{% \def\KV@Gin@bbllx{% \PackageError{pdftex.def}{% - Options `bblly', `bblly', `bburx' and `bbury'\MessageBreak - are not supported by pdftex driver:\MessageBreak + Options `bblly', `bblly', `bburx', `bbury',\MessageBreak + `natheight' and `natwidth' are not\MessageBreak + supported by pdftex driver:\MessageBreak use `viewport' instead% }\@ehc }% \let\KV@Gin@bblly\KV@Gin@bbllx \let\KV@Gin@bburx\KV@Gin@bbllx \let\KV@Gin@bbury\KV@Gin@bbllx + \let\KV@Gin@natwidth\KV@Gin@bbllx + \let\KV@Gin@natheight\KV@Gin@bbllx \def\KV@Gin@bb{% \PackageInfo{pdftex.def}% {Option `bb' equivalent to `viewport' with pdftex driver}% @@ -585,18 +588,18 @@ E \else % b) and shell escape (\write18) is enabled (possibly restricted), % c) and \DoNotLoadEpstopdf either does not exist or is not \relax, % d) and neither pst-pdf nor pdftricks is loaded (by \begin{document}). -% +% % In other words, by default .eps files will be automatically % converted to .pdf files when outputting pdf. This can be wrong! % If the .pdf is the source, rather than the .eps, you should put % \newcommand{\DoNotLoadEpstopdf}{} % before even the \documentclass line of your document. -% +% % More information about the epstopdf run will be in the .log file; % see http://ctan.org/pkg/epstopdf-pkg for more info about the % epstopdf package itself. In turn, it calls the epstopdf script % (http://ctan.org/pkg/epstopdf). -% +% % For the first discussion and background on this, see the thread on latex-l: % http://thread.gmane.org/gmane.comp.tex.latex.latex3/1465 % -- cgit v1.2.3