I've been learning LaTeX and this community has been very helpful. Currently, I'm trying to set up corporate letters but as a newbie I'm encountering a variety of challenges, so I'm posting them one by one instead of putting it in the comments... maybe this helps others as well.
Anyway, I am trying to implement this answer that indicates that I can use vbox to float an image to the right of my header. I almost have this working, but I now try to adjust this to get my logo to stick to the top of the page. So I want to have this at the right top of my document. This is quite difficult! When I place the vbox, it creates unwanted spacing, for some odd reason. So I can not get the logo to be at the right top, even though I 'reset' every possible margin to 0 (in my opinion). Here is my distilled code:
\documentclass[a4paper]{article}
\usepackage{graphicx}
\graphicspath{{./img/}}
\usepackage{color}
\usepackage{xcolor}
\definecolor{orange}{HTML}{DD4616}
\definecolor{white}{HTML}{FFFFFF}
\usepackage{fullpage}
\usepackage[margin=0cm, paperwidth=215.9mm, paperheight=30mm,top=0cm]{geometry}
\parindent=0pt
\begin{document}
\fboxsep0pt
\pagecolor{orange}
\fbox{\vbox to 0pt{\hfill\fbox{\includegraphics[height=3cm]{logo}}}}
\end{document}
I've used a full black logo for illustrative purposes. Here you can see this:

The black line is the vbox border. For some reason, it jumps down. The only way to get rid of this that I found out about is this:
Which means that I need to add:
\edef\theprevdepth{\the\prevdepth}\nointerlineskip
\vbox to 0pt{...}\prevdepth=\theprevdepth
But there are two problems with this:
- I get an error with I try this (Improper
\prevdepth.) - More importantly, I really want to understand my code at this point, and get to master the basics of positioning elements. This feels overcomplicated and I do not understand it at all.
Is there any easy way to position an image at the right top of a document?


