Since I'm getting complaints trying to include a graphic within the \chapter
-command's argument, here's what worked for me:
This is more than anything a hack, But one thing you can do is to include the graphic in the next line and move it up with a negative \vspace
. You can use any unit, but I believe it's best to use something like \baselineskip
which is contextually defined rather than an absolute unit like mm or pt for the height of the vertical space. Be sure to include a positive \vspace
afterwards to avoid squeezing the body of the chapter to the caption.
If you want to have a graphic to go with all your chapters, you can pack all of this into a macro which behaves like chapter except that it expects a second argument referencing a figure, like so:
\documentclass[final]{book}
\usepackage{graphicx, ifthen}
\newcommand{\mychapter}[3][\empty]{%
\ifthenelse{\equal{#1}{\empty}}% check whether optional parameter is empty
{\chapter[#2]{#2}}%
{\chapter[#1]{#2}}%
{\Huge %
\vspace{-2.2\baselineskip} % move up
\hfill % move graphic right
\includegraphics[height=10mm]{#3} % include graphic
\vspace{\baselineskip} % move down before body starts
}% delimit scope of \Huge
}
\begin{document}
\tableofcontents
\mychapter[toc title]{A chapter}{Logo-univie}%different title in TOC and heading
\mychapter{Another chapter}{Logo-univie}%same title everywhere
Some text
\end{document}
NOTE: Edited to preserve the optional argument of \chapter
.
figure
environment. You may specify your image command directly into the\chapter{..}
, though depending on the height it may look very odd. If you need more assistance please provide a MWE and probably a screenshot showing us your desired Output.