Document 551 Adding TeX and LaTeX commands to a documentVersion: 3.x, 4.x, 5.x - Scientific WorkPlace & Scientific Word You can use TeX commands with certain LaTeX packages to send precise typesetting instructions to LaTeX or pdfLaTeX. The documentation for each package outlines the syntax and arguments of any available commands and explains whether the commands should be placed in the preamble or in TeX fields in the body of your document. In either case, you must make certain you enter correctly formatted LaTeX to avoid typesetting difficulties and possible damage to your document. The preamble can contain definitions such as \newtheorem, \newcommand, \def, and \renewcommand, but must not contain any commands that generate typeset output. If you incorrectly enter any commands in the preamble, you can damage your document irreparably. How to add a command in the preamble of your document
How to enter a TeX field
The program inserts in your document a field containing the command. On the screen, the field appears as a small gray box, like this: . When you save your document, the program interprets the TeX command and inserts it directly into the document file. How to enter an encapsulated TeX fieldIf you want to prevent the program from interpreting the command in a TeX field, you can encapsulate and name the field. Then, when you save your document, the program stores the name and the command exactly as you entered them. The program preserves the exact syntax of the field when you save and reload the document. When you open the document again, the program displays the field on the screen as a small gray box with the field name in brackets, like this . When you typeset the document, TeX interprets the encapsulated field and inserts the command in the DVI file. NoteIncorrect code in an encapsulated field won't cause the program to fail when you open your document, because the code remains hidden. However, it will prevent LaTeX from typesetting the document. Incorrect code in an unencapsulated TeX field could damage your document.
Last revised 01/20/06 This document was created with Scientific WorkPlace. |