From c1802566752c60e5104bdfc7c68f9a10fe490239 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 21 Mar 2010 23:20:57 +0000 Subject: new latex package standalone 0.1 (21mar10) git-svn-id: svn://tug.org/texlive/trunk@17521 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/standalone/standalone.cfg | 4 + .../texmf-dist/tex/latex/standalone/standalone.cls | 104 +++++++++++++++++++ .../texmf-dist/tex/latex/standalone/standalone.sty | 113 +++++++++++++++++++++ 3 files changed, 221 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/standalone/standalone.cfg create mode 100644 Master/texmf-dist/tex/latex/standalone/standalone.cls create mode 100644 Master/texmf-dist/tex/latex/standalone/standalone.sty (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/standalone/standalone.cfg b/Master/texmf-dist/tex/latex/standalone/standalone.cfg new file mode 100644 index 00000000000..e2fcf8f8ac9 --- /dev/null +++ b/Master/texmf-dist/tex/latex/standalone/standalone.cfg @@ -0,0 +1,4 @@ +% $Id: standalone.dtx 1704 2010-03-21 19:25:13Z martin $ +\ProvidesFile{standalone.cfg}[2010/03/21 v0.1 Default configuration file for 'standalone' class and package]% +\PassOptionsToPackage{active,tightpage}{preview}% +% vim: ft=tex diff --git a/Master/texmf-dist/tex/latex/standalone/standalone.cls b/Master/texmf-dist/tex/latex/standalone/standalone.cls new file mode 100644 index 00000000000..46cc44389d2 --- /dev/null +++ b/Master/texmf-dist/tex/latex/standalone/standalone.cls @@ -0,0 +1,104 @@ +%% +%% This is file `standalone.cls', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% standalone.dtx (with options: `cls') +%% +%% Copyright (c) 2010 by Martin Scharrer +%% +%% 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 `maintained'. +%% +%% The Current Maintainer of this work is Martin Scharrer. +%% +%% This work consists of the files standalone.dtx, standalone.ins +%% and the derived file standalone.sty. +%% +% $Id: standalone.dtx 1704 2010-03-21 19:25:13Z martin $ +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{standalone} [2010/03/21 v0.1 Class to compile TeX sub-files standalone] +\def\sa@classoptionslist{} +\RequirePackage{kvoptions} +\SetupKeyvalOptions{prefix=sa@} +\DeclareBoolOption[true]{preview} +\let\standalone\empty +\let\endstandalone\relax +\def\sa@cls@document{\standalone} +\def\sa@cls@enddocument{\endstandalone} +\DeclareVoidOption{beamer}{% + \def\sa@class{beamer}% + \sa@previewfalse + \newenvironment{standaloneframe}{% + \@ifnextchar<% + {\@standaloneframe}% + {\@@standaloneframe{}}% + }{\end{frame}}% + \def\@standaloneframe<##1>{% + \@@standaloneframe{<##1>}% + } + \def\@@standaloneframe##1{% + \@ifnextchar[%] + {\@@@standaloneframe{##1}}% + {\@@@standaloneframe{##1}[]}% + }% + \def\@@@standaloneframe##1[{% + \@ifnextchar<% + {\@@@@standaloneframe{##1}[}% + {\@@@@@@standaloneframe{##1}[}% + }% + \def\@@@@standaloneframe##1[##2]{% + \@ifnextchar[%] + {\@@@@@standaloneframe{##1}{##2}}% + {\begin{frame}##1[##2][environment=standaloneframe]}% + }% + \def\@@@@@standaloneframe##1##2[##3]{% + \begin{frame}##1[##2][environment=standaloneframe,##3]% + }% + \def\@@@@@@standaloneframe##1[##2]{% + \begin{frame}##1[environment=standaloneframe,##2]% + }% +} +\DeclareStringOption[article]{class} +\DeclareStringOption[]{frameoptions} +\DeclareDefaultOption{% + \xdef\sa@classoptionslist{\sa@classoptionslist,\CurrentOption}% +} +\input{standalone.cfg} +\ProcessKeyvalOptions*\relax +\let\@classoptionslist\sa@classoptionslist +\xdef\@tempa{[\sa@classoptionslist]{\sa@class}} +\expandafter\LoadClass\@tempa +\@nameuse{sa@afterclassloaded} +\ifsa@preview + \@ifundefined{endstandalone}{% + \renewenvironment{standalone} + {\preview } + {\endpreview} + }{}% + \RequirePackage{preview} +\fi +\RequirePackage{standalone}[2010/03/21] +\standalonetrue +\def\document{% + \sa@orig@document + \let\documentclass\sa@documentclass + \sa@cls@document +} +\def\enddocument{% + \sa@cls@enddocument + \sa@orig@enddocument +} +\endinput +%% +%% End of file `standalone.cls'. diff --git a/Master/texmf-dist/tex/latex/standalone/standalone.sty b/Master/texmf-dist/tex/latex/standalone/standalone.sty new file mode 100644 index 00000000000..db5544a0fdf --- /dev/null +++ b/Master/texmf-dist/tex/latex/standalone/standalone.sty @@ -0,0 +1,113 @@ +%% +%% This is file `standalone.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% standalone.dtx (with options: `sty') +%% +%% Copyright (c) 2010 by Martin Scharrer +%% +%% 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 `maintained'. +%% +%% The Current Maintainer of this work is Martin Scharrer. +%% +%% This work consists of the files standalone.dtx, standalone.ins +%% and the derived file standalone.sty. +%% +% $Id: standalone.dtx 1704 2010-03-21 19:25:13Z martin $ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{standalone} [2010/03/21 v0.1 Package to include TeX sub-files which use the 'standalone' class] +\expandafter\newif\csname ifstandalone\endcsname +\standalonefalse +\newcommand{\sa@documentclass}[2][]{% + \let\document\sa@document + \expandafter\sa@@documentclass +} +\def\sa@@documentclass{% + \begingroup\def\sa@gobbleto{document}\sa@gobble +} +\long\def\sa@gobble#1\begin#2{% + \def\@tempa{#2}% + \ifx\@tempa\sa@gobbleto + \def\next{\expandafter\endgroup\expandafter\begin\expandafter{\sa@gobbleto}}% + \else + \def\next{\sa@gobble}% + \fi + \next +} +\@ifundefined{standalone} + {\newenvironment{standalone}[1][]{}{}} + {} +\@ifundefined{standaloneframe} + {\@ifundefined{beamer@newenv} + {\newenvironment{standaloneframe}[1][]{% + \@ifnextchar[%] + {\sa@framegobbleopt}{\sa@framegobbleargs}}{}% + } + {\newenvironment<>{standaloneframe}[1][]{% + \@ifnextchar[%] + {\sa@framegobbleopt}{\sa@framegobbleargs}}{}% + } + \def\sa@framegobbleopt[#1]{\sa@framegobbleargs} + \def\sa@framegobbleargs{% + \@ifnextchar\bgroup + {\sa@framegobbleargs@}% + {}% + } + \def\sa@framegobbleargs@#1{% + \@ifnextchar\bgroup + {\@gobble}% + {}% + } + } + {} +\let\sa@orig@document\document +\let\sa@orig@enddocument\enddocument +\def\document{% + \sa@orig@document + \let\documentclass\sa@documentclass + \ignorespaces +} +\def\sa@document{% + \let\enddocument\sa@enddocument + \sa@atbegindocument +} +\def\sa@enddocument{% + \sa@atenddocument + \aftergroup\sa@@enddocument +} +\def\sa@atbegindocument{% + \ignorespaces +}% +\def\sa@atenddocument{% + \unskip +}% +\def\sa@@enddocument{% + %\let\document\sa@orig@document + \let\enddocument\sa@orig@enddocument + \endinput +} +\def\sa@processpreamble{% + \renewcommand\usepackage[2][]{% + \message{^^J% + INFO: Sub-file requires the following package(s):^^J + \space\space[##1]{##2}^^J% + }% + }% + \let\RequirePackage\usepackage +} +%%\def\sa@@documentclass{\sa@processpreamble} +\endinput +%% +%% End of file `standalone.sty'. -- cgit v1.2.3