|
DTX submodeDescriptionThe DTX submode contains Highlighting settings, Menu customizations, Active strings and Tree directives for documented LaTEX source files (dtx). It will also acquaint WinEdt with the structure of DTX files, so that some often-used shortcuts will work as expected. Furthermore, it will dynamically highlight all commands defined in the DTX file and make them available for command completion. ModeFiles with the extension .dtx will automatically be recognized as being of the mode "TeX:DTX". That is, DTX is a submode of TeX mode, inheriting its highlighting settings etc., only adding some features. Most notably, Wrapping will be turned off. In contrast to WinEdt's default settings, files with the extensions .sty, .ins and .fd will not be regarded as DTX file, since they, -- well, they aren't. Instead, a STY submode will be installed, which only differs from the normal TeX mode in that wrapping and global switches are turned off. HighlightingThe following switches will be highlighted (additionally to the default TEX highlighting):
Here's a sample file (colours might be different on your system). Furthermore, all commands that you define in the DTX file will be highlighted and made available for command completion. Command CompletionIn WinEdt's default settings, the TEX primitives and basic LaTEX commands are available for command completion (CTRL-Enter). The DTX mode will additionally make all macros that are defined in the DTX file (those enclosed in a macro environment) known to WinEdt. After typing the beginning of a \command (at least the backslash), you can complete it by pressing CTRL-Enter. If there is more than one possible completion, you'll be prompted with a list to choose from. This also works for command names without backslash inside \cs{...}. If no matching command is found, the default word completion will step in. Menus and Active StringsSince this mode will install the dynamicKeywords package, a new menu entry Update Dynamic Keywords will be added to the Tools menu if it doesn't already exist. Using this command, you can update dynamic highlighting and command completion of the defined macros in the DTX file. (You can also use it for all other modes that take advantage of it.) A DTX submenu will be added to the Insert menu. All entries in the menu are also available as Active Strings (when typed at the beginning of the line):
ShortcutsThe following shortcuts will be modified for DTX mode (and only for DTX mode):
In fact, they will behave (almost) as you would expect -- that is, you can select or navigate through paragraphs, even though they are preceded by "%". If you enter a new line and the first character of the current line is a percent character, it will be repeated in the next line with the indentation level retained. Insert/Remove Comment will insert/remove the DTX comment string "^^A" when inside a documentation block, the percent character otherwise. Additionally, the active strings \begin{?}} resp. \end{{ (to complete the current environment) will be adjusted for DTX mode. Tree directives
A TOC tree will be set up, which knows about the directives: % \section % \subsection % \subsubsection Furthermore, a tree of all DTX modules will be built. The closing guard will be the last child of the beginning guard. Modules may be nested. If the modules in the DTX file are improperly nested or not closed, you'll receive a warning. You can select the respective text unit in the source file via the context menu for the section and module items. Finally, all \change entries will be gathered in the tree and sorted. You can change the sorting criteria by right-clicking on any item:
Regular Expression filter
|
| Mode |