diff options
author | Karl Berry <karl@freefriends.org> | 2012-11-07 23:47:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-11-07 23:47:40 +0000 |
commit | 3233d950f8aaf764441b77b3f158a45f581df79e (patch) | |
tree | 3e3dba433ecfeba2e56416feeac1ff399eab0956 /Master/texmf-dist/doc | |
parent | de79a26f78ad26d980ffb52a97e0b5c12e386dce (diff) |
sty2dtx (7nov12)
git-svn-id: svn://tug.org/texlive/trunk@28206 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r-- | Master/texmf-dist/doc/support/sty2dtx/README | 278 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/sty2dtx/sty2dtx.pdf | bin | 0 -> 140340 bytes |
2 files changed, 150 insertions, 128 deletions
diff --git a/Master/texmf-dist/doc/support/sty2dtx/README b/Master/texmf-dist/doc/support/sty2dtx/README index f9f93a2a457..96bed0f02c7 100644 --- a/Master/texmf-dist/doc/support/sty2dtx/README +++ b/Master/texmf-dist/doc/support/sty2dtx/README @@ -1,133 +1,155 @@ -sty2dtx -- Converts a LaTeX .sty file to a documented .dtx file -Version: v2.1 2011/02/02 +NAME + sty2dtx -- Converts a LaTeX .sty file to a documented .dtx file + +VERSION + Version: v2.3 + +COPYRIGHT + Copyright (c) 2010-2012 Martin Scharrer <martin@scharrer-online.de> + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program. If not, see <http://www.gnu.org/licenses/>. + +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' environemnt. Code lines outside macro definitions are + wrapped only in 'macrocode' environments. Empty lines are removed. 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. -QUICK START: -To generate a .DTX and .INS file from an existing .STY file run: + Basic Usage + perl sty2dtx.pl infile [infile ...] outfile - 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' -environemnt. -Code lines outside macro definitions are wrapped only in 'macrocode' -environments. Empty lines are removed. -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. + or + perl sty2dtx.pl < file.sty > file.dtx - -LICENCE & COPYRIGHT -Copyright (c) 2010-2011 Martin Scharrer <martin@scharrer-online.de> - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - - - -USAGE: - -sty2dtx.pl [<options>] [--<VAR>=<VALUE> ...] [--] [<infile> ...] [<outfile>] - -Files: - * can be '-' for STDIN or STDOUT, which is the default if no files are given - * multiple input files are merged to one output file - -Variables: - can be defined using --<VAR>=<VALUE> or --<VAR> <VALUE> and will be used for - substitutions in the template file. - Common variables: - author, email, maintainer, year (for copyright), - version, date, description (of package/class), - type (either 'package' default or 'class'), - filebase (automatically set from output or input file name), - -Options: - -h : Print this help text - -H : Print extended help - -V : Print version and copyright - -v : Be verbose - -o <output> : Use given file as output - -O : Overwrite already existing output file(s) - -B : Use basename of single input file for output file - -I : Also create .ins (install) file - -i <ins file> : Create .ins file with given name - -t <template> : Use this file as template instead of the default one - -T <template> : Use this file as template for the .ins file - -e <file> : Export default .dtx template to file and exit - -E <file> : Export default .ins template to file and exit - -D : Use current date as file date - -F <file> : Read more options and variables from file. - Should contain one option or variable per line only. - -Examples: - Produce 'file.dtx' from 'file.sty': - sty2dtx.pl < file.sty > file.dtx - or - sty2dtx.pl file.sty file.dtx - or - sty2dtx.pl -B file.sty - - Produce 'file.dtx' and 'file.ins' from 'file.sty': - sty2dtx.pl -I file.sty file.dtx - or - sty2dtx.pl file.sty -i file.sty file.dtx - or - sty2dtx.pl -IB file.sty - - Set custom variable values: - sty2dtx.pl --author Me --email me@there.com mypkg.sty mypkg.dtx - - 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 <martin@scharrer-online.de> for any remarks, questions -and errors about the script. -If you use and like it please tell him so! + Supported Definitions + 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 + sty2dtx [<options>] [--<VAR>=<VALUE> ...] [--] [<infile(s)>] [<outfile>] + + Files + * can be '"-"' for STDIN or STDOUT, which is the default if no files are + given + + * multiple input files are merged to one output file + + Variables + Variables can be defined using + + --<VAR>=<VALUE> + + or + + --<VAR> <VALUE> + + and will be used for substitutions in the template file. + + Common variables: + author, email, maintainer, year (for copyright), + version, date, description (of package/class), + type (either 'package' default or 'class'), + filebase (automatically set from output or input file name), + + Options + -h Print this help text + -H Print extended help + -V Print version and copyright + -v Be verbose + -o output Use given file as output + -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) + -r Remove existing 'macro', 'macrocode', etc. environments. + -R Do not remove existing 'macro', 'macrocode', etc. + environments. + -i ins-file Create .ins file with given name + -t template Use this file as template instead of the default one + -T template Use this file as template for the .ins file + -e file Export default .dtx template to file and exit + -E file Export default .ins template to file and exit + -D Use current date as file date + -F file Read more options and variables from file. + -N Do not read default config file; must be the first option + + Config files + A default config file either named 'sty2dtx.cfg' or '.sty2dtx.cfg' is + searched in the current directory, the users home directory and the + directory of this script, in this order. The first one found is loaded. + If none is found the 'texmf' tree is searched for a 'sty2dtx.cfg' config + file. As with -F files the config file should contain one option or + variable per line. Lines starting with '"%"' or '"#"' are ignored. + +Examples + Produce 'file.dtx' from 'file.sty': + + sty2dtx.pl < file.sty > file.dtx + + or + + sty2dtx.pl file.sty file.dtx + + or + + sty2dtx.pl -B file.sty + + Produce 'file.dtx' and 'file.ins' from 'file.sty': + + sty2dtx.pl -I file.sty file.dtx + + or + + sty2dtx.pl file.sty -i file.sty file.dtx + + or + + sty2dtx.pl -IB file.sty + + Set custom variable values: + + sty2dtx.pl --author Me --email me@there.com mypkg.sty mypkg.dtx + + Produce DTX file for a class: + + sty2dtx.pl --type class mycls.sty mycls.dtx + +AUTHOR + Martin Scharrer + + E-mail: martin@scharrer-online.de + + WWW: <http://www.scharrer-online.de> diff --git a/Master/texmf-dist/doc/support/sty2dtx/sty2dtx.pdf b/Master/texmf-dist/doc/support/sty2dtx/sty2dtx.pdf Binary files differnew file mode 100644 index 00000000000..57ecc28b3bf --- /dev/null +++ b/Master/texmf-dist/doc/support/sty2dtx/sty2dtx.pdf |