Why do I get ! LaTeX Error: Environment code undefined.
when I use:
\documentclass[10pt,a4wide]{article}
\usepackage{a4wide}
\usepackage[utf8]{inputenc}
\usepackage[portuguese]{babel}
\usepackage{graphicx}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\begin{document}
\begin{minipage}{7cm}
\begin{code}
module Dir where
import TeX
import Data.List
\end{code}
\end{minipage}\hfill
\begin{minipage}{7cm}
\begin{code}
module DirV where
import TeX
import Data.List
\end{code}
\end{minipage}
Best Answer
You don't have an environment called
code
. If you are trying to print code, you might be interested in theverbatim
environment, or other pretty-printing environments/packages. See Print programs with its proper syntax.Wrapping your code snippet into a minimal compiling document using
verbatim
, it produces the following output: