图形紧贴页面边框

图形紧贴页面边框

使用

\begin{tikzpicture}
\draw (0, 0) node[inner sep=0] {\includegraphics[width=\paperwidth]{kleurlabel}};
\draw (5.9,0) node (example-tabular) {
\begin{tabular}{rr}
\LARGE\color{white}\bfseries Faculteit Geneeskunde en \\
\LARGE\color{white}\bfseries Gezondheidswetenschappen \\
\end{tabular}
};
\end{tikzpicture}

结合使用\usepackage[left=2.5cm,right=1cm,top=2.5cm,bottom=0cm]{geometry}会将图像打印在页边距上,因此距离实际页面边框 2.5 厘米。我怎样才能将其打印在页面边框上?

谢谢。

M.

工作示例:

\documentclass[11pt,x11names]{report}

\usepackage[left=2.5cm,right=1cm,top=2.5cm,bottom=0cm]{geometry}
\usepackage[dutch]{babel}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{tikz}

\renewcommand{\familydefault}{\sfdefault}
\usepackage[scaled=0.92]{helvet}

\begin{document}

\definecolor{blueXIIdark}{cmyk}{1,.8,.30,.05}
\definecolor{blueXIIlight}{cmyk}{.0,.30,1,.00}

\vspace{5cm}

\begin{tikzpicture}
\draw (0, 0) node[inner sep=0] {\includegraphics[width=\paperwidth]{kleurlabel}};
\draw (5.9,0) node (example-tabular) {
\begin{tabular}{rr}
\LARGE\color{white}\bfseries Faculteit Geneeskunde en \\
\LARGE\color{white}\bfseries Gezondheidswetenschappen \\
\end{tabular}
};
\end{tikzpicture}

\vspace{5cm}

\Huge\color{blueXIIdark} Hello world!

\vspace{7cm}

\large\color{black}
\begin{tabularx}{\textwidth}{Xr}
& \textbf{\Large Micha\"el Henrotte}\vspace{0.8cm}\\
  Promotor: & Eerste bachelor in de geneeskunde \\
Prof. dr. V. Achternaam & UGent stamnummer 01404753\vspace{2cm}\\
& Academiejaar 2014--2015
\end{tabularx}

\vspace{1.5cm}
\noindent\makebox[\linewidth]{\color{blueXIIlight}\rule{30cm}{8pt}}
\end{document}

使用的图像: 在此处输入图片描述

答案1

我刚刚将您的图片下载为 OQUUD.jpg,并使用了我的方法使图片水平填满页面并保持在顶部

如果你想要页面底部的图像,你可以将一行更改为

\atxy{0in}{\paperheight}{\includegraphics[width=\paperwidth]{OQUUD}}

这是 MWE

\documentclass[10pt,a4paper]{report}
\usepackage[utf8]{inputenc}
%% Graphics
\usepackage{graphicx}
\usepackage{everypage}
\usepackage{lipsum}
% THESE ARE LaTeX DEFAULTS; CAN CHANGE IF NEEDED.
\def\PageTopMargin{1in}
\def\PageLeftMargin{1in}
\newcommand\atxy[3]{%
 \AddThispageHook{\smash{\hspace*{\dimexpr-\PageLeftMargin-\hoffset+#1\relax}%
  \raisebox{\dimexpr\PageTopMargin+\voffset-#2\relax}{#3}}}}
% VERIFIED THAT SETTING \hoffset AND \voffset DO NOT BREAK SOLUTION.
%\hoffset=0.4in
%\voffset=0.2in
\atxy{0in}{0in}{\raisebox{-\height}{\includegraphics[width=\paperwidth]{OQUUD}}}
\begin{document}
%% Titlepage
\vspace*{.2in}
\lipsum[1]
\end{document}

在此处输入图片描述

答案2

TikZ引入current page节点和选项overlay并将remember picture其放置tikzpictures在当前页面的固定位置。

由于此节点不会使用页面上的任何空间,\vspace都必须添加一些额外或更改顶部边距以开始横幅下方的文本。

\documentclass[11pt,x11names]{report}

\usepackage[left=2.5cm,right=1cm,top=2.5cm,bottom=0cm]{geometry}
\usepackage[dutch]{babel}
\usepackage{tikz}
\usetikzlibrary{positioning}

\usepackage{lipsum}

\renewcommand{\familydefault}{\sfdefault}
\usepackage[scaled=0.92]{helvet}

\begin{document}

\definecolor{blueXIIdark}{cmyk}{1,.8,.30,.05}
\definecolor{blueXIIlight}{cmyk}{.0,.30,1,.00}

\begin{tikzpicture}[remember picture, overlay]
\node[inner sep=0, anchor=north west] at (current page.north west) (banner) {\includegraphics[width=\paperwidth]{OQUUD}};
\node[text=white, font=\LARGE\bfseries, align=right, above left= of banner.south east]  (example-tabular) {
Faculteit Geneeskunde en \\
Gezondheidswetenschappen
};
\end{tikzpicture}

\vspace{3cm}
\lipsum[1-3]

\end{document}

在此处输入图片描述

相关内容