I have been using this code to put an image next to a chapter title in my TOC :

\DeclareRobustCommand\addimg[1]{\llap{\raisebox{-\dp\strutbox}{\includegraphics[height=\baselineskip]{#1} \kern20pt}}}

\chapter[\addimg{en.jpg}Machines d'audit et processus MCO et MCS]{Machines d'audit et processus MCO et MCS}

It works just fine but it's messing with my header as you can see here : enter image description here

I can't find a proper solution to keep my TOC as it is and remove the image (or maybe move it ?).

Here are my \fancyhead definition :

\fancyhead[LE]{\bf \changefont \leftmark} 
\fancyhead[RO]{\bf \changefont \leftmark}

Thanks for any help !


\usepackage[T1]{fontenc}      % Format d'encodage
\usepackage[french]{babel}    % Langue français
\usepackage[left=2.5cm, right=2.5cm, top=2.5cm, bottom=2.5cm]{geometry}

\DeclareRobustCommand\addimg[1]{\llap{\raisebox{-\dp\strutbox}{\includegraphics[height=\baselineskip]{#1} \kern20pt}}}

% Table float box with bottom caption, box width adjusted to content


  basic/.style  = {draw, text width=2cm, drop shadow, font=\sffamily, rectangle},
  root/.style   = {basic, rounded corners=2pt, thin, align=center, fill=green!30},
  level 2/.style = {basic, rounded corners=6pt, thin,align=center, fill=green!60, text width=8em},
  level 3/.style = {basic, thin, align=left, fill=pink!60, text width=6.5em}

\newcommand{\addstufftotoc}[2][toc]{% \addimagetotoc[<toc>]{<stuff>}


\fancyhead[LE]{\bf \changefont \leftmark} 
\fancyhead[RO]{\bf \changefont \leftmark}


\enspace Chapitre \thechapter\enspace}%




\chapter[\addimg{en.jpg}Machines d'audit et processus MCO et MCS]{Machines d'audit et processus MCO et MCS \label{chap:Machinesaudit}}


  • 1
    could you upload code as MWE so that we can compile it and see the problem
    – js bibra
    Sep 13, 2020 at 14:33
  • I've updated with MWE, it should work
    – Hekmil
    Sep 13, 2020 at 14:40
  • 1
    works fine - no messing with headers -- did you compile the above code -- did it reproduce your problem
    – js bibra
    Sep 13, 2020 at 14:51
  • My bad it's messing with the header only for the pages after the title of the chapter, so adding text or lipsum
    – Hekmil
    Sep 13, 2020 at 15:06
  • Updated with \pagebreak
    – Hekmil
    Sep 13, 2020 at 15:12

1 Answer 1


Untested, but this should work:

\fancyhead[LE]{\renewcommand{\addimg}[1]{}\bf \changefont \leftmark} 
\fancyhead[RO]{\renewcommand{\addimg}[1]{}\bf \changefont \leftmark}
  • Hum, doesn't change anything for me
    – Hekmil
    Sep 13, 2020 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .