帮助确定书籍图片的尺寸

帮助确定书籍图片的尺寸
\documentclass{article}

\usepackage[papersize={11in,8.5in},margin=0in]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}

\parindent=0pt

\begin{document}

\begin{tikzpicture}%
\node[anchor=south west, inner sep=0] (X) at (0,0){\includegraphics[width=10in]{ScreenShot}};%

\begin{scope}[x={(X.south east)},y={(X.north west)}]%
%% This makes all measurements with no units into fractions of the width
%% and height of the graphic contained in the node.
\fill[fill = white,fill opacity=0.6] ($(X.south west) + (0,1in)$) rectangle ($(X.north east) - (0,1in)$);%
\node[text width=10in] (Z) at (0.5,0.5) {%
    \sffamily\centering\Huge Clustering the interstellar medium\\[5pt]
  \normalsize Data Mining and Machine Learning in Astronomy\\[15pt]
  \large Andrea Hidalgo\par%
};
\end{scope}%
\end{tikzpicture}

\end{document}  

@Sgmoye 向我展示了在图像上显示透明文本的解决方案。

我的问题是:我必须如何更改该代码或添加什么才能使图像与纸张大小相同但不在横向模式下显示。我尝试了一些方法来解决这个问题,但没有成功。(实际上,我为图​​像增加了一些高度,但看起来很奇怪)。有什么帮助吗?

这就是我想要的结果:页面一半的图像必须是透明的。

在此处输入图片描述

答案1

另一种解决方案是使用background包来包含背景图像并tikzpicture定义文本的透明节点。

\documentclass[a4paper]{article}

\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{calc}

\parindent=0pt

\usepackage[pages=some]{background}
\backgroundsetup{%
contents={\includegraphics[width=\paperwidth,height=\paperheight]{frog}}, 
angle=0,
scale=1
}

\begin{document}
\BgThispage

\begin{tikzpicture}[remember picture, overlay]

\node[minimum width=\paperwidth, minimum height=10cm, outer sep=0pt, fill=green!30, fill opacity=0.5, text opacity=1, align=center] at (current page.center) {%
    \sffamily\Huge Clustering the interstellar medium\\[5pt]
  \normalsize Data Mining and Machine Learning in Astronomy\\[15pt]
  \large Andrea Hidalgo\par%
};
\end{tikzpicture}

\end{document}  

在此处输入图片描述

答案2

像这样?

\documentclass{article}

\usepackage[papersize={11in,8.5in},margin=0in]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}

\parindent=0pt

\begin{document}

\begin{tikzpicture}[remember picture,overlay]%
\node[inner sep=0] (X) at (current page.center){\includegraphics[width=\paperwidth,height=\paperheight]{example-image-a}};%

%% This makes all measurements with no units into fractions of the width
%% and height of the graphic contained in the node.
\fill[fill = white,fill opacity=0.4] (current page.south west)  rectangle ($(current page.south east)  + (0,2in)$);%
\fill[fill = white,fill opacity=0.4] (current page.north west) rectangle ($(current page.north east) + (0,-2in)$);%
\node[text width=10in] (Z) at (current page.center) {%
    \sffamily\centering\Huge Clustering the interstellar medium\\[5pt]
  \normalsize Data Mining and Machine Learning in Astronomy\\[15pt]
  \large Andrea Hidalgo\par%
};
\end{tikzpicture}
\clearpage

\end{document}

在此处输入图片描述

或这个:

\documentclass{article}

\usepackage[papersize={11in,8.5in},margin=0in]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}

\parindent=0pt

\begin{document}

\begin{tikzpicture}[remember picture,overlay]%
\node[inner sep=0,fill = white,fill opacity=0.4] (X) at (current page.center){\includegraphics[width=\paperwidth,height=\paperheight]{example-image-a}};%

\node[inner sep=0] (X) at (current page.center){\includegraphics[width=\paperwidth,height=0.4\paperheight]{example-image-b}};%

%% This makes all measurements with no units into fractions of the width
%% and height of the graphic contained in the node.
%\fill[fill = white,fill opacity=0.4] (current page.south west)  rectangle ($(current page.south east)  + (0,2in)$);%
%\fill[fill = white,fill opacity=0.4] (current page.north west) rectangle ($(current page.north east) + (0,-2in)$);%
\node[text width=10in] (Z) at (current page.center) {%
    \sffamily\centering\Huge Clustering the interstellar medium\\[5pt]
  \normalsize Data Mining and Machine Learning in Astronomy\\[15pt]
  \large Andrea Hidalgo\par%
};
\end{tikzpicture}
\clearpage

\end{document}

在此处输入图片描述

答案3

前言#1:我在最后的评论之前就开始研究这个问题了,所以现在我恐怕我误解了你在寻找什么,但是改编应该很容易。

序言#2:这绝对不是最好的解决方案,但我正在努力学习,所以我尝试了一下

以下是我的想法

\documentclass{article}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}
{
\noindent\fboxsep=0pt%
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
\node[inner sep=0pt] at (current page.center){\includegraphics[width=\paperwidth,height=\paperheight]{books}};
\node[inner sep=0pt] at (current page.center){\includegraphics[width=\paperwidth,height=0.33\paperheight]{messydesk}};
\node[opacity=0.8,inner sep=0pt]  at (current page.center) {%
    \colorbox{white}{\parbox[c][.33\paperheight][c]{\paperwidth}{~}}
};
\node[ text width=10in]  at (current page.center) {%
    \sffamily\centering\Huge Clustering the interstellar medium\\[5pt]
  \normalsize Data Mining and Machine Learning in Astronomy\\[15pt]
  \large Andrea Hidalgo\par%
};
\end{tikzpicture}
}
\clearpage
%the actual document
\end{document}

第一个node创建大图像,第二个创建较小的图像(我现在认为你可能想要摆脱这个),第三个创建一个不透明的白色框模拟“透明度”,最后一个是实际的文本

结果如下:(编辑:灰色部分是我的 acroread 背景,效果较差的快照)

覆盖

图片来源(无意侵权:www.smithsonianmag.com/innovation/what-your-messy-desk-says-about-you-its-a-good-thing-70291/http://www.alegriphotos.com/Side_of_books-lphoto-93560f5b4dcc9fc387c117d24a686161.html

相关内容