私は自分のドキュメントで派手な TikZ シャドウを使用していますpdflatex
が、問題なく動作します。しかし、PDF ドキュメントを ghostscript (またはそのps2pdf
フロントエンド) で処理すると、シャドウが壊れてしまいます。この処理は、画像が多いためドキュメントのサイズを小さくすることを目的としているため、無関係な問題であると考えています。
詳細は次のとおりです。MWE:
\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{fit}
\usetikzlibrary{through}
\usetikzlibrary{positioning}
\usetikzlibrary{arrows.meta}
\usetikzlibrary{shadows}
\usetikzlibrary{shadings}
%% even fancier shadows
\usetikzlibrary{shadows.blur}
%% fade
\usetikzlibrary{fadings}
\begin{document}
\begin{tikzpicture}[align=center,node distance = 1.2em and 1.2em,
rounded corners=10, blur shadow={shadow blur steps=50}]
\tikzstyle{block} = [rectangle, fill=blue!10, draw, text width=6em,
text centered, minimum height=2.1\baselineskip,
blur shadow={shadow blur steps=50}
]
\node (t) [block] {Test};
\end{tikzpicture}
\end{document}
元の文書は次のようになりますlatexmk -pdf mwe
:
さて、私はこう呼びかけますgs
。
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.7 -dPDFSETTINGS=/printer -dColorImageDownsampleType=/Bicubic -dColorImageResolution=72 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=72 -dMonoImageResolution=150 -dOptimize=true -q -o small-gs.pdf mwe.pdf
結果は次のとおりです。
ps2pdf
: を呼び出すこともできますps2pdf mwe.pdf small-2pdf.pdf
が、結果は同じです。( のフロントエンドなので当然ですgs
。)
バージョン:
$ pdflatex --version
pdfTeX 3.14159265-2.6-1.40.21 (TeX Live 2020)
kpathsea version 6.3.2
Copyright 2020 Han The Thanh (pdfTeX) et al.
There is NO warranty. Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.02
$ gs --version
9.52
texlive-latest
MacOS 10.15.6 および GitLab のビルド システム ( 、Ubuntu イメージ)で検証済み。PDF は Preview.app で表示します。
何が間違っているのでしょうか? (もちろん、プレビューを使用していること以外に)
PDF ファイルのより幅広い互換性を維持するにはどうすればよいですか?
答え1
dvips
+のフェーディング(不均一な透明度)のサポートはごく最近ps2pdf
追加され、pgf
GitHub リポジトリテストするには、ダウンロードしてくださいhttps://github.com/pgf-tikz/pgf/archive/master.zipそしてコピーするtex
フォルダーを作業ディレクトリにコピーします。また、Ghostscript-9.52 が必要であり、ps2pdf
オプションで実行する必要があります-dALLOWPSTRANSPARENCY
。