summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-08-13 22:20:48 +0000
committerKarl Berry <karl@freefriends.org>2011-08-13 22:20:48 +0000
commit6896e1abedec5194e9a456ce8d6c630999e4ed0f (patch)
treedb4ba79c3b3a9afcc9d682ff1135a3440930bb70 /Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty
parent878253a4b3b9dc4e9da23f4aaffb88d5d3cf6dff (diff)
ydoc (13aug11)
git-svn-id: svn://tug.org/texlive/trunk@23544 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.sty43
1 files changed, 10 insertions, 33 deletions
diff --git a/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty b/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty
index ff5f245a205..70781dba415 100644
--- a/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty
+++ b/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty
@@ -4,45 +4,23 @@
%%
%% The original source files were:
%%
-%% ydoc.dtx (with options: `expl')
+%% ydoc.dtx (with options: `ydoc-expl.sty')
%%
-%%
-%% Copyright (c) 2010-2011 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.
-%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-\RequirePackage{svn-prov}[2010/04/03]
-\ProvidesPackageSVN[ydoc]
- {$Id: ydoc_expl_sty.dtx 2332 2011-03-17 17:12:35Z martin $}
- [v0.5alpha]
- [ydoc package to insert live examples of LaTeX code]
+\ProvidesPackage{ydoc-expl}[%
+ 2011/08/11
+ v0.5alpha
+ ydoc package to insert live examples of LaTeX code]
\RequirePackage{listings}
\lst@RequireAspects{writefile}
\def\ydoc@exafile{\jobname.exa}
-\def\exampleprintsettings{numbers=left,numberstyle=\tiny\color{gray}\sffamily,numbersep=5pt}%
+\lstdefinestyle{examplecode}{numbers=left,firstnumber=1,numberstyle=\tiny\color{gray}\sffamily,numbersep=5pt}%
+\lstdefinestyle{exampleextract}{gobble=4}%
\newbox\examplecodebox
\newbox\exampleresultbox
\def\BoxExample{%
\setbox\examplecodebox\hbox{\color@setgroup
- \expandafter\expandafter\expandafter\lstinputlisting
- \expandafter\expandafter\expandafter[%
- \expandafter\exampleprintsettings\expandafter,\thisexampleprintsettings]%
+ \lstinputlisting[style=examplecode,style=thisexampleprint]%
{\ydoc@exafile}%
\unskip\color@endgroup}%
\setbox\exampleresultbox\hbox{\color@setgroup
@@ -73,10 +51,9 @@
\fi
\endgroup
}
-\def\examplecodesettings{gobble=4}
\lstnewenvironment{examplecode}[1][]{%
- \def\thisexampleprintsettings{#1}%
- \expandafter\lstset\expandafter{\examplecodesettings,#1}%
+ \lstdefinestyle{thisexampleprint}{#1}%
+ \lstset{style=exampleextract,#1}%
\setbox\@tempboxa\hbox\bgroup
\lst@BeginWriteFile{\ydoc@exafile}%
}