-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sweave.sty
54 lines (44 loc) · 2.28 KB
/
Sweave.sty
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
53
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{Sweave}{}
\RequirePackage{ifthen}
\newboolean{Sweave@gin}
\setboolean{Sweave@gin}{true}
\newboolean{Sweave@ae}
\setboolean{Sweave@ae}{true}
\DeclareOption{nogin}{\setboolean{Sweave@gin}{false}}
\DeclareOption{noae}{\setboolean{Sweave@ae}{false}}
\ProcessOptions
\RequirePackage{graphicx,fancyvrb}
\IfFileExists{upquote.sty}{\RequirePackage{upquote}}{}
\ifthenelse{\boolean{Sweave@gin}}{\setkeys{Gin}{width=0.8\textwidth}}{}%
\ifthenelse{\boolean{Sweave@ae}}{%
\RequirePackage[T1]{fontenc}
\RequirePackage{ae}
}{}%
\newenvironment{Schunk}{}{}
\newcommand{\Sconcordance}[1]{%
\ifx\pdfoutput\undefined%
\csname newcount\endcsname\pdfoutput\fi%
\ifcase\pdfoutput\special{#1}%
\else\immediate\pdfobj{#1}\fi}
% begin (Ihaka 2009 ``Sweave-customisation.pdf'')
\definecolor{sinput}{rgb}{0.29,0.098,0.82}
\definecolor{soutput}{rgb}{0.463,0.098,0.208}
\definecolor{sinput}{rgb}{0,0,0}
\definecolor{soutput}{rgb}{0,0,0}
%% verbatim environments (I tried small but prefer doing what Springer suggests)
%% FIXME: altering the xleftmargin value does not seem to have any effect.
\DefineVerbatimEnvironment{unixinput}{Verbatim}{xleftmargin=0.1em}
\DefineVerbatimEnvironment{unixoutput}{Verbatim}{xleftmargin=0.1em}
\DefineVerbatimEnvironment{Sinput}{Verbatim} {xleftmargin=0.1em,frame=leftline,formatcom=\color{sinput}}
\DefineVerbatimEnvironment{Soutput}{Verbatim}{xleftmargin=0.1em,frame=leftline,framerule=0.7mm,formatcom={\vspace{-0.25em}\color{soutput}}}
%\DefineVerbatimEnvironment{unixinput}{Verbatim}{xleftmargin=0.1em,fontsize=\small}
%\DefineVerbatimEnvironment{unixoutput}{Verbatim}{xleftmargin=0.1em,fontsize=\small}
%\DefineVerbatimEnvironment{Sinput}{Verbatim} {xleftmargin=0.1em,frame=leftline,formatcom=\color{sinput},fontsize=\small}
%\DefineVerbatimEnvironment{Soutput}{Verbatim}{xleftmargin=0.1em,frame=leftline,framerule=0.7mm,formatcom={\vspace{-0.25em}\color{soutput}},fontsize=\small}
%\DefineVerbatimEnvironment{Soutput}{Verbatim}{xleftmargin=2em,fontshape=sl,formatcom=\color{soutput}}
\DefineVerbatimEnvironment{Scode}{Verbatim}{xleftmargin=-0.1em,frame=leftline}
\fvset{listparameters={\setlength{\topsep}{0pt}}}
%\renewenvironment{Schunk}{\vspace{\topsep}}{\vspace{\topsep}}
\renewenvironment{Schunk}{\vspace{.2\topsep}}{\vspace{.2\topsep}}
% end (Ihaka)