From 4289e4647ab448dbce672649f32f107dda45c4aa Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 5 Feb 2011 00:20:15 +0000 Subject: sty2dtx (2feb11) git-svn-id: svn://tug.org/texlive/trunk@21295 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/support/sty2dtx/README | 67 ++++-- Master/texmf-dist/scripts/sty2dtx/sty2dtx.pl | 310 ++++++++++++++++----------- 2 files changed, 231 insertions(+), 146 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/support/sty2dtx/README b/Master/texmf-dist/doc/support/sty2dtx/README index 99388299b5f..f9f93a2a457 100644 --- a/Master/texmf-dist/doc/support/sty2dtx/README +++ b/Master/texmf-dist/doc/support/sty2dtx/README @@ -1,6 +1,17 @@ sty2dtx -- Converts a LaTeX .sty file to a documented .dtx file -Version: v2.0 2011/01/31 +Version: v2.1 2011/02/02 +QUICK START: +To generate a .DTX and .INS file from an existing .STY file run: + + sty2dtx.pl -IB yourfile.sty + +The script name might be only 'sty2dtx' without the '.pl' on your installation. +Also try to run it explicitly with perl: "perl sty2dtx.pl -IB yourfile.sty" + + + +DESCRIPTION: Converts a .sty file (LaTeX package) to .dtx format (documented LaTeX source), by surrounding macro definitions with 'macro' and 'macrocode' environments. The macro name is automatically inserted as an argument to the 'macro' @@ -11,6 +22,8 @@ The script is not thought to be fool proof and 100% accurate but rather as a good start to convert undocumented style files to .dtx files. + +LICENCE & COPYRIGHT Copyright (c) 2010-2011 Martin Scharrer This program is free software: you can redistribute it and/or modify @@ -27,24 +40,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . -The following macro definitions are detected when they are at the start of a -line (can be prefixed by \global, \long, \protected and/or \outer): - \def \edef \gdef \xdef - \newcommand{\name} \newcommand*{\name} - \newcommand\name \newcommand*\name - \renewcommand{\name} \renewcommand*{\name} - \renewcommand\name \renewcommand*\name - \providecommand{\name} \providecommand*{\name} - \providecommand\name \providecommand*\name - \@namedef{\name} \@namedef\name - -The following environment definitions are detected when they are at the start -of a line: - \newenvironment{name} \renewenvironemnt{name} \provideenvironment{name} - -The macro and environment definition must either end at the same line or with -a '}' on its own on a line. - USAGE: @@ -102,3 +97,37 @@ Examples: Produce DTX file for a class: sty2dtx.pl --type class mycls.sty mycls.dtx + + +SUPPORTED FORMAT +The following macro definitions are detected when they are at the start of a +line (can be prefixed by \global, \long, \protected and/or \outer): + \def \edef \gdef \xdef + \newcommand{\name} \newcommand*{\name} + \newcommand\name \newcommand*\name + \renewcommand{\name} \renewcommand*{\name} + \renewcommand\name \renewcommand*\name + \providecommand{\name} \providecommand*{\name} + \providecommand\name \providecommand*\name + \@namedef{\name} \@namedef\name + +The following environment definitions are detected when they are at the start +of a line: + \newenvironment{name} \renewenvironemnt{name} \provideenvironment{name} + +The macro and environment definition must either end at the same line or with +a '}' on its own on a line. + + +CHANGELOG + v1.0 2011/01/29 : First release. Generation of DTX code section only + v2.0 2011/01/31 : Generation of full DTX files with many available options + v2.1 2011/02/02 : Improved handling of comments included in the STY file + + +FEEDBACK & BUG REPORTS +Please do not hesitate to contact the author +Martin Scharrer for any remarks, questions +and errors about the script. +If you use and like it please tell him so! + diff --git a/Master/texmf-dist/scripts/sty2dtx/sty2dtx.pl b/Master/texmf-dist/scripts/sty2dtx/sty2dtx.pl index f439ece2378..5c0730ca5bb 100755 --- a/Master/texmf-dist/scripts/sty2dtx/sty2dtx.pl +++ b/Master/texmf-dist/scripts/sty2dtx/sty2dtx.pl @@ -2,7 +2,7 @@ use strict; use warnings; ################################################################################ -# $Id: sty2dtx.pl 2114 2011-01-31 00:54:57Z martin $ +# $Id: sty2dtx.pl 2125 2011-02-02 15:25:40Z martin $ ################################################################################ my $COPYRIGHT = << 'EOT'; Copyright (c) 2010-2011 Martin Scharrer @@ -58,7 +58,7 @@ my $DESCRIPTION = << 'EOT'; EOT ################################################################################ -my $VERSION = "v2.0 " . substr('$Date: 2011-01-31 00:54:57 +0000 (Mon, 31 Jan 2011) $', 7, 10); +my $VERSION = "v2.1 " . substr( '$Date: 2011-02-02 15:25:40 +0000 (Wed, 02 Feb 2011) $', 7, 10 ); $VERSION =~ tr/-/\//; my $TITLE = << "EOT"; sty2dtx -- Converts a LaTeX .sty file to a documented .dtx file @@ -93,6 +93,7 @@ Options: -O : Overwrite already existing output file(s) -B : Use basename of single input file for output file -I : Also create .ins (install) file + -c : Only use code section (like v1.0) -i : Create .ins file with given name -t