GNU TeXmacsUser manualReferenceAboutEnglish
Editing source

1.Creating tags

make_compound (l, n) (

edit_dynamic.cpp:94

), the C++ side of make, inserts a tag with label l. Without an explicit arity it takes the smallest arity which the DRD accepts. It wraps the selection into the tag when appropriate, starts block macros with a document, and puts the cursor in the first accessible argument. If some argument of the tag is not accessible, the tag is inserted inactive, unless the document is in source mode (its initial mode is src) or the cursor is in a show-preamble, so that its arguments can be filled in, and the footer says that ↩ activates it.

activate (

edit_dynamic.cpp:166

) removes the innermost inactive around the cursor. An inactive compound whose first argument is a name is turned into the tag of that name. The Scheme hook notify-activated is called on the result. insert_argument and remove_argument add or remove arguments of tags with a variable arity; in source mode, ⇥ after an argument inserts a new one (kbd-variant in

source-edit.scm

).

2.Entering a tag by name

\ calls make_hybrid (

edit_dynamic.cpp:521

), which inserts a hybrid tag (inactive outside source mode) and waits for a name; a small selection becomes its second argument, or its name if it is the name of a known tag. ↩ calls activate_hybrid (

edit_dynamic.cpp:559

), which tries in turn:

  1. a named command (activate_latex: kbd_get_command, the table of kbd-get-command), which is executed; this is how \alpha inserts \(\alpha\);

  2. an argument of the macro being edited (inside a macro or the macro editor), which becomes arg;

  3. a primitive or a macro, for which a new tag is made with make_compound;

  4. an environment variable, which becomes value;

  5. in source mode only, any other name, which becomes a new tag (with one argument if ⇥ was used instead of ↩).

Otherwise the footer says unknown command and the hybrid tag remains. symbol tags work the same way for symbols: activate_symbol replaces <symbol|alpha> by the symbol <alpha>, and a number by the character with that code.

3.Keyboard and menus

source-kbd.scm

binds the source shortcuts (activation, deactivation, compactness) and

source-edit.scm

overloads the structured commands for source: kbd-enter activates hybrid, compound, latex, symbol and inactive tags, kbd-variant inserts arguments, and inactive-toggle switches a tag between active and inactive. The Source menu (

source-menu.scm

) appears in source mode, or everywhere with Tools\(\rightarrow\)Source macros tool; it lists the primitives of the style language by group (definitions, macros, flow control, arithmetic, …), the activation and presentation commands, and the macro commands of the next page.

Source\(\rightarrow\)Extract style file and Source\(\rightarrow\)Extract style package (extract-style-file) build a new source buffer from the current document: a title, the use-package of its style, its initial environment as assigns (minus a few view settings such as the zoom), and the macro definitions of its preamble.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".