-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sweave.sty
47 lines (40 loc) · 1.29 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
\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,textcomp}
%% inspired by an earlier version of upquote.sty
\begingroup
\catcode`'=\active \catcode``=\active
\g@addto@macro\@noligs{\let`\textasciigrave \let'\textquotesingle}
\endgroup
\ifthenelse{\boolean{Sweave@gin}}{\setkeys{Gin}{width=0.8\textwidth}}{}%
\ifthenelse{\boolean{Sweave@ae}}{%
\RequirePackage[T1]{fontenc}
\RequirePackage{ae}
}{}%
\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl}
\DefineVerbatimEnvironment{Soutput}{Verbatim}{}
\DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl}
\ifdefined\Schunk%
\message{\string Environment Schunk is already defined, stay with former definition}%
\else
\newenvironment{Schunk}{}{}%
\fi
\newcommand{\Sconcordance}[1]{%
\ifx\pdfoutput\undefined%
\csname newcount\endcsname\pdfoutput\fi%
\ifcase\pdfoutput\special{#1}%
\else%
\begingroup%
\pdfcompresslevel=0%
\immediate\pdfobj stream{#1}%
\pdfcatalog{/SweaveConcordance \the\pdflastobj\space 0 R}%
\endgroup%
\fi}