diff options
author | Karl Berry <karl@freefriends.org> | 2006-07-14 22:24:45 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-07-14 22:24:45 +0000 |
commit | 5239fed29c5364a0c12526a31065483d95bcf73d (patch) | |
tree | a9ea18db755ba5facc75625494b522ce17e73916 /Master/texmf-dist/doc/latex/showexpl | |
parent | 9cee07ca576206ca837b5c779e49bff2f7967bba (diff) |
new package showexpl (27mar06)
git-svn-id: svn://tug.org/texlive/trunk@1837 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/showexpl')
-rw-r--r-- | Master/texmf-dist/doc/latex/showexpl/README | 9 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/showexpl/result-picture.pdf | bin | 0 -> 19256 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/showexpl/showexpl-test.pdf | bin | 0 -> 261407 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/showexpl/showexpl-test.tex | 290 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/showexpl/showexpl.cfg | 50 |
5 files changed, 349 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/showexpl/README b/Master/texmf-dist/doc/latex/showexpl/README new file mode 100644 index 00000000000..b32d0704b60 --- /dev/null +++ b/Master/texmf-dist/doc/latex/showexpl/README @@ -0,0 +1,9 @@ + +The LaTeX package `showexpl' provides a way to typeset LaTeX source +code and the related result in the same document. The `listings' +package is required. See `doc/showexpl-test.tex' for the details. + + Rolf Niepraschk + email: Rolf.Niepraschk@ptb.de + 2006-03-26 + diff --git a/Master/texmf-dist/doc/latex/showexpl/result-picture.pdf b/Master/texmf-dist/doc/latex/showexpl/result-picture.pdf Binary files differnew file mode 100644 index 00000000000..6b17a10fd6c --- /dev/null +++ b/Master/texmf-dist/doc/latex/showexpl/result-picture.pdf diff --git a/Master/texmf-dist/doc/latex/showexpl/showexpl-test.pdf b/Master/texmf-dist/doc/latex/showexpl/showexpl-test.pdf Binary files differnew file mode 100644 index 00000000000..c85329a5228 --- /dev/null +++ b/Master/texmf-dist/doc/latex/showexpl/showexpl-test.pdf diff --git a/Master/texmf-dist/doc/latex/showexpl/showexpl-test.tex b/Master/texmf-dist/doc/latex/showexpl/showexpl-test.tex new file mode 100644 index 00000000000..316049f555f --- /dev/null +++ b/Master/texmf-dist/doc/latex/showexpl/showexpl-test.tex @@ -0,0 +1,290 @@ + +% Rolf Niepraschk, 2005-07-16, Rolf.Niepraschk@ptb.de + +\listfiles\errorcontextlines=100 +\documentclass[a4paper,draft,twoside]{article} + +\usepackage[dvipsnames]{xcolor} +\usepackage[textwidth=12cm,marginparwidth=4cm]{geometry} + +\usepackage[final]{showexpl} + +\usepackage[T1]{fontenc} + +\IfFileExists{luximono.sty}% +{% + \usepackage[scaled]{luximono}% +} +{% + \IfFileExists{beramono.sty}% + {% + \usepackage[scaled]{beramono}% + }{} +} + +\lstset{% + basicstyle=\ttfamily\small, + commentstyle=\itshape\ttfamily\small, + showspaces=false, + showstringspaces=false, + breaklines=true, + backgroundcolor=\color{lightgray}, + breakautoindent=true, + captionpos=t +} + +\iftrue +\lstset{explpreset={numbers=left,numberstyle=\tiny,numbersep=.3em, + xleftmargin=1em,columns=flexible,language={}}} +\fi + +\usepackage[font=small,labelfont=bf,justification=raggedright,% + singlelinecheck=false]{caption} +\usepackage{amsmath} + +\AtBeginDocument{% + \renewcommand*\lstlistlistingname{Examples} + \renewcommand*\lstlistingname{Example} +} + +\newcommand*{\MARKER}% + {\noindent\strut\vrule + \hrulefill~half text area~\hrulefill\vrule + \hrulefill~half text area~\hrulefill\vrule + \marginpar{\strut\vrule\hrulefill~margin area~\hrulefill\vrule}} + +\begin{filecontents*}{ex1.tex} +Line 1 \par +Line 2 \par +Line 3 \par +Line 4 \par +Line 5 \par +Line 6 \par +Line 7 \par +Line 8 \par +Line 9 \par +Line 10 \par +Line 11 \par +Line 12 \par +Line 13 +\end{filecontents*} + +\begin{document} + +\section*{The \LaTeX\ package \textsf{showexpl}} + +\bigskip + +\lstlistoflistings + +\subsection*{The \textsf{listings} parameters still works} + +\begin{LTXexample}[pos=t,numbers=none, + codefile=\jobname-\theltxexample.tex] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + +\MARKER + +\subsection*{The \texttt{pos}, \texttt{overhang}, and + \texttt{caption} parameters} + +\begin{LTXexample}[pos=b,overhang=.5\marginparwidth+.5\marginparsep,% + caption={The \texttt{overhang} parameter}] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + +\MARKER + +\begin{LTXexample}[pos=l,hsep=50pt,width=55mm] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + +\MARKER + +\subsection*{The \texttt{wide} parameter with inner and outer position} + +\begin{LTXexample}[pos=o,wide,caption={The \texttt{wide} parameter},% + label=ex:Gustav] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + +\MARKER + +\begin{LTXexample}[pos=i,wide] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + + +%-------------- +\newpage + +\subsection*{More examples on an even (left) page} + +\begin{LTXexample}[pos=t] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + +\MARKER + +\begin{LTXexample}[pos=b,overhang=.5\marginparwidth+.5\marginparsep,% + captionpos=b,caption={The \texttt{overhang} parameter again},% + label=ex:Fridolin] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + +\MARKER + +\begin{LTXexample}[pos=l,hsep=50pt,width=55mm] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + +\MARKER + +\begin{LTXexample}[pos=o,wide,captionpos=b,% + caption={The \texttt{wide} parameter again}] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + +\MARKER + +\begin{LTXexample}[pos=i,wide] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + + +%-------------- +\newpage + +\subsection*{Whole \LaTeX{} documents as example code and + the para\-meters \texttt{preset}, \texttt{rframe}, and \texttt{rangeaccept}} + +\begin{LTXexample}[pos=r,wide,width=.65,preset=\LARGE,rframe={}] +\documentclass[a4paper,twoside]{article} +\begin{document} + \begin{equation} + \sigma(t)=\frac{1}{\sqrt{2\pi}} + \int^t_0 e^{-x^2/2} dx + \end{equation} +\end{document} +\end{LTXexample} + +\MARKER + +\begin{LTXexample}[wide,width=.75,preset=\footnotesize,rframe=single,% + codefile=\jobname-\theltxexample.tex] +\documentclass[a4paper,twoside]{article} +\usepackage{amsmath} +% enhancements for mathematical formulas +\begin{document} +\begin{equation}\label{eq:barwq} +\begin{split} + H_c&=\frac{1}{2n} + \sum^n_{l=0}(-1)^{l}(n-{l})^{p-2} + \sum_{l _1+\dots+ l _p=l}\prod^p_{i=1} + \binom{n_i}{l _i}\\ + &\quad\cdot[(n-l )-(n_i-l _i)]^{n_i-l _i}\cdot + \Bigl[(n-l )^2-\sum^p_{j=1}(n_i-l _i)^2\Bigr]. +\end{split} +\end{equation} +\end{document} +\end{LTXexample} + +\LTXinputExample[% + pos=r,backgroundcolor=\color{Goldenrod!50},% + %firstline=3,lastline=6,% + linerange={3-6,8-10},% + float=tb,rangeaccept=true,% + caption={[Floating Example]% + This is a floating Example (parameter \texttt{rangeaccept=true})}]{ex1} + +\newpage + +\MARKER + +\subsection*{Using a graphic as the result} + +\begin{LTXexample}[pos=i,wide] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + +\begin{LTXexample}[pos=i,wide,rframe={},% +graphic=result-picture]% graphic=\jobname-\theltxexample +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + +\begin{LTXexample}[caption={The \texttt{graphic} parameter},captionpos=b,% + pos=i,wide,graphic={[width=.5\linewidth]result-picture}] +\Large\LaTeX{} \LaTeX{} +\LaTeX{} \LaTeX{} +\end{LTXexample} + +\newpage + +\subsection*{The parameter \texttt{varwidth}} + +\bigskip + +\MARKER + +\begin{LTXexample}[caption={Fix width of the result + (side-by-side default: \texttt{0.5\textbackslash linewidth})},% + captionpos=b] +\setlength{\unitlength}{1cm} +\begin{picture}(2,2) \thicklines + \thicklines + \put(0,0){\line(1,1){2}} + \put(0,2){\line(1,-1){2}} +\end{picture} +\end{LTXexample} + +\medskip + +\begin{LTXexample}[caption={[The \texttt{varwidth} parameter]% + Width of the result reduced to the ``natural'' + width (\texttt{varwidth=true})},varwidth,captionpos=b] +\setlength{\unitlength}{1cm} +\begin{picture}(2,2) \thicklines + \put(0,0){\line(1,1){2}} + \put(0,2){\line(1,-1){2}} +\end{picture} +\end{LTXexample} + +\medskip + +\begin{LTXexample}[caption={Fix width of the result + (default: \texttt{\textbackslash linewidth})},% + pos=t,captionpos=b] +\setlength{\unitlength}{1cm} +\begin{picture}(2,2) \thicklines + \put(0,0){\line(1,1){2}} + \put(0,2){\line(1,-1){2}} +\end{picture} +\end{LTXexample} + +\medskip + +\begin{LTXexample}[caption={[The \texttt{justification} parameter]% + Result is centered (\texttt{varwidth=true})},% + varwidth,captionpos=b,pos=t,justification=\centering] +\setlength{\unitlength}{1cm} +\begin{picture}(2,2) + \thicklines + \put(0,0){\line(1,1){2}} + \put(0,2){\line(1,-1){2}} +\end{picture} +\end{LTXexample} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/showexpl/showexpl.cfg b/Master/texmf-dist/doc/latex/showexpl/showexpl.cfg new file mode 100644 index 00000000000..4712d03eec7 --- /dev/null +++ b/Master/texmf-dist/doc/latex/showexpl/showexpl.cfg @@ -0,0 +1,50 @@ +% config file for showexpl.sty +% +% Copyright Herbert Voss, 2005 +% Licence: LPPL. + +\ProvidesFile{showexpl.cfg} + [2005/08/28 v0.03 Definitions for the showexpl package (hv)] +% +\RequirePackage{xcolor} +\definecolor{hellgelb}{rgb}{1,1,0.85} +\definecolor{colKeys}{rgb}{0,0,1} +\definecolor{colIdentifier}{rgb}{0,0,0} +\definecolor{colComments}{rgb}{1,0,0} +\definecolor{colString}{rgb}{0,0.5,0} + +\lstset{% + preset=\centering,% + rframe={},% + language=PSTricks,% +% language=TeX,% + float=hbp,% + basicstyle=\footnotesize\ttfamily,% + identifierstyle=\color{colIdentifier},% + keywordstyle=\color{colKeys},% + stringstyle=\color{colString},% + commentstyle=\itshape\color{colComments},% +% columns=flexible,% +% columns=fullflexible,% + columns=fixed, + tabsize=4,% + frame=single,% + extendedchars=true,% + showspaces=false,% + showstringspaces=false,% + numbers=left,% + numberstyle=\tiny\ttfamily,% + numbersep=1em,% + breaklines=true,% + breakindent=10pt,% + backgroundcolor=\color{hellgelb},% + breakautoindent=true,% + captionpos=t,% + xleftmargin=1em,% + xrightmargin=\fboxsep,% + numbersep=1em,% +% xrightmargin=-1cm,% +% relwidth=0.5,% +% columnsep=10pt% +} +\renewcommand*\SX@Info{}% |