diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/sasnrdisplay/SASnRdisplay.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/sasnrdisplay/SASnRdisplay.tex | 182 |
1 files changed, 125 insertions, 57 deletions
diff --git a/Master/texmf-dist/doc/latex/sasnrdisplay/SASnRdisplay.tex b/Master/texmf-dist/doc/latex/sasnrdisplay/SASnRdisplay.tex index c317da93077..b51648e6dc8 100644 --- a/Master/texmf-dist/doc/latex/sasnrdisplay/SASnRdisplay.tex +++ b/Master/texmf-dist/doc/latex/sasnrdisplay/SASnRdisplay.tex @@ -1,6 +1,6 @@ -% $LastChangedDate: 2012-03-27 12:21:37 +0200 (Tue, 27 Mar 2012) $ -% $LastChangedRevision: 1479 $ -% $LastChangedBy: daleif $ +% $LastChangedDate: 2017-12-01 15:08:05 +0100 (Fri, 01 Dec 2017) $ +% $LastChangedRevision: 1923 $ +% $LastChangedBy: daleif@math.au.dk $ \documentclass[a4paper,article]{memoir} @@ -33,7 +33,8 @@ \newcommand\pkg{\texttt{SASnRdisplay}\xspace} -%\setsecnumdepth{none} +\setsecnumdepth{subsection} +\settocdepth{subsection} \setsecheadstyle{\large\slshape\bfseries\memRTLraggedright} \usepackage[svgnames,dvipsnames]{xcolor} @@ -118,22 +119,48 @@ noneedspace \newenvironment{question}[1]{ \subsubsection*{\textnormal{\textit{\color{BrickRed}#1}}} \phantomsection - \addcontentsline{toc}{subsection}{#1} + \addcontentsline{toc}{subsubsection}{#1} }{} \lstnewenvironment{solution}[1][]{ \lstset{style=Show,gobble=2,columns=fixed,#1} }{} -\usepackage{hyperref} +\usepackage[ +colorlinks, +breaklinks, +plainpages=false, +pdfpagelabels, +pdfencoding = auto, +bookmarksnumbered, +unicode, +]{hyperref} + + +\title{The \textsf{SASnRdisplay} package} +\author{Lars Madsen\thanks{Email: daleif@math.au.dk, \SnRversion}} + +\definecolor{linkcolour}{rgb}{0,0.2,0.6} +\definecolor{citecolour}{rgb}{0,0.6,0.2} +\definecolor{urlcolour} {rgb}{0.8,0,0.8} + + +\hypersetup{ + pdftitle={The \textsf{SASnRdisplay} package}, + pdfauthor={\copyright\ Lars Madsen 2017}, + linkcolor=linkcolour, + citecolor=citecolour, + filecolor=urlcolour, + urlcolor=urlcolour, +} + + \settocdepth{subsection} \pagestyle{plain} \begin{document} -\title{The \textsf{SASnRdisplay} package} -\author{Lars Madsen\thanks{Email: daleif@imf.au.dk,\SnRversion}} \maketitle \chapter*{Introdution} @@ -264,6 +291,10 @@ Available options: \item[consecutive] Use this if you just want consecutive numbering throughout, that is the number of say \SAS code, is not reset at every new chapter or section. +\item[countbylistings] Here we will leave the counters alone and just + use the one that comes with \texttt{listings}. This (of course) + disables \texttt{countbysection}, \texttt{countbychapter} and + \texttt{consecutive}. \item[noautotitles-r, noautotitles-sas] Do not automatically add a number to any of the code and outputs. It can still be added manually by using the \texttt{caption=\marg{text}} option. @@ -357,7 +388,7 @@ of either overwriting one of these pieces or override a special user style which is executed as the last style (and thus overwrites any former style). -The settings can be seen in section~\ref{cha:defa-list-style}. The +The settings can be seen in Section~\ref{cha:defa-list-style}. The styles are broken into smaller pieces. In some cases it make sense to change one of these smaller pieces, in other cases it is easier to add stuff to the provided \texttt{\meta{name}-\meta{type}-user} @@ -374,7 +405,29 @@ possible to add to a \texttt{listings} style. Thus you will have to add all your setting for, say, \texttt{r-user}, into one single call to \cs{lstdefinestyle}. -\subsection*{Colors} + +\subsection{Font} + +\begin{question}{I'd like to change the font size} + The gereral fontsize (not comments) is handled by the keyword + \texttt{basicstyle}, so you can change the font size for SAS code + in two ways, + \begin{solution} + \lstdefinestyle{sas-code-user}{ + basicstyle=\ttfamily\footnotesize + } + \end{solution} + or by overwriting the default SAS code font setting: + \begin{solution} + \lstdefinestyle{sas-code-fonts}{ + basicstyle = \ttfamily\small, + } + \end{solution} +\end{question} + + + +\subsection{Colors} \label{sec:colors} The default colors are \texttt{SnRFrame} \showcolor{SnRFrame} for the @@ -436,7 +489,7 @@ to \texttt{SnRFrameGray} \showcolor{SnRFrameGray} and \texttt{SnRBGGray} -\subsection*{Frames} +\subsection{Frames} \label{sec:frames} Listings supports a number of different types of frames, see the @@ -469,7 +522,7 @@ A user may want to experiment with the keys \endgroup -\subsection*{Captions} +\subsection{Captions} \label{sec:captions-1} This is not a configuration as such but rather a hint to how one adds @@ -538,7 +591,7 @@ Note that numbered construction without a caption are typeset as \end{question} -\subsection*{Keywords} +\subsection{Keywords} \label{sec:keywords} \begin{question}{In a presentaion, I'd like to highlight a word} @@ -587,7 +640,7 @@ Note that numbered construction without a caption are typeset as \end{question} -\subsection*{Escape to \LaTeX} +\subsection{Escape to \LaTeX} \label{sec:escape-latex} This is a very handy feature and can e.g.\ be used to get formatted @@ -615,59 +668,68 @@ in the \meta{options} for the environment or the input macro. \fancybreak{} -The \texttt{listings} manual, \cite[section~4.14]{listings} list other +The \texttt{listings} manual, \cite[Section~4.14]{listings} list other features related to escaping back to normal \LaTeX\ formatting. -\subsection*{Input encodings} +\subsection{Input encodings (e.g. UTF8)} \label{sec:input-encodings} \begin{question}{I keep getting errors when I include my program, something about undefined chars!?} - There are two things at play here: firstly \texttt{listings} does - not support two-byte UTF8 (\texttt{listings} need to do a lot of - parsing, that and parsing may break when dealing with two-byte - UTF8), secondly one may have a situation where the main document - encoding is different from the encoding being used in code filers - being included. - - Let us try and handle the later first. We assume you are using the - \texttt{inputenc} package. Then one can specify that, say, all code - should be interpreted with, say, the \texttt{latin1} encoding. Here - is how for included \SAS code: - \begin{solution} - \lstdefinestyle{sas-include-code-user}{ - inputencoding=latin1 - } - \end{solution} + The problem here is that \texttt{listings} cannot cope with so-called two two-byte characters, + \texttt{listings} needs to do a lot of parsing which may break when dealing with e.g. two-byte + UTF8 chars (essentially all non-acsii chars). + + At the moment, no-one have made a UTF8 compatible version of \texttt{listings}, so we need to cope + somehow. + + We will be assuming you are working with UTF8 files (both on the LaTeX side, and any including + source code), UTF8 is recommended nowadays, so we will ignore working purely in latin1 (which + \texttt{listings} has no issues with at all). \fancybreak{} - The other situation, i.e.\ the included\footnote{The solution is - only available for included files.} file is written in UTF8. Here - a solution exist if the two-byte UTF8 file, can safely be - transformed into a one-byte encoding such as \texttt{latin1}. And - example of this could be the situation with an \R file, written in - UTF8, including the Danish vowels æøå, but other that those only US - ascii is being used. A file like this can easily be recoded as a - \texttt{latin1} based file. - - There is a package (\texttt{listingsutf8}) can than handle this. It - extends the file inclusion feature and extend the input encoding - syntax. In the case described above, adding \texttt{listingsutf8} to - your preamble, and using + First scenario: Assuming all your \texttt{listings} presented material comes from external + sources, e.g. they are inputted, and assuming your UTF8 sources code is compatible with the latin1 + encoding (aka Western European languages), then you can simply additionally use the package + \texttt{listingsutf8}. It extends the file inclusion feature and extend the input encoding + syntax. Add \texttt{listingsutf8} to your preamble, and using \begin{solution} \lstdefinestyle{r-include-code-user}{ inputencoding=utf8/latin1 } \end{solution} - may solve the problem. See \cite{listingsutf8} for a bit more details. + will attempt to auto convert the included code into latin1 before handing it off to + \texttt{listings}. See \cite{listingsutf8} for a bit more details. + + \fancybreak{} + + Another solution, which works very well is using the the \texttt{literate} option. The value of + this key is read in triples, and is basically saying, if you see this char, typeset this + instead. Here is an example with the Danish æøå: + \begin{solution} + \lstdefinestyle{r-code-user}{ + literate={æ}{\ae}1% + {Æ}{\AE}1% + {ø}{\o}1% + {Ø}{\O}1% + {å}{\aa}1% + {Å}{\AA}1,% + } + \end{solution} + (add the comma after the last one). There are several examples on + \url{http://tex.stackexchange.com} if you search for + ``\texttt{listings literate}''. + + As for the syntax of the triple: \marg{input}\marg{typeset output}\marg{length}. + \end{question} -\subsection*{Other} +\subsection{Other} \label{sec:other} \begin{question}{I'd like to have line numbers} @@ -804,9 +866,9 @@ QUIT; /* a standard SAS comment */ whereas \begin{SASoutput} - TABLE OF NIVEAU BY FAG + TABLE OF NIVEAU BY SUBJECT - NIVEAU FAG + NIVEAU SUBJECT Frequency| Percent | @@ -836,9 +898,9 @@ whereas comes from \begin{Show} \begin{SASoutput} - TABLE OF NIVEAU BY FAG + TABLE OF NIVEAU BY SUBJECT - NIVEAU FAG + NIVEAU SUBJECT Frequency| Percent | @@ -938,6 +1000,8 @@ then one will get the \texttt{basicstyle} plus bold face (if possible) for things that are emphasized. \getsniplet{rcharsandbreaks}{\texttt{r-chars-and-breaks}} \getsniplet{rmarkup}{\texttt{r-markup}} +\R lang setting was added 2017/12/01 and requires a \texttt{listings} +newer from 2015 or later. \getsniplet{rframe}{\texttt{r-frame}} \getsniplet{rcolors}{\texttt{r-colors}} \noindent @@ -951,6 +1015,10 @@ being black by default. Note that by default, the inline style for \verb|\Rinline|, shares nothing with the rest of the \R configuration and is loaded on its own. +\R lang setting was added 2017/12/01 and requires a \texttt{listings} +newer from 2015 or later. + + \subsection{\R user styles} \label{sec:user-styles} @@ -1050,7 +1118,7 @@ input encoding for, say, all included code files. -\subsection*{Extra SAS keywords} +\subsection{Extra SAS keywords} \label{sec:extra-sas-keywords} Jørgen Granfeldt supplied extra \SAS keywords to supplement those @@ -1073,20 +1141,20 @@ Here is the current list. \begin{thebibliography}{9} \RaggedRight \bibitem{xcolor} Uwe Kern, \emph{Extending \LaTeX's color facilities: - the \textsf{xcolor} package}, 2006. + the \textsf{xcolor} package}, 2016. \addCTAN{/macros/latex/contrib/xcolor/}. \bibitem{listings} Various, \emph{The \textsf{listings} Package}, - 1996--2007. \addCTAN{/macros/latex/contrib/listings/}. + 1996--2015. \addCTAN{/macros/latex/contrib/listings/}. \bibitem{etoolbox} - Philipp Lehman, + Philipp Lehman, Joseph Wright, \emph{The etoolbox Package -- An e-TeX Toolbox for Class and Package - Authors}, 2011. \addCTAN{/macros/latex/contrib/listings/etoolbox}. + Authors}, 2017. \addCTAN{/macros/latex/contrib/listings/etoolbox}. \bibitem{listingsutf8} - Heiko Oberdiek, \emph{The \textsf{listingsutf8} package}, 2007. + Heiko Oberdiek, \emph{The \textsf{listingsutf8} package}, 2016. \addCTAN{/macros/latex/contrib/oberdiek/}. \bibitem{caption} Axel Sommerfelt, \emph{Customizing captions of |