1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
\documentclass[a4paper,10pt]{book}
\usepackage{hevea}
\usepackage[latin1]{inputenc}
\usepackage[portuguese]{babel}
\usepackage{listings}
\newstyle{.myclisting}{font-family:monospace;white-space:pre;margin:lex;padding:2ex;}
\lstdefinelanguage{myHaskell}{language={Haskell},
morekeywords={if,then,else,case,class,data,default,deriving,%
hiding,in,infix,infixl,infixr,import,instance,let,module,%
newtype,of,qualified,type,where,do}} %Bug in Hevea (?): if I put last '}' in the next line, keywords do not work!
{}
% Bug in Hevea (?): I have to repeat here the haskell keywords,
% copied from lstlang2.sty (more specifically, from lst@definelanguage{Haskell}{keywords={if,...}})
\lstnewenvironment{hask}[2]{
\lstset{language=myHaskell,emph={#1},
backgroundcolor={\color{#2}}
}}
{} % Bug in Hevea: if I comment this line, Hevea causes a fatal error, and asks reporting bug to Luc...
\newcommand{\inh}{\lstinline[language=myHaskell]}
% listings e lstinline para C
\lstdefinelanguage{myAlg}{language={C++},%
morekeywords={with,to}}
\lstnewenvironment{alg}[2]{
\lstset{language={myAlg},emph={#1},
backgroundcolor={\color{#2}}}}
{}
\newcommand{\ina}{\lstinline[language=myAlg]}
%-----------------------------------------------
\begin{document}
\ina{$c$)
\begin{enumerate}
%\epsfbox{/home/camarao/ipcc/fig/hanoi-sol.eps} % bbllx=0pt,bblly=0pt,bburx=1031pt,bbury=1027pt} % height=9cm,width=.9\textwidth}
\end{enumerate}
\end{document}
|