Что насчет среды Clisting - PullRequest
0 голосов
/ 28 мая 2020

Не могли бы вы помочь мне решить следующую проблему?

под кодом MWE и ошибкой ==> Неопределенная последовательность управления. \ end {Clisting} почему появляется ошибка? Проблема управления акцентом внутри Clisting blo c решена

Документ в формате pdf кажется совершенно хорошим. компиляция работает с pdflatex Как видите, я хочу сохранить тикз и аспект листинга, чтобы иметь красивую ломкую коробку

    \documentclass{book}
%mwe_clisting2


%Rétablissement des polices vectorielles
%Pour retourner dans le droit chemin, vous  pouvez passer par le package ae ou bien utiliser les fontes modernes, voire les deux :
\usepackage{ae,lmodern} % ou seulement l'un, ou l'autre, ou times etc.
\usepackage[english,french]{babel}
\usepackage[utf8]{inputenc}
%%% Note that this is font encoding (determines what kind of font is used), not input encoding. 
\usepackage[T1]{fontenc}
\usepackage[cyr]{aeguill}
\usepackage{tikz}
\tikzset{coltria/.style={fill=red!15!white}}
\usepackage{tcolorbox}
\tcbuselibrary{listings,breakable,skins,documentation,xparse}
\lstdefinestyle{Clst}{ 
    literate=
    {á}{{\'a}}1
    {à}{{\`a }}1
    {ã}{{\~a}}1
    {é}{{\'e}}1
    {ê}{{\^e}}1
    {î}{{\^i}}1
    {oe}{{\oe}}1
    {í}{{\'i}}1
    {ó}{{\'o}}1
    {õ}{{\~o}}1
    {ú}{{\'u}}1
    {ü}{{\"u}}1
    {ç}{{\c{c}}}1,    
    numbers=left, 
    numberstyle=\small, 
    numbersep=8pt, 
    frame = none, 
    language=C, 
    framexleftmargin=5pt,            % la marge à  gauche du code
    % test pour améliorer la présentation du code
    upquote=true,
    columns=flexible,
    basicstyle=\ttfamily,
    basicstyle=\small, % ==> semble optimal \tiny est vraiment trop petit
    % provoque une erreur texcsstyle=*\color{blue},
    commentstyle=\color{green},    % comment style
    keywordstyle=\color{blue},       % keyword style
    rulecolor=\color{black},         % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
    showspaces=false,                % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'        
    showtabs=false,                  % show tabs within strings adding particular underscores
    stringstyle=\color{cyan},     % string literal style
    numbers=none, 
    tabsize=4,
    % pour couper les lignes trop longues
    breaklines,
    breakindent=1.5em, %?indente?de?3?caracteres?vers?la?droite
    escapechar=µ,% pour escape en latex
    % pour l'encodage à l'intérieur des listing utf8 et latin1    ?????
    %   inputencoding=utf8/latin1,
    morekeywords=[2]{ % j'ajoute une catégorie de mots-clés 
        %%% pour tri sur le 5ieme caractere
        gtk_window_new,
        gtk_window_set_title,
        gtk_window_set_resizable,
        gtk_window_get_resizable,
        gtk_window_is_maximized,
        gtk_window_maximize,
        gtk_window_unmaximize,
        gtk_window_fullscreen,
        gtk_window_fullscreen_on_monitor,
        gtk_window_unfullscreen,
        %%%%%%%%%%%
        gdk_rgba_parse,
        gdk_rgba_parse,
        gdk_rgba_parse,
        gdk_rgba_parse,
        % dernier sans la virgule
    },
    morekeywords=[3]{ %% j'ajoute une autre catégorie de mots-clés 
        %%% pour tri sur le 3ieme caractere
        G_TYPE_NONE,
        G_TYPE_INTERFACE,
        G_TYPE_CHAR,
        G_TYPE_UCHAR,
        G_TYPE_BOOLEAN,
        G_TYPE_INT,
        G_TYPE_UINT,
        G_TYPE_LONG,
        % dernier sans la virgule
    },
    morekeywords=[4]{ %% j'ajoute une autre catégorie de mots-clés 
        %%% pour tri sur le 1er caractere
        GtkSourceLanguageManager, 
        GtkSourceSmartHomeEndType,
        GtkSourceMarkAttributes,
        GtkSourceDrawSpacesFlags,
        GtkSourceCompletion,
        GtkSourceGutter,
        GtkSourceBackgroundPatternType,
        Container_set_border_width,
        GtkSourceSearchContext,
        GtkFileChooserAction,
        gboolean,
        %%%%%%
        cairo_rectangle,
        cairo_fill,
        % dernier sans la virgule
    },
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%Traitement des mots-clefs type gtk_xxxxx
    keywordstyle=[2]\monstyleblue, %%%\color{blue}, % je leur donne une coloration spéciale ds le texte
    %% Intégration dans l'index OK
    moreindex={[1][keywords2]},    % ces mots-clés sont ajoutés à  l'index?oui
    %% gtk_xxxx trié par xxxx  ca fonctionne sur tout l'index
    indexstyle={[1]\indexgtk},      % par le biais de macro \indexgtk
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%Traitement des mots-clefs type g_xxxxx
    keywordstyle=[3]\monstylegreen, %%%\color{green}, % je leur donne une coloration spéciale ds le texte
    %% Intégration dans l'index OK
    moreindex={[3][keywords3]},    % ces mots-clés sont ajoutés à  l'index?oui
    %% gtk_xxxx trié par xxxx  ca fonctionne sur tout l'index
    indexstyle={[3]\indexglib},      % par le biais de ma macro tri 3ieme
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%Traitement des mots-clefs type GtkSourceSmartHomeEndType
    keywordstyle=[4]\monstylebrown,     %%%\color{brown}, % je leur donne une coloration spéciale ds le texte
    %% Intégration dans l'index OK
    moreindex={[4][keywords4]},    % ces mots-clés sont ajoutés à  l'index?oui
    %% xxxx trié par xxxx  ca fonctionne sur tout l'index
    indexstyle={[4]\indextype},          % tri sur le mot entier
}
%---------------------------------------------------------------------------------------
%------------------------------ box dédié au code langage C ----------------------------
%---------------------------------------------------------------------------------------
\newtcblisting{Clisting}[2][]{empty,breakable,leftrule=5mm,left=2mm,
    %frame style={fill,top color=red!75!black,bottom color=red!75!black,middle color=red},
    frame style={fill,top color=green!75!black,bottom color=green!75!black,middle color=green},
    listing only,
    listing engine=listings, 
    listing options={style=Clst,tabsize=4,breaklines,
        breakindent=1.5em,columns=fullflexible},
    %       keywordstyle=\color{red}},
    colback=yellow!15!white,
    % code for unbroken boxes:
    frame code={\path[tcb fill frame] (frame.south west)--(frame.north west)
        --([xshift=-5mm]frame.north east)--([yshift=-5mm]frame.north east)
        --([yshift=5mm]frame.south east)--([xshift=-5mm]frame.south east)--cycle; },
    interior code={\path[tcb fill interior] (interior.south west)--(interior.north west)
        --([xshift=-4.8mm]interior.north east)--([yshift=-4.8mm]interior.north east)
        --([yshift=4.8mm]interior.south east)--([xshift=-4.8mm]interior.south east)
        --cycle; },
    attach boxed title to top center={yshift=-2mm},
    title=\fcolorbox{black}{black}{\red{#2}},
    % code for the first part of a break sequence:
    skin first is subskin of={emptyfirst}{%
        frame code={\path[tcb fill frame] (frame.south west)--(frame.north west)
            --([xshift=-5mm]frame.north east)--([yshift=-5mm]frame.north east)
            --(frame.south east)--cycle;
            \path[coltria] ([xshift=2.5mm,yshift=1mm]frame.south west) -- +(120:2mm)
            -- +(60:2mm)-- cycle; },
        interior code={\path[tcb fill interior] (interior.south west|-frame.south)
            --(interior.north west)--([xshift=-4.8mm]interior.north east)
            --([yshift=-4.8mm]interior.north east)--(interior.south east|-frame.south)
            --cycle; },
    },%
    % code for the middle part of a break sequence:
    skin middle is subskin of={emptymiddle}{%
        frame code={\path[tcb fill frame] (frame.south west)--(frame.north west)
            --(frame.north east)--(frame.south east)--cycle;
            \path[coltria] ([xshift=2.5mm,yshift=-1mm]frame.north west) -- +(240:2mm)
            -- +(300:2mm) -- cycle;
            \path[coltria] ([xshift=2.5mm,yshift=1mm]frame.south west) -- +(120:2mm)
            -- +(60:2mm) -- cycle;
        },
        interior code={\path[tcb fill interior] (interior.south west|-frame.south)
            --(interior.north west|-frame.north)--(interior.north east|-frame.north)
            --(interior.south east|-frame.south)--cycle; },
    },
    % code for the last part of a break sequence:
    skin last is subskin of={emptylast}{%
        frame code={\path[tcb fill frame] (frame.south west)--(frame.north west)
            --(frame.north east)--([yshift=5mm]frame.south east)
            --([xshift=-5mm]frame.south east)--cycle;
            \path[coltria] ([xshift=2.5mm,yshift=-1mm]frame.north west) -- +(240:2mm)
            -- +(300:2mm) -- cycle;
        },
        interior code={\path[tcb fill interior] (interior.south west)
            --(interior.north west|-frame.north)--(interior.north east|-frame.north)
            --([yshift=4.8mm]interior.south east)--([xshift=-4.8mm]interior.south east)
            --cycle; },#1}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% attention dans les 3 commandes ci-dessous l'activation simultanée de \marginpar{\scriptsize  provoque une situation ingérable par latex
\newcommand{\monstylered}[1] % attention ici le 1 c'est un seul paramètre !!!!!
{\color{red}{\emph{#1}}
}
\newcommand{\monstyleblue}[1] % attention ici le 1 c'est un seul paramètre !!!!!
{\color{blue}{\emph{#1}}
}
\newcommand{\monstylebrown}[1] % attention ici le 1 c'est un seul paramètre !!!!!
{\color{brown}{\emph{#1}}
}

\newcommand{\monstylegreen}[1] % attention ici le 1 c'est un seul paramètre !!!!!
{\color{green}{\emph{#1}}
}
%----------------------- Fin Traitement des listing ------------------------------

% --------------------- Macros pour indexation des mots clefs --------------------

% macro pour fabriquer le fichier d'index
\usepackage{makeidx}
\makeindex
% fabrication de l'index 

%makeindex mwe_clisting2.idx -s perso.ist

%---------------------------------------------------------------------------------
%%%%%% tri a partir du 5ieme element gtk_XXXX et couleur index blue
\makeatletter
\def\@indexgtk@i#1#2#3#4#5,{\index{#5@\monstyleblue{#1#2#3#4#5}}}
\def\indexgtk#1{\@indexgtk@i#1,}
\makeatother


%---------------------------------------------------------------------------------
%%%%% tri a partir du 3ieme element G_NONE  et couleur index green
\makeatletter
\def\@indexglib@i#1#2#3,{\index{#3@\monstylegreen{#1#2#3}}}
\def\indexglib#1{\@indexglib@i#1,}
\makeatother

%%%%%% tri a partir du 1er element MANQUE MISE EN ITALIQUE et couleur index marron
\makeatletter
\def\@indextype@i#1,{\index{#1@\monstylebrown{#1}}}
\def\indextype#1{\@indextype@i#1,}
\makeatother
%---------------------------------------------------------------------------------------

\begin{document}

Voici l'étape qui a toute les chances de ne pas être lue au début mais plutôt quand on est dans une belle impasse. Croire qu'on va s'en sortir sans un minimum de méthode n'est pas viable dans le projet que je vous propose de suivre.
Aidez-moi à conjurer le mauvais sort, et lisez avec attention cette liste de recommandation qui relève du bon sens pratique du développeur expérimenté qu'il aurait aimé découvrir dès ses premiers pas.


\begin{Clisting} {fonction draw\_func}
    void draw_func (GtkDrawingArea *da,
    cairo_t        *cr,
    int             width,
    int             height,
    gpointer        data)
    {
        GdkRGBA red, green, yellow, blue;
        double w, h;

        w = width / 2.0;
        h = height / 2.0;

        gdk_rgba_parse (&red, "red");
        gdk_rgba_parse (&green, "green");
        gdk_rgba_parse (&yellow, "yellow");
        gdk_rgba_parse (&blue, "blue");

        gdk_cairo_set_source_rgba (cr, &red);
        cairo_rectangle (cr, 0, 0, w, h);
        cairo_fill (cr);

        gdk_cairo_set_source_rgba (cr, &green);
        cairo_rectangle (cr, w, 0, w, h);
        cairo_fill (cr);

        gdk_cairo_set_source_rgba (cr, &yellow);
        cairo_rectangle (cr, 0, h, w, h);
        cairo_fill (cr);

        gdk_cairo_set_source_rgba (cr, &blue);
        cairo_rectangle (cr, w, h, w, h);
        cairo_fill (cr);
    }
    ...
    gtk_drawing_area_set_draw_func (area, draw, NULL, NULL);
\end{Clisting}

\begin{Clisting}{here problem with accent}
    gboolean TEST1 = TRUE
    if (TEST1)
    {
        /** nouvel essai nouvelle méthode à tester **/
        ...
    }
    else
    {
        /** ancien bloc fonctionnel qui buggue **/
        ...
    }   
\end{Clisting}

\begin{Clisting}{Run ok with colorisation index}
    gtk_window_new  
    gtk_window_set_title  
    gtk_window_set_resizable  
    gtk_window_get_resizable  
    gtk_window_is_maximized  
    gtk_window_maximize  
    gtk_window_unmaximize  
    gtk_window_fullscreen  
    gtk_window_fullscreen_on_monitor  
    gtk_window_unfullscreen  

    G_TYPE_NONE  
    G_TYPE_INTERFACE  
    G_TYPE_CHAR  
    G_TYPE_UCHAR  
    G_TYPE_BOOLEAN  
    G_TYPE_INT  
    G_TYPE_UINT  
    G_TYPE_LONG  

    GtkSourceLanguageManager   
    GtkSourceSmartHomeEndType  
    GtkSourceMarkAttributes  
    GtkSourceDrawSpacesFlags  
    GtkSourceCompletion  
    GtkSourceGutter  
    GtkSourceBackgroundPatternType  
    Container_set_border_width  
    GtkSourceSearchContext  
    GtkFileChooserAction  
    gboolean  

\end{Clisting}
\printindex
\end{document}

РЕДАКТИРОВАТЬ: Я изменил код примера .... Чтобы понять , пожалуйста, скомпилируйте с pdflatex, посмотрите два типа ошибок .... так как вы знаете лучше меня, вы должны мне помочь. pb с ударением решено Большое спасибо заранее

1 Ответ

0 голосов
/ 13 июня 2020

Если вы посмотрите на полное сообщение об ошибке в файле журнала, вы получите

! Undefined control sequence.
<argument> \red 
                {fonction draw\_func}
l.280 \end{Clisting}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Это означает, что \red не определен, это просто неправильный синтаксис

    \documentclass{book}
%mwe_clisting2


%Rétablissement des polices vectorielles
%Pour retourner dans le droit chemin, vous  pouvez passer par le package ae ou bien utiliser les fontes modernes, voire les deux :
\usepackage{ae,lmodern} % ou seulement l'un, ou l'autre, ou times etc.
\usepackage[english,french]{babel}
\usepackage[utf8]{inputenc}
%%% Note that this is font encoding (determines what kind of font is used), not input encoding. 
\usepackage[T1]{fontenc}
\usepackage[cyr]{aeguill}
\usepackage{tikz}
\tikzset{coltria/.style={fill=red!15!white}}
\usepackage{tcolorbox}
\tcbuselibrary{listings,breakable,skins,documentation,xparse}
\lstdefinestyle{Clst}{ 
    literate=
    {á}{{\'a}}1
    {à}{{\`a }}1
    {ã}{{\~a}}1
    {é}{{\'e}}1
    {ê}{{\^e}}1
    {î}{{\^i}}1
    {oe}{{\oe}}1
    {í}{{\'i}}1
    {ó}{{\'o}}1
    {õ}{{\~o}}1
    {ú}{{\'u}}1
    {ü}{{\"u}}1
    {ç}{{\c{c}}}1,    
    numbers=left, 
    numberstyle=\small, 
    numbersep=8pt, 
    frame = none, 
    language=C, 
    framexleftmargin=5pt,            % la marge à  gauche du code
    % test pour améliorer la présentation du code
    upquote=true,
    columns=flexible,
    basicstyle=\ttfamily,
    basicstyle=\small, % ==> semble optimal \tiny est vraiment trop petit
    % provoque une erreur texcsstyle=*\color{blue},
    commentstyle=\color{green},    % comment style
    keywordstyle=\color{blue},       % keyword style
    rulecolor=\color{black},         % if not set, the frame-color may be changed on line-breaks within not-black text (e.g. comments (green here))
    showspaces=false,                % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'        
    showtabs=false,                  % show tabs within strings adding particular underscores
    stringstyle=\color{cyan},     % string literal style
    numbers=none, 
    tabsize=4,
    % pour couper les lignes trop longues
    breaklines,
    breakindent=1.5em, %?indente?de?3?caracteres?vers?la?droite
    escapechar=µ,% pour escape en latex
    % pour l'encodage à l'intérieur des listing utf8 et latin1    ?????
    %   inputencoding=utf8/latin1,
    morekeywords=[2]{ % j'ajoute une catégorie de mots-clés 
        %%% pour tri sur le 5ieme caractere
        gtk_window_new,
        gtk_window_set_title,
        gtk_window_set_resizable,
        gtk_window_get_resizable,
        gtk_window_is_maximized,
        gtk_window_maximize,
        gtk_window_unmaximize,
        gtk_window_fullscreen,
        gtk_window_fullscreen_on_monitor,
        gtk_window_unfullscreen,
        %%%%%%%%%%%
        gdk_rgba_parse,
        gdk_rgba_parse,
        gdk_rgba_parse,
        gdk_rgba_parse,
        % dernier sans la virgule
    },
    morekeywords=[3]{ %% j'ajoute une autre catégorie de mots-clés 
        %%% pour tri sur le 3ieme caractere
        G_TYPE_NONE,
        G_TYPE_INTERFACE,
        G_TYPE_CHAR,
        G_TYPE_UCHAR,
        G_TYPE_BOOLEAN,
        G_TYPE_INT,
        G_TYPE_UINT,
        G_TYPE_LONG,
        % dernier sans la virgule
    },
    morekeywords=[4]{ %% j'ajoute une autre catégorie de mots-clés 
        %%% pour tri sur le 1er caractere
        GtkSourceLanguageManager, 
        GtkSourceSmartHomeEndType,
        GtkSourceMarkAttributes,
        GtkSourceDrawSpacesFlags,
        GtkSourceCompletion,
        GtkSourceGutter,
        GtkSourceBackgroundPatternType,
        Container_set_border_width,
        GtkSourceSearchContext,
        GtkFileChooserAction,
        gboolean,
        %%%%%%
        cairo_rectangle,
        cairo_fill,
        % dernier sans la virgule
    },
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%Traitement des mots-clefs type gtk_xxxxx
    keywordstyle=[2]\monstyleblue, %%%\color{blue}, % je leur donne une coloration spéciale ds le texte
    %% Intégration dans l'index OK
    moreindex={[1][keywords2]},    % ces mots-clés sont ajoutés à  l'index?oui
    %% gtk_xxxx trié par xxxx  ca fonctionne sur tout l'index
    indexstyle={[1]\indexgtk},      % par le biais de macro \indexgtk
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%Traitement des mots-clefs type g_xxxxx
    keywordstyle=[3]\monstylegreen, %%%\color{green}, % je leur donne une coloration spéciale ds le texte
    %% Intégration dans l'index OK
    moreindex={[3][keywords3]},    % ces mots-clés sont ajoutés à  l'index?oui
    %% gtk_xxxx trié par xxxx  ca fonctionne sur tout l'index
    indexstyle={[3]\indexglib},      % par le biais de ma macro tri 3ieme
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    %%%Traitement des mots-clefs type GtkSourceSmartHomeEndType
    keywordstyle=[4]\monstylebrown,     %%%\color{brown}, % je leur donne une coloration spéciale ds le texte
    %% Intégration dans l'index OK
    moreindex={[4][keywords4]},    % ces mots-clés sont ajoutés à  l'index?oui
    %% xxxx trié par xxxx  ca fonctionne sur tout l'index
    indexstyle={[4]\indextype},          % tri sur le mot entier
}
%---------------------------------------------------------------------------------------
%------------------------------ box dédié au code langage C ----------------------------
%---------------------------------------------------------------------------------------
\newtcblisting{Clisting}[2][]{empty,breakable,leftrule=5mm,left=2mm,
    %frame style={fill,top color=red!75!black,bottom color=red!75!black,middle color=red},
    frame style={fill,top color=green!75!black,bottom color=green!75!black,middle color=green},
    listing only,
    listing engine=listings, 
    listing options={style=Clst,tabsize=4,breaklines,
        breakindent=1.5em,columns=fullflexible},
    %       keywordstyle=\color{red}},
    colback=yellow!15!white,
    % code for unbroken boxes:
    frame code={\path[tcb fill frame] (frame.south west)--(frame.north west)
        --([xshift=-5mm]frame.north east)--([yshift=-5mm]frame.north east)
        --([yshift=5mm]frame.south east)--([xshift=-5mm]frame.south east)--cycle; },
    interior code={\path[tcb fill interior] (interior.south west)--(interior.north west)
        --([xshift=-4.8mm]interior.north east)--([yshift=-4.8mm]interior.north east)
        --([yshift=4.8mm]interior.south east)--([xshift=-4.8mm]interior.south east)
        --cycle; },
    attach boxed title to top center={yshift=-2mm},
    title=\fcolorbox{black}{black}{\color{red}{#2}},
    % code for the first part of a break sequence:
    skin first is subskin of={emptyfirst}{%
        frame code={\path[tcb fill frame] (frame.south west)--(frame.north west)
            --([xshift=-5mm]frame.north east)--([yshift=-5mm]frame.north east)
            --(frame.south east)--cycle;
            \path[coltria] ([xshift=2.5mm,yshift=1mm]frame.south west) -- +(120:2mm)
            -- +(60:2mm)-- cycle; },
        interior code={\path[tcb fill interior] (interior.south west|-frame.south)
            --(interior.north west)--([xshift=-4.8mm]interior.north east)
            --([yshift=-4.8mm]interior.north east)--(interior.south east|-frame.south)
            --cycle; },
    },%
    % code for the middle part of a break sequence:
    skin middle is subskin of={emptymiddle}{%
        frame code={\path[tcb fill frame] (frame.south west)--(frame.north west)
            --(frame.north east)--(frame.south east)--cycle;
            \path[coltria] ([xshift=2.5mm,yshift=-1mm]frame.north west) -- +(240:2mm)
            -- +(300:2mm) -- cycle;
            \path[coltria] ([xshift=2.5mm,yshift=1mm]frame.south west) -- +(120:2mm)
            -- +(60:2mm) -- cycle;
        },
        interior code={\path[tcb fill interior] (interior.south west|-frame.south)
            --(interior.north west|-frame.north)--(interior.north east|-frame.north)
            --(interior.south east|-frame.south)--cycle; },
    },
    % code for the last part of a break sequence:
    skin last is subskin of={emptylast}{%
        frame code={\path[tcb fill frame] (frame.south west)--(frame.north west)
            --(frame.north east)--([yshift=5mm]frame.south east)
            --([xshift=-5mm]frame.south east)--cycle;
            \path[coltria] ([xshift=2.5mm,yshift=-1mm]frame.north west) -- +(240:2mm)
            -- +(300:2mm) -- cycle;
        },
        interior code={\path[tcb fill interior] (interior.south west)
            --(interior.north west|-frame.north)--(interior.north east|-frame.north)
            --([yshift=4.8mm]interior.south east)--([xshift=-4.8mm]interior.south east)
            --cycle; },#1}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% attention dans les 3 commandes ci-dessous l'activation simultanée de \marginpar{\scriptsize  provoque une situation ingérable par latex
\newcommand{\monstylered}[1] % attention ici le 1 c'est un seul paramètre !!!!!
{\color{red}{\emph{#1}}
}
\newcommand{\monstyleblue}[1] % attention ici le 1 c'est un seul paramètre !!!!!
{\color{blue}{\emph{#1}}
}
\newcommand{\monstylebrown}[1] % attention ici le 1 c'est un seul paramètre !!!!!
{\color{brown}{\emph{#1}}
}

\newcommand{\monstylegreen}[1] % attention ici le 1 c'est un seul paramètre !!!!!
{\color{green}{\emph{#1}}
}
%----------------------- Fin Traitement des listing ------------------------------

% --------------------- Macros pour indexation des mots clefs --------------------

% macro pour fabriquer le fichier d'index
\usepackage{makeidx}
\makeindex
% fabrication de l'index 

%makeindex mwe_clisting2.idx -s perso.ist

%---------------------------------------------------------------------------------
%%%%%% tri a partir du 5ieme element gtk_XXXX et couleur index blue
\makeatletter
\def\@indexgtk@i#1#2#3#4#5,{\index{#5@\monstyleblue{#1#2#3#4#5}}}
\def\indexgtk#1{\@indexgtk@i#1,}
\makeatother


%---------------------------------------------------------------------------------
%%%%% tri a partir du 3ieme element G_NONE  et couleur index green
\makeatletter
\def\@indexglib@i#1#2#3,{\index{#3@\monstylegreen{#1#2#3}}}
\def\indexglib#1{\@indexglib@i#1,}
\makeatother

%%%%%% tri a partir du 1er element MANQUE MISE EN ITALIQUE et couleur index marron
\makeatletter
\def\@indextype@i#1,{\index{#1@\monstylebrown{#1}}}
\def\indextype#1{\@indextype@i#1,}
\makeatother
%---------------------------------------------------------------------------------------

\begin{document}

Voici l'étape qui a toute les chances de ne pas être lue au début mais plutôt quand on est dans une belle impasse. Croire qu'on va s'en sortir sans un minimum de méthode n'est pas viable dans le projet que je vous propose de suivre.
Aidez-moi à conjurer le mauvais sort, et lisez avec attention cette liste de recommandation qui relève du bon sens pratique du développeur expérimenté qu'il aurait aimé découvrir dès ses premiers pas.


\begin{Clisting} {fonction draw\_func}
    void draw_func (GtkDrawingArea *da,
    cairo_t        *cr,
    int             width,
    int             height,
    gpointer        data)
    {
        GdkRGBA red, green, yellow, blue;
        double w, h;

        w = width / 2.0;
        h = height / 2.0;

        gdk_rgba_parse (&red, "red");
        gdk_rgba_parse (&green, "green");
        gdk_rgba_parse (&yellow, "yellow");
        gdk_rgba_parse (&blue, "blue");

        gdk_cairo_set_source_rgba (cr, &red);
        cairo_rectangle (cr, 0, 0, w, h);
        cairo_fill (cr);

        gdk_cairo_set_source_rgba (cr, &green);
        cairo_rectangle (cr, w, 0, w, h);
        cairo_fill (cr);

        gdk_cairo_set_source_rgba (cr, &yellow);
        cairo_rectangle (cr, 0, h, w, h);
        cairo_fill (cr);

        gdk_cairo_set_source_rgba (cr, &blue);
        cairo_rectangle (cr, w, h, w, h);
        cairo_fill (cr);
    }
    ...
    gtk_drawing_area_set_draw_func (area, draw, NULL, NULL);
\end{Clisting}

\begin{Clisting}{here problem with accent}
    gboolean TEST1 = TRUE
    if (TEST1)
    {
        /** nouvel essai nouvelle méthode à tester **/
        ...
    }
    else
    {
        /** ancien bloc fonctionnel qui buggue **/
        ...
    }   
\end{Clisting}

\begin{Clisting}{Run ok with colorisation index}
    gtk_window_new  
    gtk_window_set_title  
    gtk_window_set_resizable  
    gtk_window_get_resizable  
    gtk_window_is_maximized  
    gtk_window_maximize  
    gtk_window_unmaximize  
    gtk_window_fullscreen  
    gtk_window_fullscreen_on_monitor  
    gtk_window_unfullscreen  

    G_TYPE_NONE  
    G_TYPE_INTERFACE  
    G_TYPE_CHAR  
    G_TYPE_UCHAR  
    G_TYPE_BOOLEAN  
    G_TYPE_INT  
    G_TYPE_UINT  
    G_TYPE_LONG  

    GtkSourceLanguageManager   
    GtkSourceSmartHomeEndType  
    GtkSourceMarkAttributes  
    GtkSourceDrawSpacesFlags  
    GtkSourceCompletion  
    GtkSourceGutter  
    GtkSourceBackgroundPatternType  
    Container_set_border_width  
    GtkSourceSearchContext  
    GtkFileChooserAction  
    gboolean  

\end{Clisting}
\printindex
\end{document}
...