Utilizo sombras elegantes de TikZ en mi pdflatex
documento, funciona bien. Sin embargo, si proceso el documento PDF con Ghostscript (o su ps2pdf
interfaz), las sombras se rompen. El procesamiento tiene como objetivo reducir el tamaño del documento debido a que hay muchas imágenes, reconozco que es un problema no relacionado.
Aquí están los detalles. El 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}
El documento original después de latexmk -pdf mwe
:
Ahora llamo 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
El resultado es:
También puedo llamar ps2pdf
:, ps2pdf mwe.pdf small-2pdf.pdf
el resultado es el mismo. (No es de extrañar, es una interfaz para gs
.)
Versiones:
$ 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
Verificado en MacOS 10.15.6 y en un sistema de compilación en GitLab ( texlive-latest
, imagen de Ubuntu). Veo los archivos PDF en Preview.app.
¿Qué estoy haciendo mal? (Aparte de usar Vista previa, obviamente).
¿Cómo conservar una compatibilidad más amplia de mis archivos PDF?
Respuesta1
El soporte de Fadings (transparencia no uniforme) para dvips
+ ps2pdf
se ha agregado pgf
muy recientemente y está disponible solo en surepositorio de GitHub. Para probar, descargarhttps://github.com/pgf-tikz/pgf/archive/master.zipy copiar eltex
carpeta que contiene en el directorio de trabajo. Además, se necesita Ghostscript-9.52 y ps2pdf
debe ejecutarse con la opción -dALLOWPSTRANSPARENCY
.