![如何将图形/图像放置在目录元素旁边](https://linux22.com/image/419784/%E5%A6%82%E4%BD%95%E5%B0%86%E5%9B%BE%E5%BD%A2%2F%E5%9B%BE%E5%83%8F%E6%94%BE%E7%BD%AE%E5%9C%A8%E7%9B%AE%E5%BD%95%E5%85%83%E7%B4%A0%E6%97%81%E8%BE%B9.png)
答案1
在这里我使用在目录中指定单独标题的功能来添加图形(如果需要),通过搭接。
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\tableofcontents
\noindent\hrulefill
\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 number\hfill\rlap{\kern20pt\includegraphics%
[height=\baselineskip]{example-image}}}]{Right of page number}
\end{document}
补充
\chapter
为了回应关于在课堂上使用book
以及图像垂直对齐的评论,我提供了额外的 MWE:
\documentclass[a4paper,openright]{book}
\usepackage{graphicx}
\DeclareRobustCommand\addimg[1]{\llap{\raisebox{-\dp\strutbox}%
{\includegraphics[height=\baselineskip]{#1} \kern20pt}}}
\begin{document}
\tableofcontents
\noindent\hrulefill
\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}