TeX - LaTeX Asked by Hekmil on April 10, 2021
I am searching to put a figure/image next to a TOC chapter element.
At the moment I only found a way to put it just under it but not either before the number of the chapter or after the page.
addstufftotoc{nobreakprotectincludegraphics[height=1baselineskip]{Image/en.jpg}par}
Here I use the feature of specifying a separate heading in the toc to add the graphic, via lap, if necessary.
documentclass{article}
usepackage{graphicx}
begin{document}
tableofcontents
noindenthrulefill
section{Normal section}
section[{llap{includegraphics[height=baselineskip]{example-image}%
kern20pt}Left of section number}]{Left of section number}
section[{Right of title includegraphics[height=baselineskip]{example-image}}]%
{Right of title}
section[{Right of page numberhfillrlap{kern20ptincludegraphics%
[height=baselineskip]{example-image}}}]{Right of page number}
end{document}
SUPPLEMENT
In response to comments about the use of chapter
in the book
class, and vertical alignment of the image, I provide an additional MWE:
documentclass[a4paper,openright]{book}
usepackage{graphicx}
DeclareRobustCommandaddimg[1]{llap{raisebox{-dpstrutbox}%
{includegraphics[height=baselineskip]{#1} kern20pt}}}
begin{document}
tableofcontents
noindenthrulefill
chapter[addimg{example-image}Left of section number]{Left of section number}
chapter[addimg{example-image}Machines d'audit et processus MCO et MCS]{Machines d'audit et processus MCO et MCS}
end{document}
Correct answer by Steven B. Segletes on April 10, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP