diff options
author | Karl Berry <karl@freefriends.org> | 2010-04-10 21:56:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-04-10 21:56:52 +0000 |
commit | 5406b8e0ea1d596600f773e766975256e4087c51 (patch) | |
tree | 74d244f62ddcc29123ecef56e914cc0fd7bd6de3 /Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty | |
parent | 4f711ec63a6c65e74a08a634bc886ee54b2140fe (diff) |
new latex package ydoc (10apr10)
git-svn-id: svn://tug.org/texlive/trunk@17793 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty b/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty new file mode 100644 index 00000000000..d8daf010426 --- /dev/null +++ b/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty @@ -0,0 +1,84 @@ +%% +%% This is file `ydoc-expl.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% ydoc.dtx (with options: `expl') +%% +%% Copyright (c) 2010 by Martin Scharrer <martin@scharrer-online.de> +%% WWW: http://latex.scharrer-online.de/ +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% 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.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 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 ydoc.dtx and ydoc.ins +%% and the derived file ydoc.cls, ydoc.sty, ydoc-code.sty, +%% ydoc-expl.sty and ydoc-desc.sty. +%% +\RequirePackage{svn-prov}[2010/04/03] +\NeedsTeXFormat{LaTeX2e}[1999/12/01] +\ProvidesPackageSVN + [ydoc-expl] + {$Id: ydoc.dtx 1847 2010-04-10 10:57:11Z martin $} + [v0.1alpha] + [ydoc package to insert live examples of LaTeX code] +\RequirePackage{listings} +\lst@RequireAspects{writefile} +\def\ydoc@exafile{\jobname.exa} +\def\exampleprintsettings{frame=lines}% +\newbox\examplecodebox +\newbox\exampleresultbox +\def\BoxExample{% + \setbox\examplecodebox\hbox{\color@setgroup + \expandafter\expandafter\expandafter\lstinputlisting + \expandafter\expandafter\expandafter[% + \expandafter\exampleprintsettings\expandafter,\thisexampleprintsettings]% + {\ydoc@exafile}% + \color@endgroup}% + \setbox\exampleresultbox\hbox{\color@setgroup + \@@input\ydoc@exafile\relax + \color@endgroup}% +} +\RequirePackage{showexpl} +\def\PrintExample{% + \begingroup + \lstset{basicstyle=\ttfamily}% + \MakePercentComment + \LTXinputExample[varwidth]{\ydoc@exafile}% + \endgroup +} +\def\examplecodesettings{gobble=4} +\lstnewenvironment{examplecode}[1][]{% + \def\thisexampleprintsettings{#1}% + \expandafter\lstset\expandafter{\examplecodesettings,#1}% + \setbox\@tempboxa\hbox\bgroup + \lst@BeginWriteFile{\ydoc@exafile}% +} +{% + \lst@EndWriteFile + \egroup + \PrintExample +} +\RequirePackage{float} +\floatstyle{plain} +\newfloat{example}{tbhp}{loe} +\floatname{example}{\examplename} +\def\examplename{Example} +\newenvironment{exampletable}{% + \floatstyle{plaintop}% + \restylefloat{example}% + \example +}{\endexample} +\endinput +%% +%% End of file `ydoc-expl.sty'. |