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 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 , -t : 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 , -p : (M) Load given tex-file, package or module depending on whether '*tex', '*latex' or 'context' is used. For LaTeX the can start with `[]` and end with `` or `{}`. --class , -c : (LaTeX only) Load given class instead of default ('article'). The can start with `[]` and end with `` or `{}`. --environment , -p : (M) Show definition inside the given environment . --othercode , -o : (M) Add other code into the preamble before the definition is shown. This can be used to e.g. load PGF/TikZ libraries. --before , -b : (M) Place before definition is shown. The can be arbitray TeX code and doesn't need be be balanced. --after , -a : (M) Place after definition is shown. The 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