summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pstricks/pstricks-pdf.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-06-11 21:09:12 +0000
committerKarl Berry <karl@freefriends.org>2020-06-11 21:09:12 +0000
commita1a946ff7eceabb8096d4bec23510234a240af84 (patch)
tree0b15fbfd33a5371a3f1778cf5e7e06c70a621629 /Master/texmf-dist/tex/latex/pstricks/pstricks-pdf.sty
parentdb3622d54b18c9315619271b5b916549f82ae093 (diff)
pstricks (11jun20)
git-svn-id: svn://tug.org/texlive/trunk@55515 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pstricks/pstricks-pdf.sty')
-rw-r--r--Master/texmf-dist/tex/latex/pstricks/pstricks-pdf.sty105
1 files changed, 45 insertions, 60 deletions
diff --git a/Master/texmf-dist/tex/latex/pstricks/pstricks-pdf.sty b/Master/texmf-dist/tex/latex/pstricks/pstricks-pdf.sty
index db3be75a186..bbed5743017 100644
--- a/Master/texmf-dist/tex/latex/pstricks/pstricks-pdf.sty
+++ b/Master/texmf-dist/tex/latex/pstricks/pstricks-pdf.sty
@@ -1,21 +1,23 @@
-% $Id: pstricks-pdf.sty 4 2020-06-09 08:32:19Z herbert $
+% $Id: pstricks-pdf.sty 6 2020-06-10 18:50:14Z herbert $
%%
%% This is file `pstricks-pdf.sty'.
%%
%% IMPORTANT NOTICE:
%%
-%% pstricks-pdf.sty Copyright (C) 2017 Herbert Voss <hvoss@tug.org>
+%% pstricks-pdf.sty Copyright (C) 2020 Herbert Voss <hvoss@tug.org>
%%
%% This package may be distributed under the terms of the LaTeX Project
%% Public License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%
+%%
+%% This code is more or less exactly the same as for auto-pst-pdf from
+%% Will Robertson
+%%
\NeedsTeXFormat{LaTeX2e}
-
-\ProvidesPackage{pstricks-pdf}[2017/03/17 v0.01 creating pdf output (HV)]
-%
-\RequirePackage{ifpdf,xkeyval,pst-platform,ifluatex,ifxetex}
+\ProvidesPackage{pstricks-pdf}[2020/06/11 v0.01 creating pdf output (hv)]
+\RequirePackage{ifpdf,xkeyval,ifplatform}
\newif\if@app@off@
\newif\if@app@crop@
@@ -23,10 +25,6 @@
\def\app@suffix{autopp}
\edef\app@jobname{\jobname-\app@suffix}
\edef\app@pics{\jobname-pics.pdf}
-
-%%%
-% the following code is adapted from auto-pst-pdf
-%%%
\DeclareOptionX{off}[]{\@app@off@true}
\define@choicekey{pstricks-pdf.sty}{crop}[\@tempa\@tempb]{on,off}{%
\ifcase\@tempb\relax
@@ -48,7 +46,6 @@
#1}}
\DeclareOptionX{dvips}{\def\app@dvips@opts{#1}}
\DeclareOptionX{pspdf}{\def\app@pspdf@opts{#1}}
-\def\app@pdfcrop@opts{--hres}%%% hv 20130405
\DeclareOptionX{pdfcrop}{\def\app@pdfcrop@opts{#1}}
\DeclareOptionX{cleanup}{%
@@ -64,11 +61,7 @@
\c@app@runs\@ne
\fi}
-\DeclareOptionX*{%
- \PassOptionsToPackage{prologue}{xcolor}% to get named colors into the ps file
- \PassOptionsToPackage\CurrentOption{pstricks}%
- \PassOptionsToPackage\CurrentOption{pst-pdf}%
-}
+\DeclareOptionX*{\PassOptionsToPackage{\CurrentOption}{pst-pdf}\PassOptionsToPackage{\CurrentOption}{pstricks}}
\ExecuteOptionsX{%
ext=tex,
@@ -84,13 +77,11 @@
\else
\ExecuteOptionsX{pspdf={-dAutoRotatePages=/None}}
\fi
-%
-\ProcessOptionsX\relax
-%
-\ifxetex\@app@off@true\fi
-%
+\ProcessOptionsX
+\def\app@exe{\immediate\write18}
\def\app@nl{^^J\space\space\space\space}
-\newcommand\app@PackageError[2]{\PackageError{pstricks-pdf}{\app@nl #1^^J}{#2}}
+\newcommand\app@PackageError[2]{%
+ \PackageError{pstricks-pdf}{\app@nl #1^^J}{#2}}
\newcommand\app@PackageWarning[1]{%
\PackageWarning{pstricks-pdf}{\app@nl #1^^JThis warning occured}}
\newcommand\app@PackageInfo[1]{\PackageInfo{pstricks-pdf}{#1}}
@@ -98,31 +89,22 @@
\newcommand\NotIfFileExists[2]{\IfFileExists{#1}{}{#2}}
\def\app@convert#1#2#3{%
\OnlyIfFileExists{#2}{%
-% \expandafter\typeout\expandafter{\csname app@cmd@#1\endcsname}%
- \typeout{filenameIN: #2}%
- \typeout{filenameOUT: #3}%
- \ShellEscape{\csname app@cmd@#1\endcsname{#2}{#3}}%
+ \app@exe{\csname app@cmd@#1\endcsname{#2}{#3}}%
\NotIfFileExists{#3}{\app@PackageWarning{Creation of #3 failed.}}}}
\def\app@compile{%
\app@cleanup
\app@remove@container
\loop\ifnum\c@app@runs > \@ne
- \app@convert{extralatex}{\jobname.\app@ext}{}%
+ \app@convert{extralatex}{\jobname.\app@ext}{\app@jobname.dvi}%
\advance\c@app@runs\m@ne
\repeat
- \app@convert{latex}{\jobname.\app@ext}{}%
- \ifxetex\else
- \app@convert{dvips}{\app@jobname.dvi}{\app@jobname.ps}%
- \fi
+ \app@convert{latex}{\jobname.\app@ext}{\app@jobname.dvi}%
+ \app@convert{dvips}{\app@jobname.dvi}{\app@jobname.ps}%
\if@app@crop@
- \ifxetex\else
- \app@convert{pstopdf}{\app@jobname.ps}{\app@jobname.pdf}%
- \fi
+ \app@convert{pstopdf}{\app@jobname.ps}{\app@jobname.pdf}%
\app@convert{pdfcrop}{\app@jobname.pdf}{\app@pics}%
\else
- \ifxetex\else
- \app@convert{pstopdf}{\app@jobname.ps}{\app@pics}%
- \fi
+ \app@convert{pstopdf}{\app@jobname.ps}{\app@pics}%
\fi
\IfFileExists{\app@pics}
{\app@cleanup}
@@ -131,31 +113,35 @@
\edef\app@rm{\ifwindows del \else rm -- \fi}
\newcommand\app@try@rm[1]{%
\@for\@tempa:=#1\do{%
- \OnlyIfFileExists{\@tempa}{\ShellEscape{\app@rm "\@tempa"}}}}
+ \OnlyIfFileExists{\@tempa}{\app@exe{\app@rm "\@tempa"}}}}
\def\app@remove@container{\app@try@rm{\app@pics}}
\def\app@cleanup{\app@try@rm{\app@rm@files}}
-\ifluatex
-% \def\app@cmd@latex#1#2{lualatex --output-format=dvi \app@latex@opts\space "\unexpanded{\let\APPmakepictures\empty\input} #1"}
-% \def\app@cmd@extralatex#1#2{lualatex --output-format=dvi \app@latex@opts\space "\unexpanded{\let\APPmakepictures\undefined\input} #1"}
- \def\app@cmd@latex#1#2{xelatex \app@latex@opts\space "\unexpanded{\AtBeginDocument{\pagestyle{empty}}\let\APPmakepictures\empty\input} #1"}
- \def\app@cmd@extralatex#1#2{xelatex \app@latex@opts\space "\unexpanded{\AtBeginDocument{\pagestyle{empty}}\let\APPmakepictures\undefined\input} #1"}
-\else
- \def\app@cmd@latex#1#2{latex \app@latex@opts\space "\unexpanded{\let\APPmakepictures\empty\input} #1"}
- \def\app@cmd@extralatex#1#2{\@app@prog\space \app@latex@opts\space "\unexpanded{\let\APPmakepictures\undefined\input} #1"}
- \def\app@cmd@dvips#1#2{dvips \app@dvips@opts\space -o "#2" "#1"}
- \def\app@cmd@pstopdf#1#2{ps2pdf \app@pspdf@opts\space "#1" "#2"}
-\fi
+\def\app@cmd@latex#1#2{latex \app@latex@opts\space
+ "\unexpanded{\let\APPmakepictures\empty\input} #1"}
+\def\app@cmd@extralatex#1#2{latex \app@latex@opts\space
+ "\unexpanded{\let\APPmakepictures\undefined\input} #1"}
+\def\app@cmd@dvips#1#2{dvips \app@dvips@opts\space -o "#2" "#1"}
+\def\app@cmd@pstopdf#1#2{ps2pdf \app@pspdf@opts\space "#1" "#2"}
\def\app@cmd@pdfcrop#1#2{pdfcrop \app@pdfcrop@opts\space "#1" "#2"}
\ifpdf
\if@app@off@\else
- \ShellEscape{echo " "}
- \ShellEscape{echo "-------------------------------------------------"}
- \ShellEscape{echo "pstricks-pdf: Auxiliary LaTeX compilation"}
- \ShellEscape{echo "-------------------------------------------------"}
+ \ifshellescape
+ \app@exe{echo " "}
+ \app@exe{echo "-------------------------------------------------"}
+ \app@exe{echo "pstricks-pdf: Auxiliary LaTeX compilation"}
+ \app@exe{echo "-------------------------------------------------"}
\app@compile
- \ShellEscape{echo "-------------------------------------------------"}
- \ShellEscape{echo "pstricks-pdf: End auxiliary LaTeX compilation"}
- \ShellEscape{echo "-------------------------------------------------"}
+ \app@exe{echo "-------------------------------------------------"}
+ \app@exe{echo "pstricks-pdf: End auxiliary LaTeX compilation"}
+ \app@exe{echo "-------------------------------------------------"}
+ \else
+ \app@PackageError{%
+ "shell escape" (or "write18") is not enabled:\app@nl
+ pstricks-pdf will not work!}
+ {You need to run LaTeX with the equivalent of
+ "pdflatex -shell-escape"\app@nl
+ Or turn off pstricks-pdf.}%
+ \fi
\fi
\if@app@crop@
\PassOptionsToPackage{notightpage}{pst-pdf}
@@ -170,10 +156,9 @@
\fi
\fi
\RequirePackage{pst-pdf}
-\RequirePackage{pstricks}
-\@ifclassloaded{beamer}{\setbeamertemplate{navigation symbols}}{}%
-%
\let\app@ig\includegraphics
-%
+
+\ifpdf\else\RequirePackage{pstricks}\fi
+
%%
%% End of file `pstricks-pdf.sty'.