1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| \documentclass{book}
%% todonote_custom_MWE.tex fonctionnement ok sur les liens
\usepackage[english,french]{babel}%pour un document en français
\usepackage[cyr]{aeguill}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lipsum} % Dummytext
%---------------------------------------------------------------------------------
\usepackage{hyperref}%rend actif les liens, références croisée, toc, ...
\hypersetup{colorlinks,%
citecolor=blue,%
filecolor=blue,%
linkcolor=orange,%ou bien blue
urlcolor=blue}
\usepackage{xargs} % Use more than one optional parameter in a new commands
\usepackage[pdftex,dvipsnames]{xcolor} % Coloured text etc.
\usepackage[colorinlistoftodos,french,prependcaption,textsize=tiny]{todonotes}
%liste de nouvelles commandes customisée
\newcommandx{\info}[2][1=]{\todo[linecolor=OliveGreen,backgroundcolor=OliveGreen!25,bordercolor=OliveGreen,#1]{#2}}
%---------------------------------------------------------------------------------
% part of custom is not compatible with hyperref
\makeatletter
\def\myaddcontentsline#1#2#3#4{%
\phantomsection
\addtocontents{#1}{\protect\contentsline{#2}{#3}{see \thesection\ at page \thepage}{#4}}}{}%
\renewcommand{\@todonotes@addElementToListOfTodos}{%
\if@todonotes@colorinlistoftodos%
\myaddcontentsline{tdo}{todo}{{%
\colorbox{\@todonotes@currentbackgroundcolor}%
{\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
\ \@todonotes@caption}}{blalbla}%
\else%
\myaddcontentsline{tdo}{todo}{{\@todonotes@caption}}{blabla}%
\fi}%
\newcommand*\mylistoftodos[1][nom par défaut]{%
\begingroup
\setbox\@tempboxa\hbox{see 9.9 at p. 99}%
\renewcommand*\@tocrmarg{\the\wd\@tempboxa}%
\renewcommand*\@pnumwidth{\the\wd\@tempboxa}%
\listoftodos[#1]%
\endgroup
}
\makeatother
%---------------------------------------------------------------------------------
\begin{document}
\chapter{démo de todonotes}
\lipsum[1]\info{il faut bien en faire une}
\lipsum[1]\info{il faut bien en faire deux}
\lipsum[1]\info{il faut bien en faire trois}
\mylistoftodos[Liste des points a traiter...]
\end{document} |
Partager