summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty')
-rw-r--r--Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty24
1 files changed, 21 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty b/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty
index 3115370a579..257cc758ff8 100644
--- a/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty
+++ b/Master/texmf-dist/tex/latex/ydoc/ydoc-expl.sty
@@ -8,13 +8,30 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{ydoc-expl}[%
- 2011/11/19
+ 2012/05/03
v0.6alpha
ydoc package to insert live examples of LaTeX code]
\RequirePackage{listings}
\lst@RequireAspects{writefile}
\def\ydoc@exafile{\jobname.exa}
-\lstdefinestyle{examplecode}{numbers=left,firstnumber=1,numberstyle=\tiny\color{gray}\sffamily,numbersep=5pt}%
+\lstdefinestyle{examplecode}{%
+ language=[latex]tex,
+ basicstyle=\ttfamily,
+ columns=fullflexible,
+ numbers=left,
+ firstnumber=1,
+ numberstyle=\tiny\color{gray}\sffamily,
+ numbersep=5pt,
+ breaklines,prebreak={\mbox{\tiny$\swarrow$}},
+ commentstyle=\color{black!60},
+}%
+\lstdefinestyle{exampleresult}{%
+ firstnumber=1,
+ gobble=0,
+ basicstyle=\ttfamily,
+ columns=fullflexible,
+ commentstyle=\color{black!60},
+}
\lstdefinestyle{exampleextract}{gobble=4}%
\newbox\examplecodebox
\newbox\exampleresultbox
@@ -24,6 +41,7 @@
{\ydoc@exafile}%
\unskip\color@endgroup}%
\setbox\exampleresultbox\hbox{\color@setgroup
+ \lstset{style=exampleresult}%
\@@input\ydoc@exafile\relax
\unskip\color@endgroup}%
}
@@ -53,8 +71,8 @@
}
\lstnewenvironment{examplecode}[1][]{%
\lstdefinestyle{thisexampleprint}{#1}%
- \lstset{style=exampleextract,#1}%
\setbox\@tempboxa\hbox\bgroup
+ \lstset{style=exampleextract,#1}%
\lst@BeginWriteFile{\ydoc@exafile}%
}
{%