Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using SASnRdisplay for SAS code and output. My code is

\documentclass[a4paper,article]{memoir}
\setlrmarginsandblock{3cm}{3cm}{*}
\setulmarginsandblock{2.5cm}{3cm}{*}
\checkandfixthelayout[nearest]
\usepackage[T1]{fontenc}
\usepackage{kpfonts}
\usepackage{xspace,calc,listings,enumitem,url,ragged2e}
\setlist{  
  listparindent=\parindent,
  parsep=0pt,
}
\usepackage[scaled=0.8]{beramono}

\hfuzz=5pt

%\setlength\cftbeforechapterskip{0em plus 0.2em}

\AtBeginDocument{\providecommand\href[2]{#2}}

\DeclareUrlCommand\mypath{\urlstyle{sf}}
%\urlstyle{rm}
\newcommand\addCTAN[2][\textsf{CTAN}:]{%
    {\footnotesize\href{http://mirror.ctan.org/#2}{#1\:{\mypath{#2}}}}% 
}

\newcommand\CTAN[1]{%
  {\footnotesize\href{http://mirror.ctan.org/#1}{\textsf{CTAN:}~{\mypath{#1}}}}}


\newcommand\pkg{\texttt{SASnRdisplay}\xspace}
%\setsecnumdepth{none}
\setsecheadstyle{\large\slshape\bfseries\memRTLraggedright}

\usepackage[svgnames,dvipsnames]{xcolor}
 \definecolor{felinesrcbgcolor}{rgb}{0.94,0.97,1}
 \definecolor{felineframe}{rgb}{0.79,0.88,1}


\usepackage[
english,
%grayscale,
%noautotitles-sas,
noneedspace
]{SASnRdisplay}

\captionsetup[lstlisting]{
  font=small,
  labelfont=bf
}  



\newcommand\R{\textsf{R}\xspace}
\newcommand\SAS{\textsf{SAS}\xspace}
\newcommand\sweave{\textsf{Sweave}\xspace}

\usepackage{xkeyval}


\setlength\unitlength{\linewidth+1em}
\lstdefinestyle{Show}{
  basicstyle=\ttfamily\small,
  breaklines,
  breakatwhitespace,
  columns=flexible,
  backgroundcolor=\color{BrickRed!10},
  rulecolor=\color{BrickRed},
  frame=single,
  framesep=0.25em,
  escapeinside=||,
}
\lstdefinestyle{inShow}{
  style=Show,
  basicstyle=\ttfamily\normalsize\color{BrickRed},
}
\lstnewenvironment{Show}[1][]{
\lstset{
  style=Show,#1
}
}{}
%\setsecnumdepth{none}
\newcommand\error[1]{\textcolor{OliveGreen}{>>#1<<}}

\def\NAME{SASnRdisplay.sty}
\newcommand\getsniplet[2]{
  \begingroup
  \Needspace{4\onelineskip}
  \ifblank{#2}{
    \lstinputlisting[style=Show,
    rangeprefix=\%\ ,
    includerangemarker=false,
    linerange=#1-end\ #1,
    columns=fixed,
    xleftmargin=0.5em,
    framexleftmargin=0.5em,
    ]{\NAME}
  }{
    \lstinputlisting[style=Show,
    rangeprefix=\%\ ,
    includerangemarker=false,
    linerange=#1-end\ #1,
    title={Style: #2},
    columns=fixed,
    xleftmargin=0.5em,
    framexleftmargin=0.5em,
    ]{\NAME}}
  \endgroup
  \noindent\ignorespaces
}

\newcommand\showcolor[1]{>>{\color{#1}\rule{1em}{0.5em}}<<}

\newenvironment{question}[1]{
  \subsubsection*{\textnormal{\textit{\color{BrickRed}#1}}}
  \phantomsection
  \addcontentsline{toc}{subsection}{#1}
}{}
\lstnewenvironment{solution}[1][]{
  \lstset{style=Show,gobble=2,columns=fixed,#1}
}{}


\lstdefinestyle{sas-inline}{
basicstyle = \ttfamily,
style = sas-more-keywords,
language = SAS,
}

\usepackage{hyperref}


\pagestyle{plain}


\begin{document}



\begin{SAScode}[caption={Test of caption}]
PROC INSIGHT DATA data=fisk;
SCATTER x1 x2 x3 x4 x5 * dosis vgt;
RUN; 
OUTPUT
QUIT; /* a standard SAS comment */
\end{SAScode}

\end{document}

Questions

  1. I want to put listings for the code
  2. and want to use BLUE font for SAS reserved words.

Any help will be highly appreciated.

share|improve this question
"Do my work for me" questions aren't very popular here. You'll do better if you try to solve your problem yourself and if that doesn't work, show us what you tried. The listings package is being loaded and set up, so it's not clear what you want. As far as I can tell, the SAScode environment isn't defined here, however… – Seamus Jan 21 '12 at 10:12
The SASnRdisplay manual should be your first required reading. Followed by the listings manual if need be. – Seamus Jan 21 '12 at 10:14

closed as not a real question by lockstep, Joseph Wright Mar 3 '12 at 21:42

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

Browse other questions tagged or ask your own question.