我正在嘗試為文檔章節創建一個精美的封面,其中我想包含與內容相關的圖片,為此我創建了一個minipage
環境,在其中放置了tikzpicture
包含章節標題的環境,一些灰色背景來模擬一些陰影和圖像本身。然而,圖像檔案的大小與盒子的大小不同minipage
,它會「洩漏」。
是否有參數或方法可以解決此問題,以便我可以升級影像,同時限制其僅在環境內列印minipage
?我確實找到了這個解決方案(將影像裁剪為方框)但我很挑剔地更換,minipage
所以我保留了該章的標籤。
這是我到目前為止得到的程式碼:
\usepackage{tikz,lipsum}
\usepackage{geometry}\geometry{letterpaper, margin=1in}
\thispagestyle{empty}
\begin{minipage}[b][6cm]{\paperwidth}
\begin{tikzpicture}[remember picture, overlay]
\draw[fill=gray, xshift=-3cm] (current page.north west) rectangle (\paperwidth, 0cm); %% grey shadow rectangle
\node[yshift=9cm, opacity=0.5] at (current page.center)
{\includegraphics[scale=0.75]{nilum}}; %% the image
\node[rectangle, rounded corners=8pt, fill=blue] at (1.5,0)
{\Huge\bfseries\color{red} Chapter one}; %% chapter title
\end{tikzpicture}
\end{minipage}\vspace{3em}
\lipsum[1]