No need for extra packages; simply include your image with a standard \includegraphics
and use \smash
, as in
The Netherlands\hfill
\smash{\includegraphics[width=3cm]{example-image-a}}
A complete example:
The code:
\documentclass[10pt,a4paper]{article}
\usepackage[a4paper,margin=0.75in]{geometry}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{resume}
\begin{document}
\sloppy
\maintitle{Cies Breijs}{June 12, 1982}{}
\nobreakvspace{0.3em}
\noindent\href{mailto:cies.at.kde.dot.nl}{cies\mbox{}@\mbox{}kde.nl}\sbull
\textsmaller{+}31.646469087\sbull
{cies010} \emph{(Skype)}\sbull
\href{http://www.linkedin.com/in/ciesbreijs}{www.linkedin.com/in/ciesbreijs}
\\
Mathenesserplein 84\sbull
3022\thinspace {\large \sc ld}\sbull
Rotterdam\sbull
The Netherlands\hfill
\smash{\includegraphics[width=3cm]{example-image-a}}
\spacedhrule{0.9em}{-0.4em}
\roottitle{Summary}
\end{document}
Update
If the image's height is too big, one could reduce it in \includegraphics
, as in
\includegraphics[height=2cm]{example-image-a}
or use instead something like
The Netherlands\hfill
\raisebox{-.5\totalheight}[0pt][.5\totalheight]{\includegraphics[width=3cm,height=5cm]{example-image-a}}
Update redefining \chapterlinesformat
Since KOMA-Script version 3.19 the command \chapterlinesformat
can be redefined to change the layout of chapter titles that have no prefix line. Now it is possible to set a different entry for the page headings or to use the starred versions of the chapter title command. Chapter titles with more than one line are possible too.
The following example uses open=any
to show that it also works on left handed pages.
\documentclass[open=any]{scrbook}[2015/10/03]
%\providecommand*\Ifthispageodd{\ifthispageodd}% needed up to and including KOMA-Script version 3.27, see https://komascript.de/faq_deprecatedif
\usepackage{blindtext}% dummy text
\usepackage{tikz}
\usetikzlibrary{positioning}
\RedeclareSectionCommand[
beforeskip=1sp minus 1sp,
afterskip=4\baselineskip plus .5ex minus .5ex
]{chapter}
\newcommand*\chapterimageheight{.5\paperwidth}% height of the chapter images
\newcommand*\chapterboxvoffset{1cm}% offset from text bottom to image bottom
\newcommand*\chapterboxhoffset{1cm}% offset from outer text margin to outer box border
\newcommand*\chapterboxwidth{\textwidth+1cm}% width of the chapter box
\newcommand*\chapterboxsep{1em}% inner sep of the chapter box
\definecolor{ocre}{RGB}{243,102,25}
\colorlet{chapterbordercolor}{ocre}
\tikzset{
chapterbox/.style={
line width=2pt,rounded corners=20pt,draw=chapterbordercolor,
fill=white,fill opacity=.5,text opacity=1,
inner sep=\chapterboxsep,
font=\usekomafont{disposition}\usekomafont{chapter}\huge
}
}
\makeatletter
\newcommand*\@chapterimage{example-image.pdf}
\newcommand*\chapterimage[1]{\renewcommand*\@chapterimage{#1}}
\renewcommand\chapterlinesformat[3]{%
\vspace*{\dimexpr-1in-\headsep-\headheight-\topmargin-1ex\relax}%
\Ifthispageodd
{\hspace*{\dimexpr-1in-\oddsidemargin\relax}%
\tikzset{chapterboxpos/.style={
anchor=south east,
above left= \chapterboxvoffset and \chapterboxhoffset of bb.south east
}}%
}
{\hspace*{\dimexpr\textwidth+1in+\oddsidemargin-\paperwidth\relax}%
\tikzset{chapterboxpos/.style={
anchor=south west,
above right= \chapterboxvoffset and \chapterboxhoffset of bb.south west
}}%
}%
\makebox[0pt][l]{%
\parbox[b][\chapterimageheight][b]{\paperwidth}{%
\begin{tikzpicture}[inner sep=0pt,outer sep=0pt]
\node[use as bounding box,minimum width=\paperwidth,minimum height=\chapterimageheight](bb){};
\node[anchor=center] at (bb.center)
{\includegraphics[width=\paperwidth,height=\chapterimageheight]
{\@chapterimage}};
\node[chapterbox,chapterboxpos]
{\parbox{\dimexpr\chapterboxwidth-\chapterboxsep*2\relax}{\@hangfrom{#2}{\raggedchapter#3}}};
\end{tikzpicture}%
}%
}%
}%
\makeatother
\begin{document}
\chapterimage{chapter_head_1}
\tableofcontents
\addchap*{Unnumbered Chapter without entry in table of contents}
\Blindtext
\addchap{Unnumbered Chapter with entry in table of contents}
\Blindtext[2]
\chapter{Numbered chapter}
\blindtext
\chapter[Numbered chapter with long title]{Numbered chapter that is really long and needs more than one line}
\chapterimage{chapter_head_2}% change the image
\colorlet{chapterbordercolor}{purple!80!black}% change the bordercolor
\Blindtext[10]
\blinddocument
\end{document}
Run twice (because \Ifthispageodd
) to get
Best Answer
I think the beautiful way to obtain your expected result is to modify the template. Here i provide you a ugly (in term of LaTeX behavior) solution to make it easy
This solution need to be avoided if it is possible but it works well for you.