1

I am documenting a script which has almost 43+ keywords. The output I want is something on the below lines... enter image description here

and the latex code I have is

\documentclass[a4paper, onesided]{article}
\usepackage{listings}

\lstdefinestyle{customc}
{%
basicstyle=\small\ttfamily,
keywordstyle=\color{blue},
commentstyle=\color{green!40!black},
stringstyle=\color{red!40!black},
columns=fullflexible
}%

\lstdefinelanguage{InnoScript}{%
keywords={AllowCancelDuringInstall, WindowVisible, RestartIfNeededByRun, Name, MessagesFile, Source, DestDir, Flags, Languages, Parameters, Filename, WorkingDir},
sensitive=true,
comment=[l]{;},
string=[b]'
}%
\begin{document}
\lstset{style=customc}
\lstinputlisting[language=InnoScript, firstline=39, lastline=51]{<WindowsLocation>Script.iss}
\end{document}

The errors I receive is:

enter image description here

Where am I wrong?

EDIT

@Daniel, came to rescue. Now, the question arises. How do I fix the overfull box warning? :-D

6
  • Load one of the available color packages (e.g., \usepackage{xcolor}), which define the \color command.
    – Daniel
    Commented Jan 14, 2016 at 10:59
  • And, by the way: Welcome to tex.se :-)
    – Daniel
    Commented Jan 14, 2016 at 11:00
  • What the...? Someone willing to blind me in one eye? I have been kicking myself inside out!!!Thank you so much @Daniel.
    – abyshukla
    Commented Jan 14, 2016 at 11:02
  • About the overfull box, breaklines=true added to the 'lstdefinestyle`? Commented Jan 14, 2016 at 11:39
  • Geez. Another foot-in-mouth moment... @TorbjørnT. thank you so much
    – abyshukla
    Commented Jan 14, 2016 at 12:40

1 Answer 1

1

Just add the \usepackage{color} line to your preamble, like this:

\documentclass[a4paper]{article}
\usepackage{listings}
\usepackage{color}

this works for me on Mac using latest TeXShop and TeXLive.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .