This tells you that \red is not defined, this is simply wrong syntax


    \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}

Recommend

R Shiny non-numeric argument to binary operator error

change a group of arguments separated by a space to become one argument in Discord.js?

Not able to use LINES and COLS as constants in ncurses

GO-AWS-SDK to access instance information on AWS

Why does this book suggest you can overload javascript constructors?

host an Angular app inside .NET Core 3.1 WebAPI?

attach interface to a fragment, Kotlin, Android

Why does Django 3.0.6 generate the urlpatterns variable using the url() function instead of the path() function

Read Excel Rows Using Pandas like Xlrd module

While executing action (with delegate and protocol included), a part does't work

Why Hive SQL returning NULL values for a particular column in Select statement when that column has all double values?

detect if drug was given in interval

Vuetify make items stay in a single row and resize based on content

Todo App in React- Wanted to add button which when clicks deletes the whole todo list

Not able to read txt file without comma separator in pandas python

R: adding vertical line to barplot

An interesting story about type inference with RxJs and typescript

Julia: Appending an element to a 2-D array

Can't upload pdf to slack no_file_data with Elixir and Hackney

Why am I getting a no package error while installing tidy linter on aws ec2

A Pythonic way to get unique values in a Pandas data frame column based on multiple filtering criteria

Jenkins: This site cannot be reached

Express req.query works fine with GET but not with POST

add put together a single dataframe from a list of dataframes

Docker cp parameter expansion in powershell

Java: weird behavior of conditional operator

OpenGL 2D faded circle being stretched/compressed by the resolution

Connection to Mongodb fails from Strapi on Heroku

imagemagick pixel color extraction (force RGB)

count internal and external edges of a subgraph

Handling different Retrofit responses

get Azure access token using client secret in MSAL?

Array in state being replaced with a 1 when setting state

Print already opened Internet explorer

limit the results of a Python if-in statement when checking if a string is found in another string?

Discord.py async function does not give any output and does not do anything

Can I define width for a Flutter widget in percentage instead of pixels?

type check a binary type alias in Typescript

Access relationship from WhereIn

Powershell replace string from array inside foreach loop

Calculating line intersections with Python gave unexpected result

Converting string to argument in bash

Move all files in a folder to a new location if the same existing Folder name exists at remote location

SQL Query to get the first day of the month passed in the parameer of the current year

Flutter: Shared preferences singleton not initializing properly

split a LineString to segments

extend the return type of a function passing the parameter type?

use select query inside max function?

Increase the marker size of SOME of the markers in a seaborn pairplot

Compare two files by checking the first 3 columns. if they are not the same values, then print the entire line (python)

Laravel debug the Model connection to check if the env function is parsing the credentials properly

Odoo select all records where user is follower

Displaying no results found when the api returns an empty result set in Angular?

Modifying a pre-existing taxonomy

Azure Data Explorer, Kusto: regex not semantically correct in extract()

Can I use two tables on CodeIgniter's model?

I restricted the words in the tweets to content words now I want to Transform the words to lower case and add the POS with an underderscore

create a table in the back of my other tables?

which function with magrittr

TypeError: db.collection(...).document is not a function in firestore

Calling a class without using parentheses (example: new Discord.Client())

Understanding type error or indexing error with matrices

return a newly created object when using sequelize transcation?

Create sublists from a master list based on the first element of the list

Add sub elements to a config file (XML) with powershell

Inherited class destructor

make two or more turtles perform a task at the same time?

Creating Products with Stripe API in Django

create pygame in game menus

check current status of a latest Data Factory Pipeline run with Pipeline name?

Am I accessing already freed memory, or is DrMemory reporting incorrectly in this case?

get intellisense of mapGetters, mapActions Vuex and typescript without class-style or decorators syntax

MaterialTable can't populate it

Ruby - print first part of string in element of array

Creating a list of CustomUserModel

No get method providing array access - error when assigning new values ​to the matrix

print specific lines of .py file in powershell

Port number not showing in headers.host

remove fieldname type from salesforce output payload in mule 4

ARM Template - Creating a template for VirtualnetworkGateway combined in a single template

retrieve the real name (Name and surname) of a Facebook profile that signed in with Firebase?

MySQL Loop within a Loop to Transpose records

SUM a column even if some Cells are blank?

Validate request body separately from request as a whole

Call function from material ui fonction

get the id of the aspusers table?

Where to put large Python lists

history.push() and Custom URL parameters using react-router

persist an R workspace across multiple CMD statements in a Dockerfile?

listiterator add method issue

Dual of Elvis: do this if not null?

get groups with n smallest sums within column

String Comparison Failing in Javascript When Values Are Equal

Index out of range SwiftUI

Convert HashSet of Integers to Comma Separated String in Java

How connect to Azure Key Vault from java backend using Azure Java SDK?

Partial-compare-and-full-swap for atomic values

Is there a way to add Share buttons to make plots shareable in Shiny

Is it possible to generate multiple elements from Akka Streams Flow

Regex Match greedy, optional, non-capturing groups