\begin{boxedlaw}{6.4in}
\colorbox[HTML]{F8E0E0}{
\begin{minipage}[c]{380px}
\begin{center}
\begine{verbatim}
\# define LM_ENCA 18 //Port0
\# define LM_ENCB 17 //Port0
\# define RM_ENCA 29 //Port0
\# define RM_ENCB 28 //Port0
\# define LMDir 10 //Port0
\# define RMDir 11 //Port0
\# define LeftTx 21 //Port1
\# define RightTx 20 //Port1
\# define LfrontTx 17 //Port1
\# define RfrontTx 16 //Port1
\# define LeftRx 13 //Port0
\# define RightRx 12 //Port0
\# define LfrontRx 21 //Port0
\# define RfrontRx 22 //Port0
\# define Buzzer 31 //Port1
\# define ModeSel 2 //Port0
\# define GyroOut 5 //Port0
\# define GyroOut4X 4 //Port0
\end{verbatim}
\end{center}
\end{minipage}}
\end{boxedlaw}
When I use this code I keep getting an error:
"! Missing $ inserted."
"! Missing } inserted."
I have declared this new environment at the start:
\usepackage{xcolor} % Extended colors
\usepackage{color} % Color extended names
%DEFINE ENVIRONMENT BLOCK
% Riddle
\newenvironment{colbox}[3]{ % Riddle environment
\begin{center} % Centering minipage
\colorbox[HTML]{#1} { % Set's the color of minipage
\begin{minipage}[b]{380px} % Starts minipage
\textbf{#2}\\ \textit{#3} % Set's title and starts italic for text
\end{minipage}} % End minipage
}{\end{center}} % End Riddle environment
The above environment is something I have copied from a different post on this forum. However being a novice with Latex I dont know if I can use it as it is. Any help would be great.
colbox
environment (last snippet) but you use aboxedlaw
environment in the first snippet; where is this environment defined? Also, there's a missing\begin{verbatim}
in the first snippet.verbatim
inside a macro argument, here the\colorbox
. Also, when you use verbatim you should turn the\#
into#
, right?