luatodonotes 软件包 colorinlistoftodos 选项中存在错误

luatodonotes 软件包 colorinlistoftodos 选项中存在错误

为了按自己的待办事项排序,我认为使用 luatodonotes 是正确无误的,但事实上我遇到了问题。

为了区分不同类型的待办事项,可以使用 colorinlistoftodos 选项加载 todonotes 包,该选项会在待办事项列表中添加小彩色方块。 \usepackage[colorinlistoftodos]{todonotes}

但是在我的mwe colorinlistoftodos选项中不起作用为什么?

\documentclass{article}
% test_todonote_4auteurs_02 owner and counter
\usepackage{hyperref}
\usepackage{lipsum}
\usepackage{xspace}
\usepackage{etoolbox}

\hypersetup{
    pdfauthor = {me},
    pdftitle = {Fascicule  },
    pdfsubject = {Tutoriel },
    colorlinks=true,
    citecolor=blue,
    anchorcolor = white,
    filecolor=blue,
    breaklinks=true,        
    linkcolor=blue,
    urlcolor=orange}


% why bug with colorinlistoftodos option
%\usepackage[colorinlistoftodos,french,shadow,prependcaption,leadertype=sBezier,textsize=tiny]{luatodonotes}

\usepackage[french,shadow,prependcaption,leadertype=sBezier,textsize=small]{luatodonotes}
\setlength{\marginparwidth}{2.5cm}





