MattiのPweaveを少し再構築したので、任意の「チャンクプロセッサ」をプラグインモジュールとして定義できます。これにより、いくつかのチャンクベースのテキスト前処理アプリケーションを簡単に拡張できます。再構築されたバージョンは、https://bitbucket.org/edgimar/pweave/srcで入手できます。例として、次のLaTeX-Pweaveドキュメントを作成できます(この例の「プロセッサ名」は「mplfig」という名前で指定されていることに注意してください)。
\documentclass[a4paper]{article}
\usepackage{graphicx}
\begin{document}
\title{Test document}
\maketitle
Don't miss the great information in Figure \ref{myfig}!
<<p=mplfig, label=myfig, caption = "Figure caption...">>=
import sys
import pylab as pl
pl.plot([1,2,3,4,5],['2,4,6,8,10'], 'b.', markersize=15)
pl.axis('scaled')
pl.axis([-3,3, -3,3]) # [xmin,xmax, ymin,ymax]
@
\end{document}