diff options
author | Karl Berry <karl@freefriends.org> | 2011-03-21 17:22:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-03-21 17:22:48 +0000 |
commit | 40c3c9626d2ff87ef13711353b6e94c3b199c05b (patch) | |
tree | 077bc2e170a4649ab31a426da0bde2116e402d4a /Master/texmf-dist/doc/support/texdef | |
parent | a7bf6f6e627d298be092740db7f84e1a23493702 (diff) |
new script texdef (6mar11)
git-svn-id: svn://tug.org/texlive/trunk@21783 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/support/texdef')
-rw-r--r-- | Master/texmf-dist/doc/support/texdef/INSTALL | 59 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/texdef/README | 64 |
2 files changed, 123 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/support/texdef/INSTALL b/Master/texmf-dist/doc/support/texdef/INSTALL new file mode 100644 index 00000000000..61e8e803059 --- /dev/null +++ b/Master/texmf-dist/doc/support/texdef/INSTALL @@ -0,0 +1,59 @@ +Installation +============ + +Requirements +------------ + +The `texdef` program is a Perl script which needs a Perl interpreter to work. +Informations about installing Perl can be found at http://www.perl.org/get.html. + +The script calls a TeX compiler (tex, latex, ...) to display the definition of commands/macros. +Therefore (La)TeX must also be installed. +Informations about installing (La)TeX can be found at http://www.latex-project.org/ftp.html. + + +Location +-------- + +For installation the script 'texdef.pl' must simply be copied to a location suitable for executables, +i.e. a directory in the PATHi, e.g. '/usr/bin' or '/usr/local/bin' for Linux/Unix. + +The script should be set as "executable", i.e. 'chmod +x texdef.pl' for Linux/Unix. +This is not required for MS Windows. + + +Name +---- + +This script can show the definitions of commands with different flavours of TeX +(tex, etex, latex, pdftex, pdfetex, pdflatex, xetex, xelatex, context, ...). +The flavour can be given using an command line option or over the _script name_, +i.e. if the script is called 'texdef' it will use 'tex', but called 'latexdef' +it will use 'latex' and so on. +The script can be simply copied several times, but creating _symbolic links_ +to the real script is enough on operation systems / file systems which support +this. + +At least the two variations 'texdef' and 'latexdef' should be installed. + + +Quick Install Nodes for Linux/Unix +---------------------------------- + + cp texdef.pl /usr/local/bin/ + cd /usr/local/bin + ln -s texdef.pl texdef + ln -s texdef.pl latexdef + ln -s texdef.pl etexdef + ln -s texdef.pl luatexdef + ln -s texdef.pl lualatexdef + ln -s texdef.pl pdftexdef + ln -s texdef.pl pdflatexdef + ln -s texdef.pl xetexdef + ln -s texdef.pl xelatexdef + ln -s texdef.pl 'some other TeX flavour of your choice' + +or use the Makefile (defaults to `/usr/local/bin`) + + make install INSTALLDIR=/your/path + diff --git a/Master/texmf-dist/doc/support/texdef/README b/Master/texmf-dist/doc/support/texdef/README new file mode 100644 index 00000000000..f4d2f601fb4 --- /dev/null +++ b/Master/texmf-dist/doc/support/texdef/README @@ -0,0 +1,64 @@ +texdef -- Show definitions of TeX commands + +This perl script shows the definition of (La)TeX commands in a similar way as `\show`. + + +Version 1.0 -- 2011/03/05 +Copyright (C) 2011 Martin Scharrer <martin@scharrer-online.de> +This program comes with ABSOLUTELY NO WARRANTY; +This is free software, and you are welcome to redistribute it under certain conditions; + +Usage: + texdef [options] commandname [commandname ...] + latexdef [options] commandname [commandname ...] + +Other program names are possible. See the 'tex' option. Command names do not need to start with `\`. + +Options: + --tex <flv>, -t <flv> : Use given flavour of TeX: 'tex', 'latex', 'context'. + Variations of 'tex' and 'latex', like 'luatex', 'lualatex', 'xetex', 'xelatex' are supported. + The default is given by the used program name: 'texdef' -> 'tex', 'latexdef' -> 'latex', etc. + --value, -v : Show value of command instead (i.e. \the\command). + --preamble, -P : Show definition of the command inside the preamble. + --beforeclass, -B : Show definition of the command before \documentclass. + --package <pkg>, -p <pkg> : (M) Load given tex-file, package or module depending on whether '*tex', '*latex' + or 'context' is used. For LaTeX the <pkg> can start with `[<options>]` and end + with `<pkgname>` or `{<pkgname>}`. + --class <class>, -c <class> : (LaTeX only) Load given class instead of default ('article'). + The <class> can start with `[<classs options>]` and end + with `<classname>` or `{<classname>}`. + --environment <env>, -p <env> : (M) Show definition inside the given environment <env>. + --othercode <code>, -o <code> : (M) Add other code into the preamble before the definition is shown. + This can be used to e.g. load PGF/TikZ libraries. + --before <code>, -b <code> : (M) Place <code> before definition is shown. + The <code> can be arbitray TeX code and doesn't need be be balanced. + --after <code>, -a <code> : (M) Place <code> after definition is shown. + The <code> can be arbitray TeX code and doesn't need be be balanced. + --help, -h : Print this help and quit. + + Long option can be shorten as long the are still unique. Short options can be combined. + If the option 'environment', 'before' and 'after' are used toegether the + produced code will be inserted in the given order (reversed order for 'after'). + (M) = This option can be given multiple times. + +Examples: +Show the definition of '\chapter' with different classes ('article' (default), 'book' and 'scrbook'): + + latexdef chapter + latexdef -c book chapter + latexdef -c scrbook chapter + +Show value of `\textwidth` with different class options: + + latexdef -c [a4paper]{book} -v paperwidth + latexdef -c [letter]{book} -v paperwidth + +Show definition of TikZ's '\draw' outside and inside a 'tikzpicture' environment: + + latexdef -p tikz draw + latexdef -p tikz --env tikzpicture draw + +Show definition of TikZ's '\draw' inside a node, inside a 'beamer' frame in 'handout' mode: + + latexdef -c [handout]beamer -p tikz --env frame --env tikzpicture -b '\node {' -a '};' draw + |