\makeatletter
\newcommand\@todonotes@owner{default}
\define@key{todonotes}%
{owner}{\def\@todonotes@owner{#1}}

\newtoggle{ownerdefault}
\newtoggle{ownerchange}
\newtoggle{ownerB}
\newtoggle{ownerfaq}
\newtoggle{ownergerarld}

%---------------------------------------------------------------------------------
%---------------------------------------------------------------------------------
\newcommand\stR[2]{% 1st reviewer comment
    \todo[%
    owner=default,
    author=1st Reviewer,line,caption={1st Reviewer #1 },color=blue!20%
    ]%
    {Commentaire :#1 }{\color{blue}{\bfseries#2}}}
%---------------------------------------------------------------------------------
%---------------------------------------------------------------------------------
\newcommand\ndR[2]{% 2nd reviewer comment
    \todo[%
    owner=B,
    author=2nd Reviewer,line,caption={2nd Reviewer #1 },color=red!50!white%
    ]%
    {Commentaire :#1 }{\color{red}{\bfseries#2}}}
%---------------------------------------------------------------------------------

%------------------------ Version N°5 du 5-2-2024 --------------------------------
%Nouvelle formule pour intégrer un auteur owner=faq dans le but de les trier par auteur
% la finalité est de faire une liste de note au fil de l'eau avec une recap triée en début de doc triée
% le drapeau \toggletrue{ownerfaq}  les autres mis à false
%---------------------------------------------------------------------------------
\newcounter{todoListFAQ}
\newcommand{\todofaq}[1]{
    \refstepcounter{todoListFAQ}%
    #1% je répète le champ pour pas à l'avoir à écrire 3 fois ?????
    \todo[%
    owner=faq,color=green!20,%couleur du texte au coeur, du lien et de de la bulle
    caption={\protect\hypertarget{todo\thetodoListFAQ}{}\textbf{Note N°\thetodoListFAQ} #1}]
    {\hyperlink{todo\thetodoListFAQ}{\fcolorbox{blue}{yellow}{$\uparrow$}}}}
%---------------------------------------------------------------------------------

%---------------------------------------------------------------------------------  
%------------------------ Version N°5 du 5-2-2024 --------------------------------
%in order to sort by gerarld owner
% flag \toggletrue{ownergerarld}  put true the other  false
%---------------------------------------------------------------------------------
\newcounter{notegerarld}
\newcommand{\notegerarld}[1]{
    \refstepcounter{notegerarld}%
    #1%
    \todo[%
    owner=gerarld,color=red!50!white,%
    caption={\protect\hypertarget{todo\thenotegerarld}{}\textbf{Rem. G. N°\thenotegerarld} #1}]
    {\hyperlink{todo\thenotegerarld}{\fcolorbox{blue}{yellow}{$\uparrow$}}}}
%---------------------------------------------------------------------------------

%---------------------------------------------------------------------------------      
%------------------------ Version N°5 du 5-2-2024 --------------------------------
%in order to sort by gerarld owner change
% flag \toggletrue{ownerchange}  put true the other  false
%---------------------------------------------------------------------------------
\newcounter{changecount}
\newcommand{\change}[1]{
    \refstepcounter{changecount}%
    #1% 
    \todo[%
    owner=change,color=blue!50!white,%
    caption={\protect\hypertarget{todo\thechangecount}{}\textbf{Rem. F.N°\thechangecount} #1}]
    {\hyperlink{todo\thechangecount}{\fcolorbox{blue}{yellow}{$\uparrow$}}}}
%---------------------------------------------------------------------------------
%---------------------------------------------------------------------------------      
    
\def\myaddcontentsline#1#2#3{%
    \addtocontents{#1}{\protect\contentsline{#2}{#3}{voir \thesection\  page \thepage}{\@currentHref}}}

\renewcommand{\@todonotes@addElementToListOfTodos}{%
    \if@todonotes@colorinlistoftodos%
    \myaddcontentsline{tdo}
    {%
        \protect\iftoggle{owner\@todonotes@owner}
        {%
            \protect\contentsline {todo}
            {\protect\fcolorbox{\@todonotes@currentbordercolor}%
                {\@todonotes@currentbackgroundcolor}%
                {\protect\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
                \ \@todonotes@caption
            }{\thepage}{\@currentHref}%
        }{}%
    }%
    \else%
    \addtocontents{tdo}
    {%
        \protect\iftoggle{owner\@todonotes@owner}
        {%
            \protect\contentsline {todo}
            {\@todonotes@caption
            }{\thepage}{\@currentHref}%
        }{}%
    }%
    \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}


\section{todo index Section}

todo sorted by owner

\toggletrue{ownerdefault}
\togglefalse{ownerfaq}
\togglefalse{ownerB}
\togglefalse{ownerchange}
\section*{Other comment}
\InputIfFileExists{\jobname.tdo}{}

\toggletrue{ownergerarld}
\togglefalse{ownerdefault}
\section*{ Gerald comment}
\InputIfFileExists{\jobname.tdo}{}


\toggletrue{ownerfaq}
\togglefalse{ownergerarld}
\section*{Important item to know}
\InputIfFileExists{\jobname.tdo}{}

\toggletrue{ownerchange}
\togglefalse{ownerfaq}
\section*{List of necessary change}
\InputIfFileExists{\jobname.tdo}{}

\togglefalse{ownerchange}
\makeatletter \@starttoc{tdo}\makeatother % to trigger the creation of the list 

    \section{Section}
    
    
    
    \lipsum[1]
    Text \stR{2nd}{2nd comment of the 1st reviewer} another text
    \lipsum[1]\vspace{\baselineskip}
    Some text \ndR{1st}{1st comment of the 2nd reviewer} continue text
    
    \lipsum[1]
    \stR{3nd}{3iem remarque du premier relecteur}
    \lipsum[1]
    
    
    \lipsum[1]\change{il y a trop F ici}
    \lipsum[1]
    \todofaq{le fakir n'est pas le clou du spectacle!}
    
    \lipsum[1]\change{il y a trop G ici}
    \todofaq{le fakir n'est pas le clou du spectacle!}
    \lipsum[1]
    HHHH\change{il y a trop H ici}
    \todofaq{le fakir n'est pas le clou du spectacle!}
    
    KKKKKKKKKKKKK\change{il y a trop K ici}
    
    \notegerarld{le fakir n'est pas le clou du spectacle!}
    
    \lipsum[1]
    \notegerarld{le fakir n'est pas le clou du spectacle!}
\end{document}

相关内容