내 문서에 멋진 TikZ 그림자를 사용했는데 pdflatex
잘 작동합니다. 그러나 고스트스크립트(또는 해당 프런트엔드)를 사용하여 PDF 문서를 처리하면 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 이미지) 에서 확인되었습니다 . Preview.app에서 PDF를 봅니다.
내가 도대체 뭘 잘못하고있는 겁니까? (물론 미리보기를 사용하는 것 외에는 말이죠.)
내 PDF 파일의 더 폭넓은 호환성을 유지하는 방법은 무엇입니까?
답변1
dvips
+ 에 대한 페이딩(불균일 투명도) 지원은 최근 ps2pdf
에 추가되었으며 해당 기능에서만 사용할 수 있습니다.pgf
GitHub 저장소. 테스트를 위해 다운로드하세요.https://github.com/pgf-tikz/pgf/archive/master.zip그리고 복사tex
그 안에 있는 폴더를 작업 디렉토리에 넣습니다. 또한 Ghostscript-9.52가 필요하며 ps2pdf
옵션을 사용하여 실행해야 합니다 -dALLOWPSTRANSPARENCY
.