我正在尝试添加透明背景图像,为此我尝试了很多选项。我现在尝试的是eso-pic
与transparent
包一起使用。这是我目前所拥有的:
\documentclass{book}
\usepackage{graphicx}
\usepackage{tikz} % Required for drawing custom shapes
\usepackage{pgfplots}
\usepgflibrary{shapes.geometric}
\usepgfplotslibrary{colorbrewer}
\usetikzlibrary{pgfplots.groupplots, plotmarks, calc, spy, pgfplots.polar, backgrounds, external}
\tikzexternalize[prefix=./figures/tikz/]
\usepackage{transparent}
\usepackage{eso-pic}
\begin{document}
\begingroup
\thispagestyle{empty}
\begin{center}
{
\resizebox{\linewidth}{!}{\tt FIRST PAGE}} \\[10pt]
\vspace{0.75\baselineskip}
\Huge \tt SUBTITLE
\end{center}
\vfill
\begin{flushleft}
\Large
AUTHOR\\
\vfill
THE PUBLISHER {\normalsize 2018}
\end{flushleft}
\AddToShipoutPictureBG*{\transparent{0.1}\includegraphics[width=\paperwidth,height=\paperheight]{./background.pdf}};
\endgroup
\end{document}
但是,如果我加载tikz
包(我需要在整个文档中使用它),我无法像示例中那样将图中的不透明度设置为 0.2。我尝试了以下方法这里的建议首先加载tikz
然后iso-pic
但它不起作用。
答案1
我确认您的观察并建议采取以下解决方法:
\documentclass{book}
\usepackage{graphicx}
%\usepackage{transparent}
\usepackage{eso-pic}
\usepackage{tikz} % Required for drawing custom shapes
\usepackage{pgfplots}
\usepgflibrary{shapes.geometric}
\usepgfplotslibrary{colorbrewer}
\usetikzlibrary{pgfplots.groupplots, plotmarks, calc, spy, pgfplots.polar, backgrounds, external}
\tikzexternalize[prefix=./figures/tikz/]
\begin{document}
\begingroup
\thispagestyle{empty}
\begin{center}
{
\resizebox{\linewidth}{!}{\tt FIRST PAGE}} \\[10pt]
\vspace{0.75\baselineskip}
\Huge \tt SUBTITLE
\end{center}
\vfill
\begin{flushleft}
\Large
AUTHOR\\
\vfill
THE PUBLISHER {\normalsize 2018}
\end{flushleft}
\AddToShipoutPictureBG*{\tikzexternaldisable
\begin{tikzpicture}[opacity=0.5]\node at
(0,0){\includegraphics[width=\paperwidth,height=\paperheight]{background.pdf}};
\end{tikzpicture}
\tikzexternalenable}
\endgroup
\end{document}
\documentclass{article}
\def\def{\empty}
\begin{document}
\section*{Hello}
\end{document}
这个想法是简单地使用 Ti钾改为 Z 不透明度。