texlive[46477] Master/texmf-dist: graphicxpsd (29jan18)
commits+karl at tug.org
commits+karl at tug.org
Tue Jan 30 01:03:23 CET 2018
Revision: 46477
http://tug.org/svn/texlive?view=revision&revision=46477
Author: karl
Date: 2018-01-30 01:03:23 +0100 (Tue, 30 Jan 2018)
Log Message:
-----------
graphicxpsd (29jan18)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/graphicxpsd/README.md
trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.pdf
trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.tex
trunk/Master/texmf-dist/doc/latex/graphicxpsd/test-gin-rule-psd.tex
trunk/Master/texmf-dist/tex/latex/graphicxpsd/graphicxpsd.sty
Modified: trunk/Master/texmf-dist/doc/latex/graphicxpsd/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/graphicxpsd/README.md 2018-01-30 00:03:10 UTC (rev 46476)
+++ trunk/Master/texmf-dist/doc/latex/graphicxpsd/README.md 2018-01-30 00:03:23 UTC (rev 46477)
@@ -1,12 +1,13 @@
-`graphicxpsd` Package
-==========
-Adobe Photoshop Data format (PSD) support for graphicx package
+# graphicxpsd Package
+LaTeX: Adobe Photoshop Data format (PSD) support for graphicx package via PSD-to-PDF conversion
+
This package provides Adobe Photoshop Data format (PSD) support for graphicx package
-with sips (Darwin/macOS)/convert (ImageMagick) command.
+with `sips` (Darwin/macOS)/`magick` (ImageMagick) command.
* Major drivers support: `dvipdfmx`, `xetex`, `pdftex`, `luatex`
+
## Requirements
* recent [TeX Live](https://www.tug.org/texlive/) environment
@@ -13,10 +14,12 @@
(TeX Live 2012 or higher release version)
* Mac OS X or [ImageMagick](https://www.imagemagick.org/)
+
## Installation
-Copy: `graphicxpsd.sty` -> `$TEXMF/tex/platex/graphicxpsd/`
+Copy: `graphicxpsd.sty` -> `$TEXMF/tex/latex/graphicxpsd/`
+
## License
This package is licensed under the terms of the MIT License.
Modified: trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.tex 2018-01-30 00:03:10 UTC (rev 46476)
+++ trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.tex 2018-01-30 00:03:23 UTC (rev 46477)
@@ -1,21 +1,22 @@
%#!rm -f tigerpsdfmt4* && lualatex -shell-escape graphicxpsd
\documentclass[luatex]{article}
\usepackage{shortvrb}\MakeShortVerb{\|}
+\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{graphicxpsd}
\title{\textsf{graphicxpsd} Package}
\author{Munehiro Yamamoto}
-\date{2018/01/26 v1.0}
+\date{2018/01/30 v1.1}
\begin{document}
\maketitle
\begin{abstract}
This package provides Adobe Photoshop Data format (PSD) support
for \textsf{graphicx} package
-with \texttt{sips} (Darwin/macOS)/\texttt{convert} (ImageMagick) command.
+with \texttt{sips} (Darwin/macOS)/\texttt{magick} (ImageMagick) command.
\end{abstract}
\section{Motivation}
-\texttt{graphicx} package supports already many graphics image formats as bellow.
+\textsf{graphicx} package supports already many graphics image formats as bellow.
\begin{itemize}
\item non-vector formats: jpg, png, bmp, and so on
\item PostScript-style formats: eps, ps
@@ -25,10 +26,13 @@
Against that, we developed the \textsf{graphicxpsd} package
to support PSD format via PSD-to-PDF conversion
-with the following image converters.
+with two image converters.
\begin{itemize}
-\item \texttt{sips}: pre-installed command in Darwin/macOS
-\item \texttt{convert}: bundled command in ImageMagick
+\item \texttt{sips}:
+pre-installed command in Darwin/macOS
+
+\item \texttt{magick}:
+bundled command in \href{https://www.imagemagick.org/}{ImageMagick}
\end{itemize}
\section{Loading \textsf{graphicxpsd} Package}
@@ -44,17 +48,37 @@
The list of available options is the following.
\begin{itemize}
-\item |dvipdfmx|, |xetex|, |pdftex|, |luatex|: supported driver options;
+\item |dvipdfmx|, |xetex|, |pdftex|, |luatex|:
+supported driver options;
You can also give specific driver option from global option.
-\item |sips| (default), |imagemagick|: supported converter
+\item |sips| (default), |magick| (same as |imagemagick|), |convert|\footnotemark:
+supported image converters;
+\begin{itemize}
+\item
+Darwin/macOS users do not have to do anything
+unless you choose ImageMagick as PSD-to-PDF converter.
+\item
+If you use ImageMagick~7, you may choose |magick|.
+\item
+If you should use ImageMagick~6 or lower version, you just choose |convert|.
\end{itemize}
+\end{itemize}
+\footnotetext{When ImageMagick project had released ImageMagick~7,
+they changed \texttt{convert} to \texttt{magick}
+because that might be the usual problem with the conflict of names
+between the ImageMagick's \texttt{convert.exe} and
+the Windows ``\texttt{convert.exe}'' program,
+which complains about invalid parameters, and
+changing the Imagemagick program's name to imconvert and
+using that instead avoided the conflict.}
\section{Example}
-Typeset the following {\LaTeX} document with LuaTeX.
-
+Typeset the following {\LaTeX} document with Lua{\TeX} enabling the shell escape,
+that is, run |lualatex -shell-escape|.
\begin{quote}
+\small
\begin{verbatim}
%#!lualatex -shell-escape
\documentclass[luatex]{article}%%set luatex driver as global option
@@ -65,9 +89,19 @@
\end{document}
\end{verbatim}
\end{quote}
-
Then, the result is as below.
-
+\begin{center}
\includegraphics{tigerpsdfmt.psd}
+\end{center}
+Incidentally, the above \texttt{tigerpsdfmt.psd} file is converted from
+the \texttt{tiger.eps} file (a.k.a.~``cubic spline tiger''),
+which comes with Ghostscript.
+\begin{quote}
+\small
+\begin{verbatim}
+$ file tigerpsdfmt.psd
+tigerpsdfmt.psd: Adobe Photoshop Image, 550 x 568, RGBA, 4x 8-bit channels
+\end{verbatim}
+\end{quote}
\end{document}
Modified: trunk/Master/texmf-dist/doc/latex/graphicxpsd/test-gin-rule-psd.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/graphicxpsd/test-gin-rule-psd.tex 2018-01-30 00:03:10 UTC (rev 46476)
+++ trunk/Master/texmf-dist/doc/latex/graphicxpsd/test-gin-rule-psd.tex 2018-01-30 00:03:23 UTC (rev 46477)
@@ -2,13 +2,18 @@
% #!rm -f tigerpsdfmt4* && xelatex -shell-escape test-gin-rule-psd
% #!rm -f tigerpsdfmt4* && pdflatex -shell-escape test-gin-rule-psd
%#!rm -f tigerpsdfmt4* && lualatex -shell-escape test-gin-rule-psd
-\documentclass[luatex]{article}%%set as a global option
+\documentclass[luatex]{article}%%set driver as global option
\usepackage{graphicx}
\usepackage[%
- imagemagick,%default: sips
+ magick,%imagemagick,%%same as the one; %%default: sips
+ % convert,%% old ImageMagick
]{graphicxpsd}
\listfiles
\begin{document}
+\makeatletter
+PSD-to-PDF: \@gfxpsd at psdtopdf
+\makeatother
+
%% $ file tigerpsdfmt.psd
%% tigerpsdfmt.psd: Adobe Photoshop Image, 550 x 568, RGBA, 4x 8-bit channels
\includegraphics{tigerpsdfmt.psd}
Modified: trunk/Master/texmf-dist/tex/latex/graphicxpsd/graphicxpsd.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/graphicxpsd/graphicxpsd.sty 2018-01-30 00:03:10 UTC (rev 46476)
+++ trunk/Master/texmf-dist/tex/latex/graphicxpsd/graphicxpsd.sty 2018-01-30 00:03:23 UTC (rev 46477)
@@ -13,9 +13,10 @@
%%
%% This package is licensed under the terms of the MIT License.
%%
+\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{graphicxpsd}
- [2018/01/26 v1.0 Adobe Photoshop Data format (PSD) support for graphicx package
- with sips (Darwin/macOS)/convert (ImageMagick) command]
+ [2018/01/30 v1.1 Adobe Photoshop Data format (PSD) support for graphicx package
+ with sips (Darwin/macOS)/magick (ImageMagick) command]
%% declare package errors
\def\gfxpsd at error{\PackageError{graphicxpsd}}
@@ -31,10 +32,18 @@
\DeclareOption{luatex}{\@gfxpsd at dvipdfmxfalse\@gfxpsd at pdftextrue}
\DeclareOption{pdftex}{\@gfxpsd at dvipdfmxfalse\@gfxpsd at pdftextrue}
-%% support two psd-to-pdf command: sips (Darwin/macOS), convert (ImageMagick)
+%% support two psd-to-pdf commands:
+%% sips (Darwin/macOS), magick/convert (ImageMagick)
+\newif\if at gfxpsd@imagemagick \@gfxpsd at imagemagickfalse
\def\@gfxpsd at psdtopdf{sips}%% as default
-\DeclareOption{imagemagick}{\gdef\@gfxpsd at psdtopdf{convert}}
-\DeclareOption{sips}{\gdef\@gfxpsd at psdtopdf{sips}}
+\DeclareOption{sips}{%
+ \@gfxpsd at imagemagickfalse\gdef\@gfxpsd at psdtopdf{sips}}
+\DeclareOption{imagemagick}{%
+ \@gfxpsd at imagemagicktrue\gdef\@gfxpsd at psdtopdf{magick}}
+\DeclareOption{magick}{%
+ \@gfxpsd at imagemagicktrue\gdef\@gfxpsd at psdtopdf{magick}}
+\DeclareOption{convert}{%
+ \@gfxpsd at imagemagicktrue\gdef\@gfxpsd at psdtopdf{convert}}
\ProcessOptions\relax
@@ -46,12 +55,14 @@
\@namedef{Gin at rule@.PSD}#1{{psdtopdf}{.pdf}{#1}}
\@namedef{Gin at rule@.psd}#1{{psdtopdf}{.pdf}{#1}}
\else
- \grnchry at error{Please choice specific dviware driver from the following list
+ \gfxpsd at error{Please choice specific dviware driver from the following list
and set the one as a documentclass option.^^J
available dviware drivers: dvipdfmx, xetex, luatex, pdftex}%
\fi\fi
%% then, include .psd file as converted PDF
+\@ifundefined{Ginclude at pdf}{\gfxpsd at error{%
+ Please load 'graphicxpsd' package after loading 'graphicx' package.}}\relax
\let\Ginclude at psdtopdf\Ginclude at pdf
%% compatibility for TL16 or lower version
@@ -69,11 +80,11 @@
\let\clone at Gread@pdf\Gread at pdf
\def\Gread at psdtopdf#1{%
\typeout{converting: \Gin at base\Gin at ext\GPT at space -> \Gin at base4gfxpsd.pdf}%
- \def\gfxpsd at tmp{sips}\ifx\@gfxpsd at psdtopdf\gfxpsd at tmp
+ \if at gfxpsd@imagemagick
+ \ShellEscape{\@gfxpsd at psdtopdf\GPT at space\Gin at base\Gin at ext\GPT at space\Gin at base4gfxpsd.pdf}%
+ \else
\ShellEscape{sips -s format pdf \Gin at base\Gin at ext\GPT at space --out \Gin at base4gfxpsd.pdf}%
- \else\def\gfxpsd at tmp{convert}\ifx\@gfxpsd at psdtopdf\gfxpsd at tmp
- \ShellEscape{convert \Gin at base\Gin at ext\GPT at space\Gin at base4gfxpsd.pdf}%
- \fi\fi
+ \fi
%% renamed inside: foo.psd -> foo4gfxpsd.pdf
\let\clone at Gin@base\Gin at base
\def\Gin at base{\clone at Gin@base4gfxpsd}%
More information about the tex-live-commits
mailing list