I'm using the listings package to insert code into the document. My research led me towards the literate option of listings to control operator highlighting. I have one issue - the right round bracket won't accept the rule. Every other line in this snippet of code works as intended.
\documentclass[11pt, twoside]{book}
\usepackage{verbatim} % For commenting out multy line commands
%\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{lipsum} % Dummy Text
\usepackage{listings} % Code Inclusion
\definecolor{codegray}{HTML}{A0A0A0}
\definecolor{codegreen}{HTML}{00A000}
\definecolor{codeblue}{HTML}{0000A0}
\definecolor{codelightblue}{HTML}{0000FF}
\definecolor{codepurple}{HTML}{F000F0}
\definecolor{codered}{HTML}{FF003A}
%----------------- Code Formatting Options ---------------
\lstset
{
backgroundcolor=\color{white}, % choose the background color;
commentstyle=\color{codegray},
keywordstyle=\color{codeblue},
stringstyle=\color{codelightblue},
identifierstyle=\color{black},
literate=%
*{0}{{{\color{codepurple}{0}}}}1
{1}{{{\color{codepurple}{1}}}}1
{2}{{{\color{codepurple}{2}}}}1
{3}{{{\color{codepurple}{3}}}}1
{4}{{{\color{codepurple}{4}}}}1
{5}{{{\color{codepurple}{5}}}}1
{6}{{{\color{codepurple}{6}}}}1
{7}{{{\color{codepurple}{7}}}}1
{8}{{{\color{codepurple}{8}}}}1
{9}{{{\color{codepurple}{9}}}}1
{[}{{{\color{codered}{[}}}}1
{]}{{{\color{codered}{]}}}}1
{(}{{{\color{codered}{(}}}}1
{)}{{{\color{codered}{)}}}}1 %problematic )
{=}{{{\color{codered}{=}}}}1
{+}{{{\color{codered}+}}}1
{-}{{{\color{codered}-}}}1
{*}{{{\color{codered}*}}}1
{>}{{{\color{codered}>}}}1
{<}{{{\color{codered}<}}}1
{|}{{{\color{codered}|}}}1
{&}{{{\color{codered}&}}}1
{!}{{{\color{codered}!}}}1
{:}{{{\color{codered}:}}}1
{;}{{{\color{codered};}}}1
{,}{{{\color{codered},}}}1
{\{}{{{\color{codered}\{}}}1
{\}}{{{\color{codered}\}}}}1,
%tag=[s]{()},
% you must add \usepackage{color} or \usepackage{xcolor}; should come as last argument
language=C, % the language of the code
basicstyle=\linespread{.9}\ttfamily\footnotesize, % the size of the fonts that are used for the code. Line spread should not be more than 1.
numbers=left, % where to put the line-numbers; possible values are (none, left, right)
numbersep=5pt, % how far the line-numbers are from the code
stepnumber=1, % the step between two line-numbers. If it's 1, each line will be numbered
showstringspaces=false, % underline spaces within strings only
tabsize=1, % sets default tabsize to 1 spaces
breaklines=true, % sets automatic line breaking
breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace
numberstyle=\tiny\color{white}, % the style that is used for the line-numbers
frame=l,
framesep=4.5mm, % sets the thickness of the background
framexleftmargin=0.5mm, % sets the distance from the code
fillcolor=\color{myDarkGray}, % sets the background colour
rulecolor=\color{myDarkGray}, % sets the left border colour
%aboveskip=5mm, % creates space abjove the code, but within the box
%belowskip=10mm % creates space below the code, but within the box
}
\begin{document}
\lstinputlisting{file.c}
\end{document}
The output:

file.c. It would be great if you could add a small dummy file or include it directly with\begin{listings}...\end{listings}so we don't have to come up with example code ourselves. – moewe Dec 15 '18 at 16:19