Macro Language Reference > PIs > Formatting Instructions > @
  
@
Description
Inserts a specified string of characters at the current text cursor position, ensuring they are processed exactly as typed. This is useful for inserting attribute changes directly, or for inserting an item of boilerplate text.
 
Example 368. Insert a PI and execute a macro with one line
The macro below inserts the codes for a typeface change into the text stream at the text cursor position, and then redraws the screen:
(@<?tf="Times-b">):wdr
Note that the @ command and its text have to be placed within parentheses since they are followed by another macro.
 
Example 369. Insert special characters at cursor position
This example inserts parentheses and backslash characters by enclosing the whole macro in parentheses and preceding the special character to output with a backslash.
When an @ macro appears within parentheses the (, ) and \ characters are treated specially. Preceding any of these characters with the backslash will output the character itself, so the macro below will output ()\.
(@\(\)\\)
 
Example 370. Insert TeX functions and nested macros at cursor position
This example inserts some simple maths commands and shows the use of nested macro commands. This is particularly important to remember if you use @ to set up Maths keys with functions that require use of the backslash. The macro below does this correctly and includes some nested macros which make entering a fraction such as \curr{78}\over{999} easier:
(@<$>\\curr{}\\over{}<$>):(9 klf):(*1077 (7 krt):(*1077 krt))
 
Example 371. Insert variable values from a script
The simple script sample below inserts the contents of the ^name variable at the end of strm0 text stream and places a carriage return immediately afterwards:
^name=chris
tend "strm0"
@^name^
#13
Syntax
@ insert_string:b
insert_string
The string of characters to be inserted in the text stream.
 
The characters are not validated, so care should be taken not to enter invalid sequences of characters (e.g. mismatched brackets).
Additional Information
An alternative to using the @ macro is to click on the icon in the Status bar (see tyone).
Related Links