I have this short example derived from this XeTeX CV template, which uses margin notes to show years. You can use the Mandrill picture for pic.jpg
, and you could also use the original template to reproduce the issue instead of this SSCE.
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[10pt, a4paper]{article}
\usepackage{fontspec}
% DOCUMENT LAYOUT
\usepackage{geometry}
\geometry{a4paper, textwidth=5.5in, textheight=8.5in, marginparsep=7pt, marginparwidth=.6in}
\setlength\parindent{0in}
% FONTS
\usepackage{xunicode}
\usepackage{xltxtra}
\defaultfontfeatures{Mapping=tex-text} % converts LaTeX specials (``quotes'' --- dashes etc.) to unicode
\setromanfont [Ligatures={Common},Numbers={OldStyle}]{Adobe Caslon Pro}
\setmonofont[Scale=0.8]{Monaco}
\setsansfont[Scale=0.9]{Optima Regular}
% ---- MARGIN YEARS
\usepackage{marginnote}
\newcommand{\years}[1]{\marginnote{\scriptsize #1}}
\renewcommand*{\raggedleftmarginnote}{}
\setlength{\marginparsep}{7pt}
\reversemarginpar
\usepackage{wrapfig}
% DOCUMENT
\begin{document}
\begin{wrapfigure}[1]{r}{.2\linewidth}
\centering
\includegraphics[width=1\linewidth]{pic.jpg}
\end{wrapfigure}
\section*{Education}
\noindent
\years{2011} Mandrill College\\
\end{document}
Ideally, it should show the following:
But as soon as I include the wrapfigure
, this becomes:
The margin note simply disappears. There are no warnings displayed. Now, I've already observed that the placement of the figure relative to where the margin notes should be displayed doesn't matter. In my real CV I'd place the figure top right and the sections with Education etc. would be much further down the page.
So my questions
- Why does this fail?
- What do I have to change to have the years displayed again?
- If I can't use
wrapfig
to insert a floating figure at the top right no matter what the text, what should I use instead?