關於這兩個問題Tikz - 橫向模式下兩頁三張圖片和Tikz - 突出顯示圖像中的文本,我努力將給定的解決方案放在一起(否則對我來說效果很好)以突出顯示圖 A 中的一部分。
上下文是我有兩頁(橫向模式下的 A4),上面有三張圖片,而中間的一張圖片橫跨兩頁。現在我想突出顯示第一張圖片的一部分,但未能突出顯示所需的部分,並將其餘部分減少為不透明的黑色。
這是我的程式碼:
\documentclass{article}
\usepackage[margin=0cm, top=0cm, bottom=0cm, outer=0cm, inner=0cm, landscape, a4paper]{geometry}
\pagestyle{empty}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[overlay,remember picture]
\pgfmathsetmacro{\mywidth}{2*\paperwidth/3-1cm} % kept local
\node at ([xshift=-\paperwidth/6-1cm]current page.center){%
\includegraphics[width=\mywidth pt,height=\paperheight]{example-image-a}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\fill[even odd rule,opacity=0.4]
(0.11,0.4) -- (0.37,0.404) -- (0.37,0.414) -- (0.11,0.41) -- cycle
(0,0) rectangle (1,1);
\end{scope}
\node at (current page.east){%
\includegraphics[width=\mywidth pt,height=\paperheight]{example-image-b}};
\end{tikzpicture}
~
\clearpage
\begin{tikzpicture}[overlay,remember picture]
\pgfmathsetmacro{\mywidth}{2*\paperwidth/3-1cm} % kept local
\node (image) at ([xshift=\paperwidth/6+1cm]current page.center){%
\includegraphics[width=\mywidth pt,height=\paperheight]{example-image-c}};
\node at (current page.west){%
\includegraphics[width=\mywidth pt,height=\paperheight]{example-image-b}};
\end{tikzpicture}
\end{document}
我認為我無法突出顯示圖像的某些部分,因為它不在小型頁面環境中。我能做些什麼?
答案1
如果我添加缺少的節點名稱(image)
,我會得到
\documentclass{article}
\usepackage[margin=0cm, top=0cm, bottom=0cm, outer=0cm, inner=0cm, landscape, a4paper]{geometry}
\pagestyle{empty}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[overlay,remember picture]
\pgfmathsetmacro{\mywidth}{2*\paperwidth/3-1cm} % kept local
\node (image) at ([xshift=-\paperwidth/6-1cm]current page.center){%
\includegraphics[width=\mywidth pt,height=\paperheight]{example-image-a}};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\fill[even odd rule,opacity=0.4]
(0.11,0.4) -- (0.37,0.404) -- (0.37,0.414) -- (0.11,0.41) -- cycle
(0,0) rectangle (1,1);
\end{scope}
\node at (current page.east){%
\includegraphics[width=\mywidth pt,height=\paperheight]{example-image-b}};
\end{tikzpicture}
~
\clearpage
\begin{tikzpicture}[overlay,remember picture]
\pgfmathsetmacro{\mywidth}{2*\paperwidth/3-1cm} % kept local
\node (image) at ([xshift=\paperwidth/6+1cm]current page.center){%
\includegraphics[width=\mywidth pt,height=\paperheight]{example-image-c}};
\node at (current page.west){%
\includegraphics[width=\mywidth pt,height=\paperheight]{example-image-b}};
\end{tikzpicture}
\end{document}
作為我的水晶球被偷了,我不知道這是否是你想要強調的部分。 ;-)