texlive[47484] Master: includernw (29apr18)

commits+karl at tug.org commits+karl at tug.org
Sun Apr 29 23:47:49 CEST 2018


Revision: 47484
          http://tug.org/svn/texlive?view=revision&revision=47484
Author:   karl
Date:     2018-04-29 23:47:49 +0200 (Sun, 29 Apr 2018)
Log Message:
-----------
includernw (29apr18)

Modified Paths:
--------------
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/includernw/
    trunk/Master/texmf-dist/doc/latex/includernw/README.txt
    trunk/Master/texmf-dist/doc/latex/includernw/includeRnw-doc.pdf
    trunk/Master/texmf-dist/doc/latex/includernw/includeRnw-doc.tex
    trunk/Master/texmf-dist/tex/latex/includernw/
    trunk/Master/texmf-dist/tex/latex/includernw/includeRnw.sty
    trunk/Master/tlpkg/tlpsrc/includernw.tlpsrc

Added: trunk/Master/texmf-dist/doc/latex/includernw/README.txt
===================================================================
--- trunk/Master/texmf-dist/doc/latex/includernw/README.txt	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/includernw/README.txt	2018-04-29 21:47:49 UTC (rev 47484)
@@ -0,0 +1,40 @@
+includeRnw:
+Makes commands for including external .Rnw files.
+
+├── README.txt
+├── includeRnw-doc.pdf
+├── includeRnw-doc.tex
+└── includeRnw.sty
+
+Not tested on Windows!
+
+Quick start:
+
+\documentclass{article}
+\usepackage{includeRnw}
+\begin{document}
+  \includeRnw{path/to/my.Rnw}
+\end{document}
+
+
+Author: Storvik Strauman, Andreas
+
+For bug report, inquires, contributed or anything else:
+https://github.com/Strauman/includeRnw/
+
+Licence:
+
+The LaTeX package includeRnw - version v0.0.2 (2018/04/29) - build 10
+includeRnw.sty
+-------------------------------------------------------------------------------------------
+Copyright (c) 2018 by Andreas Storvik Strauman
+-------------------------------------------------------------------------------------------
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3c
+of this license or (at your option) any later version.
+The latest version of this license is in
+  http://www.latex-project.org/lppl.txt
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008/05/04 or later.
+This work has the LPPL maintenance status `author-maintained'.
+This work consists of all files listed in README.txt


Property changes on: trunk/Master/texmf-dist/doc/latex/includernw/README.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/includernw/includeRnw-doc.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/includernw/includeRnw-doc.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/includernw/includeRnw-doc.pdf	2018-04-29 21:46:58 UTC (rev 47483)
+++ trunk/Master/texmf-dist/doc/latex/includernw/includeRnw-doc.pdf	2018-04-29 21:47:49 UTC (rev 47484)

Property changes on: trunk/Master/texmf-dist/doc/latex/includernw/includeRnw-doc.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/includernw/includeRnw-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/includernw/includeRnw-doc.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/includernw/includeRnw-doc.tex	2018-04-29 21:47:49 UTC (rev 47484)
@@ -0,0 +1,193 @@
+%% includeRnw v0.0.2b10 - 2018/04/29
+%% The LaTeX package includeRnw - version v0.0.2 (2018/04/29) build 10
+%% Manual/Documentation for includeRnw.sty
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2018 by Andreas Storvik Strauman
+%% -------------------------------------------------------------------------------------------
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
+%% This work has the LPPL maintenance status `author-maintained'.
+%% This work consists of all files listed in README.txt
+\documentclass[a4paper]{article}
+\usepackage[all]{tcolorbox}
+\usepackage{needspace}
+\usepackage{tabularx}
+\usepackage{geometry}
+\makeatletter
+\def\input at path{{../../docs/}}
+\lstdefinestyle{mydocumentation}{style=tcbdocumentation,
+  classoffset=0,
+  texcsstyle=*\color{blue},
+  moretexcs={arrayrulecolor,draw,includegraphics,ifthenelse,isodd,lipsum,path,pgfkeysalso},
+  classoffset=1,
+  moretexcs={% core
+    includeRnw
+  },
+  texcsstyle=*\color{Definition}\bfseries,
+  classoffset=0,% restore default
+  }
+\newtcolorbox{marker}[1][]{enhanced,
+    before skip=2mm,after skip=3mm,
+    boxrule=0.4pt,left=5mm,right=2mm,top=1mm,bottom=1mm,
+    colback=yellow!50,
+    colframe=yellow!20!black,
+    sharp corners,rounded corners=southeast,arc is angular,arc=3mm,
+    underlay={%
+      \path[fill=tcbcol at back!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
+      \path[draw=tcbcol at frame,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
+      \path[fill=yellow!50!black,draw=none] (interior.south west) rectangle node[white]{\Huge\bfseries !} ([xshift=4mm]interior.north west);
+      },
+    drop fuzzy shadow,#1}
+  \def\l at macro#1#2{#1\hfill\newline}
+\newcommand\macrotable{\hypersetup{linkcolor=black}\@starttoc{mac}\hypersetup{linkcolor=Definition}}
+\newcommand\gh[1]{\href{#1}{https://github.com/#1}}
+% --- CHANGELOG TABLE --- %
+\newcommand*\l at version[2]{%
+  \ifnum \c at tocdepth >\z@
+    \addpenalty\@secpenalty
+    \addvspace{1.0em \@plus\p@}%
+    \setlength\@tempdima{1.5em}%
+    \begingroup
+      \parindent \z@ \rightskip \@pnumwidth
+      \parfillskip -\@pnumwidth
+      \leavevmode \bfseries
+      \advance\leftskip\@tempdima
+      \hskip -\leftskip
+      #1\nobreak\hfil \nobreak\hb at xt@\@pnumwidth{}\par
+    \endgroup
+  \fi}
+  \newcommand*\l at change[2]{%
+    \addvspace{0.5em \@plus\p@}%
+    \leftskip1em--\hspace{0.5em}\begin{minipage}{0.5\textwidth}#1\end{minipage}\hfill%
+    \begin{minipage}{0.3\textwidth}#2\end{minipage}\par%
+  }
+
+\newcommand\chlogtable{\begin{NoHyper}\@starttoc{chlog}\hypersetup{final}\end{NoHyper}}
+\def\newversion#1{\addcontentsline{chlog}{version}{#1}}
+\newcommand\change[2][]{\addtocontents{chlog}{\protect\contentsline{change}{#2}{#1}{section.\thepage}}}
+% --- /CHANGELOG TABLE --- %
+
+\let\oldTOC\tableofcontents
+\renewcommand\tableofcontents{\hypersetup{linkcolor=black}\oldTOC\hypersetup{linkcolor=Definition}}
+\reversemarginpar
+\def\updated#1{\tcbdocmarginnote{\bfseries{\color{blue}U}#1}}
+\def\defnew#1{\tcbdocmarginnote{\bfseries{\color{green}N}#1}}
+
+\let\dac\docAuxCommand
+\def\mdac#1{\docAuxCommand{\expandafter\@gobble\string#1}}
+
+\makeatother
+
+\long\def\keyDef#1#2#3#4{\begin{docKey}{#1}{=\meta{#2}}{\meta{default}=#3}#4\end{docKey}}
+\long\def\optDef#1#2{\begin{docKey*}{#1}{}{}#2\end{docKey*}}
+\tcbset{documentation listing style=mydocumentation}
+% Magenta HREF style
+\let\oldhref\href
+\gdef\href#1#2{{\color{magenta}\oldhref{#1}{#2}}}
+\tcbset{documentation listing style=mydocumentation,/tcb/color hyperlink=Definition}
+\hypersetup{colorlinks=true}
+% Give section some space
+\let\oldsection\section
+\gdef\section{\needspace{0.3\paperheight}\oldsection}
+\let\oldsubsection\subsection
+\gdef\subsection{\needspace{0.2\paperheight}\oldsubsection}
+
+
+\setlength{\parindent}{0pt}
+\title{{includeRnw - manual\\ v0.0.2{\\[-0.5em]\footnotesize(build 10)}}}
+\author{Andreas Strauman}
+\begin{document}
+\maketitle
+This package is for including \texttt{.Rnw}-files in normal \texttt{.tex}-files.
+It invokes the command \texttt{R} from your command line.\\
+ 
+If you found any bugs or want new functionality, to contribute, view the commented source, get latest version of this package or get in touch with me, you can do all of that at\\\url{https://github.com/Strauman/includeRnw/}. If you have questions of functionality, kindly direct them to the community\\ \url{http://tex.stackexchange.com}. The author is active on this site regularly.
+
+\tableofcontents
+\clearpage
+\section{Quick start}
+\begin{dispListing}
+  \documentclass{article}
+  \usepackage{includeRnw}
+  \begin{document}
+    \includeRnw{path/to/my.Rnw}
+  \end{document}
+\end{dispListing}
+
+\begin{marker}
+Path to \texttt{r}-files are relative to the path of the \texttt{.Rnw}-file
+\end{marker}
+ \section{Reference}
+\filbreak\subsection{Reference}
+\begin{docCommand}{includeRnw}{\oarg{irw-options}\marg{path/to/file.Rnw}}
+Compiles .Rnw-files using R. Assumes that \texttt{R} can be called
+from the command line. It is optional to add the extension \texttt{.Rnw}
+\end{docCommand}
+\filbreak\subsection{Command Options}
+Options to use with \refCom{includeRnw}
+\optDef{h}{Use the \refKey{h} to prevent \dac{includeRnw} from
+actually knitting the file, but only include the knitted \texttt{.tex} file}
+\optDef{f}{\refKey{f} forces \dac{includeRnw} to actually knitting the file no matter,
+what (as long as it exists).}
+\filbreak\subsection{Package Options}
+\dac{usepackage}[\oarg{options}] where the \meta{options} are:\\
+\optDef{halt}{If you do \dac{usepackage}[halt]\brackets{includeRnw},
+then \dac{includeRnw}\{my/file.Rnw\} will \emph{not} run knitr on it.
+However, if the knitted file exists, it will include this. You can
+override this with the f-option in the \refCom{includeRnw}:
+\dac{includeRnw}[f]\brackets{my/file.Rnw}}
+\optDef{new}{This option would make the \refCom{includeRnw} only
+run knitr on the file if the knitted file does not exist.
+}
+\optDef{noknithead}{
+This option will prevent \dac{includeRnw} from building and including the knitr-preamble.
+}
+\filbreak\subsection{User macros}
+ The default user macro settables are
+\begin{dispListing}
+\rnwInputDirectory{.}
+\rnwKnittedSuffix{knitted}
+\rnwKnitlogFile{\rnw at dir@output/knitlog.log}
+\rnwKnitheadName{\rnw at dir@output/knithead}
+\end{dispListing}
+Where \dac{rnw at dir@output} is the value of the set \dac{rnwOutputDirectory}
+\begin{docCommand}{rnwInputDirectory}{\marg{directory}}
+\defnew{v0.0.2\\2018/04/28 } This command sets what directory \dac{includeRnw} will be using. If you e.g.
+ have all the Rnw-files inside a directory called \texttt{myRnws} then
+ \dac{rnwInputDirectory}\brackets{myRnws} would fix this.
+\end{docCommand}
+\begin{docCommand}{rnwKnittedSuffix}{\marg{text}}
+\defnew{v0.0.2\\2018/04/28 } Set the default suffix of the filename of the knitted output
+\end{docCommand}
+\begin{docCommand}{rnwKnitlogFile}{\marg{filename}}
+\defnew{v0.0.2\\2018/04/28 } Sets the filename of the log output by knitr.
+\end{docCommand}
+\begin{docCommand}{rnwKnitheadName}{\marg{filename}}
+\defnew{v0.0.2\\2018/04/28 } Sets the filename of the preamble generated by knitr.
+\end{docCommand}
+\filbreak\subsection{List of all macros}
+
+ \addcontentsline{mac}{macro}{\refCom{includeRnw}}{}
+\addcontentsline{mac}{macro}{\refCom{rnwInputDirectory}}{}
+\addcontentsline{mac}{macro}{\refCom{rnwKnitheadName}}{}
+\addcontentsline{mac}{macro}{\refCom{rnwKnitlogFile}}{}
+\addcontentsline{mac}{macro}{\refCom{rnwKnittedSuffix}}{}
+
+ \macrotable
+
+
+% \newgeometry{lmargin=0.7cm}
+\section{Changelog}
+\newversion{v0.0.1 2018/04/20}
+\change{Created the package}
+\newversion{v0.0.2 2018/04/28}
+\change{Fixed wrong error message on no shell-escape}
+\change{Added macros for setting custom values}
+\change{Added \refKey{noknithead}}
+\chlogtable
+ \end{document}


Property changes on: trunk/Master/texmf-dist/doc/latex/includernw/includeRnw-doc.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/tex/latex/includernw/includeRnw.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/includernw/includeRnw.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/includernw/includeRnw.sty	2018-04-29 21:47:49 UTC (rev 47484)
@@ -0,0 +1,139 @@
+% Source (with comments) can be found at https://github.com/Strauman/includeRnw/
+%% The LaTeX package includeRnw - version v0.0.2 (2018/04/29) - build 10
+%% includeRnw.sty
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2018 by Andreas Storvik Strauman <andreas dot s dot strauman at uit dot no>
+%% -------------------------------------------------------------------------------------------
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%   http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
+%% This work has the LPPL maintenance status `author-maintained'.
+%% This work consists of all files listed in README
+\ProvidesPackage{includeRnw}[2018/04/29 v0.0.2 Makes commands for including external .Rnw files.]
+\providecommand\rnw at loglevel{0}
+\RequirePackage{pdftexcmds}
+\RequirePackage{kvoptions}
+\let\incl\input
+\RequirePackage{kvoptions}
+\SetupKeyvalOptions{ family=includeRnw,
+ prefix=rnw at opt@
+}
+\DeclareBoolOption[true]{build}
+\DeclareComplementaryOption{halt}{build}
+\DeclareBoolOption[false]{new}
+\DeclareBoolOption[true]{knithead}
+\DeclareComplementaryOption{noknithead}{knithead}
+\ProcessKeyvalOptions*\relax
+\ifrnw at opt@build\else
+  \ifrnw at opt@new
+    \@latex at warning{includeRnw: can't use halt and new together. Falling back to new.}
+    \rnw at opt@haltfalse
+  \fi
+\fi
+\providecommand\rnw at dir@input{.}
+\providecommand\rnw at dir@output{./knitrout}
+\providecommand\rnw at suffix{knitted}
+\providecommand\rnw at file@knitlog{\rnw at dir@output/knitlog.log}
+\providecommand\rnw at filebase@knithead{\rnw at dir@output/knithead}
+\def\insp#1{\texttt{\string#1:\meaning#1}}
+\def\inspw#1{\@latex at warning{\string#1:\meaning#1}}
+\providecommand\rnw at loglevel{3}
+\newcommand\@dlog[2][1]{\ifnum\rnw at loglevel>#1\relax\@latex at warning{#2}\fi}
+\def\rnw at filename@parse#1{%
+ \filename at parse{#1}
+ \edef\rnw at filepath{\filename at area\filename at base}
+ \edef\rnw at filebase{\filename at base}
+ \edef\rnw at fileext{\ifx\filename at ext\relax Rnw\else\filename at ext\fi}
+ \edef\rnw at infile@fullpath{\filename at area\filename at base.\filename at ext}
+}
+\def\rnw at clear@knitlog{%
+\immediate\write18{echo "" > \rnw at file@knitlog}
+}
+\def\rnw at check@ouput at file{\rnw at dir@output/.includeRnwShellEscapeCheck}
+\def\check at shell@escape{%
+  \ifcase\pdf at shellescape%
+  \PackageError{includeRnw}{\string\includeRnw\space requires --shell-escape}{}\stop\or%
+  \message{Shell escape test passed}\or%
+  \PackageError{includeRnw}{\string\includeRnw\space requires --shell-escape. Current is restricted shell escape}{}\stop\fi%
+}
+\def\check at output@dir{%
+  \immediate\write18{touch \rnw at check@ouput at file}
+  \IfFileExists{\rnw at check@ouput at file}{}{%
+    \immediate\write18{mkdir \rnw at dir@output}
+}
+  \immediate\write18{rm \rnw at check@ouput at file}
+}
+\def\rnw at include@knithead{%
+  \IfFileExists{\rnw at filebase@knithead.tex}{}{%
+    \@dlog[0]{Creating knithead}
+    \immediate\write18{echo "<<create-preamble,echo=FALSE,results='asis'>>=\string\ncat(knitr:::make_header_latex())\string\n@" > \rnw at filebase@knithead.Rnw}
+    \immediate\write18{R -e 'library("knitr");knit("\rnw at filebase@knithead.Rnw","\rnw at filebase@knithead.tex")' >> \rnw at file@knitlog}
+}
+  \IfFileExists{\rnw at filebase@knithead.tex}{\@dlog[0]{Including knithead}\incl{\rnw at dir@output/knithead.tex}}{\PackageError{includeRnw}{Could not find knitr preamble: \rnw at dir@output/knithead.tex}{}}
+}
+\xdef\rnw at gopt@halt{h}
+\xdef\rnw at gopt@force{f}
+\def\ifrnw at should@knitr{  \@dlog[0]{Deciding whether to do knitting}
+  \let\ifrnw at local@build\ifrnw at opt@build
+  \newif\ifrnw at doknit
+  \rnw at doknittrue
+  \@dlog[2]{Decision is given option: \givenopt}
+  \ifnum\pdfstrcmp{\rnw at gopt@force}{\givenopt\relax}=\z@\relax\rnw at doknittrue\@dlog[2]{Focing build}\else%
+    \ifnum\pdfstrcmp{\rnw at gopt@halt}{\givenopt\relax}=\z@\rnw at doknitfalse\relax\else%
+        \ifrnw at opt@new%
+        \else%
+          \let\ifrnw at doknit\ifrnw at opt@build\relax%
+        \fi%
+    \fi
+  \fi
+\ifrnw at doknit
+\@dlog[1]{Decided to build}
+}
+\def\rnw at purge@outdir{  \immediate\write18{rm -rf \rnw at dir@output}
+  \immediate\write18{mkdir \rnw at dir@output}
+}
+\providecommand\rnw at execute@knitr[2][]{%
+  \def\givenopt{#1}
+  \rnw at filename@parse{#2}
+  \xdef\knitOutfile{\rnw at dir@output/\filename at base\rnw at suffix.tex}
+  \ifrnw at should@knitr
+    \IfFileExists{\rnw at infile@fullpath}{      \@dlog[2]{Building \rnw at infile@fullpath\space to \rnw at dir@output/\filename at base\rnw at suffix.tex}
+      \immediate\write18{R -e 'library("knitr");knit("\rnw at dir@input/\rnw at infile@fullpath",  "\rnw at dir@output/\filename at base\rnw at suffix.tex")' &> \rnw at file@knitlog}
+}{\@latex at error{includeRnw: Could not find file that I was asked to knit: \rnw at infile@fullpath!}{}\stop}
+  \else \@dlog[2]{- Skipping knit of \rnw at infile@fullpath}
+  \fi
+  \IfFileExists{\knitOutfile}{%
+    \@dlog[2]{Found \knitOutfile. Including it.}
+    \incl{\knitOutfile}
+}{%
+    \PackageError{includeRnw}{Couldn't find knitted file: \knitOutfile}{}
+}
+}
+\newcommand\rnw at settable[3][]{%
+\edef\reserved at R{\expandafter\@gobble\string #2}%
+\@ifundefined\reserved at R%
+  {%
+    \gdef#2##1{\gdef#3{##1}#1}
+}%
+  {%
+    \@ifundefined{no\reserved at R}{      \@latex at error{includeRnw: Tried to define \@backslashchar \reserved at R \space, but it's already defined. \MessageBreak If you don't need the command \@backslashchar \reserved at R \space, then just define \string\no\reserved at R\space before you include the includeRnw package: \string\def\string\no\reserved at R{}}{}\stop
+}{      \@latex at warning{\@backslashchar\reserved at R is not defined by includeRnw since it was already defined someewhere else. Continuing since \string\no\reserved at R is defined.}
+}
+}%
+}
+\rnw at settable\rnwInputDirectory\rnw at dir@input
+\rnw at settable\rnwKnittedSuffix\rnw at suffix
+\rnw at settable\rnwKnitlogFile\rnw at file@knitlog
+\rnw at settable\rnwKnitheadName\rnw at filebase@knithead
+\let\includeRnw\rnw at execute@knitr
+\let\purgeOutDir\rnw at purge@outdir
+\check at shell@escape
+\check at output@dir
+\rnw at clear@knitlog
+\ifrnw at opt@knithead%
+  \rnw at include@knithead
+\fi


Property changes on: trunk/Master/texmf-dist/tex/latex/includernw/includeRnw.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2018-04-29 21:46:58 UTC (rev 47483)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2018-04-29 21:47:49 UTC (rev 47484)
@@ -336,7 +336,8 @@
     iitem ijmart ijqc ijsra
     imac image-gallery imakeidx impatient impatient-cn impatient-fr
     imfellenglish impnattypo import imsproc imtekda
-    incgraph inconsolata index indextools initials inlinebib inlinedef
+    incgraph includernw inconsolata index indextools
+    initials inlinebib inlinedef
     inputtrc insbox installfont
     interactiveworkbook interchar interfaces interpreter interval intopdf
     intro-scientific

Modified: trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2018-04-29 21:46:58 UTC (rev 47483)
+++ trunk/Master/tlpkg/tlpsrc/collection-mathscience.tlpsrc	2018-04-29 21:47:49 UTC (rev 47484)
@@ -86,6 +86,7 @@
 depend hepparticles
 depend hepthesis
 depend hepunits
+depend includernw
 depend interval
 depend ionumbers
 depend isomath

Added: trunk/Master/tlpkg/tlpsrc/includernw.tlpsrc
===================================================================


More information about the tex-live-commits mailing list